|
#1
|
||||
|
||||
index.php news mod help...
in my index.php i found this code that is for news:
Code:
if ($welcome_message != ""){ OpenTable(_btsitenews, '726'); $welcome_message = format_comment($welcome_message); parse_smiles($welcome_message); echo "<table width=\"100%\"><tr><td>".$welcome_message."</td></tr></table>"; CloseTable(); } Code:
if ($welcome_message != ""){ OpenTable(_btsitenews, '726'); ?> <script type="text/javascript" language="JavaScript"> function togglen(nome) { if(document.getElementById(nome).style.display=='none') { document.getElementById(nome).style.display = 'block'; document.getElementById(nome+"img").src="http://www.bvlist.com/images/collapse.png"; } else { document.getElementById(nome).style.display = 'none'; document.getElementById(nome+"img").src="http://www.bvlist.com/images/expand.png"; } } </script> <?php //Getting number of news(posts) $last_in = $user->lastlogin; $title = array(); $topic_id = array(); $sql = "SELECT id AS id, subject AS subject FROM torrent_forum_topics WHERE forumid='26' ORDER BY id DESC LIMIT 3;"; $res = $db->sql_query($sql) or btsqlerror($sql); $count = $db->sql_numrows($res); while ($row = $db->sql_fetchrow($res)) { $title[] = $row['subject']; $topic_id[] = $row['id']; } for ($i=0; $i<=$count; $i++) { if ($i > $count-1)break; echo "<table width=\"100%\"><tr><td align=right frame=\"below\">"; $res = $db->sql_query("SELECT body, added FROM ".$db_prefix."_forum_posts WHERE topicid='".$topic_id[$i]."' ORDER BY added ASC LIMIT 1") or sqlerr(__FILE__, __LINE__); $rowe = $db->sql_fetchrow($res); $resa = $db->sql_query("SELECT count(id) AS posts FROM ".$db_prefix."_forum_posts WHERE topicid='".$topic_id[$i]."'") or sqlerr(__FILE__, __LINE__); $rowa = $db->sql_fetchrow($resa); $welcome_message = format_comment($rowe['body']); parse_smiles($welcome_message); if (!$welcome_message == '' && sql_timestamp_to_unix_timestamp($rowe["added"]) >= sql_timestamp_to_unix_timestamp($last_in)) { echo "<img src=./images/new_031.gif alt=New! border=0 >"; } if($i == 0)$show = 'block'; else $show = 'none'; if($i == 0)$img = 'collapse'; else $img = 'expand'; $nid = $i+1; echo "Added on: ".$rowe['added']."<br />Comments : ".($rowa['posts']-1)."</td></tr><tr><td><a href=/forums.php?action=viewtopic&topicid=".$topic_id[$i].">".$title[$i]."</a></td></tr><tr><td><a style=\"cursor: pointer;\" onClick=\"togglen('nn".$nid."');\"><img title=\"Expand item\" id=\"nn".$nid."img\" src=\"http://www.bvlist.com/images/".$img.".png\" width=\"11px\" height=\"8px\" alt=\"+\"></a><div id=\"nn".$nid."\" style=\"display: $show\"><h2>".$welcome_message."</h2></div></td></tr></table>\n"; } CloseTable();} but i get no news @ my index... (for testing reasons i uploaded a torrent and made a new thread at the forum or even commented on another torrent but no news :-( ) |
#2
|
||||
|
||||
First are you using the PMBT forum or the phpBB3 mod?
If the PMBT forum is your news section ID 26?
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
#3
|
||||
|
||||
i am using pmbt 2.0.4, so i believe i am using the phpbb3 mod of your's....
about the news section ID 26, i just copied your code, i do not know what should i enter there so it displays something @ my tracker's index.php... |
#4
|
||||
|
||||
That mod is not for phpBB3
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
#5
|
||||
|
||||
can you suggest a code that does this work and is for phpbb3?
Bump: nevermind i made it show latest forum posts....a mod by Joe Roberts... |
Tags |
indexphp , mod , news |
|
|