kopier mal meinen teil aus der index.php in deine portal.php rein
Code: Alles auswählen
// Beginn Foto Box in PORTAL
//
// BEGIN Random or Recent Photo
//
$Display = 'Recent'; // Replace 'XXXX' with 'Recent' or 'Random'.
$CategoryID = 1; // Replace 0 with a category ID. Otherwise, keep it as it is.
// Example: http://www.seekideas.com/forum/album_cat.php?cat_id=3
// Category ID is 3
if ($Display == 'Random') {
if ($CategoryID != 0) {
$sql = "SELECT * FROM phpbb_album WHERE pic_cat_id = $CategoryID ORDER BY RAND() LIMIT 1";
}
else {
$sql = "SELECT * FROM phpbb_album ORDER BY RAND() LIMIT 1";
}
}
else if ($Display == 'Recent') {
if ($CategoryID != 0) {
$sql = "SELECT pic_id, pic_title, pic_username, pic_time FROM phpbb_album WHERE pic_cat_id = $CategoryID ORDER BY pic_time DESC LIMIT 0,1";
}
else {
$sql = "SELECT pic_id, pic_title, pic_username, pic_time FROM phpbb_album ORDER BY pic_time DESC LIMIT 0,1";
}
}
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query album information', '', __LINE__, __FILE__, $sql);
}
$picrow = $db->sql_fetchrow($result);
//
// END Random or Recent Photo
//
markus