Firefox PHP

Display Last 5 Phorum Posts -script

Posted by dagon 
Re: Display Last 5 Phorum Posts -script
December 05, 2006 05:26PM
Can you help me to change query


$result = mysql_query("select * from $table m, $forum_table f where m.forum_id = f.forum_id order by m.datestamp desc limit $number") or die("Failed Query of " . $result. mysql_error());



I would like to show last two topics from every forum.
But not to show last post on last topics, I want to show first post on last two topics.
Is it posible?



Edited 1 time(s). Last edit at 12/05/2006 05:30PM by nikolaaa.
Re: Display Last 5 Phorum Posts -script
December 05, 2006 07:35PM
If I understand the question right, then try adding m.parent_id = 0 to the where statement. That way you will select messages without a parent (thus thread starting messages).


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Display Last 5 Phorum Posts -script
December 06, 2006 08:27AM
I want to make something like on this forum:
[www.sitepoint.com]
Re: Display Last 5 Phorum Posts -script
December 06, 2006 08:52AM
And how to use funcion
phorum_custom_get_url( $page, $query_items, $suffix )
from nice_urls mod
in this module?
Re: Display Last 5 Phorum Posts -script
December 06, 2006 08:55AM
And I would like to make forum names as links


//format below to match your site
echo "<p><strong>$row[name]: <a href=\"".$PHORUM[SETTINGS][http_path]."/read.php?".$row[forum_id].",".$row[thread].",".$row[message_id]."#".$row[message_id]."\">" .$row[subject]. "</a>\n";

is it posible to make $row[name] to be url ?
Re: Display Last 5 Phorum Posts -script
December 07, 2006 06:49AM
Quote
nikolaaa
$result = mysql_query("select * from $table m, $forum_table f where m.forum_id = f.forum_id order by m.datestamp desc limit $number") or die("Failed Query of " . $result. mysql_error());

find $number = 5; and change it to $number = 2;

Quote
nikolaaa
I would like to show last two topics from every forum.
But not to show last post on last topics, I want to show first post on last two topics.

There's no easy way, because if you select thread starter with m.parent_id = 0 then the date isn't necessarily the latest available.

---
-=[ Panu ]=-
Re: Display Last 5 Phorum Posts -script
December 07, 2006 06:50AM
Quote
nikolaaa
And I would like to make forum names as links


//format below to match your site
echo "<p><strong>$row[name]: <a href=\"".$PHORUM[SETTINGS][http_path]."/read.php?".$row[forum_id].",".$row[thread].",".$row[message_id]."#".$row[message_id]."\">" .$row[subject]. "</a>\n";

is it posible to make $row[name] to be url ?

echo "<p><strong>$row[name]: <a href=\"".$PHORUM[SETTINGS][http_path]."/read.php?".$row[forum_id].",".$row[thread].",".$row[message_id]."#".$row[message_id]."\">" .$row[name]. "</a>\n";

---
-=[ Panu ]=-
Re: Display Last 5 Phorum Posts -script
March 06, 2007 02:06PM
Is there a way that i can DISALLOW a certain forum from being included in this list? For example, I have a hidden forum (id=25) that I don't want to be seen by anyone, but obviously as soon as someone posts there, it's shown on this list.
Re: Display Last 5 Phorum Posts -script
March 06, 2007 02:11PM
WHERE forum_id !=25
Re: Display Last 5 Phorum Posts -script
March 06, 2007 02:53PM
ok where on earth would I put that?
Sorry, only registered users may post in this forum.

Click here to login