Firefox PHP

[Answered] How do I display last post link in index tpl "Last Post" column ?

Posted by davidm_nodeo 
[Answered] How do I display last post link in index tpl "Last Post" column ?
February 11, 2008 03:13AM
I'd like to reproduce the behavior common to many boards, which is to add a link to the last post and last author directly from the forum's index, on top of the date of the last post.

I have installed the recent_forum_author module, which added the link to the latest author.
Now I looked at how the last post link is inserted in list.tpl :

<a href="{MESSAGES->URL->LAST_POST}">{LANG->LastPostLink}</a>

I first tried to wrap the above code in a MESSAGE LOOP in the index tpl, but I have a missing argument error.

I then assumed that this kind of logic could be used in the FORUMS LOOP writing it like this on index.tpl :

<a href="{FORUMS->URL->LAST_POST}">{LANG->LastPostLink}</a>

But it doesn't work, probably because I can't use those variables in that context.

If I could write PHP, I'd try to adapt recent_forum_author's logic to write a last_forum_post module (didn't find this in the addons), but I don't have the skills...

Any idea how this could be achieved ?



Edited 2 time(s). Last edit at 02/11/2008 11:36AM by davidm_nodeo.
Re: How do I display last post link in index tpl "Last Post" column ?
February 11, 2008 04:14AM
This is functionality which never was considered useful by the Phorum team. Frankly, do you really need to see the last post? If your board gets any popular, then this information will be changing pretty quickly. I find the Recent Messages module functionality a lot more useful for users to keep track of new threads and messages on the board.

Anyway, the functionality that you requested is not available by default. It needs a module to keep track of that info. Rather than making it a new module, I would say that it could be an extension of the Recent Forum Author module. One thing to keep in mind is that this might be troublesome for messages which are moved to other forums or (worse) messages that get deleted by a moderator. That would give you broken links. So the module would have to hook into the moderation process as well to find the most recent message and put that in the data when a message is deleted.

Since you are not able to write PHP code, you would have to find a programmer that can update the module for you.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: How do I display last post link in index tpl "Last Post" column ?
February 11, 2008 06:08AM
True the recent messages module is a great way to follow up on recent messages.

I guess it's not that essential, and it's more like I am used to have it handy and was curious to know if there was any simple way to implement this. I can understand the issues it would raise now.

Bottom line : I'd like to have a better view of which board has new messages. On the threads list (the list.tpl page) I have a flag next to new messages, but boards which have a new message don't seem to have any indicator displayed on the index.tpl page (and that's curious, since there seems to be something to that effect in the template, and adjusted the board settings too).

I mean when I read

(<span class="new-flag">{FORUMS->new_threads} {LANG->newflag} </span>)

and

   (<span class="new-flag">{FORUMS->new_messages} {LANG->newflag}</span>)

it seems to mean the new flag span should appear and it doesn't.

On a side note, I have the same issue with the new_count module... Still trying to wrap my head around what goes wrong here...



Edited 3 time(s). Last edit at 02/11/2008 06:10AM by davidm_nodeo.
Re: How do I display last post link in index tpl "Last Post" column ?
February 11, 2008 06:37AM
Do you have the setting enabled for displaying the new message info on the index page? As you can see on this board, Phorum does have options to show you this info.

Go to the admin interface.
Open the "General Settings" page.
Check the "Show New Counts for Forums on the Index Page" setting.
It should be set to "Yes".


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: How do I display last post link in index tpl "Last Post" column ?
February 11, 2008 06:40AM
It is set to Yes, and I have also tried to set to "no count, just indicator" but to no avail.

I'll try to set all cache setting to "No" and report, maybe it's a cache issue of some kind...

(My config is : Apache 2.2.6 - MySQL 5.0.45 - PHP 5.2.5 | Debian 4.0 (Etch) )



Edited 1 time(s). Last edit at 02/11/2008 06:41AM by davidm_nodeo.
Re: How do I display last post link in index tpl "Last Post" column ?
February 11, 2008 06:46AM
It is strange if this would not work.

- Did you actually try posting using another user and then logging in as your original user? For your own messages, the read flag is set immediately at posting time already, so for those you won't see indicators in the index page.

- Are you logged in at all? New message tracking is only available for registered users.

- Could you check your phorum_user_newflags table? I would suspect real errors if that table got corrupted, but let's rule out that it's not a database problem here.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: How do I display last post link in index tpl "Last Post" column ?
February 11, 2008 08:40AM
Quote
davidm_nodeo
I guess it's not that essential, and it's more like I am used to have it handy and was curious to know if there was any simple way to implement this. I can understand the issues it would raise now.

I hear you, coming from another boxy forum app, like phpBB or SMF, you tend to want to make Phorum appear and act the same, I know I did at first. But after using it for a little over a month, I've grown to appreciate the differences, it makes you rethink what a discussion forum can be. I've only started to explore the templating possibilities, and boxy is not a direction I would head with it.

--
Bert Garcia - When all you have is a keyboard
Re: How do I display last post link in index tpl "Last Post" column ?
February 11, 2008 08:59AM
Quote
mmakaay
It is strange if this would not work.

Very strange indeed, can't make sense out of this :-\
I did test locally with MAMP 1.7.1, with the template I have built and it works just fine.

Maybe it's a corner case config issue of some sorts ???

Not a cache issue it would seem.
Not a DB issue either, did a check on the tables and phpMyAdmin returns OK for all tables.

Actually, wondering if I should not just re-install...

Quote
mmakaay
- Did you actually try posting using another user and then logging in as your original user? For your own messages, the read flag is set immediately at posting time already, so for those you won't see indicators in the index page.

Yes I did.

Quote
mmakaay
- Are you logged in at all? New message tracking is only available for registered users.

Yes I am logged in, under different test accounts.

Quote
mmakaay
- Could you check your phorum_user_newflags table? I would suspect real errors if that table got corrupted, but let's rule out that it's not a database problem here.

Yes I checked but nothing seems wrong.

As I said, I should backup -> re-install Phorum -> re-install Addons one by one, checking each time that everything runs fine. Maybe I did something wrong while learning my way into the system.

I don't have that many content and I don't think I'll understand where this comes from...

Quote
hcgtv
I hear you, coming from another boxy forum app, like phpBB or SMF, you tend to want to make Phorum appear and act the same, I know I did at first. But after using it for a little over a month, I've grown to appreciate the differences, it makes you rethink what a discussion forum can be. I've only started to explore the templating possibilities, and boxy is not a direction I would head with it.

Hi Bert :)

I admit I gave Phorum another look after enjoying the xPattern forums :P

Yeah we guys can sure appreciate what a flexible and templatable application can bring to the table compared to "1 click install", YAPS/YABB out there.

Phorum can be to forums what Textpattern or MODx are for CMS, e.g not bloated and in your way, but light and flexible (working your way).

True about the "boxy" concept, when you have real templating control you can go your way and it makes it way easier to integrate designs fully (comes in handy !).



Edited 3 time(s). Last edit at 02/11/2008 09:11AM by davidm_nodeo.
Re: How do I display last post link in index tpl "Last Post" column ?
February 11, 2008 09:22AM
I doubt that a reinstall is what you would need here. Maybe try emptying your user newflags table. It's safe to delete all records from that one. That should get you into a clean state for the newflags. If a module is causing you troubles, then disabling it should restore a working state too. So maybe try disabling all modules and work your way up from there. Another thing to try is check if the newflags work if you are using the Emerald template, to see if something went wrong in templating. I don't think you're suffering from any corner case here. The newflags-on-index configuration is really simple and limited to the three options in the General Settings page.

Does the site run on a public URL? Could you provide us with that URL so we can take a look ourselves as well?


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: How do I display last post link in index tpl "Last Post" column ?
February 11, 2008 09:49AM
Quote
mmakaay
I doubt that a reinstall is what you would need here. Maybe try emptying your user newflags table. It's safe to delete all records from that one. That should get you into a clean state for the newflags.

Just tried. Indeed it resets the new-message indicator for annoucements on the index page and on the thread list too. But nothing changes aside from that.

Quote
mmakaay
If a module is causing you troubles, then disabling it should restore a working state too. So maybe try disabling all modules and work your way up from there.

OK will do !

Quote
mmakaay
Another thing to try is check if the newflags work if you are using the Emerald template, to see if something went wrong in templating.

Doesn't seem to be templating, I switched to Emerald template but same issue.

As I said, I did test locally with MAMP 1.7.1, a clean Phorum install with the template I have built and it works just fine.

There must be something I wrecked along the way, or else it's a module conflicting with another module or something...

Quote
mmakaay
I don't think you're suffering from any corner case here. The newflags-on-index configuration is really simple and limited to the three options in the General Settings page.Does the site run on a public URL? Could you provide us with that URL so we can take a look ourselves as well?

Of course here it is : [forums.modxcms.fr]
I have currently reverted the default settings to the Emerald template.

If you need access to the admin account I can PM you the info.

Thanks for your patience :)
Sorry, only registered users may post in this forum.

Click here to login