Changeset 9641 for extensions


Ignore:
Timestamp:
Mar 13, 2011, 11:56:02 AM (13 years ago)
Author:
mistic100
Message:

[plugins] Comments on Albums

  • stable version
Location:
extensions/Comments_on_Albums
Files:
19 added
11 edited

Legend:

Unmodified
Added
Removed
  • extensions/Comments_on_Albums/changelog.txt

    r9634 r9641  
     10.3
     2- stable version
     3- all fonctionnalities complete
     4
    150.2
    26- Test version
  • extensions/Comments_on_Albums/include/coa_admin_comments.php

    r9634 r9641  
    22/* Code adapted from admin/comments.php */
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     4
     5load_language('plugin.lang', COA_PATH);
    46
    57// +-----------------------------------------------------------------------+
     
    1113        array(
    1214                'code' => 'pictures',
    13                 'label' => l10n('Photos'),
     15                'label' => l10n('COA_comments_photos'),
    1416        ),
    1517        array(
    1618                'code' => 'albums',
    17                 'label' => l10n('Albums'),
     19                'label' => l10n('COA_comments_albums'),
    1820        ),
    1921);
  • extensions/Comments_on_Albums/include/coa_albums.php

    r9634 r9641  
    4444                        }
    4545                }
    46                
    4746                case 'delete_comment' : {
    4847                        check_pwg_token();
     
    5756                        redirect($url_self);
    5857                }
    59                
    6058                case 'validate_comment' : {
    6159                        check_pwg_token();
     
    8987
    9088        include_once(COA_PATH.'include/functions_comment.inc.php');
    91         $comment_action = insert_user_comment($comm, @$_POST['key'], $infos);
     89        $comment_action = insert_user_comment_albums($comm, @$_POST['key'], $infos);
    9290
    9391        switch ($comment_action) {
  • extensions/Comments_on_Albums/include/coa_comments_page.php

    r9634 r9641  
    11<?php
     2/* inspired by include/comments.php */
    23if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     4
     5load_language('plugin.lang', COA_PATH);
     6$conf['comments_on_albums'] = unserialize($conf['comments_on_albums']);
    37
    48$template->assign(array(
    59        'COA_PATH' => COA_PATH,
    6         'ICON_COLOR' => 'ff3363',
    7         'ICON_COLOR_OVER' => 'ff7700',
     10        'ICON_COLOR' => $conf['comments_on_albums']['icon_color'],
     11        'ICON_COLOR_OVER' => $conf['comments_on_albums']['icon_color_over'],
    812));
    913
    10 // ajout d'un bouton sur la page principale
     14
     15// +-----------------------------------------------------------------------+
     16//                              Main page (comments on photos)
     17// +-----------------------------------------------------------------------+
     18
    1119if (!isset($_GET['display_mode'])) {   
    12        
     20        // adds a button for switch page
    1321        $template->set_prefilter('comments', 'coa_add_button');
    14 
    1522        function coa_add_button($content, &$smarty) {
    16                 $search = '#<ul class="categoryActions">#';
    17 
    18                 $replacement = '
    19                 {html_head}
    20                         <style type="text/css">
    21                                 .pwg-icon-comments-albums {ldelim}
    22                                         background-image: url({$COA_PATH}template/s26/outline_{$ICON_COLOR}.png);
    23                                         background-position: -26px 0;
     23                $search = '<ul class="categoryActions">';
     24
     25$replacement = '
     26{html_head}
     27        <style type="text/css">
     28                .pwg-icon-comments-albums {ldelim}
     29                        background-image: url({$COA_PATH}template/s26/outline_{$ICON_COLOR}.png);
     30                        background-position: -26px 0;
     31                }
     32                a:hover .pwg-icon-comments-albums {ldelim}
     33                        background-image: url({$COA_PATH}template/s26/outline_{$ICON_COLOR_OVER}.png);
     34                        background-position: -26px 0;
     35                }
     36        </style>
     37{/html_head}
     38
     39        <ul class="categoryActions">
     40                <li><a href="comments.php?display_mode=albums" title="' . l10n('COA_comments_albums') . '" class="pwg-state-default pwg-button">
     41                        <span class="pwg-icon pwg-icon-comments-albums">&nbsp;</span><span class="pwg-button-text">' . l10n('COA_comments_albums') . '</span>
     42                </a></li>';
     43
     44                return str_replace($search, $replacement, $content);
     45        }
     46       
     47       
     48// +-----------------------------------------------------------------------+
     49//                              Second page (comments on albums)
     50// +-----------------------------------------------------------------------+
     51
     52} else if ($_GET['display_mode'] == 'albums') {
     53        // reset some template vars
     54        $template->clear_assign(array('comments', 'navbar', 'sort_by_options'));
     55       
     56        // sort_by : database fields proposed for sorting comments list
     57        $sort_by = array(
     58                'date' => l10n('comment date'),
     59                'category_id' => l10n('album')
     60        );
     61        $template->assign('sort_by_options', $sort_by);
     62
     63        // +-----------------------------------------------------------------------+
     64        // |                         comments management                           |
     65        // +-----------------------------------------------------------------------+
     66        $comment_id = null;
     67        $action = null;
     68
     69        $actions = array('delete_albums', 'validate_albums', 'edit_albums'); // different indexes to not interfer with the main process
     70        foreach ($actions as $loop_action) {
     71                if (isset($_GET[$loop_action])) {
     72                        $action = $loop_action;
     73                        check_input_parameter($action, $_GET, false, PATTERN_ID);
     74                        $comment_id = $_GET[$action];
     75                        break;
     76                }
     77        }
     78
     79        if (isset($action)) {
     80                include_once(COA_PATH.'include/functions_comment.inc.php');
     81                check_pwg_token();
     82                $comment_author_id = get_comment_author_id_albums($comment_id);
     83                $true_action = str_replace('_albums', null, $action); // but we must check true action names
     84
     85                if (can_manage_comment($true_action, $comment_author_id)) {
     86                        $perform_redirect = false;
     87
     88                        if ('delete_albums' == $action) {
     89                                delete_user_comment_albums($comment_id);
     90                                $perform_redirect = true;
     91                        }
     92                        if ('validate_albums' == $action) {
     93                                validate_user_comment_albums($comment_id);
     94                                $perform_redirect = true;
     95                        }
     96                        if ('edit_albums' == $action) {
     97                                if (!empty($_POST['content'])) {
     98                                        update_user_comment_albums(array(
     99                                                'comment_id' => $_GET['edit_albums'],
     100                                                'image_id' => $_POST['image_id'],
     101                                                'content' => $_POST['content']
     102                                                ), $_POST['key']
     103                                        );
     104                                        $perform_redirect = true;
     105                                } else {
     106                                        $edit_comment = $_GET['edit_albums'];
    24107                                }
    25                                 a:hover .pwg-icon-comments-albums {ldelim}
    26                                         background-image: url({$COA_PATH}template/s26/outline_{$ICON_COLOR_OVER}.png);
    27                                         background-position: -26px 0;
    28                                 }
    29                         </style>
    30                 {/html_head}
    31 
    32                 <ul class="categoryActions">
    33                         <li><a href="comments.php?display_mode=albums" title="Commentaires albums" class="pwg-state-default pwg-button">
    34                                 <span class="pwg-icon pwg-icon-comments-albums">&nbsp;</span><span class="pwg-button-text">Commentaires albums</span>
    35                         </a></li>';
    36 
    37                 return preg_replace($search, $replacement, $content);
    38         }
    39        
    40 // page modifiée pour les commentaires albums
    41 } else if ($_GET['display_mode'] == 'albums') {
    42         $template->clear_assign(array('comments', 'navbar', 'sort_by_options'));
    43        
    44 // sort_by : database fields proposed for sorting comments list
    45 $sort_by = array(
    46         'date' => l10n('comment date'),
    47         'category_id' => l10n('album')
    48 );
    49 $template->assign('sort_by_options', $sort_by);
    50 
    51 // +-----------------------------------------------------------------------+
    52 // |                         comments management                           |
    53 // +-----------------------------------------------------------------------+
    54 
    55 $comment_id = null;
    56 $action = null;
    57 
    58 $actions = array('delete_albums', 'validate_albums', 'edit_albums');
    59 foreach ($actions as $loop_action) {
    60         if (isset($_GET[$loop_action])) {
    61                 $action = $loop_action;
    62                 check_input_parameter($action, $_GET, false, PATTERN_ID);
    63                 $comment_id = $_GET[$action];
    64                 break;
    65         }
    66 }
    67 
    68 if (isset($action)) {
    69         include_once(COA_PATH.'include/functions_comment.inc.php');
    70         check_pwg_token();
    71         $comment_author_id = get_comment_author_id_albums($comment_id);
    72         $true_action = str_replace('_albums', null, $action);
    73 
    74         if (can_manage_comment($true_action, $comment_author_id)) {
    75                 $perform_redirect = false;
    76 
    77                 if ('delete_albums' == $action) {
    78                         delete_user_comment_albums($comment_id);
    79                         $perform_redirect = true;
    80                 }
    81 
    82                 if ('validate_albums' == $action) {
    83                         validate_user_comment_albums($comment_id);
    84                         $perform_redirect = true;
    85                 }
    86 
    87                 if ('edit_albums' == $action) {
    88                         if (!empty($_POST['content'])) {
    89                                 update_user_comment_albums(array(
    90                                         'comment_id' => $_GET['edit_albums'],
    91                                         'image_id' => $_POST['image_id'],
    92                                         'content' => $_POST['content']
    93                                         ), $_POST['key']
    94                                 );
    95                                 $perform_redirect = true;
    96                         } else {
    97                                 $edit_comment = $_GET['edit_albums'];
    98                         }
    99                 }
    100 
    101                 if ($perform_redirect) {
    102                         $redirect_url = PHPWG_ROOT_PATH.'comments.php'.get_query_string_diff(array('delete_albums','validate_albums','edit_albums','pwg_token'));
    103                         redirect($redirect_url);
    104                 }
    105         }
    106 }
    107 
    108 // +-----------------------------------------------------------------------+
    109 // |                            navigation bar                             |
    110 // +-----------------------------------------------------------------------+
    111 
    112 if (isset($_GET['start']) and is_numeric($_GET['start'])) {
    113         $start = $_GET['start'];
    114 } else {
    115         $start = 0;
    116 }
    117 
    118 $query = 'SELECT COUNT(DISTINCT(com.id))
    119         FROM '.COA_TABLE.' AS com
    120         LEFT JOIN '.USERS_TABLE.' As u
    121         ON u.'.$conf['user_fields']['id'].' = com.author_id
    122         WHERE '.implode('
    123         AND ', $page['where_clauses']).'
    124 ;';
    125 
    126 list($counter) = pwg_db_fetch_row(pwg_query($query));
    127 
    128 $url = PHPWG_ROOT_PATH . 'comments.php' . get_query_string_diff(array('start','delete','validate','pwg_token'));
    129 $navbar = create_navigation_bar($url, $counter, $start, $page['items_number'], '');
    130 $template->assign('navbar', $navbar);
    131 
    132 // +-----------------------------------------------------------------------+
    133 // |                        last comments display                          |
    134 // +-----------------------------------------------------------------------+
    135 
    136 $comments = array();
    137 $element_ids = array();
    138 $category_ids = array();
    139 
    140 $query = 'SELECT
    141                 com.id AS comment_id,
    142                 com.category_id,
    143                 com.author,
    144                 com.author_id,
    145                 com.date,
    146                 com.content,
    147                 com.validated
    148         FROM '.COA_TABLE.' AS com
    149         LEFT JOIN '.USERS_TABLE.' As u
    150         ON u.'.$conf['user_fields']['id'].' = com.author_id
    151         WHERE '.implode('
    152         AND ', $page['where_clauses']).'
    153         GROUP BY
    154                 comment_id,
    155                 com.category_id,
    156                 com.author,
    157                 com.author_id,
    158                 com.date,
    159                 com.content,
    160                 com.validated
    161         ORDER BY '.$page['sort_by'].' '.$page['sort_order'];
    162         if ('all' != $page['items_number']) {
     108                        }
     109                        if ($perform_redirect) {
     110                                $redirect_url = PHPWG_ROOT_PATH.'comments.php'.get_query_string_diff(array('delete_albums','validate_albums','edit_albums','pwg_token'));
     111                                redirect($redirect_url);
     112                        }
     113                }
     114        }
     115
     116        // +-----------------------------------------------------------------------+
     117        // |                            navigation bar                             |
     118        // +-----------------------------------------------------------------------+
     119        if (isset($_GET['start']) and is_numeric($_GET['start'])) {
     120                $start = $_GET['start'];
     121        } else {
     122                $start = 0;
     123        }
     124
     125        $query = 'SELECT COUNT(DISTINCT(com.id))
     126                FROM '.COA_TABLE.' AS com
     127                LEFT JOIN '.USERS_TABLE.' As u
     128                ON u.'.$conf['user_fields']['id'].' = com.author_id
     129                WHERE '.implode('
     130                AND ', $page['where_clauses']).'
     131        ;';
     132        list($counter) = pwg_db_fetch_row(pwg_query($query));
     133
     134        $url = PHPWG_ROOT_PATH . 'comments.php' . get_query_string_diff(array('start','delete_albums','validate_albums','edit_albums','pwg_token'));
     135        $navbar = create_navigation_bar($url, $counter, $start, $page['items_number'], '');
     136        $template->assign('navbar', $navbar);
     137
     138        // +-----------------------------------------------------------------------+
     139        // |                        last comments display                          |
     140        // +-----------------------------------------------------------------------+
     141        $comments = array();
     142        $element_ids = array();
     143        $category_ids = array();
     144
     145        $query = 'SELECT
     146                        com.id AS comment_id,
     147                        com.category_id,
     148                        com.author,
     149                        com.author_id,
     150                        com.date,
     151                        com.content,
     152                        com.validated
     153                FROM '.COA_TABLE.' AS com
     154                LEFT JOIN '.USERS_TABLE.' As u
     155                ON u.'.$conf['user_fields']['id'].' = com.author_id
     156                WHERE '.implode('
     157                AND ', $page['where_clauses']).'
     158                GROUP BY
     159                        comment_id,
     160                        com.category_id,
     161                        com.author,
     162                        com.author_id,
     163                        com.date,
     164                        com.content,
     165                        com.validated
     166                ORDER BY '.$page['sort_by'].' '.$page['sort_order'];
     167                if ('all' != $page['items_number']) {
     168                        $query.= '
     169                        LIMIT '.$page['items_number'].' OFFSET '.$start;
     170                }
    163171                $query.= '
    164                 LIMIT '.$page['items_number'].' OFFSET '.$start;
    165         }
    166         $query.= '
    167 ;';
    168 $result = pwg_query($query);
    169 
    170 while ($row = pwg_db_fetch_assoc($result)) {
    171         array_push($comments, $row);
    172         array_push($element_ids, $row['category_id']);
    173 }
    174 
    175 if (count($comments) > 0) {
    176         // retrieving category informations
    177         $query = 'SELECT
    178                         cat.id,
    179                         cat.name,
    180                         cat.permalink,
    181                         cat.uppercats,
    182                         com.id as comment_id
    183                 FROM '.CATEGORIES_TABLE.' AS cat
    184                 LEFT JOIN '.COA_TABLE.' AS com
    185                 ON cat.id=com.category_id
    186                 '.get_sql_condition_FandF(array(
    187                         'forbidden_categories' => 'cat.id',
    188                         'visible_categories' => 'cat.id'
    189                 ), 'WHERE').'
    190                 AND cat.id IN ('.implode(',', $element_ids).')
    191172        ;';
    192         $categories = hash_from_query($query, 'comment_id');
    193 
    194         foreach ($comments as $comment) {
    195                 $name = $categories[$comment['comment_id']]['name'];
    196 
    197                 $url = duplicate_index_url(array(
    198                         'category' => array(
    199                                 'id' => $categories[$comment['comment_id']]['id'],
    200                                 'name' => $categories[$comment['comment_id']]['name'],
    201                                 'permalink' => $categories[$comment['comment_id']]['permalink'],
    202                         ),array('start')
    203                 ));
    204 
    205                 $tpl_comment = array(
    206                         'U_PICTURE' => $url,
    207                         'TN_SRC' => $url,
    208                         'ALT' => $name,
    209                         'AUTHOR' => trigger_event('render_comment_author', $comment['author']),
    210                         'DATE' => format_date($comment['date'], true),
    211                         'CONTENT' => trigger_event('render_comment_content',$comment['content']),
    212                 );
    213 
    214                 if (can_manage_comment('delete', $comment['author_id'])) {
    215                         $url = get_root_url().'comments.php'.get_query_string_diff(array('delete','validate','edit', 'pwg_token'));
    216 
    217                         $tpl_comment['U_DELETE'] = add_url_params($url, array(
    218                                 'delete_albums' => $comment['comment_id'],
    219                                 'pwg_token' => get_pwg_token(),
     173        $result = pwg_query($query);
     174
     175        while ($row = pwg_db_fetch_assoc($result)) {
     176                array_push($comments, $row);
     177                array_push($element_ids, $row['category_id']);
     178        }
     179
     180        if (count($comments) > 0) {
     181                // retrieving category informations
     182                $query = 'SELECT
     183                                cat.id,
     184                                cat.name,
     185                                cat.permalink,
     186                                cat.uppercats,
     187                                com.id as comment_id
     188                        FROM '.CATEGORIES_TABLE.' AS cat
     189                        LEFT JOIN '.COA_TABLE.' AS com
     190                        ON cat.id=com.category_id
     191                        '.get_sql_condition_FandF(array(
     192                                'forbidden_categories' => 'cat.id',
     193                                'visible_categories' => 'cat.id'
     194                        ), 'WHERE').'
     195                        AND cat.id IN ('.implode(',', $element_ids).')
     196                ;';
     197                $categories = hash_from_query($query, 'comment_id');
     198
     199                foreach ($comments as $comment) {
     200                        // comment content
     201                        $name = $categories[$comment['comment_id']]['name'];
     202                        $url = duplicate_index_url(array(
     203                                'category' => array(
     204                                        'id' => $categories[$comment['comment_id']]['id'],
     205                                        'name' => $categories[$comment['comment_id']]['name'],
     206                                        'permalink' => $categories[$comment['comment_id']]['permalink'],
     207                                ),array('start')
    220208                        ));
    221                 }
    222                 if (can_manage_comment('edit', $comment['author_id'])) {
    223                         $url = get_root_url().'comments.php'.get_query_string_diff(array('edit', 'delete','validate', 'pwg_token'));
    224 
    225                         $tpl_comment['U_EDIT'] = add_url_params($url, array(
    226                                 'edit_albums' => $comment['comment_id'],
    227                                 'pwg_token' => get_pwg_token(),
    228                         ));
    229 
    230                         if (isset($edit_comment) and ($comment['comment_id'] == $edit_comment)) {
    231                                 $key = get_ephemeral_key(2, $comment['category_id']);
    232                                 $tpl_comment['IN_EDIT'] = true;
    233                                 $tpl_comment['KEY'] = $key;
    234                                 $tpl_comment['IMAGE_ID'] = $comment['category_id'];
    235                                 $tpl_comment['CONTENT'] = $comment['content'];
    236                         }
    237                 }
    238                 if (can_manage_comment('validate', $comment['author_id'])) {
    239                         if ('true' != $comment['validated']) {
    240                                 $tpl_comment['U_VALIDATE'] = add_url_params($url, array(
    241                                         'validate_albums'=> $comment['comment_id'],
     209                        $tpl_comment = array(
     210                                'CAT_URL' => $url,
     211                                'CAT_NAME' => $name,
     212                                'AUTHOR' => trigger_event('render_comment_author', $comment['author']),
     213                                'DATE' => format_date($comment['date'], true),
     214                                'CONTENT' => trigger_event('render_comment_content',$comment['content']),
     215                        );
     216
     217                        // rights
     218                        if (can_manage_comment('delete', $comment['author_id'])) {
     219                                $url = get_root_url().'comments.php'.get_query_string_diff(array('delete','validate','edit', 'pwg_token'));
     220
     221                                $tpl_comment['U_DELETE'] = add_url_params($url, array(
     222                                        'delete_albums' => $comment['comment_id'],
    242223                                        'pwg_token' => get_pwg_token(),
    243224                                ));
    244225                        }
    245                 }
    246                
    247                 $template->append('comments', $tpl_comment);
     226                        if (can_manage_comment('edit', $comment['author_id'])) {
     227                                $url = get_root_url().'comments.php'.get_query_string_diff(array('edit', 'delete','validate', 'pwg_token'));
     228
     229                                $tpl_comment['U_EDIT'] = add_url_params($url, array(
     230                                        'edit_albums' => $comment['comment_id'],
     231                                        'pwg_token' => get_pwg_token(),
     232                                ));
     233
     234                                if (isset($edit_comment) and ($comment['comment_id'] == $edit_comment)) {
     235                                        $key = get_ephemeral_key(2, $comment['category_id']);
     236                                        $tpl_comment['IN_EDIT'] = true;
     237                                        $tpl_comment['KEY'] = $key;
     238                                        $tpl_comment['IMAGE_ID'] = $comment['category_id'];
     239                                        $tpl_comment['CONTENT'] = $comment['content'];
     240                                }
     241                        }
     242                        if (can_manage_comment('validate', $comment['author_id'])) {
     243                                if ('true' != $comment['validated']) {
     244                                        $tpl_comment['U_VALIDATE'] = add_url_params($url, array(
     245                                                'validate_albums'=> $comment['comment_id'],
     246                                                'pwg_token' => get_pwg_token(),
     247                                        ));
     248                                }
     249                        }
     250                       
     251                        $template->append('comments', $tpl_comment);
     252                }
     253        }
     254
     255        // +-----------------------------------------------------------------------+
     256        // |                        template                                       |
     257        // +-----------------------------------------------------------------------+
     258        $template->set_filenames(array('comments'=> dirname(__FILE__).'/../template/coa_comments_page.tpl'));
     259       
     260        // add a layer for display category name
     261        $template->set_prefilter('comments', 'coa_change_comments_list');
     262        function coa_change_comments_list($content, &$smarty) {
     263                $search = '<div class="description"{if isset($comment.IN_EDIT)} style="height:200px"{/if}>';
     264
     265$replacement = '<div class="category-title">
     266        <a href="{$comment.CAT_URL}">{$comment.CAT_NAME}</a>
     267</div>
     268<div class="description"{if isset($comment.IN_EDIT)} style="height:220px"{/if}>';
     269
     270                return str_replace($search, $replacement, $content);
    248271        }
    249272}
    250273
    251        
    252         $template->set_filenames(array('comments'=> dirname(__FILE__).'/../template/coa_comments_page.tpl'));
    253 }
    254 
    255274?>
  • extensions/Comments_on_Albums/main.inc.php

    r9634 r9641  
    11<?php
    22/*
    3 Plugin Name: Comment on Albums
    4 Version: 0.2
    5 Description: Allows users to comment albums
     3Plugin Name: Comments on Albums
     4Version: 0.3
     5Description: Activate comments on albums pages
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=512
    77Author: Mistic
     
    1616//                                      Global variables
    1717// +-----------------------------------------------------------------------+
    18 define('COA_NAME' , 'Comment on Albums');
    19 define('COA_VERSION', '0.2');
     18define('COA_NAME' , 'Comments on Albums');
     19define('COA_VERSION', '0.3');
    2020define('COA_DIR' , basename(dirname(__FILE__)));
    2121define('COA_PATH' , PHPWG_PLUGINS_PATH . COA_DIR . '/');
    2222define('COA_TABLE' , $prefixeTable . 'comments_categories');
     23define('COA_ADMIN', get_root_url().'admin.php?page=plugin-' . COA_DIR);
    2324
    2425
     
    2930add_event_handler('loc_after_page_header', 'COA_comments_page');
    3031add_event_handler('loc_end_admin', 'COA_admin');
     32add_event_handler('get_admin_plugin_menu_links', 'COA_admin_menu');
    3133
    3234
     
    6163}
    6264
     65function COA_admin_menu($menu) {
     66        array_push($menu, array(
     67                'NAME' => COA_NAME,
     68                'URL' => COA_ADMIN
     69        ));
     70        return $menu;
     71}
     72
    6373?>
  • extensions/Comments_on_Albums/maintain.inc.php

    r9634 r9641  
    11<?php
    22if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     3
     4// Default configuration
     5define('default_config', serialize(array(
     6        'icon_color' => 'ff3363',
     7        'icon_color_over' => 'ff7700',
     8)));
    39
    410// Installation
     
    1723                PRIMARY KEY (`id`)
    1824        ) DEFAULT CHARSET=utf8;");
     25       
     26        pwg_query("INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('comments_on_albums', '" . default_config . "', 'Parametres du plugin Comments on Albums');");
    1927}
    2028
     
    2432
    2533        pwg_query("DROP TABLE `" . $prefixeTable . "comments_categories`;");
     34        pwg_query("DELETE FROM " . CONFIG_TABLE . " WHERE `param` = 'comments_on_albums';");
    2635}
    2736?>
  • extensions/Comments_on_Albums/template/coa_admin_comments.tpl

    r9634 r9641  
     1{* this is a copy of admin/theme/defaults/template/comments.tpl a bit modified *}
     2       
    13{literal}
    24<script type="text/javascript">
     
    2729
    2830<div class="titrePage">
    29         <h2>{'Waiting'|@translate} {$TABSHEET_TITLE}</h2>
     31        <h2>{'Waiting'|@translate}</h2>
    3032</div>
    3133
  • extensions/Comments_on_Albums/template/coa_admin_intro.tpl

    r9634 r9641  
     1{* this code add a line to the database infos list *}
     2
    13{footer_script}
    2         // add element to database informations, non intrusive way
    34        jQuery('dl[style="padding-top: 30px;"] dd:last-child ul li:last-child').append('[{'Photos'|@translate}]');
    45        jQuery('<li>'+
  • extensions/Comments_on_Albums/template/coa_albums.tpl

    r9634 r9641  
     1{* this is inspired by theme/defaults/template/picture.tpl *}
     2       
    13{combine_script id="jquery"}
    24{combine_css path=$COA_PATH|@cat:'template/style_albums.css'}
  • extensions/Comments_on_Albums/template/coa_comments_page.tpl

    r9634 r9641  
     1{* this is a copy of theme/defaults/template/comments.tpl a bit modified *}
     2       
     3{combine_css path=$COA_PATH|@cat:'template/style_comments.css'}
     4
    15{html_head}
    26        <style type="text/css">
     
    1620<div class="titrePage">
    1721        <ul class="categoryActions">
    18                 <li><a href="comments.php" title="Commentaires images" class="pwg-state-default pwg-button">
    19                         <span class="pwg-icon pwg-icon-comments-images">&nbsp;</span><span class="pwg-button-text">Commentaires images</span>
     22                <li><a href="comments.php" title="{'COA_comments_photos'|@translate}" class="pwg-state-default pwg-button">
     23                        <span class="pwg-icon pwg-icon-comments-images">&nbsp;</span><span class="pwg-button-text">{'COA_comments_photos'|@translate}</span>
    2024                </a></li>
    2125                <li><a href="{$U_HOME}" title="{'Home'|@translate}" class="pwg-state-default pwg-button">
  • extensions/Comments_on_Albums/template/navigation_bar.tpl

    r9624 r9641  
     1{* this is a copy of theme/defaults/template/navigation_bar.tpl
     2        but with other variables to not interfer with the thumbnails' navigation bar *}
     3       
    14<div class="navigationBar">
    25        {if isset($comment_navbar.URL_FIRST)}
Note: See TracChangeset for help on using the changeset viewer.