Title: [Plugin: phpbb_recent_topics] &gt;&gt;&gt; phpbb recent    POSTS
Last modified: August 19, 2016

---

# [Plugin: phpbb_recent_topics] >>> phpbb recent POSTS

 *  [rate4d](https://wordpress.org/support/users/rate4d/)
 * (@rate4d)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/)
 * I’d like some instrukcions, that in my wordpress sidebar topics would be listed
   by the time someone made a post in the topic. for example if topic is very old
   and it isn’t visible in the recent topic sidebar, and when someone posts there
   it goes in the first position in the sidebar, I’d be thankful for instrukcions
   or plugin update with this option 🙂
 * [http://wordpress.org/extend/plugins/phpbb-recent-topics/](http://wordpress.org/extend/plugins/phpbb-recent-topics/)

Viewing 15 replies - 1 through 15 (of 15 total)

 *  Thread Starter [rate4d](https://wordpress.org/support/users/rate4d/)
 * (@rate4d)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244621)
 * 😀 lol noOne gives a fuck what do I need 😀
 *  [Torsten Landsiedel](https://wordpress.org/support/users/zodiac1978/)
 * (@zodiac1978)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244674)
 * !!! This only works in phpBB3 !!!
 * In the file display.php change “topic_time” to “topic_last_post_time” (5x)
    Now
   the Topics are sorted by the latest post in the topic, but the plugin is still
   linking to the topic-page and not to the last post. So you have to change (in
   display.php) this line: `echo " href='" . $SITEURL . "/viewtopic.php?t=$topic-
   >topic_id'>";` to this: `echo " href='" . $SITEURL . "/viewtopic.php?p=$topic-
   >topic_last_post_id#p$topic->topic_last_post_id'>";`
 * Now you have links to the latest post in the topic!
 * Greetings
    Torsten
 *  [Galerio](https://wordpress.org/support/users/galerio/)
 * (@galerio)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244684)
 * Thanks, can you share more hacks? And it would be beautifull to have the ability
   to add two or more widgets with different information inside (for example, one
   with last topic, one with last post, and so on).
 * Thank you
 *  Thread Starter [rate4d](https://wordpress.org/support/users/rate4d/)
 * (@rate4d)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244689)
 * zodiac1978, dude, thanks a lot.It was REALLY REALLY helpful.I was sooo nervous
   that noone could help me.I’d like to donate you, could I ? 🙂 I’d like to know
   your paypal in order to do that.If you don’t want to say it public, you can send
   it to my email. [rate4d@gmail.com](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/rate4d@gmail.com?output_format=md)
 *  [Torsten Landsiedel](https://wordpress.org/support/users/zodiac1978/)
 * (@zodiac1978)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244690)
 * [@rate4d](https://wordpress.org/support/users/rate4d/): I’ve got a Paypal Donate-
   Button on my Blog: [http://netztaucher.wordpress.com/](http://netztaucher.wordpress.com/)
   🙂
 *  Thread Starter [rate4d](https://wordpress.org/support/users/rate4d/)
 * (@rate4d)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244696)
 * I’ve donated €5.00 EUR.It’s not very big money, but a bit better than only “thanks”.
   So, thanks again zodiac, you helped a lot.It’s pleasure to do someone good 🙂
   As I appreaciate your help I hope you appreciate people’s donations.Helping for
   people in support forums **for free** is very kind work. 🙂
 *  [Torsten Landsiedel](https://wordpress.org/support/users/zodiac1978/)
 * (@zodiac1978)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244705)
 * Sorry for answering so late. The Paypal-E-Mail was in my spam folder!
    Thank 
   you **very much** for your donation! This is my first donation ever … 🙂
 * Kind regards
    Torsten
 *  [number3nl](https://wordpress.org/support/users/number3nl/)
 * (@number3nl)
 * [16 years ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244751)
 * Great modification. After reviewing the idea (and implementing it). I thought
   it would be nice to reflect the real post date (and time).
 * So after changing some lines of code, I ended up with this:
 *     ```
       <?php
   
       # Get the Options from the Database
   
       $PHPBBDB = stripslashes(get_option('prt_phpbb_db'));
       $TOPIC_TABLE = stripslashes(get_option('prt_phpbb_tt'));
       $SITEURL = stripslashes(get_option('prt_phpbb_url'));
       $PHPBBDATE = stripslashes(get_option('prt_phpbb_date'));
       $PHPBBEXCLUDED = get_option('prt_phpbb_exclued');
       $OPENINNEWWIN = stripslashes(get_option('prt_phpbb_newwin'));
       # TODO change above variables to match "admin-display" style, cause it makes more sense!
       $prt_phpbb_dbinsecureon = stripslashes(get_option('prt_phpbb_dbinsecureon'));
   
       # Setup our WordPress DB Connection
       	global $wpdb;
   
       # Are we a function call or Page call ? Set up our list length...
   
       	if (is_null($LIMIT)) { 
   
       		$LIMIT = stripslashes(get_option('prt_phpbb_LIMIT'));
   
       		if (is_null($LIMIT)) {
                       $LIMIT = 5;
       	        }
       	}
   
       # Check the $TOPIC_TABLE variable
   
       	if (is_null($TOPIC_TABLE)) {
   
       		$TOPIC_TABLE = "phpbb_topics";
   
       	}
   
       	# if $TOPIC_TABLE is set up empty :)
       	if ($TOPIC_TABLE == "") {
   
                       $TOPIC_TABLE = "phpbb_topics";
   
               }
   
       # Connect to php BB
       #
       # Insecure Method
       if ($prt_phpbb_dbinsecureon == "1") { 
   
       	$prt_phpbb_dbinsecureuid = stripslashes(get_option('prt_phpbb_dbinsecureuid'));
       	$prt_phpbb_dbinsecurepw = stripslashes(get_option('prt_phpbb_dbinsecurepw'));
       	$prt_phpbb_dbinsecurehost = stripslashes(get_option('prt_phpbb_dbinsecurehost'));
   
       	$phpbbdb = new wpdb($prt_phpbb_dbinsecureuid, $prt_phpbb_dbinsecurepw, $PHPBBDB, $prt_phpbb_dbinsecurehos);
   
       } else {
       # Secure Method
   
       	$wpdb->select($PHPBBDB);
   
       }
   
       # Run The query
   
       if (is_array($PHPBBEXCLUDED)) {
       	$counter = 0;
       	$countermax = count($PHPBBEXCLUDED) -1;
       	# Construct Excluded Query
       	$EXCLUDED_FORUM = "AND ";
       	foreach ($PHPBBEXCLUDED as $EXCLUDED) {
       		$EXCLUDED_FORUM .= "forum_id !=$EXCLUDED";
       			if ($counter < $countermax  ) {
       				$EXCLUDED_FORUM .= " AND ";
       			}
       	 $counter++;
       	}
   
       	// Added WHERE TOPIC_APPROVED = 1 to the following, creditz Ashish http://www.microstrategy101.com/
   
       	if ($prt_phpbb_dbinsecureon == "1") {
   
       //		$results = $phpbbdb->get_results("SELECT * FROM $TOPIC_TABLE WHERE TOPIC_APPROVED = 1 $EXCLUDED_FORUM ORDER BY topic_time DESC LIMIT $LIMIT");
   
       		$results = $phpbbdb->get_results("SELECT * FROM $TOPIC_TABLE WHERE TOPIC_APPROVED = 1 $EXCLUDED_FORUM ORDER BY topic_last_post_time DESC LIMIT $LIMIT");
   
       	} else {
   
       //		$results = $wpdb->get_results("SELECT * FROM $TOPIC_TABLE WHERE TOPIC_APPROVED = 1 $EXCLUDED_FORUM ORDER BY topic_time DESC LIMIT $LIMIT");
   
       		$results = $wpdb->get_results("SELECT * FROM $TOPIC_TABLE WHERE TOPIC_APPROVED = 1 $EXCLUDED_FORUM ORDER BY topic_last_post_time DESC LIMIT $LIMIT");
   
       	}
       } else {
       	# No excluded Query
   
       	if ($prt_phpbb_dbinsecureon == "1") {
   
       		$results = $phpbbdb->get_results("SELECT * FROM $TOPIC_TABLE WHERE TOPIC_APPROVED = 1 ORDER BY topic_time DESC LIMIT $LIMIT");
       	} else {
       		$results = $wpdb->get_results("SELECT * FROM $TOPIC_TABLE  WHERE TOPIC_APPROVED = 1 ORDER BY topic_time DESC LIMIT $LIMIT");
       	}
       }
   
       if ($results){
   
       		echo "<ul>";	
   
       	# Loop away baby !
       	foreach ($results as $topic)
       		{
   
       		echo "<li>";
       		//echo "$topic->post_text";
       		echo "<a ";
       			if ($OPENINNEWWIN == "1") { echo "target=\"_blank\""; }
       	//	echo " href='" . $SITEURL . "/viewtopic.php?t=$topic->topic_id'";
       	        echo " href='" . $SITEURL . "/viewtopic.php?p=$topic->topic_last_post_id#p$topic->topic_last_post_id'";	
   
       		echo ">";
                       echo "$topic->topic_last_post_subject";
       	//      echo "$topic->topic_title";
       		echo "</a>";
   
       		if ($PHPBBDATE != "") {
       			echo "<br />\n";
       			//echo "<small><i>" . date("$PHPBBDATE", $topic->topic_time) . "</i></small>\n";
                               echo "<small><i>" . date("$PHPBBDATE", $topic->topic_last_post_time) . "</i></small>\n";
       		}
   
       		echo "</li>";
       		}
   
       		echo "</ul>";
       } else {
       		echo "<h2> phpBB Error  -$TOPIC_TABLE </h2>";
       }
   
        if ($prt_phpbb_dbinsecureon != "1") {
       	# Connect back to wordpress :-)
       	$wpdb->select(DB_NAME);
        }
   
       ?>
       ```
   
 * Now the only thing I want to add is a little code to fetch the post content and
   show it as a tooltip. But I have not gotten this to work yet, since I need to
   read the content of the post from another table.
 *  [linickx](https://wordpress.org/support/users/linickx/)
 * (@linickx)
 * [16 years ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244752)
 * Hi All,
 * FYI I have this thread bookmarked an will incorporate the suggestions in the 
   next version 🙂
 * If you could checkout the source from [the trunk](http://plugins.svn.wordpress.org/phpbb-recent-topics/trunk/)
   and post a link to a .diff / patch file that would really help me.
 * Thanks,
    Nick
 *  [number3nl](https://wordpress.org/support/users/number3nl/)
 * (@number3nl)
 * [16 years ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244753)
 * Hi Nick,
    I will look into making a diff. Suggestions for which tool to use would
   be great… I am not into development lately, missed out on most SVN/Git like tools.
   So what to use to make a diff? Gr. #3
 *  [linickx](https://wordpress.org/support/users/linickx/)
 * (@linickx)
 * [16 years ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244754)
 * This is now in the trunk – [http://plugins.trac.wordpress.org/log/phpbb-recent-topics/](http://plugins.trac.wordpress.org/log/phpbb-recent-topics/)
 * I plan to do some further code clean up prior to the next release, please test.
 * Cheers,
    Nick
 *  [kfallman-1](https://wordpress.org/support/users/kfallman-1/)
 * (@kfallman-1)
 * [16 years ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244755)
 * Great plugin !
 * I have 1 problem. When i fetch the topics i get wrong time. Im in sweden ( UTC
   + 1 ) and summertime, but it shows -2 hrs.
 *  [kfallman-1](https://wordpress.org/support/users/kfallman-1/)
 * (@kfallman-1)
 * [16 years ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244756)
 * forgot to say date is correct in forum
 *  [number3nl](https://wordpress.org/support/users/number3nl/)
 * (@number3nl)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244759)
 * Yeah, I deleted time from my settings for this plugin. But I do see the same 
   problem. I have looked into this, but I have not been able to pinpoint the problem.
 * Anyone any ideas on how to solve this?
 *  [linickx](https://wordpress.org/support/users/linickx/)
 * (@linickx)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244760)
 * Elo,
 * I think the problem is that the servers ‘actual’ time is on a different zone 
   to the forum/wp.
 * In the plugin I pull the post/topic time direct out from mysql (_and format it
   in php_)…. the solution requires a patch to handle timezones, however the technically
   difficulty relies in that this plugin _must_ support PHP4 ([like WP](http://wordpress.org/about/requirements/))
   and be future-proofed to work with [PHP 5.2’s built-in functions](http://www.php.net/manual/en/datetime.gettimezone.php)….
   setting up a testing environment which can debug both PHP4/5 is a bit of a headache….
   possibly something I’ll do once I’m sure that no WP3.0 bugs appear.
 * Cheers,
    Nick

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘[Plugin: phpbb_recent_topics] >>> phpbb recent POSTS’ is closed to new
replies.

 * 15 replies
 * 6 participants
 * Last reply from: [linickx](https://wordpress.org/support/users/linickx/)
 * Last activity: [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-phpbb_recent_topics-gtgtgt-phpbb-recent-posts/#post-1244760)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
