Jump to content


Show_phpBB2


28 replies to this topic

#21 rockarena

    Etomite Forum Newbie

  • Member
  • 12 posts

Posted 25 November 2006 - 11:19 PM

How would I use this snippet to just show all the new topics? Is there a way to identify them or maybe just post the new snippets from a certain date? The reason I'm asking this is because I want this snippet to post that information on a small space on my website, namely a sidebar. Is this at all possible?

#22 Gyepmester

    Etomite Forum Newbie

  • Member
  • 2 posts

Posted 19 June 2007 - 05:25 AM

Does it work for phpBB 3 too?

#23 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 19 June 2007 - 06:57 AM

phpBB3 is still classified as UNSTABLE, therefore, if it does work now, that doesn't guarantee that it will work in the future, and vice versa. Why not try it and let us all know if it works? I personally would be waiting to integrate a STABLE release.

#24 lloyd_borrett

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 605 posts
  • Gender:Male

Posted 30 September 2009 - 10:45 PM

G'day,

I've just noticed that my versions of the Show_phpBB2 and Showhead_phpBB2 are no longer returning the topics I expect them to. I haven't checked the pages using them for years, so I'm not quite sure when the problem surfaced. I suspect it has something to do with the host being updated at some stage to 4.1.22-standard or PHP to 5.2.5. Or maybe the query in the snippet was just never correct for the functionality required.

I want to get the first x topics from the desired forum. Say the first 5 topics as shown at http://www.scubadoct...ewforum.php?f=1

Instead I'm getting a very different result. See http://www.scubadoct...nouncements.htm, or maybe easier, the bottom of the page http://www.scubadoctor.com.au/home.htm.

Nothing has changed in the snippet's SELECT statements.
	$query = "SELECT * FROM ".$table_prefix."topics WHERE forum_id=".$forumnr." ORDER BY 'topic_type' DESC , 'topic_first_post_id' DESC LIMIT 0 , ". $topiccount ;
	$result2 = mysql_query($query);
	while($row = mysql_fetch_array($result2)) {

It seems as if MySQL is getting the first x topics and then sorting them. That is, the LIMIT is applied before the ORDER BY.

I need to be getting all of the topics, sorting them, and then just returning the first x after the sort. That is, the LIMIT is applied after the ORDER BY.

When I try the SELECT statement in phpMyAdmin I get the results I'd expect. But not by the snippets.

Any suggestions as to how to resolve this would be gratefully received.

Question: Is there an easy way to dump the results of the query in the snippet for debugging purposes?

Edited by lloyd_borrett, 30 September 2009 - 10:59 PM.


#25 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,506 posts
  • Gender:Male

Posted 01 October 2009 - 12:12 AM

Two ideas for you Lloyd... First, try using LIMIT ". $topiccount instead of LIMIT 0 , ". $topiccount as the zero can be implicit and may help... If that doesn't work, could you create an index for 'topictype'...??? If neither of those works, let us know...


#26 lloyd_borrett

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 605 posts
  • Gender:Male

Posted 01 October 2009 - 11:00 PM

Changing and even removing the LIMIT part makes no difference.
Thus it seems my first thoughts are probably incorrect.

It seems the ORDER BY part of the query simply isn't working.
Doesn't work in phpMyAdmin either.

It's got me stumped.

#27 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,506 posts
  • Gender:Male

Posted 01 October 2009 - 11:50 PM

I just noticed that you're using single quotes instead of backticks around your column names... Try using either nothing around the column names, or backticks, and then single quotes around values...

$query = "SELECT * FROM {$table_prefix}topics WHERE forum_id={$forumnr} ORDER BY topic_type DESC , topic_first_post_id DESC LIMIT 0,{$topiccount}";
-- OR --
$query = "SELECT * FROM {$table_prefix}topics WHERE `forum_id`={$forumnr} ORDER BY `topic_type` DESC , `topic_first_post_id` DESC LIMIT 0,{$topiccount}";


#28 lloyd_borrett

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 605 posts
  • Gender:Male

Posted 02 October 2009 - 12:22 AM

That did it! Many thanks Ralph.

#29 DodoG

    Etomite Forum Newbie

  • Member
  • 7 posts

Posted 17 August 2010 - 11:13 PM

Has anyone modified this script for phpBB3? It would be very usefull.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users