Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: How to create a block to display specific album thumbs?  (Read 4749 times)

0 Members and 1 Guest are viewing this topic.

biscodyl

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
How to create a block to display specific album thumbs?
« on: February 09, 2005, 11:58:13 am »

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>';
?>




Logged

casNuy

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 671
  • My other hobby
    • Nuy Community
Re: How to create a block to display specific album thumbs?
« Reply #1 on: February 13, 2005, 04:04:00 am »

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

Cas
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.