Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   BT.Manager (phpMyBitTorrent) (http://www.bvlist.com/forumdisplay.php?f=23)
-   -   index.php news mod help... (http://www.bvlist.com/showthread.php?t=9176)

Giorgatzelos 19th May 2013 04:12

index.php news mod help...
 
1 Attachment(s)
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 "
".$welcome_message."
";
CloseTable();
}

and somewhere in here i found this code that is for news and joe completed it for someone else:

Code:

if ($welcome_message != ""){
OpenTable(_btsitenews, '726');
?>

//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 "
";
$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 "New!";
}
if($i == 0)$show = 'block';
else
$show = 'none';
if($i == 0)$img = 'collapse';
else
$img = 'expand';
$nid = $i+1;
echo "Added on: ".$rowe['added']."Comments : ".($rowa['posts']-1)."
".$title[$i]."
\"+\"

".$welcome_message."

\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 :-( )

joeroberts 19th May 2013 08:23

First are you using the PMBT forum or the phpBB3 mod?
If the PMBT forum is your news section ID 26?

Giorgatzelos 19th May 2013 14:57

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...

joeroberts 19th May 2013 17:17

That mod is not for phpBB3

Giorgatzelos 19th May 2013 17:21

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...


All times are GMT +2. The time now is 06:16.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.