Verfasst: 10.03.2005 23:31
Das template gibt es hier.
Wie anders? Sollen die letzten Beiträge auf der Index nicht mehr angezeigt werden?
Wie anders? Sollen die letzten Beiträge auf der Index nicht mehr angezeigt werden?
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Code: Alles auswählen
$last_url = '<a href="'. append_sid("viewtopic.$phpEx?". POST_POST_URL .'='. $line[$i]['topic_last_post_id']) .'#'. $line[$i]['topic_last_post_id'] .'"><img src="'. $images['icon_latest_reply'] .'" alt="'. $lang['View_topic'] .'" title="'. $lang['View_topic'] .'" border="0" /></a>'; Code: Alles auswählen
<?php
// ############ Edit below ########################################
$topic_length = '50'; // Länge des Thementitels
$topic_limit = '10'; // Anzahl der angezeigten Themen
$forum_ids = '27'; // IDs der Foren die NICHT angezeigt werden sollen (trenne sie mit einem Komma); z.B. /viewforum.php?f=2 (2 wäre die ID)
// ############ Edit above ########################################
$sql = "SELECT
t.topic_id, t.forum_id, t.topic_title, t.topic_replies, t.topic_last_post_id, t.topic_last_time, t.topic_last_poster,
u.user_id, u.username
FROM ". TOPICS_TABLE ." t, ". USERS_TABLE ." u
WHERE t.forum_id NOT IN (".$forum_ids.") AND t.topic_last_poster = u.user_id
ORDER BY topic_last_time DESC
LIMIT $topic_limit";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'could not obtain main information.', '', __LINE__, __FILE__, $sql);
}
$line = array();
while( $row = $db->sql_fetchrow($result) )
{
$line[] = $row;
}
$db->sql_freeresult($result);
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] .'_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] .'_f']) : array();
for( $i = 0; $i < count($line); $i++ )
{
$forum_id = $line[$i]['forum_id'];
$is_auth = auth(AUTH_ALL, $forum_id, $userdata);
if ( !empty($is_auth['auth_read']) )
{
$topic_id = $line[$i]['topic_id'];
$word_censor = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $line[$i]['topic_title']) : $line[$i]['topic_title'];
$topic_title = ( strlen($line[$i]['topic_title']) < $topic_length ) ? $word_censor : substr(stripslashes($word_censor), 0, $topic_length) .'...';
$topic_title_a = $line[$i]['topic_title'];
$replies = $line[$i]['topic_replies'];
$last_author = ( $line[$i]['user_id'] != ANONYMOUS ) ? '<a href="'. append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $line[$i]['user_id']) .'" title="'.sprintf($lang['Viewing_user_profile'], $line[$i]['username']).'">'. $line[$i]['username'] .'</a>' : ( ($line[$i]['username'] != '' ) ? $line[$i]['username'] : $lang['Guest'] );
$last_time = create_date($board_config['default_dateformat'], $line[$i]['topic_last_time'], $board_config['board_timezone']);
$last_url = '<a href="'. append_sid("viewtopic.$phpEx?". POST_POST_URL .'='. $line[$i]['topic_last_post_id']) .'#'. $line[$i]['topic_last_post_id'] .'"><img src="'. $images['icon_latest_reply'] .'" alt="'. $lang['View_topic'] .'" title="'. $lang['View_topic'] .'" border="0" /></a>';
$topic_url = append_sid("viewtopic.$phpEx?". POST_TOPIC_URL ."=$topic_id");
$template->assign_block_vars('recent', array(
'TOPIC_TITLE_A' => $topic_title_a,
'TOPIC_TITLE' => $topic_title,
'REPLIES' => $replies,
'LAST_AUTHOR' => $last_author,
'LAST_TIME' => $last_time,
'LAST_URL' => $last_url,
'U_VIEW_TOPIC' => $topic_url,
));
}
}
$template->assign_vars(array(
'L_RECENT_TITLE' => $lang['Recent_topics'],
'L_RECENT_BY' => $lang['Recent_first_poster'],
'L_RECENT_STARTED' => $lang['Recent_first']
));
?>