Проблем с phpbb3

ge0rgi_92

Registered
Здравейте бихте ли ми помогнали относно кода последно от форума дава ми грешка на 28 ред не знам как да го оправя ако може да ми помогнете ето ви кода
Код:
    <?php
    include "forum/config.php";
    //Брой на последните теми, които искате да се показват
    $latest = "10";

    $link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd");
    if (!$link)
    {
    die('Not connected : ' . mysql_error());
    }
    $db_selected = mysql_select_db("$dbname", $link);
    if (!$db_selected)
    {
    die ('Can\'t use foo : ' . mysql_error());
    }
    mysql_query("SET NAMES cp1251");
    $get_url = "SELECT config_name, config_value FROM $table_prefix".config." WHERE config_name = 'server_name' LIMIT 0,1";
    $url = mysql_query($get_url);
    $url = mysql_fetch_array($url);
    $latest_topics = "SELECT * FROM $table_prefix".topics." WHERE topic_approved = '1' ORDER BY topic_time DESC LIMIT 0,$latest";
    $topics = mysql_query($latest_topics);
    echo "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\" width=\"492\">
    <tr style='border: 1px solid #000;  background: #444;'>
    <td style='border: 1px solid #000;  background: url(images/bg.png) repeat-x;'><center><img src=\"images/cs.png\" /></center></td><td style='border: 1px solid #000;  background: url(../images/bg.png) repeat-x;'>Тема</td><td style='border: 1px solid #000;  background: url(images/bg.png) repeat-x; text-align: center;'>Преглеждания</td><td style='border: 1px solid #000;  background: url(images/bg.png) repeat-x;'><center>Отговори</center></td>";
    while($row = mysql_fetch_array($topics))
    {
    extract($row);
    if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
    {

    echo "<tr><td style='border: 1px solid #000;  background: url(images/bg.png) repeat-x;'><center><img src=\"images/cs.png\" /></center></td><td style='border: 1px solid #000;  background: url(images/bg.png) repeat-x;'><font color=\"white\">   <a href='".$phpbb_root_path."/viewtopic.php?f=".$forum_id."&t=".$topic_id."' target='_blank'>".$topic_title."</a></td><td style='border: 1px solid #000;  background: url(images/bg.png) repeat-x;'>$topic_views</td><td style='border: 1px solid #000;  background: url(images/bg.png) repeat-x;'>$topic_replies</td></tr>";
    }
    }

    echo "</table>";

    ?>
    </div>

Ето тук ми дава грешката

Код:
if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
 
Най-добре намери си друг код. Всъщност някои са написани да ти вадят само от home папката, какъвто случай мисля, че е твоя. Другите има начин да окажеш от коя папка да вадят инфото, демек от forum, forums и т.н. където си сложил форума си.
 
PHP:
<?php 
// ############ Edit below ######################################## 
$topic_length = '30'; // length of topic title 
$topic_limit = '10'; // limit of displayed topics 
$special_forums = '0'; // specify forums ('0' = no; '1' = yes) 
$forum_ids = ''; // IDs of forums; separate them with a comma 

$config_path = '/forum/'; // 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="100%" cellpadding="1" cellspacing="1" border="0" align="center"> 
<tr> 
</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']; 
$topic_id = $line[$i]['topic_id']; 
$topic_url = $root_path .'viewtopic.php?t='. $topic_id; 

$topic_title = ( strlen($line[$i]['topic_title']) < $topic_length ) ? $line[$i]['topic_title'] : substr(stripslashes($line[$i]['topic_title']), 0, $topic_length) .'...'; 

$views = $line[$i]['topic_views']; 
$replies = $line[$i]['topic_replies']; 

$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_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'] .'">'. $last_author .'</a>'; 

// ############## output ############## 
echo '<tr> 
<td valign="top" nowrap="nowrap">'. $topic_type .'<a style="text-decoration:" href="'. $topic_url .'"><img src="images/arrow.gif" border="0"> '. $topic_title .'</a></td> 
</tr> 
<tr> 
</tr>'; 
// ############## output ############## 
} 

echo '</table>'; 
mysql_close(); 
?>[code]

Това е моя, ако нещо не ти е ясно питай[/code]
 
Правиш си един gif 9x9 с име arow да ти зарежда малко изображение преди линка. Стойностите от кода може да си ги промениш, брой теми, id и т.н.
 

Back
Горе