bitweaver
Wiki
wiki Home
List Pages
wiki Books
Orphan Pages
wiki Rankings
Photos
List Galleries
Forums
Browse forums
Files
List Galleries
Categories
List Categories
Sign In
Message Boards
»
07. Support - 3rd party apps
Newest
Oldest
Threaded
5
10
20
50
100
All
Messages
Custom phpBB last active topics block
Post Reply
dukeofgaming
Joined: 27 Apr 2006
Custom phpBB last active topics block
Posted:27 Apr 2006 (19:54 UTC)
dspt
Joined: 10 Jan 2006
Posted:28 Apr 2006 (08:08 UTC)
dukeofgaming
Joined: 27 Apr 2006
Posted:28 Apr 2006 (14:41 UTC)
Post Reply
Page 1 of 1
1
Post
Title
Login
If you are already registered, please enter your login credentials.
Your Name
Anonymous Post
Content Format
Tiki Wiki Syntax
Allow HTML
{quote format_guid="bbcode" comment_id="7678" user="dukeofgaming"}Hi, i have some code I modified in order to see the last x # of threads along with # of views, replies, name of the last user that replied linked to his/her profile, and an arrow img to go directly to las post, you can see it in action [url=http://www.hardwarecult.com/phpBBHCSynd.php]here[/url] Though, I dont know how it could be used in bitweaver since I cant find an option to add a custom block like in XOOPS, where you can even insert php or html... I'd love to see this in bitweaver, since you guys support phpBB and most known CMSs [like XOOPS, Mambo & Joomla!] wont. How can i do this?...It would be really nice that you could include this with bitweaver... heres the code for everyone to use :D [code:1:531610904e] <?php /////////////////////////////////////////////////////////////////////////////// // ACTIVE_TOPICS.PHP /////////////////////////////////////////////////////////////////////////////// // Copyright: (C) 2002 Matthijs van de Water <matthijs@beryllium.net> // Version: 1.1 // Date: 03/02/2002 /////////////////////////////////////////////////////////////////////////////// // Show phpBB 2.0 Active Topics List // Output format can be any HTML or XML // This script must be able to access vital phpBB 2.0 configuration scripts /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // CUSTOM SETTINGS /////////////////////////////////////////////////////////////////////////////// // Amount of active topics to show define("TOPIC_COUNT", 10); // Path to the phpBB 2.0 root directory define("PHPBB_PATH", "foro/"); // URL to the phpBB 2.0 installation define("PHPBB_LOCATION", "http://www.hardwarecult.com/foro/"); // Time format to output the date/time (for format see PHP manual) define("TIME_FORMAT", "H:i"); /////////////////////////////////////////////////////////////////////////////// // Includes of phpBB scripts $phpbb_root_path = PHPBB_PATH; if ( !defined('IN_PHPBB') ) { define('IN_PHPBB', true); include(PHPBB_PATH . 'extension.inc'); include(PHPBB_PATH . 'config.'.$phpEx); include(PHPBB_PATH . 'includes/constants.'.$phpEx); include(PHPBB_PATH . 'includes/db.'.$phpEx); } /////////////////////////////////////////////////////////////////////////////// // HTML header start /////////////////////////////////////////////////////////////////////////////// ?> <table border="0" cellpadding="3" cellspacing="1" width="100%"> <tr> <td align="center" class="ActiveTopics" bgcolor="#FF9900">Tema</td> <td align="center" class="ActiveTopics" bgcolor="#FF9900">Vistas</td> <td align="center" class="ActiveTopics" bgcolor="#FF9900">Respuestas</td> <td align="center" class="ActiveTopics" bgcolor="#FF9900">Ultima respuesta</td> </tr> <?php /////////////////////////////////////////////////////////////////////////////// // HTML header end /////////////////////////////////////////////////////////////////////////////// // sql statement to fetch active topics of public forums $sql = "SELECT DISTINCT t.topic_title, t.topic_id,t.topic_views,t.topic_replies, t.topic_last_post_id, p.post_time,p.poster_id, f.forum_name, u.user_id, u.username FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . FORUMS_TABLE . " AS f, " . USERS_TABLE . " AS u WHERE t.forum_id = f.forum_id AND f.auth_view = " . AUTH_ALL . " AND p.topic_id = t.topic_id AND p.poster_id = u.user_id AND p.post_id = t.topic_last_post_id ORDER BY p.post_time DESC LIMIT " . TOPIC_COUNT; $nt_result = $db->sql_query($sql); if(!$nt_result) { die("Failed obtaining list of active topics".mysql_error()); } else { $nt_data = $db->sql_fetchrowset(); } if ( count($nt_data) == 0 ) { die("No topics found"); } else { $cq = 1; $cc = 333333; // $nt_data contains all interesting data for ($i = 0; $i < count($nt_data); $i++) { $title = $nt_data[$i]['topic_title']; $Turl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?t=" . $nt_data[$i]['topic_id']; $LPurl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?" . POST_POST_URL . "=" . $nt_data[$i]['topic_last_post_id'] . "#" . $nt_data[$i]['topic_last_post_id']; $on_forum = 'En el foro ' . $nt_data[$i]['forum_name']; $post_time = date(TIME_FORMAT, $nt_data[$i]['post_time']); //Profile profile.php?mode=viewprofile&u=23 $profile = PHPBB_LOCATION . 'profile.' . $phpEx . "?mode=viewprofile&u=" . $nt_data[$i]['poster_id'] ; $usrname = $nt_data[$i]['username']; // As of now you can actually do anything with the data // I chose to output in XML /////////////////////////////////////////////////////////////////////////////// // Item HTML start /////////////////////////////////////////////////////////////////////////////// if($cq%2 == 0){$cc = 333333;$cq++;} else{$cc = 666666;$cq++;}?> <tr> <td bgcolor="#<?php echo $cc;?>" align="left" class="ActiveTopics"><a href="<?php echo $Turl; ?>" title="<?php echo $on_forum; ?>" target="_parent"><?php echo $title; ?></a></td> <td bgcolor="#<?php echo $cc;?>" align="left" class="ActiveTopics"><div align="center"><?php echo $nt_data[$i]['topic_views'] ?></div></td> <td bgcolor="#<?php echo $cc;?>" align="left" class="ActiveTopics"><div align="center"><?php echo $nt_data[$i]['topic_replies'] ?></div></td> <td bgcolor="#<?php echo $cc;?>" align="left" class="ActiveTopics">Por <a href="<?php echo $profile; ?>" target="_parent"><?php echo $usrname?></a><a href="<?php echo $LPurl; ?>" target="_parent"><img src="<?php echo PHPBB_LOCATION;?>/templates/subSilver/images/icon_latest_reply.gif" border="0" /></a> </td> </tr> <?php /////////////////////////////////////////////////////////////////////////////// // Item HTML end /////////////////////////////////////////////////////////////////////////////// } } /////////////////////////////////////////////////////////////////////////////// // Footer HTML start /////////////////////////////////////////////////////////////////////////////// ?> </table> [/code:1:531610904e] Thanx in advance{/quote}
Recent Page Changes
welcome to bitweaver.org
Bitweaver Overview
ReleaseTwo Schema Changelog 2006
PressReleaseOne
Spider's Web
Press Release Two
BitcommercePackage
InfiniBand vs Ethernet Performance
InfiniBand for Dummies
Show More…