hi bandito
klar ist es ne kleinigkeit ...

hab einen neuen lösungsansatz ....
suche und ersetze in der portal.php
Code: Alles auswählen
//
// BEGIN Random or Recent Photo
//
$Display = 'Recent'; // Replace 'XXXX' with 'Recent' or 'Random'.
$CategoryID = 2; // Replace 0 with a category ID. Otherwise, keep it as it is.
// Example: http://www.bandit600.ch/phpBB2/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
//
ersetze mit
Code: Alles auswählen
// Get Newest Pic
$sql = "SELECT * FROM ". ALBUM_CONFIG_TABLE;
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Could not query album config information.", "", __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
$album_config_name = $row['config_name'];
$album_config_value = $row['config_value'];
$album_config[$album_config_name] = $album_config_value;
}
$sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments
FROM ". ALBUM_TABLE ." AS p
LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id
LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id
LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id
WHERE pic_approval = 1
GROUP BY p.pic_id ORDER BY pic_time DESC LIMIT 3";
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query album information.', '', __LINE__, __FILE__, $sql);
}
while ( $picrow = $db->sql_fetchrow($result) )
{
if(!$picrow['rating'])
{
$picrow['rating'] = $lang['Not_rated'];
}
else
{
$picrow['rating'] = round($picrow['rating'], 2);
}
$pic_poster = '<a href="'. append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $picrow['pic_user_id']) .'">'. $picrow['pic_username'] .'</a>';
$template->assign_block_vars('albumrow', array(
'L_NEWEST_PIC' => $lang['Newest_pic'],
'PIC_IMAGE' => append_sid('album_thumbnail.'. $phpEx . '?pic_id=' . $picrow['pic_id']),
'U_PIC_LINK' => append_sid('album_page.' . $phpEx . '?pic_id=' . $picrow['pic_id']),
'L_PIC_TITLE' => $lang['Pic_Title'],
'L_VIEW' => $lang['View'],
'L_POSTER' => $lang['Poster'],
'L_POSTED' => $lang['Posted'],
'L_RATING' => $lang['Rating'],
'TITLE' => stripslashes($picrow['pic_title']),
'POSTER' => $picrow['username'],
'PIC_POSTER' => $pic_poster,
'TIME' => create_date($board_config['default_dateformat'], $picrow['pic_time'], $board_config['board_timezone']),
'VIEW' => $picrow['pic_view_count'],
'RATING' => ($album_config['rate'] == 1) ? ( '<a href="'. append_sid("album_rate.$phpEx?pic_id=". $picrow['pic_id']) . '">' . $lang['Rating'] . '</a> : ' . $picrow['rating'] . '<br />') : '',
'COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="'. append_sid("album_comment.$phpEx?pic_id=". $picrow['pic_id']) . '">' . $lang['Comments'] . '</a> : ' . $picrow['comments'] . '<br />') : '',
));
}
// END - Get Newest Pic
portal_body.tpl
suche und ersetze
Code: Alles auswählen
<!-- ##### SMARTOR PHOTO ADDON START ##### -->
<table width="100%" cellpadding="3" cellspacing="1" border="0" align="center" class="forumline">
<tr>
<th class="catleft" colspan="2" height="22" align="left"><span class="thCornerL"> {L_NEWEST_PIC}</a></span></th>
</tr>
<tr>
<td class="row1" width="100%">
<span class="gensmall" style="line-height:150%"><br /><center><a href="{U_PIC_LINK}"><img src="{PIC_IMAGE}" border="0" alt="{L_NEWEST_PIC}"></a><br /><br /></span>
</td>
</tr>
<tr>
<td class="row1" width="100%">
<span class="gensmall" style="line-height:150%"><b>{PIC_TITLE}</b> by <b>{PIC_POSTER}</b><br />{PIC_TIME}</span>
</td>
</tr>
<tr>
<td class="row1" width="100%">
<span class="gensmall">[ <a href="{U_ALBUM}">{L_ALBUM}</a> ]</span>
</td>
</tr>
</table>
<!-- ##### SMARTOR PHOTO ADDON ENDE ##### -->
ersetze mit
Code: Alles auswählen
<table border="0" align="center" cellspacing="1" cellpadding="1" class="forumline" width="100%">
<tr>
<!-- BEGIN albumrow -->
<td align="left" valign="top" class="row2">
<table border="0" align="center" cellspacing="1" cellpadding="1">
<tr>
<td><span class="gensmall" style="line-height:150%"><a href="{albumrow.U_PIC_LINK}"><img src="{albumrow.PIC_IMAGE}" border="0"></a></span></td>
<td><span class="gensmall">
{albumrow.L_PIC_TITLE}: {albumrow.TITLE}<br />
{albumrow.L_POSTER}: <b>{albumrow.PIC_POSTER}</b><br />
{albumrow.L_POSTED}: {albumrow.TIME}<br />
{albumrow.L_RATING}{albumrow.RATING}
{albumrow.L_VIEW}: {albumrow.VIEW}</span></td>
</tr>
<tr>
<td align="center" colspan="2"><span class="gensmall">{albumrow.COMMENTS}</span></td>
</tr>
</table></td>
<!-- END albumrow -->
</tr>
<tr>
<td align="center" class="row1" colspan="4"><span class="gensmall">[ <a href="{U_ALBUM}">{L_ALBUM}</a> ] </span></td>
</tr>
</table>
so mal scheuen was er jetzt sagt
markus