Firefox PHP

Last post listing on index page

Posted by Brian Moon 
All files from this thread

File Name File Size   Posted by Date  
lastforumpost.zip 1.9 KB open | download Brian Moon 08/19/2004 Read message
Last post listing on index page
August 19, 2004 12:36AM
I just made this module. I made it mainly to test a new function I put in mysql.php just for module writers and the new index hook I added to index.php. But, it is also a common feature on many other systems. It just puts the last post into the index.php page for each forum on the page. It is linked and shows the author. Currently it just hacks the info into the forum description. It could be modified to move it to the date column if you wished like phpBB does.

Oh, you will need latest cvs for index.php and mysql.php to use this.

Oh[2], you can see what it looks like (for now) at the dev test forum. [dev.phorum.org]

Brian - Cowboy Ninja Coder - Personal Blog - Twitter



Edited 2 time(s). Last edit at 08/19/2004 12:46AM by brianlmoon.
Re: Last post listing on index page
August 19, 2004 07:43AM
Looks nice. You may want to provide a link or an attachment, or something people can download. :)

(also, is it normal that the dev page index shows 58 threads with 71 of them new?)
Re: Last post listing on index page
August 19, 2004 10:03AM
oops. I made the zip and everything.

That issue is fixed in CVS.

Brian - Cowboy Ninja Coder - Personal Blog - Twitter



Edited 1 time(s). Last edit at 08/19/2004 10:04AM by brianlmoon.
Attachments:
open | download - lastforumpost.zip (1.9 KB)
Re: Last post listing on index page
August 22, 2004 12:20AM
How would I move it to the date column? I know I'd have to edit lastforumpost.php, but I'm not sure what to replace with what exactly.

Edit: Nevermind, I got it. I'd tried last_post_time, lastpost, all kinds of things, until I got to last_post, hehe. :)

-------------------------------------------

"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe




Edited 1 time(s). Last edit at 08/22/2004 12:45AM by portal of curiousity.
Re: Last post listing on index page
August 22, 2004 06:46PM
Yeah, you can see the correct value in the template.

Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: Last post listing on index page
August 23, 2004 02:52PM
Problem for logged-out users in cvs-2004082314 -

Fatal error: Only variables can be passed by reference in /home/wtower/public_html/phorum/mods/lastforumpost/lastforumpost.php on line 9



Edited 1 time(s). Last edit at 08/23/2004 03:30PM by Mandingo.
Re: Last post listing on index page
September 04, 2004 02:13AM
Hi,

last cvs: phorum5-cvs-2004090400.tar.gz

module: lastforumpost version 1.2


Did a fresh install and i've have converted from phorum3 to phorum5. All works fine.
Did only "Mark all Messages Read" in all forums. I've wrote no new messages.

Then i gone to Admin and have activated (enabled) the lastforumpost module. Back to Phorum index and get following error:

Parse error: parse error, unexpected T_IF in /home/www/public_html/phorum/mods/lastforumpost/lastforumpost.php on line 12


Edit 1:
Found the problem in line 10 of lastforumpost.
Missing ; at the end
change
$messages = phorum_db_get_recent_messages(1, $forum["forum_id"])
in
$messages = phorum_db_get_recent_messages(1, $forum["forum_id"]);


Now the next error i have:
Warning: Wrong parameter count for array_shift() in /home/www/public_html/phorum/mods/lastforumpost/lastforumpost.php on line 13


Hopefully i can fix it for myself.



Edit 2:
Line 13:
change
$message = array_shift();
in
$message = array_shift($messages);


No warranty. I'm a n00b in php etc.
Please correct me if i was wrong with these
changes.



Regards, Stoebi




Edited 2 time(s). Last edit at 09/04/2004 02:56AM by Stoebi.
Re: Last post listing on index page
September 04, 2004 09:34AM
where did you get that version of the module?

the version on this page does not have either one of those problems.

Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: Last post listing on index page
September 04, 2004 12:16PM
Hi,

@brianlmoon


I havve download it from here:
[dev.phorum.org]

You can see it here:
[dev.phorum.org]



Regards, Stoebi



Edited 1 time(s). Last edit at 09/04/2004 12:19PM by Stoebi.
Re: Last post listing on index page
September 04, 2004 03:27PM
the cvs for them is NOT official.
Only use modules posted in this forum directly.


Thomas Seifert
Sorry, only registered users may post in this forum.

Click here to login