I found the script and it is for coppermine with pragma mx. Is it a very hard job to change the code so that it gives at the end an anycontent2.php?
<?php // $Id: block-Gallery-scroll-Random_pictures.php,v 20.1 2004/08/29 22:04:32 EllselAn Exp $
/************************************************************************/
/* mX / pragmaMx Content Management System Platform */
/* ==================================================================== */
/* Copyright (C) 2004 by the vkpMx & pragmaMx Developer Team */
/* email: team@pragmamx.org */
/* homepage: http://www.maax-design.de & http://www.pragmaMx.org */
/************************************************************************/
// Coppermine Photo Gallery for mX //
// required version: >= 1.3.1 //
// ---------------------------------------------------------------------//
// Copyright (C) 2002,2004 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 //
// -------------------------------------------------------------------- //
// 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 (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");
#error_reporting(E_ALL); $GLOBALS['mxSqlErrorDebug'] = true;
global $CONFIG, $cpg_name, $lang_get_pic_data;
$cpg_name = "Gallery";
if (@file_exists('modules/'.$cpg_name.'/blocks.inc.php')) {
include('modules/'.$cpg_name.'/blocks.inc.php');
}
else {
if (mxIsAdmin()) {
$content = 'The module "'.$cpg_name.'" doesn\'t exist or is not correctly installed. Please install this module or change the Variable $cpg_name in file blocks/'.basename(__file__).'.';
}
return;
}
// BEGINN USER DEFINEABLES
$limit = $CONFIG['thumbcols']-1; //number of thumbs
$scrollheight = '145';
$title_length = 17; //length of title below thumb
// END USER DEFINEABLES
$output = '';
$result = sql_query("
SELECT COUNT(*)
FROM $CONFIG[TABLE_PICTURES] as p INNER JOIN $CONFIG[TABLE_ALBUMS] AS a ON (p.aid = a.aid)
WHERE p.approved='YES' AND ".$vis_groups."
GROUP BY p.pid");
$nbEnr = sql_fetch_row($result);
$pic_count = $nbEnr[0];
// if we have more than 1000 pictures, we limit the number of picture returned
// by the SELECT statement as ORDER BY RAND() is time consuming
if ($pic_count > 1000) {
$result = sql_query("
SELECT COUNT(*) from $CONFIG[TABLE_PICTURES]
WHERE approved = 'YES'");
$nbEnr = sql_fetch_row($result);
$total_count = $nbEnr[0];
$granularity = floor($total_count / 1000);
$cor_gran = ceil($total_count / $pic_count);
srand(time());
for ($i = 1; $i <= $cor_gran; $i++) $random_num_set = rand(0, $granularity) . ', ';
$random_num_set = substr($random_num_set, 0, -2);
$result = sql_query("
SELECT p.pid, p.url_prefix, p.filepath, p.filename, p.aid
FROM $CONFIG[TABLE_PICTURES] AS p INNER JOIN $CONFIG[TABLE_ALBUMS] AS a ON (p.aid = a.aid)
WHERE randpos IN ($random_num_set) AND p.approved='YES' AND ".$vis_groups."
ORDER BY RAND() DESC
LIMIT $limit");
} else {
$result = sql_query("
SELECT p.pid, p.url_prefix, p.filepath, p.filename, p.aid
FROM $CONFIG[TABLE_PICTURES] AS p INNER JOIN $CONFIG[TABLE_ALBUMS] AS a ON (p.aid = a.aid)
WHERE p.approved='YES' AND ".$vis_groups."
ORDER BY RAND() DESC
LIMIT $limit");
}
$rowset = array();
while ($row = sql_fetch_array($result)) {
if (empty($row['title'])) $row['title'] = substr($row['filename'], 0, -4);
$output .= '<p align="center"><a href="modules.php?name='.$cpg_name.'&file=displayimage&album='.$row['aid'].'&pos=-' . $row["pid"] . '"><img src="' .get_pic_url($row, 'thumb') . '" border="0" alt="' . $row['title'] . '" title="' . $row['title'] . '"><br />' . mxCutString($row['title'], $title_length) . '</a></p>';
}
// marquee info at http://www.faqs.org/docs/htmltut/_marquee.html
if ($output) {
$content = '<div align="center" style="overflow: hidden; height: '.$scrollheight.'px;">
<marquee loop="0" behavior="scroll" direction="up" height="'.$scrollheight.'" scrollamount="1" scrolldelay="1" onmouseover="this.stop()" onmouseout="this.start()">
'.$output.'
</marquee>
</div>
<p align="center"><a href="modules.php?name='.$cpg_name.'">' . $CONFIG['gallery_name'] . '</a></p>';
}
?>
hama