Show ALL messages with same tag on ONE page, oldest above.

Creating and modifying plugins.
Post Reply
rmulders
Regular
Posts: 5
Joined: Mon Sep 18, 2006 8:49 pm

Show ALL messages with same tag on ONE page, oldest above.

Post by rmulders »

Hi There.

I'm using the tag plugin and I have the following question.

When I now show all messages with the same tag it only shows 15 messages one one page (just like the main page), starting with the newest message at the top.

What I would like to have is ALL the messages (with the same tag) on one page and start with the oldest at the top.

Who can help me on how to do this? Thank!

Robert
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Show ALL messages with same tag on ONE page, oldest abov

Post by garvinhicking »

Hi!

For that you will need to patch the serendipity_event_freetag.php file.

At around line 684 find:

Code: Select all

include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
and add this code before that line:

Code: Select all

$serendipity['fetchLimit'] = 9999;
This will show 9999 entries on a page.

To reorder the listing chronologically inverted, that's actually much more work. For that you would need to create a new event plugin that listens on a special hook and looks if the tagoutput is happening and would change some $eventData for it. That is some advanced stuff for which I sadly currently have no time to write that for you.

Maybe for starters you will be fine with simply showing all tags in the blog-usual order.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
rmulders
Regular
Posts: 5
Joined: Mon Sep 18, 2006 8:49 pm

Post by rmulders »

Thanks you for the very quick reply! I applied the changes that you suggested and now have all the all the messages on one page. Perfect!

As for the second request I had (the reversed time order), it sounds difficult. I'll try to look into it.

Thanks again, I really appreciate your help!
rmulders
Regular
Posts: 5
Joined: Mon Sep 18, 2006 8:49 pm

Post by rmulders »

Hi there,

I hope I'm not oversimplifying, but could the followinf solve my question to change the order of the a tag listing:

Within "serendipity_event_freetag.php" there are some SQL strings, could I not change one of the ORDER BY statements? (something like ORDER BY e2.timestamp ASC?) If so, where in this file should I look?

Again, thanks for your time, I appriciate it.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

hm, that might work. Try to find this

Code: Select all

@define('PLUGIN_VARS_DISPLAYTAG', $showtag);
in the file (at around line 945) and add this after that line:

Code: Select all

$eventData['orderby'] = 'e.timestamp ASC';
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
rmulders
Regular
Posts: 5
Joined: Mon Sep 18, 2006 8:49 pm

Post by rmulders »

Wow, that was fast!

Changed it and it works like a charm, thanks very much!
Great support Garvin!
Post Reply