TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 06:10:50 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,106
  • Total Topics: 21,213
  • Online today: 358
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online

[Reguest] Tag Cloud snippet

Started by soMzE, February 28, 2007, 06:11:07 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

JPDeni

I don't think you can do it with the ORDER BY command. You would need to get the information for all the tags, loop through them, putting the most frequent N tags into an array and then loop through again, putting them in alpabetical order. I can try to write the code later, but it's very early in the morning where I am and I've only just woke up.

3nd3r

Ok. Please, take your time and thank you again :)

3nd3r

Hello there... Any idea about this?

Please take your time. I'm not in a hurry, just I want you to remember it.

Thanks in advance for your time  :up:

JPDeni

I can't work it out. Sorry. Maybe someone else has a clue.

3nd3r

Ok, don't worry. Maybe anybody else would be interested in trying to make it.

In addition, I will look for a code that do it and maybe could be adapted to work.

Thanks again for trying :up:

3nd3r

Well, I think this sentence can work...
To remember it, what I want is show the most popular N tags:
SELECT * FROM
(
SELECT t.tag AS tag, l.ID_TAG, COUNT(l.ID_TAG) AS quantity
FROM {$db_prefix}tags as t, {$db_prefix}tags_log as l WHERE t.ID_TAG = l.ID_TAG
GROUP BY l.ID_TAG
ORDER BY t.tag DESC
)
WHERE ROWNUM <= N

But this causes a 'hacking attemp' error...
I think I'm in the way to make it, but I need a little help...

Can anybody figure it out?

catchpen

#36
This block snippet gives me an internal server error.

Does this mean I need to change something in the code to get it to retrieve from MySQL or is this a copy paster snippet? OR do I install the SMF mod then use this block?

3nd3r

You first have to install Tagging system for topics mod: http://custom.simplemachines.org/mods/index.php?mod=579
And then you can use this snippet.

catchpen

Quote from: 3nd3r on October 10, 2007, 08:41:33 AM
You first have to install Tagging system for topics mod: http://custom.simplemachines.org/mods/index.php?mod=579
And then you can use this snippet.

Thanks I'll try it out when I get a chance. I already have the "googletagged" mod and thought that would be a nice front page center block. I'll have to read up if these 2 mods will conflict each other since they are quite similar

catchpen

Works perfect.  With this snippet I didn't have to manually install any part of the mod with my custom theme. Thanks.