Author Topic: Modification of the GLOBAL Tag List  (Read 1217 times)

0 Members and 1 Guest are viewing this topic.

Offline a4evermedia

  • Global Moderator
  • Full Member
  • ***
  • Posts: 122
  • Karma: +25/-0
  • Gender: Male
    • View Profile
    • A4Ever Media
Modification of the GLOBAL Tag List
« on: July 18, 2012, 04:39:01 PM »
This bit of code generates a list of 50 popular tags capatilized and comma-seperated, and sorted by frequency:
Code: [Select]
{tags var=$tags sort="frequency DESC" alphabetize=true amount=50 minscore=100 maxscore=200}

{foreach var=$tag from=$tags counter=$i}
{assign var=$tag_text code=ucwords(str_replace(array('_'), ' ', $tag.tag))}
<a href=&quot;{$g_config.base_uri}/tag/{$tag.tag}&quot;  class=&quot;tag-{$tag.score}&quot;>{$tag_text}</a>{if $i < 50}, {/if}
{/foreach}


If you want to remove the commas, delete the counter=$i code and change the anchor tag by removing the {if} conditional at the end:
Code: [Select]


For all lower case, change ucwords to strtolower

Thanks Dred!
« Last Edit: July 18, 2012, 04:47:45 PM by a4evermedia »

Unofficial JMB Support Forums

Modification of the GLOBAL Tag List
« on: July 18, 2012, 04:39:01 PM »


Tags:
 

Related Topics

  Subject / Started by Replies Last post
0 Replies
1659 Views
Last post April 30, 2012, 04:35:57 AM
by a4evermedia
0 Replies
1271 Views
Last post May 23, 2012, 06:14:47 PM
by a4evermedia
3 Replies
1093 Views
Last post October 31, 2013, 04:27:18 PM
by mike22
0 Replies
864 Views
Last post January 10, 2014, 09:56:58 PM
by mac500
0 Replies
1291 Views
Last post July 22, 2015, 04:55:34 PM
by seojedi32