Changeset 3619


Ignore:
Timestamp:
Jul 17, 2009, 7:41:22 PM (15 years ago)
Author:
tiico
Message:

Add compatiblity with tag page (piclens and wall)
Add parameter to avoid double image in the feed

Location:
extensions/piclens
Files:
12 edited

Legend:

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

    r3410 r3619  
    5959  $me->my_config['piclens_bestrated_active'] = isset($_POST['piclens_bestrated_active']);
    6060  $me->my_config['piclens_favorites_active'] = isset($_POST['piclens_favorites_active']);
     61  $me->my_config['piclens_tags_active'] = isset($_POST['piclens_tags_active']);
    6162
    6263  $me->my_config['piclens_recursive_mode'] = $_POST['recursive_mode'];
     
    6768}
    6869
    69 //$template->assign('PICLENS_ACTIVATED', $me->my_config['piclens_active'] ? 'checked="checked"' : '' );
    70 //$template->assign('PICLENS_RECURSIVE_ACTIVATED', $me->my_config['piclens_recursive'] ? 'checked="checked"' : '' );
    71 //$template->assign('PICLENS_GALLERIE_ACTIVATED', $me->my_config['piclens_gallerie_active'] ? 'checked="checked"' : '' );
    72 
    7370// Affichage des coix miniature possibles pour la recursivite de l'option 'Activer gallerie'
    7471$i=1;
     
    7875        $i++;   
    7976}
    80 //$template->assign('PICLENS_GALLERIE_TYPE', $me->my_config['piclens_gallerie_type']);
    81 
    82 //$template->assign('PICLENS_LITE_ACTIVATED', $me->my_config['piclens_lite_active'] ? 'checked="checked"' : '' );
    83 
    84 //$template->assign('PICLENS_SECUREIMAGE', get_db_plugins('active','secureImages'));
    85 //$template->assign('PICLENS_SECUREIMAGE_ACTIVATED', $me->my_config['piclens_secureimage'] ? 'checked="checked"' : '' );
    86 
    87 //$template->assign('PICLENS_EXTENDEDDESC', get_db_plugins('active','ExtendedDescription') );
    88 //$template->assign('PICLENS_EXTENDEDDESC_ACTIVATED', $me->my_config['piclens_extendeddesc'] ? 'checked="checked"' : '' );
    89  
    90 //$template->assign('PICLENS_RECENTPICS_ACTIVATED', $me->my_config['piclens_recentpics_active'] ? 'checked="checked"' : '' );
    91 //$template->assign('PICLENS_RECENTCATS_ACTIVATED', $me->my_config['piclens_recentcats_active'] ? 'checked="checked"' : '' );
    92 //$template->assign('PICLENS_MOSTVISITED_ACTIVATED', $me->my_config['piclens_mostvisited_active'] ? 'checked="checked"' : '' );
    93 //$template->assign('PICLENS_BESTRATED_ACTIVATED', $me->my_config['piclens_bestrated_active'] ? 'checked="checked"' : '' );
    94 //$template->assign('PICLENS_FAVORITES_ACTIVATED', $me->my_config['piclens_favorites_active'] ? 'checked="checked"' : '' );
    9577
    9678$template->assign(array(
     
    10991        'PICLENS_BESTRATED_ACTIVATED'   => ($me->my_config['piclens_bestrated_active'] ? 'checked="checked"' : '' ),
    11092        'PICLENS_FAVORITES_ACTIVATED'   => ($me->my_config['piclens_favorites_active'] ? 'checked="checked"' : '' ),
     93        'PICLENS_TAGS_ACTIVATED'                => ($me->my_config['piclens_tags_active'] ? 'checked="checked"' : '' ),
    11194        $me->my_config['piclens_recursive_mode'].'_CHECKED' => 'checked="checked"',
    11295        'ICON_INFO' => PICLENS_ADMIN_PATH . 'info.png',
  • extensions/piclens/admin/config.tpl

    r3410 r3619  
    102102                        <input type="checkbox" name="piclens_recentcats_active" {$PICLENS_RECENTCATS_ACTIVATED}/> {'piclens_recentcats_label'|@translate}
    103103                    <br/>
     104                        <input type="checkbox" name="piclens_tags_active" {$PICLENS_TAGS_ACTIVATED}/> {'piclens_tags_label'|@translate}
     105                    <br/>
    104106
    105107                </TD>
  • extensions/piclens/admin/piclenswallconfig.php

    r3598 r3619  
    4545  $me->my_config['piclens_wall_spec_bestrated'] = isset($_POST['piclens_wall_spec_bestrated']);
    4646  $me->my_config['piclens_wall_spec_favorites'] = isset($_POST['piclens_wall_spec_favorites']);
     47  $me->my_config['piclens_wall_spec_tags'] = isset($_POST['piclens_wall_spec_tags']);
    4748
    4849  $me->my_config['piclens_wall_swflocal'] = isset($_POST['piclens_wall_swflocal']);
     
    104105        'PICLENS_WALL_SPEC_BESTRATED'                                           => ($me->my_config['piclens_wall_spec_bestrated'] ? 'checked="checked"' : '' ),
    105106        'PICLENS_WALL_SPEC_FAVORITES'                                           => ($me->my_config['piclens_wall_spec_favorites'] ? 'checked="checked"' : '' ),
     107        'PICLENS_WALL_SPEC_TAGS'                                                        => ($me->my_config['piclens_wall_spec_tags'] ? 'checked="checked"' : '' ),
    106108        'PICLENS_WALL_SWFLOCAL'                                                         => ($me->my_config['piclens_wall_swflocal'] ? 'checked="checked"' : '' )
    107109        ));
  • extensions/piclens/admin/piclenswallconfig.tpl

    r3598 r3619  
    139139                    <br/>
    140140                                 <input type="checkbox" name="piclens_wall_spec_recentpics" {$PICLENS_WALL_SPEC_RECENTPICS}/> {'piclens_recentpics_label'|@translate}
     141                    <br/>
     142                                 <input type="checkbox" name="piclens_wall_spec_tags" {$PICLENS_WALL_SPEC_TAGS}/> {'piclens_tags_label'|@translate}
    141143                       
    142144                        </TD>
  • extensions/piclens/admin/rssfeed.php

    r3614 r3619  
    1919$me = get_plugin_data($plugin_id);
    2020
    21 //$order_list = array('Defaut Piwigo', 'Date de Creation', 'Date d\'ajout', 'Note Moyenne', 'Plus vues', 'Nom du fichier', 'Id', 'Al&eacute;atoire', 'Cat&eacute;gories');
    2221$order_list = array(l10n('piclens_label_orderPiwigo'), l10n('piclens_label_orderCreDate'), l10n('piclens_label_orderAddDate'), l10n('piclens_label_orderRank'), l10n('piclens_label_orderBest'), l10n('piclens_label_orderName'), l10n('piclens_label_orderID'), l10n('piclens_label_orderRand'), l10n('piclens_label_orderCat'));
    23 //$sort_list = array('Defaut Piwigo', 'Croissant', 'Decroissant');
    2422$sort_list = array(l10n('piclens_label_sortPiwigo'), l10n('piclens_label_sortUp'), l10n('piclens_label_sortDown'));
    2523
    26 //$thumb_list = array('Miniature', 'Normal');
    2724$thumb_list = array(l10n('piclens_label_TypeTN'), l10n('piclens_label_TypeNorm'));
    28 //$normal_list = array('Miniature', 'Normal', 'High');
    2925$normal_list = array(l10n('piclens_label_TypeTN'), l10n('piclens_label_TypeNorm'), l10n('piclens_label_TypeHigh'));
    30 //$nameformat_list = array('Nom vignette : taille', 'Nom vignette', 'Nom de l\'image');
     26
    3127//$nameformat_list = array(l10n('piclens_label_Name1'), l10n('piclens_label_Name2'), l10n('piclens_label_Name3'));
    32 //$descformat_list = array('Rien', 'Nom de l\'image', 'Description de l\'image');
    3328//$descformat_list = array(l10n('piclens_label_Desc1'), l10n('piclens_label_Desc2'), l10n('piclens_label_Desc3'));
    3429 
     
    6156  $me->my_config['piclens_rss_name'] = $_POST['piclens_rss_name'];
    6257  $me->my_config['piclens_rss_desc'] = $_POST['piclens_rss_desc'];
     58  $me->my_config['piclens_exclude_double'] = isset($_POST['piclens_exclude_double']);
    6359   
    6460
     
    147143$template->assign('PICLENS_RSS_NAME', $me->my_config['piclens_rss_name']);
    148144$template->assign('PICLENS_RSS_DESC', $me->my_config['piclens_rss_desc']);
     145$template->assign('PICLENS_EXCLUDE_DOUBLE', $me->my_config['piclens_exclude_double'] ? 'checked="checked"' : '' );
    149146
    150147
  • extensions/piclens/admin/rssfeed.tpl

    r3614 r3619  
    134134                </TD>
    135135        </TR>
     136        <TR>
     137                <TD >
     138                     - <input type="checkbox" name="piclens_exclude_double" {$PICLENS_EXCLUDE_DOUBLE}/> {'piclens_rsscfg_exclude_double'|@translate}
     139                </TD >
     140                <TD colspan="2">        &nbsp;
     141                </TD>
     142        </TR>
    136143
    137144</TABLE>
  • extensions/piclens/generate_rss.php

    r3614 r3619  
    178178                }
    179179
     180                // Gestion des tags
     181                elseif (($page['section']) == 'tags')
     182                {
     183//                      $row = get_image_ids_for_tags($page['tags_id']);
     184                        // $cat need to bo not null...
     185                        array_push($cat, "1");
     186                        $query = 'SELECT DISTINCT(tag.image_id) , img.id, img.file, img.date_available, img.date_creation, img.tn_ext, img.name,
     187                                          img.comment, img.author, img.hit ,img.filesize, img.average_rate, img.has_high, img.path,
     188                                          img.level , ic.category_id, cat.name AS catname, cat.comment AS catcomment, cat.rank, cat.status,
     189                                          cat.visible, cat.uppercats, cat.permalink, cat.dir '
     190                                        .' FROM '.IMAGE_TAG_TABLE.' AS tag '."\n"
     191                                        .' INNER JOIN '.IMAGES_TABLE.' AS img ON tag.image_id = img.id'
     192                                        .' INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON img.id = ic.image_id'
     193                                        .' INNER JOIN '.CATEGORIES_TABLE.' AS cat ON ic.category_id = cat.id'                   
     194                                        .' WHERE tag.tag_id IN ('.implode(',', $page['tag_ids']).') '
     195                                    .$forbidden
     196                                        .' '.$conf['order_by'].';';
     197                }
     198               
     199               
    180200                elseif (($page['section']) == 'categories')
    181201                {
     
    320340                {
    321341                        $result = pwg_query($query);
     342                       
    322343                        while ($row = mysql_fetch_assoc($result))
    323344                        {
     
    329350                                                && ((isset($row['catname']) ? !(substr_count($row['catname'],  $piclens_extdesc_hidden)) : true))
    330351                                                ))
    331                                         array_push($pictures, $row);
     352                                {
     353                                        // Suppression des doublons (même path)
     354                                        if ($obj->my_config['piclens_exclude_double'])
     355                                        {
     356                                                $double = false;
     357                                                foreach ($pictures as $key => $values)
     358                                                        // même path
     359                                                        if ($row['path'] == $values['path'])
     360                                                                $double=true;
     361
     362                                                // pas de double trouvé
     363                                                if (!$double)
     364                                                        array_push($pictures, $row);
     365                                        }
     366                                        else
     367                                                array_push($pictures, $row);
     368                                }
    332369                        }
    333370                }
    334371                // Fin requetes recherches photos
    335372
    336                
     373
    337374                // Creation du fichier xml (flux rss)
    338375                // It's a rss file
     
    366403
    367404                // Icone de la gallerie dans le flux RSS
    368 //              echo '<logo url="'.get_root_url().'template-common/favicon.ico"></logo>';
    369405                echo "\n";
    370406                echo '<atom:icon>'.$obj->root_site_piclens.'template-common/favicon.ico</atom:icon>';
    371407                echo "\n";
    372 //   <atom:link href="http://mywebsite.com/photos.rss" rel="self" type="application/rss+xml" />
    373408
    374409                // Pour chacune des images, preparation du flux xml
     
    544579                        echo "<link>" . $url . "</link>\n";
    545580
    546 //                      echo "<guid>" . $row['id'] . "\</guid>\n";                             
    547581                        echo "<guid isPermaLink=\"false\">\"" . $row['id'] . "\"</guid>\n";
    548582                       
  • extensions/piclens/include/Piclens.class.php

    r3410 r3619  
    4747                        {
    4848
     49                                // Page Tags
     50                                if (($page['section']) == 'tags' && $this->my_config['piclens_tags_active'])
     51                                {
     52                                        $tags = '';
     53                                        foreach ($page['tag_ids'] as $id => $tag)
     54                                                $tags .= '/'.$tag.'-'.$page['tags'][''.$id.'']['name'];
     55                                       
     56                                        $piclnkMaster='<link rel="alternate"'
     57                                                                . ' href="'.$this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/tags'
     58                                                                .$tags
     59                                                                .'"'
     60                                                                .' type="application/rss+xml" title="" id="recent_pics"'
     61                                                                . ' >' . "\n";                 
     62                                }
    4963                                // Page images recentes
    50                                 if (($page['section']) == 'recent_pics' && $this->my_config['piclens_recentpics_active'])
     64                                elseif (($page['section']) == 'recent_pics' && $this->my_config['piclens_recentpics_active'])
    5165                                {
    5266                                        $piclnkMaster='<link rel="alternate"'
     
    250264                                        || (($page['section']) == 'best_rated' && $this->my_config['piclens_bestrated_active'])
    251265                                        || (($page['section']) == 'favorites' && $this->my_config['piclens_favorites_active'])
     266                                        || (($page['section']) == 'tags' && $this->my_config['piclens_tags_active'])
    252267                                        || (($page['section']) == 'categories')
    253268                                        )
     
    443458                                else if ($page['section'] == 'favorites' && $this->my_config['piclens_wall_spec_favorites'])
    444459                                        $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/favorites';
     460                                else if ($page['section'] == 'tags' && $this->my_config['piclens_wall_spec_tags'])
     461                                {
     462                                        $tags = '';
     463                                        foreach ($page['tag_ids'] as $id => $tag)
     464                                                $tags .= '/'.$tag.'-'.$page['tags'][''.$id.'']['name'];
     465                                        $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/tags'.$tags;
     466                                }
    445467                        }
    446468                        // Remplacement de la navigation
  • extensions/piclens/include/default_values.inc.php

    r3614 r3619  
    5353$piclens_default_values['piclens_bestrated_active'] = true;
    5454$piclens_default_values['piclens_favorites_active'] = true;
     55$piclens_default_values['piclens_tags_active']  = true;
    5556
    5657$piclens_default_values['piclens_wall_spec'] = false; // remplacement navigation image dans categories par le mur 3D
     
    6061$piclens_default_values['piclens_wall_spec_bestrated'] = false;
    6162$piclens_default_values['piclens_wall_spec_favorites'] = false;
     63$piclens_default_values['piclens_wall_spec_tags'] = false;
    6264
    6365$piclens_default_values['piclens_wall_swflocal'] = false;       // Flash swf local utilise pour le mur 3D (pas besoin du fichier crossdomain.xml mais pas de MAJ automatique du flash)
     
    8385
    8486
    85 $piclens_default_values['piclens_rss_name'] = "%I2"; // Nom
    86 $piclens_default_values['piclens_rss_desc'] = "%I3"; // Description
     87$piclens_default_values['piclens_rss_name'] = "Nom : %I2"; // Nom
     88$piclens_default_values['piclens_rss_desc'] = "(%I3)"; // Description
    8789
     90$piclens_default_values['piclens_exclude_double']       = false; // Suppression des doublons
    8891?>
  • extensions/piclens/language/en_UK/plugin.lang.php

    r3614 r3619  
    207207// Fin legende
    208208
     209$lang['piclens_tags_label']             = 'Tags';
     210$lang['piclens_rsscfg_exclude_double']  = 'Suppress double picture in the feed (same path)';
    209211
    210212?>
  • extensions/piclens/language/fr_FR/plugin.lang.php

    r3614 r3619  
    210210// Fin legende
    211211
     212$lang['piclens_tags_label']             = 'Tags';
     213$lang['piclens_rsscfg_exclude_double']  = 'Suppression des doublons d\'image dans le flux (même répertoire d\'accès)';
    212214?>
  • extensions/piclens/main.inc.php

    r3615 r3619  
    6969 /* 0.3.6 --> Ajout parametres supplementaires du mur embeded  */
    7070 /* 0.4.0 --> Changement methode pour parametrer les noms et decriptions des images */
     71 /*              Ajout integration piclens sur les tags */
     72 /*              Ajout paramètre pour supprimer les doublons d'image dans le flux rss */
    7173 
    7274
Note: See TracChangeset for help on using the changeset viewer.