Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*** phpBB3 - Last Active Topics System ***/
- //Author: Ioan Filipov
- //Email: jonidev@gmail.com
- //Date: 04.06.2007
- //------------------------------
- //Edit these parameters:
- //MySQL server adress
- $host="localhost";
- //Username
- $user="...";
- //Password
- $pass="...";
- //Database
- $db="...";
- //Table prefix
- $table="phpbb_";
- //Show last x topics
- $laforums="15";
- //post per page 10 is default
- $posts_per_page = '10';
- $link=mysql_connect($host, $user, $pass);
- $db=mysql_select_db($db);
- //to add excluded forum add "AND forum_id<>$id_to_the_forum" after "topic_approved = '1'" or AND forum_id=4 for only that forum
- $query="select * from $table".topics." WHERE topic_visibility = '1' AND forum_id<>20 order by topic_last_post_time desc limit 0,$laforums";
- $query2="select config_name,config_value from $table".config." where config_name = 'server_name' limit 0,1";
- $result2=mysql_query($query2);
- $row2 = mysql_fetch_array($result2);
- extract($row2);
- $result=mysql_query($query);
- while ($row=mysql_fetch_array($result)) {
- extract($row);
- $topic_posts_sum = $topic_replies + 1;
- $page_start_post = '0';
- $counter = $posts_per_page;
- do {
- $page_start_post += $posts_per_page;
- $counter += $posts_per_page;
- } while ($counter < $topic_posts_sum);
- $date = date("d M Y", $topic_last_post_time );
- $query3="select forum_name from $table".forums." WHERE forum_id = ".$forum_id."";
- $result3=mysql_query($query3);
- $row2 = mysql_fetch_array($result3);
- if ($topic_posts_sum > $posts_per_page) {
- echo "<a href='http://".$config_value."/forum/viewtopic.php?f=".$forum_id."&t=".$topic_id."&start=".$page_start_post."#p".$topic_last_post_id."' target='blank'><b>";
- } else {
- echo "<a href='http://".$config_value."/forum/viewtopic.php?f=".$forum_id."&t=".$topic_id."#p".$topic_last_post_id."' target='blank'><b>";
- }
- echo $topic_title."</b></a><BR><span class='smltxt'>views: ".$topic_views.", replies: ".$topic_replies."<BR>".$date."</span><br /><br>";
- }
- //-------------------------- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement