參考連結:http://www.4homepages.de/forum/viewtopic.php?t=1020
使用版本:phpbb 2.0.10 4images 1.7
網站位置:http://www.amily.idv.tw
狀況描述:
各位好,小弟昨天照著上述的連結,安裝了4images 的隨機圖片
安裝後,圖片是成功的顯示出來了,但是弄了半天,就是只有一張圖片
小弟曾試著去作修改,但就是沒法一次顯出更多的圖片
能否各位前輩指點一下小弟如何作修改,多謝
以下是小弟page_header.php的一段語法
代碼: 選擇全部
// START RANDOM PIC MOD
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: none *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* MOD for 4images 1.7 & phpBB 2.0.2 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* 4images ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (http://www.4homepages.de/4images/lizenz.php) fur *
* weitere Informationen. *
* --------------------------------------------------------------- *
* 4images is NOT freeware! Please read the Copyright Notice *
* (http://www.4homepages.de/4images/lizenz_e.php) for further *
* information. *
* *
*************************************************************************/
// Set here the URL to your 4images Gallery. WITH trailing slash!
define('SCRIPT_URL', 'http://www.amily.idv.tw/4images/');
// Set here your THUMBNAIL directory. Normally no need to change. WITHOUT trailing slash!
define('THUMB_DIRS', 'data/thumbnails/');
function is_remote($file_name) {
return (preg_match('#^https?\\\:\\\/\\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// In following queries CHANGE 4images table PREFIX if it doesn't match (Standard "4images_")!
$sql = "SELECT COUNT(*) as total_images
FROM 4images_images a, 4images_categories b
WHERE a.image_active=1
AND a.cat_id = b.cat_id
AND b.auth_viewcat>=2
AND b.auth_viewimage>=2
";
if ( !($result = $db->sql_query($sql)) )
{
return false;
}
$row = $db->sql_fetchrow($result);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
FROM 4images_images a, 4images_categories b
WHERE a.image_active=1
AND a.cat_id = b.cat_id
AND b.auth_viewcat>=2
AND b.auth_viewimage>=2
LIMIT $number, 1";
if ( !($result = $db->sql_query($sql)) )
{
return false;
}
$row = $db->sql_fetchrow($result);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIRS."/".$cat_id."/".$row['image_thumb_file'];
$randompic = "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br />$image_name<br />評論: $image_comments
";
// HAVE FUN
// END RANDOM PIC MOD