| Code: |
<?php
if (eregi("block-CPG-center-Last_pictures_thumb.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
define('NO_HEADER', true);
global $prefix, $db, $CONFIG, $Version_Num, $cpg_dir, $lang_pagetitle_php;
$cpg_dir = "coppermine";
$cat = is_numeric($cat) ? $cat : 0;
$cpg_block = true;
require("modules/" . $cpg_dir . "/include/load.inc.php");
$cpg_block = false;
$length =3; //number of thumbs
// $length=3; //number of thumbs
$content = "";
$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");
$content .= '<br /><table width="100%" cols="' . $length . '" border="0" cellpadding="0" cellspacing="0" align="center"><tr align="center">';
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 .= '<td align="center" valign="baseline"><a href="' . $CPG_M_URL . '&file=displayimage&pos=-' . $row["pid"] . '"><img src="' . $row["filepath"] . $CONFIG["thumb_pfx"] . $row["filename"] . '" border="0" alt="' . $thumb_title . '" title="' . $thumb_title . '" style="filter:alpha(opacity=20)" onMouseover="high(this)" onMouseout="low(this)"></a></td>';
}
$content .= '</tr></table>';
?>
|