Problem beim recent-mod
Verfasst: 09.01.2005 11:17
Hallo
ich habe den recent v.2.2.3 Mod eingebaut, und er läuft auch, aber es gibt ein kleines problem mit den Links. Ich lasse die letzten einträge auf meiner Startseite anzeigen, aber in den links fehlt der PUNKT vor html
die links gehen aber trotz alle dem.
zb. .../forum/ftopic4html
hier
meine recent.php
kann mir jemand weiter helfen ??
gruss swity
ich habe den recent v.2.2.3 Mod eingebaut, und er läuft auch, aber es gibt ein kleines problem mit den Links. Ich lasse die letzten einträge auf meiner Startseite anzeigen, aber in den links fehlt der PUNKT vor html
die links gehen aber trotz alle dem.
zb. .../forum/ftopic4html
hier
meine recent.php
Code: Alles auswählen
<?php
// ############ Edit below ########################################
$topic_length = '27'; // Länge des Thementitels
$topic_limit = '3'; // Anzahl der angezeigten Themen pro Seite
$special_forums = '0'; // spezielle Foren anzeigen ('0' = nein; '1' = ja)
$forum_ids = '/forum/forum4.html'; // IDs der Foren die angezeigt werden sollen (trenne sie mit einemKomma); z.B. /viewforum.php?f=2 (2 wäre die ID)
$content = '10'; // Länge des angezeigten Textes
$config_path = '/'; // path to config.php
$root_path = '/forum/'; // link path
// ############ Edit above ########################################
$path = dirname(__FILE__);
include_once($path.$config_path .'config.php');
mysql_connect($dbhost, $dbuser, $dbpasswd) OR die('Unable to select server.');
mysql_select_db($dbname) OR die('Unable to select database.');
// ############## output ##############
echo '<table width="50%" cellpadding="1" cellspacing="0" border="1" align="center" bordercolor="#000000" bgcolor="#EBBB63">
<tr>
<th colspan="2"><strong><font size="3">Letzten '. $topic_limit .' Foren Einträge</strong></font></th>
</tr>';
// ############## output ##############
$where_forums = ( $special_forums == '0' ) ? '' : 't.forum_id IN ('. $forum_ids .') AND ';
$sql = "SELECT t.*, f.forum_id, f.forum_name, u.username AS first_poster, u.user_id AS first_poster_id, u2.username AS last_poster, u2.user_id AS last_poster_id, p.post_username AS first_poster_name, p2.post_username AS last_poster_name, p2.post_time
FROM ". $table_prefix ."topics t, ". $table_prefix ."forums f, ". $table_prefix ."users u, ". $table_prefix ."posts p, ". $table_prefix ."posts p2, ". $table_prefix ."users u2
WHERE $where_forums t.topic_poster = u.user_id AND f.forum_id = t.forum_id AND p.post_id = t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND u2.user_id = p2.poster_id
ORDER BY t.topic_last_post_id DESC LIMIT $topic_limit";
$result = mysql_query($sql);
if( !$result )
{
die('SQL Statement Error: '. mysql_error());
exit();
}
$line = array();
while( $row = mysql_fetch_array($result) )
{
$line[] = $row;
}
for( $i = 0; $i < count($line); $i++ )
{
$forum_id = $line[$i]['forum_id'];
$forum_url = $root_path .'forum'. $forum_id.html;
$topic_id = $line[$i]['topic_id'];
$topic_url = $root_path .'ftopic'. $topic_id.html;
$topic_title = ( strlen($line[$i]['topic_title']) < $topic_length ) ? $line[$i]['topic_title'] : substr(stripslashes($line[$i]['topic_title']), 0, $topic_length) .'...';
$topic_type = ( $line[$i]['topic_type'] == '2' ) ? 'Announcement ': '';
$topic_type .= ( $line[$i]['topic_type'] == '3' ) ? 'Global Announcement ': '';
$topic_type .= ( $line[$i]['topic_type'] == '1' ) ? 'Sticky ': '';
$topic_type .= ( $line[$i]['topic_vote'] ) ? 'Poll ': '';
$views = $line[$i]['topic_views'];
$replies = $line[$i]['topic_replies'];
$first_time = date('d.m.Y', $line[$i]['topic_time']);
$first_author = ( $line[$i]['first_poster_id'] != '-1' ) ? '<a href="'. $root_path .'profile.php?mode=viewprofile&u='. $line[$i]['first_poster_id'] .'">'. $line[$i]['first_poster'] .'</a>' : ( ($line[$i]['first_poster_name'] != '' ) ? $line[$i]['first_poster_name'] : 'guest' );
$last_time = date('d.m.Y', $line[$i]['post_time']);
$last_author = ( $line[$i]['last_poster_id'] != '-1' ) ? $line[$i]['last_poster'] : ( ($line[$i]['last_poster_name'] != '' ) ? $line[$i]['last_poster_name'] : 'guest' );
$last_url = '<a href="'. $root_path .'viewtopic.php?p='. $line[$i]['topic_last_post_id'] .'#'. $line[$i]['topic_last_post_id'] .'"></a>';
// ############## output ##############
echo '<tr>
<td valign="top" nowrap="nowrap">'. $topic_type .'<a href="'. $topic_url .'" target="_blank">* <font size="2">'. $topic_title .'</font></a></td>
</tr> ';
// ############## output ##############
}
echo '</table>';
mysql_close();
?>
gruss swity