Ignore:
Timestamp:
Jun 11, 2012, 10:10:56 PM (12 years ago)
Author:
mistic100
Message:

HUGE update, main features : global subscriptions (all images in an album, all images, all albums), beautyful (!) mails

Location:
extensions/Subscribe_to_comments/template
Files:
12 added
3 edited
2 moved

Legend:

Unmodified
Added
Removed
  • extensions/Subscribe_to_comments/template/index.php

    r12560 r15641  
    11<?php
    2 // +-----------------------------------------------------------------------+
    3 // | Piwigo - a PHP based photo gallery                                    |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2011 Piwigo Team                  http://piwigo.org |
    6 // | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
    7 // | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    8 // +-----------------------------------------------------------------------+
    9 // | This program is free software; you can redistribute it and/or modify  |
    10 // | it under the terms of the GNU General Public License as published by  |
    11 // | the Free Software Foundation                                          |
    12 // |                                                                       |
    13 // | This program is distributed in the hope that it will be useful, but   |
    14 // | WITHOUT ANY WARRANTY; without even the implied warranty of            |
    15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
    16 // | General Public License for more details.                              |
    17 // |                                                                       |
    18 // | You should have received a copy of the GNU General Public License     |
    19 // | along with this program; if not, write to the Free Software           |
    20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
    21 // | USA.                                                                  |
    22 // +-----------------------------------------------------------------------+
    23 
    24 // Recursive call
    252$url = '../';
    263header( 'Request-URI: '.$url );
  • extensions/Subscribe_to_comments/template/style.css

    r12607 r15641  
    11.subscriptions_list {
    2   width:600px;
    3         border: 1px solid #111;
     2  width:700px;
     3        border-left: 1px solid #444;
     4        border-right: 1px solid #444;
    45        margin: 1em auto;
    56        padding: 0;
    67  background-color:#222;
    7   border-collapse:collapse;
     8  border-spacing:0;
     9  text-align: left;
    810}
    911
    10 .subscriptions_list TD {
     12.subscriptions_list td, .subscriptions_list th {
    1113        padding:5px 5px 2px 5px;
    1214  vertical-align:center;
     15  border-top: 1px solid #444;
     16  border-bottom: 1px solid #111;
     17}
     18  .subscriptions_list .chkb {
     19    text-align:center;
     20  }
     21  .subscriptions_list td.info {
     22    width:200px;
     23    padding-top:2em;
     24    vertical-align:top;
     25  }
     26    .subscriptions_list tr .actions {
     27      display:none;
     28    }
     29    .subscriptions_list tr:hover .actions {
     30      display:block;
     31    }
     32  .subscriptions_list td.date {
     33    width:250px;
     34    padding-top:2em;
     35    vertical-align:top;
     36  }
     37 
     38.subscriptions_list tr.row2 { background-color:#222; }
     39.subscriptions_list tr.row1 { background-color:#333; }
     40
     41.subscriptions_list tr.not-validated { background-color:#433; }
     42
     43.subscriptions_list tr.header th, .subscriptions_list tr.footer td
     44{
     45  height:30px;
     46}
     47.subscriptions_list tr.header th, .subscriptions_list tr.footer.row1 td {
     48 
     49  background: #333333;
     50  background: -moz-linear-gradient(top,  #333333 0%, #222222 100%);
     51  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#333333), color-stop(100%,#222222));
     52  background: -webkit-linear-gradient(top,  #333333 0%,#222222 100%);
     53  background: -o-linear-gradient(top,  #333333 0%,#222222 100%);
     54  background: -ms-linear-gradient(top,  #333333 0%,#222222 100%);
     55  background: linear-gradient(top,  #333333 0%,#222222 100%);
     56  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#333333', endColorstr='#222222',GradientType=0 );
     57}
     58.subscriptions_list tr.footer.row2 td {
     59  background: #222222;
     60  background: -moz-linear-gradient(top,  #222222 0%, #333333 100%);
     61  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#222222), color-stop(100%,#333333));
     62  background: -webkit-linear-gradient(top,  #222222 0%,#333333 100%);
     63  background: -o-linear-gradient(top,  #222222 0%,#333333 100%);
     64  background: -ms-linear-gradient(top,  #222222 0%,#333333 100%);
     65  background: linear-gradient(top,  #222222 0%,#333333 100%);
     66  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222222', endColorstr='#333333',GradientType=0 );
    1367}
    1468
    15 .subscriptions_list TR {
    16         text-align: left;
    17 }
    1869
    19 .row2 { background-color:#222; }
    20 .row1 { background-color:#333; }
    2170
    2271.stc p {
     
    3281  max-height:90px;
    3382}
     83
  • extensions/Subscribe_to_comments/template/subscribtions_page.tpl

    r12607 r15641  
    11{combine_css path=$SUBSCRIBE_TO_PATH|@cat:'template/style.css'}
    22
    3 {$MENUBAR}
     3{if $themeconf.name != "stripped" and $themeconf.parent != "stripped" and $themeconf.name != "simple-grey" and $themeconf.parent != "simple"}
     4  {$MENUBAR}
     5{else}
     6  {assign var="intern_menu" value="true"}
     7{/if}
     8<div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">
     9{if $intern_menu}{$MENUBAR}{/if}
    410
    5 {if !empty($PLUGIN_INDEX_CONTENT_BEFORE)}{$PLUGIN_INDEX_CONTENT_BEFORE}{/if}
     11<div class="titrePage">
     12  <h2>{'Subscriptions of'|@translate} <i>{$EMAIL}</i></h2>
     13</div>
    614
    7 <div id="content" class="content stc">
    8   <div class="titrePage">
    9     <ul class="categoryActions">
    10       {if !empty($PLUGIN_INDEX_ACTIONS)}{$PLUGIN_INDEX_ACTIONS}{/if}
    11     </ul>
    12     <h2>{'Subscriptions of'|@translate} <i>{$EMAIL}</i></h2>
    13   </div> <!-- titrePage -->
     15{include file='infos_errors.tpl'}
     16 
     17{if $IN_VALIDATE or $IN_UNSUBSCRIBE}
     18<p>
     19  {if !empty($element)}<a href="{$element.url}" title="{$element.name}">{'Return to item page'|@translate}</a><br>{/if}
     20  <a href="{$MANAGE_LINK}">{'Manage my subscriptions to comments'|@translate}</a>
     21</p>
     22{/if}
    1423 
    15   {if !empty($errors)}
    16   <div class="errors">
    17     <ul>
    18       {foreach from=$errors item=error}
    19       <li>{$error}</li>
     24<form action="{$MANAGE_LINK}" method="post">
     25  {if !empty($global_subscriptions)}
     26  <fieldset>
     27    <legend>{'Global subscriptions'|@translate}</legend>
     28    <table class="subscriptions_list">
     29      {foreach from=$global_subscriptions item=sub name=subs_loop}
     30      <tr class="{if $smarty.foreach.subs_loop.index is odd}row1{else}row2{/if}">
     31        <td>
     32          {if $sub.type == 'all-images'}
     33            <img src="{$SUBSCRIBE_TO_PATH}template/image.png"> {'You are currently subscribed to comments on all pictures of the gallery.'|@translate}
     34          {else $sub.type == 'all-albums'}
     35            <img src="{$SUBSCRIBE_TO_PATH}template/album.png"> {'You are currently subscribed to comments on all albums of the gallery.'|@translate}
     36          {/if}
     37        </td>
     38        <td style="white-space:nowrap;">
     39          <a href="{$MANAGE_LINK}&amp;unsubscribe={$sub.id}">{'Unsubscribe'|@translate}</a>
     40          {if $sub.validated == 'false'}<br> <a href="{$MANAGE_LINK}&amp;validate={$sub.id}">{'Validate'|@translate}</a>{/if}
     41        </td>
     42        <td style="white-space:nowrap;">
     43          <i>{$sub.registration_date}</i>
     44        </td>
     45      </tr>
    2046      {/foreach}
    21     </ul>
    22   </div>
    23   {/if}
    24   {if !empty($infos)}
    25   <div class="infos">
    26     <ul>
    27       {foreach from=$infos item=info}
    28       <li>{$info}</li>
    29       {/foreach}
    30     </ul>
    31   </div>
     47    </table>
     48  </fieldset>
    3249  {/if}
    3350 
    34   {if !empty($unsubscribe_form)}
    35   <form action="" method="post">
    36   <fieldset>
    37     <legend>{'Unsubscribe from email notification'|@translate}</legend>
    38    
    39     <p>
    40       <label><input type="radio" name="unsubscribe" value="{$unsubscribe_form}" checked="checked"> {'Only unsubscribe notifications for comments from:'|@translate} <a href="{$element.url}" target="_blank">{$element.name}</a></label>
    41       <label><input type="radio" name="unsubscribe" value="all"> {'Unsubscribe from all email notifications'|@translate}</label>
    42       <br>
    43       <label><input type="submit" value="Unsubscribe notifications for {$EMAIL}"></label>
    44       <a href="{$MANAGE_LINK}">{'Manage my subscriptions'|@translate}</a>
    45     </p>
    46   </fieldset>
    47   </form>
    48   {/if}
    49  
    50   {if !empty($validate)}
    51   <p>
    52     {if empty($errors)}<a href="{$element.url}">{'Return to item page'|@translate}</a><br>{/if}
    53     <a href="{$MANAGE_LINK}">{'Manage my subscriptions'|@translate}</a>
    54   </p>
    55   {/if}
    56  
    57   {if !empty($subscriptions) and $subscriptions != 'none'}
    58   <form action="{$MANAGE_LINK}" method="post">
     51  {if !empty($subscriptions)}
    5952  <fieldset>
    6053    <legend>{'Manage my subscriptions to comments'|@translate}</legend>
    6154    <table class="subscriptions_list">
     55      <tr class="header">
     56        <th class="chkb"><input type="checkbox" id="check_all"></th>
     57        <th colspan="2" class="info">{'Subject'|@translate}</th>
     58        <th class="date">{'Followed on'|@translate}</th>
     59      </tr>
     60     
    6261      {foreach from=$subscriptions item=sub name=subs_loop}
    63       <tr class="{if $smarty.foreach.subs_loop.index is odd}row1{else}row2{/if}">
    64         <td><img src="{$sub.infos.thumbnail}" alt="{$sub.infos.name}" class="thumbnail"></td>
    65         <td>
    66           {if $sub.type == 'image'}
    67           <img src="{$SUBSCRIBE_TO_PATH}template/picture.png" alt="(P)">
    68           {else}
    69           <img src="{$SUBSCRIBE_TO_PATH}template/folder_picture.png" alt="(A)">
    70           {/if}
     62      <tr class="{if $smarty.foreach.subs_loop.index is odd}row1{else}row2{/if} {if $sub.validated == 'false'}not-validated{/if}">
     63        <td class="chkb"><input type="checkbox" name="selected[]" value="{$sub.id}"></td>
     64        <td class="thumb"><img src="{$sub.infos.thumbnail}" alt="{$sub.infos.name}" class="thumbnail"></td>
     65        <td class="info">
     66          <img src="{$SUBSCRIBE_TO_PATH}template/{$sub.type}.png">
    7167          <a href="{$sub.infos.url}">{$sub.infos.name}</a>
    72           <br>{$sub.registration_date}
     68
     69          <div class="actions">
     70            <a href="{$MANAGE_LINK}&amp;unsubscribe={$sub.id}">{'Unsubscribe'|@translate}</a>
     71            {if $sub.validated == 'false'}| <a href="{$MANAGE_LINK}&amp;validate={$sub.id}">{'Validate'|@translate}</a>{/if}
     72          </div>
    7373        </td>
    74         <td><a href="{$MANAGE_LINK}&amp;unsubscribe={$sub.id}">{'Unsubscribe'|@translate}</a></td>
     74        <td class="date">
     75          <i>{$sub.registration_date}</i>
     76        </td>
    7577      </tr>
    7678      {/foreach}
     79     
     80      <tr class="footer {if $smarty.foreach.subs_loop.index is odd}row1{else}row2{/if}"><td colspan="4">
     81        <select name="action">
     82          <option value="-1">{'Choose an action'|@translate}</option>
     83          <option value="unsubscribe">{'Unsubscribe'|@translate}</option>
     84          <option value="validate">{'Validate'|@translate}</option>
     85        </select>
     86        <input type="submit" name="apply_bulk" value="{'Apply action'|@translate}">
     87      </td></tr>
    7788    </table>
    7889   
    7990    <p>
    80       <input type="hidden" name="unsubscribe" value="all">
    81       <input type="submit" value="{'Unsubscribe from all email notifications'|@translate}">
     91      <b>Legend :</b>
     92      <img src="{$SUBSCRIBE_TO_PATH}template/image.png"> {'comments on a picture'|@translate}.
     93      <img src="{$SUBSCRIBE_TO_PATH}template/album-images.png"> {'comments on all pictures of an album'|@translate}.
     94      {if $COA_ACTIVATED}<img src="{$SUBSCRIBE_TO_PATH}template/album.png"> {'comments on an album'|@translate}.{/if}
    8295    </p>
    8396  </fieldset>
    84   {elseif !empty($subscriptions) and $subscriptions == 'none'}
    85   <p>
    86     {'You are not subscribed to any comment.'|@translate}
    87   </p>
    8897  {/if}
     98 
     99  {if !empty($global_subscriptions) or !empty($subscriptions)}
     100    <p>
     101      <label><input type="checkbox" name="unsubscribe_all_check" value="1"> {'Unsubscribe from all email notifications'|@translate}</label>
     102      <input type="submit" name="unsubscribe_all" value="{'Submit'|@translate}">
     103  {/if}
     104</form>
     105
     106{footer_script require="jquery"}{literal}
     107jQuery("#check_all").change(function() {
     108  if ($(this).is(":checked"))
     109    $("input[name^='selected']").attr('checked', 'checked');
     110  else
     111    $("input[name^='selected']").removeAttr('checked');
     112});
     113{/literal}{/footer_script}
    89114
    90115</div> <!-- content -->
    91 
    92 {if !empty($PLUGIN_INDEX_CONTENT_AFTER)}{$PLUGIN_INDEX_CONTENT_AFTER}{/if}
Note: See TracChangeset for help on using the changeset viewer.