Tag plugin: how to show max number of tags?

Creating and modifying plugins.
Post Reply
zoran
Regular
Posts: 71
Joined: Sun Jan 16, 2005 9:13 pm
Location: Amsterdam
Contact:

Tag plugin: how to show max number of tags?

Post by zoran »

Hi all,

How would I show a maximum number of tags using the tags plugin? Can't find it in the configuration, but I might be looking in the wrong place? The tags list is to be growing to be a bit large. Most popular in the primary view and a 'read more' link to the whole list would be nice.

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

Re: Tag plugin: how to show max number of tags?

Post by garvinhicking »

Sadly such a config option does not exist yet, so one would need to patch that functionality into the plugin...

Inside serendipity_plugin_freetag.php you can patch the generate_content() function. You need to modify this SQL:

Code: Select all

        $query = "SELECT tag, count(tag) as total FROM {$serendipity['dbPrefix']}entrytags GROUP BY tag ORDER BY tag";
like to:

Code: Select all

        $query = "SELECT tag, count(tag) as total FROM {$serendipity['dbPrefix']}entrytags GROUP BY tag HAVING total > 2 ORDER BY tag LIMIT 20";
?

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/
zoran
Regular
Posts: 71
Joined: Sun Jan 16, 2005 9:13 pm
Location: Amsterdam
Contact:

Re: Tag plugin: how to show max number of tags?

Post by zoran »

I've mailed you a patched version.
MySchizoBuddy
Regular
Posts: 340
Joined: Sun Jun 12, 2005 5:28 am

Post by MySchizoBuddy »

beside the related tags features. It would be nice if there was a heading
"Posts tagged adobe" and also "2 posts tagged"
just like you have on technorati (http://technorati.com/tag/adobe)
Image
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

I think this is already listed in the plugin's Todo-list at the top of the file. But nobody has implemented it yet :)

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/
MySchizoBuddy
Regular
Posts: 340
Joined: Sun Jun 12, 2005 5:28 am

Post by MySchizoBuddy »

is it possible to not show the tags on the main page but only show it on the extended entry page
Image
Post Reply