Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > BT.Manager (phpMyBitTorrent)
Reply
  #1  
Old 19th May 2013, 04:12
Giorgatzelos's Avatar
Giorgatzelos Giorgatzelos is offline
Senior Member
 
Join Date: Nov 2009
Greece
Posts: 300
Default 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();
}
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');
?>
<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 :-( )
Attached Thumbnails
19-5-2013 5-06-32 ??.png  
Reply With Quote
  #2  
Old 19th May 2013, 08:23
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
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/
Reply With Quote
  #3  
Old 19th May 2013, 14:57
Giorgatzelos's Avatar
Giorgatzelos Giorgatzelos is offline
Senior Member
 
Join Date: Nov 2009
Greece
Posts: 300
Default
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...
Reply With Quote
  #4  
Old 19th May 2013, 17:17
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
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/
Reply With Quote
  #5  
Old 19th May 2013, 17:21
Giorgatzelos's Avatar
Giorgatzelos Giorgatzelos is offline
Senior Member
 
Join Date: Nov 2009
Greece
Posts: 300
Default
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...
Reply With Quote
Reply

Tags
indexphp , mod , news

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 14:10. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.