Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Sommaire/Index complet CPG 1.4.8  (Read 4987 times)

0 Members and 1 Guest are viewing this topic.

Pascal YAP

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Sommaire/Index complet CPG 1.4.8
« on: August 07, 2006, 08:01:06 pm »

Bonjour,

Créez un sommaire général de votre galerie !

Copiez et Coller le code ci-dessous, puis nommez-le "photo-sitemap.php".
Lorsque téléchargé sur votre serveur, appelez
http ://votre-Coppermine/photo-sitemap.php
(Exemple)

Code: [Select]
<?php 
define
('IN_COPPERMINE'true);

require(
'include/init.inc.php');
pageheader(Sommaire-General-du-Site);

// Select all photos
$result cpg_db_query("SELECT a.pid, a.aid, a.title, a.caption, a.keywords, b.title atitle from {$CONFIG['TABLE_PICTURES']} a, {$CONFIG['TABLE_ALBUMS']} b where a.aid = b.aid order by a.aid, a.pid desc");
if (!
mysql_num_rows($result)) cpg_die(ERROR$lang_errors['non_exist_ap']);

$p_aid = -;

// Result to table
starttable("100%"Sommaire_General3);

   while (
$row mysql_fetch_array($result)) 
        { 
                if (
$row[aid] != $p_aid) {
                  echo 
"<tr><td class=\"tableh2_compact\" colspan = \"3\">$row[atitle]</td></tr>" ;
            }
            
// weer geef de data 
            
echo "<tr><td><a href=\"displayimage.php?pos=-$row[pid]\" title=\"$row[title]\">$row[title]</a></td><td>$row[caption]</td><td>$row[keywords]</td></tr>"
       
$p_aid $row[aid] ;
    } ; 
// while
                
endtable();
pagefooter();
?>

PYAP

sujet original by fotofreek
« Last Edit: October 31, 2006, 02:49:30 pm by PYAP »
Logged

Pascal YAP

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: Sommaire/Index complet CPG 1.4.8
« Reply #1 on: August 09, 2006, 04:19:55 pm »

Bonjour, afin de préserver les Albums Privé, modifiez  $album_filter comme ci-dessous :
Code: [Select]
$album_filter = '';
if($FORBIDDEN_SET){
$album_filter = ' and ' . str_replace('p.', 'a.', $FORBIDDEN_SET);
}
$result = cpg_db_query("SELECT a.pid, a.aid, a.title, a.caption, a.keywords, b.title atitle from {$CONFIG['TABLE_PICTURES']} a, {$CONFIG['TABLE_ALBUMS']} b where a.aid = b.aid $album_filter order by a.aid, a.pid desc");


PYAP
« Last Edit: October 31, 2006, 02:49:03 pm by PYAP »
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.