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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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                       
Note: See TracChangeset for help on using the changeset viewer.