Bravo List
Register
Go Back   > Bravo List > Sourcecode > phpMyBitTorrent (BT.Manager) > Mods & Themes
Reply
  #1  
Old 13-02-09, 14:24
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 1,988
Default [PMBT 2.x]Add last forum posts to index
This mod well add the last forum posts to your tracker index
First you well need to create a new file called forumposts.php and add this
PHP Code:
<?php
 
if ($user->user)
 {
     
define'IN_PHPBB'true );
    
$phpbb_root_path './'.$forumbase.'/'// change in your own root path.
    
$phpEx substr(strrchr(__FILE__'.'), 1);
    include(
$phpbb_root_path 'common.' $phpEx);
    include(
$phpbb_root_path 'includes/functions_display.' $phpEx);
    include(
$phpbb_root_path 'includes/bbcode.' $phpEx);
    
    
$user->session_begin();
    
$auth->acl$user->data );
    
$user->setup();

    
//-- Fetch the data from the specified fora
    
$bbcode = new bbcode();
    
$news_fora_id = array( 25,19,20,16); // Change in the fora id's you need
    
$output '';
    
    
$topic_count '10'// Change in the number of topics you want to show.
    
$query "
        SELECT p.topic_id, p.forum_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid,
            u.user_id, u.user_email, u.username, u.user_posts, u.user_rank, u.user_colour, u.user_allow_viewonline, u.user_allow_viewemail,
            t.topic_title,
                (
                    SELECT COUNT( post_id )
                    FROM " 
POSTS_TABLE "
                        WHERE topic_id = p.topic_id
                ) AS aantal_posts
        FROM " 
POSTS_TABLE " AS p, " USERS_TABLE " AS u, " TOPICS_TABLE " AS t
            WHERE " 
$db->sql_in_set'p.forum_id'$news_fora_id ) . "
                AND u.user_id = p.poster_id
                AND t.topic_id = p.topic_id
        GROUP BY topic_id
        ORDER BY t.topic_time DESC
        LIMIT 0, 
{$topic_count} 
    "
;

    
//die('<pre>' . $query );
    
$result $db->sql_query$query )or btsqlerror($query);
        
$output .= "<table class=\"torrenttable\" border=\"0\" cellpadding=\"3\" width=\"100%\">";
        
$output .="<thead>\n<tr><th><p>Topics</p></th>";
        
$output .="<th><p>Replies</p></th>";
        
$output .="<th><p>Views</p></th>";

        
$output .= "</tr></thead>\n";

    while( 
$row $db->sql_fetchrow($result) )
    {
    
$sql_view ="SELECT * FROM " TOPICS_TABLE " WHERE topic_id = "$row['topic_id'] . "";
$res_views $db->sql_query($sql_view);
$row_views $db->sql_fetchrow($res_views);
        
// Parse the message and subject
        
$message censor_text($row['post_text']);

        
// Second parse bbcode here
        
if ($row['bbcode_bitfield'])
        {
            
$bbcode->bbcode_second_pass($message$row['bbcode_uid'], $row['bbcode_bitfield']);
        }

        
//$message = bbcode($message);
        
$message smiley_text($message);
        
        
// Send data to output var
        
$output .= "<tbody>\n";
        
$output .="<td class=\"torrenttable\">";
        
$output .= "<a href=\"phpBB.php?page=viewtopic&amp;f={$row['forum_id']}&amp;t={$row['topic_id']}\" title=\""  censor_text($row['post_subject']) . "\">".censor_text($row['post_subject'])."</a>      <br>By <a href=\"phpBB.php?page=memberlist&mode=viewprofile&u=" $row['user_id'] . "\"  style='color:#9E8DA7'>" $row['username'] ."</a> on \n";
        
$output .= $user->format_date($row['post_time'])."\n" ;
        
$output .= "</td>\n" ;
        
$output .="<td>";
        
$output .= $row['aantal_posts']-."\n";
        
$output .="</td>";
        
$output .="<td>";
        
$output .= $row_views['topic_views']."\n";
        
$output .="</td>";
        
$output .="</tbody>\n";
    }
        
$output .="</table>\n";

    
// print the output
OpenTable('Resent Forum Posts');
    print( 
$output);
CloseTable();    
}
?>
make sure you edit to what you like
PHP Code:
    $news_fora_id = array( 25,19,20,16); // Change in the fora id's you need 
this one is an array and you only add the forum not the posts
PHP Code:
    $topic_count '10'// Change in the number of topics you want to show. 
this is how many posts you want to show on the index
now open index.php and add
PHP Code:
include ("forumposts.php"); 
where you want it to show up
__________________
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
  #2  
Old 08-07-11, 19:12
wMan's Avatar
wMan wMan is offline
Banned
 
Join Date: Feb 2008
P2P
Posts: 1,433
Default
Quote:
Originally Posted by joeroberts View Post
This mod well add the last forum posts to your tracker index
First you well need to create a new file called forumposts.php and add this
where you want it to show up
PHP Code:
include ("forumposts.php"); 
not working saying qsl error in the index
Reply With Quote
  #3  
Old 09-07-11, 05:38
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 1,988
Default
that is because it is for phpBB3 forum.
You would want this one
http://www.bvlist.com/21817-post19.html
__________________
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
  #4  
Old 16-07-13, 04:01
Giorgatzelos's Avatar
Giorgatzelos Giorgatzelos is offline
Senior Member
 
Join Date: Nov 2009
Greece
Posts: 293
Default
how can i make the numbers of views and answers be centered?

Bump: I altered this part of the code and worked!

PHP Code:
        //$output .="<td>";
$output .="<td align=\"middle\">";
        
$output .= $row['aantal_posts']-."\n";
        
$output .="</td>";
        
//$output .="<td>";
$output .="<td align=\"middle\">"
Attached Thumbnails
16-7-2013 4-58-32 ??.png  
Reply With Quote
Reply

Tags
2xadd , forum , index , pmbt , posts

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[PMBT 2.0] TLeech tracker and forum joeroberts Mods & Themes 23 03-09-10 21:11
torrent strike forum threads and posts not counted inebunit Torrent Strike 7 10-01-10 14:16
Block members from downloading until they have two posts InFeRnO TBDev 0 18-12-09 15:13
[PMBT 2.0.3]Latest Torrent Mod for index page Azurious phpMyBitTorrent (BT.Manager) 9 25-01-09 21:15
[PMBT 2.x] Adding tracker stats to forum joeroberts Mods & Themes 0 17-01-09 21:33



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