Ignore:
Timestamp:
Mar 19, 2011, 10:39:36 AM (13 years ago)
Author:
mistic100
Message:

[plugins] Comments on Albums

  • compatible with BBCode Bar and/or Smilies Support
  • better css integration
Location:
extensions/Comments_on_Albums
Files:
4 added
15 edited

Legend:

Unmodified
Added
Removed
  • extensions/Comments_on_Albums/admin/config.php

    r9641 r9766  
    66// +-----------------------------------------------------------------------+
    77if (isset($_POST['config_submit'])) {
    8         $user_config = array(
     8        $conf['comments_on_albums'] = array(
    99                'icon_color' => $_POST['icon_color'],
    1010                'icon_color_over' => $_POST['icon_color_over'],
    1111        );
    1212       
    13         pwg_query("UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($user_config) . "' WHERE `param` = 'comments_on_albums';");
    14         redirect(COA_ADMIN . '-config&msg=saved');
     13        pwg_query("UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($conf['comments_on_albums']) . "' WHERE `param` = 'comments_on_albums';");
     14        array_push($page['infos'], l10n('Information data registered in database'));
    1515}       
     16
    1617
    1718// +-----------------------------------------------------------------------+
    1819//                              Template
    1920// +-----------------------------------------------------------------------+
    20 if (isset($_GET['msg']) AND $_GET['msg'] == 'saved') {
    21         array_push($page['infos'], l10n('Information data registered in database'));
    22 }
    2321
    2422// available icons
    2523$dh = opendir(COA_PATH . 'template/s26');
    2624while (($file = readdir($dh)) !== false ) {
    27         if ($file !== '.' && $file !== '..') {
    28                 $color = preg_replace('#^outline\_([a-f0-9]{6})\.png$#', '$1', $file);
    29                 $template->append('COLORS', $color);
     25        if ($file !== '.' AND $file !== '..'
     26        AND in_array(strtolower(end(explode('.', $file))), array('jpg', 'png', 'gif'))) {
     27                $template->append('COLORS', $file);
    3028        }
    3129}
    3230closedir($dh);
    3331       
    34 
    3532$template->assign(array(
    3633        'ICON_COLOR' => $conf['comments_on_albums']['icon_color'],
     
    3835));
    3936
    40 
    4137$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/config.tpl'));
    4238$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
     39
    4340?>
  • extensions/Comments_on_Albums/admin/template/config.tpl

    r9641 r9766  
    1 {combine_script id='jquery' path='themes/default/js/jquery.min.js'}
    2 {combine_script id='jquery.cluetip' path='themes/default/js/plugins/jquery.cluetip.js'}
     1{combine_script id='jquery.cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'}
    32{combine_css path=$COA_PATH|@cat:'admin/template/style.css'}
    43
    5 {footer_script}
     4{footer_script require='jquery'}
    65{literal}
    76        jQuery().ready(function(){
     
    1312{/literal}             
    1413                jQuery('select').change(function() {ldelim}
    15                         jQuery('#' + jQuery(this).attr('name') + '_live').attr('src', '{$COA_PATH}template/s26/outline_' + jQuery(this).val() + '.png');
     14                        jQuery('#' + jQuery(this).attr('name') + '_live').attr('src', '{$COA_PATH}template/s26/' + jQuery(this).val());
    1615                });
    1716        });
    18 
    1917{/footer_script}
    2018
     
    4240                                        <select name="icon_color">
    4341                                        {foreach from=$COLORS item=COLOR}
    44                                                 <option value="{$COLOR}" style="color:#{$COLOR};" {if $COLOR == $ICON_COLOR}selected="selected"{/if}>{$COLOR}</option>
     42                                                <option value="{$COLOR}" {if $COLOR == $ICON_COLOR}selected="selected"{/if}>{$COLOR}</option>
    4543                                        {/foreach}
    4644                                        </select>
    4745                                       
    48                                         <img id="icon_color_live" class="pwg-icon" src="{$COA_PATH}template/s26/outline_{$ICON_COLOR}.png"/>
     46                                        <img id="icon_color_live" class="pwg-icon" src="{$COA_PATH}template/s26/{$ICON_COLOR}"/>
    4947                                </td>
    5048                        </tr>
     
    5856                                        </select>
    5957                                       
    60                                         <img id="icon_color_over_live" class="pwg-icon" src="{$COA_PATH}template/s26/outline_{$ICON_COLOR_OVER}.png"/>
     58                                        <img id="icon_color_over_live" class="pwg-icon" src="{$COA_PATH}template/s26/{$ICON_COLOR_OVER}"/>
    6159                                </td>
    6260                        </tr>
  • extensions/Comments_on_Albums/changelog.txt

    r9641 r9766  
     11.0
     2- first public version
     3- compatible with BBCode Bar and/or Smilies Support
     4- better css integration
     5
    160.3
    27- stable version
  • extensions/Comments_on_Albums/include/coa_admin_comments.php

    r9641 r9766  
    9292
    9393        $query = 'SELECT
    94                         c.id,
    95                         c.category_id,
    96                         c.date,
    97                         c.author,
     94                        com.id,
     95                        com.category_id,
     96                        com.date,
     97                        com.author,
    9898                        '.$conf['user_fields']['username'].' AS username,
    99                         c.content,
    100                         i.name
    101                 FROM '.COA_TABLE.' AS c
    102                 INNER JOIN '.CATEGORIES_TABLE.' AS i
    103                 ON i.id = c.category_id
     99                        com.content,
     100                        cat.name
     101                FROM '.COA_TABLE.' AS com
     102                INNER JOIN '.CATEGORIES_TABLE.' AS cat
     103                ON cat.id = com.category_id
    104104                LEFT JOIN '.USERS_TABLE.' AS u
    105                 ON u.'.$conf['user_fields']['id'].' = c.author_id
     105                ON u.'.$conf['user_fields']['id'].' = com.author_id
    106106                WHERE validated = \'false\'
    107                 ORDER BY c.date DESC
     107                ORDER BY com.date DESC
    108108        ;';
    109109        $result = pwg_query($query);
    110110
    111111        while ($row = pwg_db_fetch_assoc($result)) {
     112                // author
    112113                if (empty($row['author_id'])) {
    113114                        $author_name = $row['author'];
     
    116117                }
    117118               
     119                // comment content
    118120                $template->append('comments', array(
    119121                        'CAT_URL' => PHPWG_ROOT_PATH.'admin.php?page=cat_modify&amp;cat_id='.$row['category_id'],
  • extensions/Comments_on_Albums/include/coa_albums.php

    r9641 r9766  
    154154                $query = 'SELECT
    155155                                com.id,
    156                                 author,
    157                                 author_id,
     156                                com.author,
     157                                com.author_id,
    158158                                '.$conf['user_fields']['username'].' AS username,
    159                                 date,
    160                                 category_id,
    161                                 content,
    162                                 validated
     159                                com.date,
     160                                com.category_id,
     161                                com.content,
     162                                com.validated
    163163                        FROM '.COA_TABLE.' AS com
    164164                        LEFT JOIN '.USERS_TABLE.' AS u
  • extensions/Comments_on_Albums/include/coa_comments_page.php

    r9641 r9766  
    2727        <style type="text/css">
    2828                .pwg-icon-comments-albums {ldelim}
    29                         background-image: url({$COA_PATH}template/s26/outline_{$ICON_COLOR}.png);
     29                        background-image: url({$COA_PATH}template/s26/{$ICON_COLOR});
    3030                        background-position: -26px 0;
    3131                }
    3232                a:hover .pwg-icon-comments-albums {ldelim}
    33                         background-image: url({$COA_PATH}template/s26/outline_{$ICON_COLOR_OVER}.png);
     33                        background-image: url({$COA_PATH}template/s26/{$ICON_COLOR_OVER});
    3434                        background-position: -26px 0;
    3535                }
     
    148148                        com.author,
    149149                        com.author_id,
     150                        '.$conf['user_fields']['username'].' AS username,
    150151                        com.date,
    151152                        com.content,
     
    198199
    199200                foreach ($comments as $comment) {
    200                         // comment content
     201                        // category
    201202                        $name = $categories[$comment['comment_id']]['name'];
    202203                        $url = duplicate_index_url(array(
     
    207208                                ),array('start')
    208209                        ));
     210                       
     211                        // comment content
    209212                        $tpl_comment = array(
    210213                                'CAT_URL' => $url,
  • extensions/Comments_on_Albums/language/en_UK/plugin.lang.php

    r9641 r9766  
    1010$lang['COA_icon_over'] = 'Over state';
    1111
    12 $lang['COA_help_icon_pack'] = "Select which icons must be used on the main Comments page.";/*<br>
     12$lang['COA_help_icon_pack'] = "Select which icons must be used on the main Comments page.<br>
    1313        <br>
    14         You can add your owns in the folder <i>plugins/comments_on_pictures/template/s26</i>.<br>
    15         Please respect the name scheme !";*/
     14        You can add your owns in the folder <i>plugins/comments_on_pictures/template/s26</i>.";
    1615       
    1716?>
  • extensions/Comments_on_Albums/language/fr_FR/plugin.lang.php

    r9641 r9766  
    1010$lang['COA_icon_over'] = 'Etat haut';
    1111
    12 $lang['COA_help_icon_pack'] = "Selectionnez les icônes à utiliser sur la page principale des commentaires";/*<br>
     12$lang['COA_help_icon_pack'] = "Selectionnez les icônes à utiliser sur la page principale des commentaires<br>
    1313        <br>
    14         Vous pouvez ajouter les votres dans le dossier <i>plugins/comments_on_pictures/template/s26</i>.<br>
    15         Attention à respecter le même nommage !";*/
     14        Vous pouvez ajouter les votres dans le dossier <i>plugins/comments_on_pictures/template/s26</i>.";
    1615       
    1716?>
  • extensions/Comments_on_Albums/language/hu_HU/plugin.lang.php

    r9656 r9766  
    1010$lang['COA_icon_over'] = 'Bővített állapot';
    1111
    12 $lang['COA_help_icon_pack'] = "Ki kell választani a Hozzászólások fő oldalon megjelenítendő ikonokat.";/*<br>
     12$lang['COA_help_icon_pack'] = "Ki kell választani a Hozzászólások fő oldalon megjelenítendő ikonokat.<br>
    1313        <br>
    14         Hozzáadhatsz saját mappát a  <i>plugins/comments_on_pictures/template/s26</i> könyvtárhoz.<br>
    15         Légy tekintettel az azonos név sémára !";*/
     14        Hozzáadhatsz saját mappát a  <i>plugins/comments_on_pictures/template/s26</i> könyvtárhoz.";
    1615       
    1716?>
  • extensions/Comments_on_Albums/main.inc.php

    r9641 r9766  
    22/*
    33Plugin Name: Comments on Albums
    4 Version: 0.3
     4Version: 1.0
    55Description: Activate comments on albums pages
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=512
     
    1717// +-----------------------------------------------------------------------+
    1818define('COA_NAME' , 'Comments on Albums');
    19 define('COA_VERSION', '0.3');
     19define('COA_VERSION', '1.0');
    2020define('COA_DIR' , basename(dirname(__FILE__)));
    2121define('COA_PATH' , PHPWG_PLUGINS_PATH . COA_DIR . '/');
     
    3838
    3939function COA_index() {
    40         global $template, $page, $conf;
     40        global $template, $page, $conf, $pwg_loaded_plugins;
    4141       
    4242        if ($page['section'] == 'categories' AND isset($page['category'])) {   
     43                if (isset($pwg_loaded_plugins['bbcode_bar'])) set_bbcode_bar();
     44                else if (isset($pwg_loaded_plugins['SmiliesSupport']))set_smiliessupport_page();
     45               
    4346                include(COA_PATH . 'include/coa_albums.php');
    4447        }
  • extensions/Comments_on_Albums/maintain.inc.php

    r9641 r9766  
    44// Default configuration
    55define('default_config', serialize(array(
    6         'icon_color' => 'ff3363',
    7         'icon_color_over' => 'ff7700',
     6        'icon_color' => 'outline_ff3363.png',
     7        'icon_color_over' => 'outline_ff7700.png',
    88)));
    99
  • extensions/Comments_on_Albums/template/coa_albums.tpl

    r9641 r9766  
    33{combine_script id="jquery"}
    44{combine_css path=$COA_PATH|@cat:'template/style_albums.css'}
    5 
    6 {footer_script require="jquery"}{literal}
    7         // cancel all color changements and set default color to comments
    8         jQuery('.thumbnailCategory').css('color', jQuery('body').css('color'));
    9 {/literal}{/footer_script}
     5{if $themeconf.name == 'Sylvia'}{combine_css path=$COA_PATH|@cat:'template/style_albums_sylvia.css'}{/if}
    106
    117<a name="comments"></a>
  • extensions/Comments_on_Albums/template/coa_comments_page.tpl

    r9641 r9766  
    66        <style type="text/css">
    77                .pwg-icon-comments-images {ldelim}
    8                         background-image: url({$COA_PATH}template/s26/outline_{$ICON_COLOR}.png);
     8                        background-image: url({$COA_PATH}template/s26/{$ICON_COLOR});
    99                        background-position: 0 0;
    1010                }
    1111                a:hover .pwg-icon-comments-images {ldelim}
    12                         background-image: url({$COA_PATH}template/s26/outline_{$ICON_COLOR_OVER}.png);
     12                        background-image: url({$COA_PATH}template/s26/{$ICON_COLOR_OVER});
    1313                        background-position: 0 0;
    1414                }
  • extensions/Comments_on_Albums/template/style_albums.css

    r9634 r9766  
    77}
    88
    9 #comments .thumbnailCategory {
    10         padding:0px 2px 0px 12px !important;
    11         border:1px solid grey;
    12 }
    139#comments .thumbnailCategories {
    1410        margin-left:5px;
    1511}
     12#comments  .thumbnailCategory {
     13        margin:2px 0;
     14}
    1615
    17 #comments .thumbnailCategories li:hover,
    18 #comments .thumbnailCategory:hover,
    19 #comments .thumbnailCategory:hover A {
    20         background:none;
    21 }
    22        
    2316#comments .thumbnailCategory  .date, #comments .thumbnailCategory  .author {
    2417        font-weight:bold;
  • extensions/Comments_on_Albums/template/style_comments.css

    r9641 r9766  
    11.thumbnailCategory .category-title {
    2         position:absolute;
    3         margin-top:-5px;
    4         font-size:1.2em;
     2        font-size:1.1em;
    53        font-weight:bold;
    64}
Note: See TracChangeset for help on using the changeset viewer.