News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

Main Menu

How to create a block to display specific album thumbs?

Started by biscodyl, February 09, 2005, 11:58:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

biscodyl

Hi,

Can anyone help to modify the block below, so it will scroll last picture from specific album?

<?php
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.2.2c for CMS                                   //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002,2003  GrĂ©gory DEMAR <gdemar@wanadoo.fr>               //
// http://www.chezgreg.net/coppermine/                                      //
// ------------------------------------------------------------------------- //
// Updated by the Coppermine Dev Team                                        //
// (http://coppermine.sf.net/team/)                                          //
// see /docs/credits.html for details                                        //
// ------------------------------------------------------------------------- //
// New Port by GoldenTroll                                                  //
// http://coppermine.findhere.org/                                          //
// Based on coppermine 1.1d by Surf  http://www.surf4all.net/               //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify     //
// it under the terms of the GNU General Public License as published by     //
// the Free Software Foundation; either version 2 of the License, or        //
// (at your option) any later version.                                      //
// ------------------------------------------------------------------------- //
if (eregi("block-CPG", $_SERVER['PHP_SELF'])) {
   Header("Location: index.php");
   die();
}
define('NO_HEADER', true);
global $prefix, $db, $CONFIG, $Version_Num, $cpg_dir;
global $ALBUM_SET;

$cpg_dir = "coppermine";

$cpg_block = true;
require("modules/".$cpg_dir."/include/load.inc");
$cpg_block = false;

// $length=$CONFIG['thumbcols']; //number of thumbs
$length=10; //number of thumbs
$title_length = 20; // maximum length of title under pictures, 20 is default

// marquee info at http://www.faqs.org/docs/htmltut/_MARQUEE.html
$content='<p align="center"><a name="scroller"></a><MARQUEE loop="1" behavior="SCROLL" direction="up" height="150" scrollamount="1" scrolldelay="1" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'><center>';
// END USER DEFINABLES
// modified by DJMaze
$result = $db->sql_query("SELECT pid, filepath, filename, p.aid, p.title FROM ".$cpg_prefix."pictures AS p INNER JOIN ".$cpg_prefix."albums AS a ON (p.aid = a.aid AND ".VIS_GROUPS.") WHERE approved='YES' GROUP BY pid ORDER BY pid DESC LIMIT $length");
$pic = 0;
while ($row = $db->sql_fetchrow($result)) {
   if ($CONFIG['seo_alts'] == 0) {
       $thumb_title = $row['filename'];
   } else {
       if ($row['title'] != '') {
           $thumb_title = $row['title'];
       } else {
           $thumb_title = substr($row['filename'], 0, -4);
       }
   }
   stripslashes($thumb_title);
   $content .= '<a href="'. $CPG_M_URL . '&amp;file=displayimage&amp;meta=lastup&amp;cat=0&amp;pos='.$pic.'"><img src="'.get_pic_url($row, 'thumb') .'" border="0" alt="'.$thumb_title.'" title="'.$thumb_title.'"><br />' . truncate_stringblocks($thumb_title,$title_length) . '</a><br /><br />';
   $pic++;
}
$content .= '</MARQUEE></p><p align="center"><a href="'. $CPG_M_URL . '">'.$lang_pagetitle_php["photogallery"].'</a></p>';
?>





casNuy

If you have a real requirement,post the details seperately. I will see if it can be added to next version.

Cas