Display Last 5 Phorum Posts -script
Posted by dagon
Re: Display Last 5 Phorum Posts -script December 05, 2006 05:26PM |
Registered: 17 years ago Posts: 8 |
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.
$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 |
Admin Registered: 19 years ago Posts: 8,532 |
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
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Display Last 5 Phorum Posts -script December 06, 2006 08:27AM |
Registered: 17 years ago Posts: 8 |
Re: Display Last 5 Phorum Posts -script December 06, 2006 08:52AM |
Registered: 17 years ago Posts: 8 |
Re: Display Last 5 Phorum Posts -script December 06, 2006 08:55AM |
Registered: 17 years ago Posts: 8 |
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 ?
//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 |
Registered: 22 years ago Posts: 1,076 |
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 |
Registered: 22 years ago Posts: 1,076 |
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 |
Registered: 19 years ago Posts: 278 |
Re: Display Last 5 Phorum Posts -script March 06, 2007 02:11PM |
Registered: 22 years ago Posts: 62 |
Re: Display Last 5 Phorum Posts -script March 06, 2007 02:53PM |
Registered: 19 years ago Posts: 278 |
Sorry, only registered users may post in this forum.