Custom Tag Cloud

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • microbob
    New Member
    • Jun 2009
    • 17
    • 3.8.x

    Custom Tag Cloud

    I have a question regarding the "POPULAR TAGS" Module/PHP file. I'm running vB 3.8.7 PL3



    Is there a way to separate out tags to reflect e.g., say only "VIRGINIA"-related tags vs. only "Maryland"-related tags, so I can copy the existing module (which covers all of my states) and fine tune it for state-specific pages like Virginia?

    Here are the modules controlling the tag cloud:

    tagbit

    tagbit_wrapper

    tag_cloud_box

    tag_cloud_box_search

    tag_cloud_headinclude

    tag_cloud_link

    tag_cloud_page

    tag_edit

    tag_edit_ajax

    tag_managebit

    tag_search

    Which part of the code/modules would I have to change to make it specific to a particular state? All of them or just specific ones?

    Remember that the only thing I'm changing is instead of pulling the data from all of my coverage states, each new cloud tag box will be state-specific. I'm thinking that since this is calling the tags that I'm inserting into my forums messages, that I might be able to draw only those from a specific section (or in my case, each state). Kinda like what I did with the News module. That allowed me to cull only the messages that I wanted. So, I'm hoping for the same sort of customization.

    Please advise. Thanks!



    Bob
  • microbob
    New Member
    • Jun 2009
    • 17
    • 3.8.x

    #2
    Here is the code from each of the templates listed above:

    TAGBIT



    <a href="tags.php?$session[sessionurl]tag=$tag_url">$tag</a>



    __________________________________________________________________________________________ ______________________________________



    TAGBIT_WRAPPER



    <if condition="$tag_list">$tag_list<else /><i>$vbphrase[none]</i></if> <img src="$stylevar[imgdir_misc]/11x11progress.gif" id="tag_form_progress" class="inlineimg" style="display:none" alt="" />



    __________________________________________________________________________________________ ______________________________________



    TAG_CLOUD_BOX



    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">

    <tr>

    <td class="tcat">

    <div class="smallfont" style="float:$stylevar[right]"><phrase 1="$cloud[count]">$vbphrase[these_are_the_x_most_used_thread_tags]</phrase></div>

    $vbphrase[tag_cloud]

    </td>

    </tr>

    <tr>

    <td class="alt1" style="text-align:justify">$cloud[links]</td>

    </tr>

    </table>



    __________________________________________________________________________________________ ______________________________________



    TAG_CLOUD_BOX_SEARCH



    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">

    <tr>

    <td class="tcat">

    <div class="smallfont" style="float:$stylevar[right]"><phrase 1="$cloud[count]">$vbphrase[these_are_the_x_most_searched_thread_tags]</phrase></div>

    $vbphrase[search_tag_cloud]

    </td>

    </tr>

    <tr>

    <td class="alt1" style="text-align:justify">$cloud[links]</td>

    </tr>

    </table>



    __________________________________________________________________________________________ ______________________________________



    TAG_CLOUD_HEADINCLUDE



    <style type="text/css">

    a.tagcloudlink:link, a.tagcloudlink:visited { text-decoration:none; }

    a.tagcloudlink:hover, a.tagcloudlink:active { text-decoration:underline; }

    a.level1 { font-size: xx-small; }

    a.level2 { font-size: small; }

    a.level3 { font-size: medium; }

    a.level4 { font-size: large; }

    a.level5 { font-size: xx-large; }

    </style>



    __________________________________________________________________________________________ __________________________________________



    TAG_CLOUD_LINK



    <a href="tags.php?$session[sessionurl]tag=$thistag[tagtext_url]" class="tagcloudlink level$thistag[level]">$thistag[tagtext]</a>



    __________________________________________________________________________________________ ______________________________________



    TAG_CLOUD_PAGE





    $stylevar[htmldoctype]

    <html xmlns="[URL="http://www.w3.org/1999/xhtml%22"]http://www.w3.org/1999/xhtml"[/URL="http://www.w3.org/1999/xhtml%22"] dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">

    <head>

    $headinclude

    <title>$vboptions[bbtitle] - $vbphrase[tags]</title>

    <if condition="$show['inlinemod']"><script type="text/javascript" src="clientscript/vbulletin_inlinemod.js?v=$vboptions[simpleversion]"></script></if>

    $tag_cloud_headinclude

    </head>

    <body>

    $header

    $navbar



    <if condition="$tag_cloud">

    $tag_cloud<br />

    </if>



    <form action="tags.php" method="get">

    <if condition="$session['sessionhash']">

    <input type="hidden" name="s" value="$session[sessionhash]" />

    </if>

    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" id="threadslist">

    <tr>

    <td class="tcat">$vbphrase[search_by_tag]</td>

    </tr>

    <tr>

    <td class="alt1" align="center"><div style="width: $stylevar[formwidth]" align="$stylevar[left]">

    <span id="tag_wrapper"><input type="text" id="tag_input" name="tag" size="25" style="width: 80%" class="bginput" /></span>

    <input type="submit" class="button" value="$vbphrase[search]" />

    </div></td>

    </tr>

    </table>

    </form>



    <if condition="$show['popups']">

    <div id="tag_wrapper_menu" class="vbmenu_popup" style="display:none"></div>

    <script type="text/javascript" src="clientscript/vbulletin_ajax_tagsugg.js?v=$vboptions[simpleversion]"></script>

    <script type="text/javascript">

    <!--

    vbmenu_register('tag_wrapper', true);

    tag_comp = new vB_AJAX_TagSuggest('tag_comp', 'tag_input', 'tag_wrapper');

    //-->

    </script>

    </if>



    $footer



    </body>

    </html>



    __________________________________________________________________________________________ ______________________________________



    TAG_EDIT





    $stylevar[htmldoctype]

    <html xmlns="[URL="http://www.w3.org/1999/xhtml%22"]http://www.w3.org/1999/xhtml"[/URL="http://www.w3.org/1999/xhtml%22"] dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">

    <head>

    $headinclude

    <title>$vboptions[bbtitle] - $threadinfo[title] - $vbphrase[tag_management]</title>

    <style type="text/css" id="vbulletin_showthread_css">

    <!--

    #tag_edit_list { list-style:none; margin:0px; padding:0px; }

    #tag_edit_list li { float:$stylevar[left]; display:block; width:200px; }

    #tag_edit_list li.mine { font-weight:bold; }

    -->

    </style>

    </head>

    <body>

    $header

    $navbar



    <if condition="$show['errors']">

    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">

    <tr>

    <td class="tcat">$vbphrase[errors]</td>

    </tr>

    <tr>

    <td class="alt1">$errorlist</td>

    </tr>

    </table>

    <br />

    </if>



    <form action="threadtag.php?do=managetags&amp;t=$threadinfo[threadid]" method="post">

    <input type="hidden" name="s" value="$session[sessionhash]" />

    <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />

    <input type="hidden" name="t" value="$threadinfo[threadid]" />

    <input type="hidden" name="do" value="managetags" />

    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">

    <tr>

    <td class="tcat">

    <span class="smallfont normal" style="float: $stylevar[right]"><b>$vbphrase[thread]</b>: <a href="showthread.php?$session[sessionurl]t=$threadinfo[threadid]">$threadinfo[title]</a></span>

    $vbphrase[tag_management]

    </td>

    </tr>

    <tr>

    <td class="panelsurround" align="center">

    <div class="panel">

    <div style="width:$stylevar[formwidth]" align="$stylevar[left]">

    <fieldset class="fieldset">

    <legend>$vbphrase[tags]</legend>

    <div style="padding:$stylevar[formspacer]px">

    <if condition="$tag_manage_options">

    <div style="padding-bottom:$stylevar[formspacer]px">$vbphrase[uncheck_tag_remove_bold_you]</div>

    <ul class="floatcontainer" id="tag_edit_list">

    $tag_manage_options

    </ul>

    <hr size="1" style="color:$stylevar[tborder_bgcolor]; background-color:$stylevar[tborder_bgcolor]" />

    </if>



    <div style="float: $stylevar[right]">

    <if condition="$show['add_option']"><div style="visibility:hidden">text</div></if>

    <input type="submit" class="button" value="$vbphrase[save_changes]" accesskey="s" tabindex="302" />

    </div>



    <if condition="$show['add_option']">

    <div>$vbphrase[add_tags] <span class="shade">($vbphrase[separate_tags_using_comma])</span></div>

    <div id="tag_add_wrapper"><input type="text" class="bginput" name="taglist" id="tag_add_input" size="50" style="width:300px" tabindex="301" /></div>

    <if condition="$show['tag_limit_phrase']">

    <if condition="!$tags_remain">

    $vbphrase[cannot_add_tags_remove_first]

    <else />

    <phrase 1="$tags_remain">$vbphrase[you_may_add_x_tags_to_thread]</phrase>

    </if>

    </if>

    $vbphrase[tags_visible_all_users]

    </if>

    </div>

    </fieldset>

    </div>

    </div>

    </td>

    </tr>

    </table>

    </form>



    <if condition="$show['popups']">

    <div id="tag_add_wrapper_menu" class="vbmenu_popup" style="display:none"></div>

    <script type="text/javascript" src="clientscript/vbulletin_ajax_tagsugg.js?v=$vboptions[simpleversion]"></script>

    <script type="text/javascript">

    <!--

    vbmenu_register('tag_add_wrapper', true);

    tag_add_comp = new vB_AJAX_TagSuggest('tag_add_comp', 'tag_add_input', 'tag_add_wrapper');

    tag_add_comp.allow_multiple = true;

    tag_add_comp.set_delimiters('$tag_delimiters');

    //-->

    </script>

    </if>



    $footer

    </body>

    </html>



    __________________________________________________________________________________________ ______________________________________



    TAG_EDIT_AJAX



    <form action="threadtag.php?do=managetags&amp;t=$threadinfo[threadid]" id="tag_edit_form" method="post">

    <input type="hidden" name="s" value="$session[sessionhash]" />

    <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />

    <input type="hidden" name="t" value="$threadinfo[threadid]" />

    <input type="hidden" name="do" value="managetags" />



    <div align="center"><div style="width:$stylevar[formwidth]" align="$stylevar[left]">

    <fieldset class="fieldset">

    <legend>$vbphrase[tags]</legend>

    <div style="padding:$stylevar[formspacer]px">

    <if condition="$tag_manage_options">

    <div style="padding-bottom:$stylevar[formspacer]px">$vbphrase[uncheck_tag_remove_bold_you]</div>

    <ul class="floatcontainer" id="tag_edit_list">

    $tag_manage_options

    </ul>

    <hr size="1" style="color:$stylevar[tborder_bgcolor]; background-color:$stylevar[tborder_bgcolor]" />

    </if>





    <div style="float: $stylevar[right]">

    <if condition="$show['add_option']"><div style="visibility:hidden">text</div></if>

    <img src="$stylevar[imgdir_misc]/progress.gif" id="tag_edit_progress" class="inlineimg" style="display:none" alt="" />

    <input type="submit" name="tagsubmit" class="button" value="$vbphrase[save_changes]" accesskey="s" tabindex="302" />

    <input type="button" class="button" value="$vbphrase[cancel]" id="tag_edit_cancel" accesskey="c" tabindex="303" />

    </div>



    <if condition="$show['add_option']">

    <div>$vbphrase[add_tags] <span class="shade">($vbphrase[separate_tags_using_comma])</span></div>

    <div id="tag_add_wrapper"><input type="text" class="bginput" name="taglist" id="tag_add_input" size="50" style="width:300px" tabindex="301" /></div>

    <if condition="$show['tag_limit_phrase']">

    <if condition="!$tags_remain">

    $vbphrase[cannot_add_tags_remove_first]

    <else />

    <phrase 1="$tags_remain">$vbphrase[you_may_add_x_tags_to_thread]</phrase>

    </if>

    $vbphrase[tags_visible_all_users]

    </if>

    </if>

    </div>

    </fieldset>

    </div></div>

    </form>



    <if condition="$show['popups']">

    <div id="tag_add_wrapper_menu" class="vbmenu_popup" style="display:none"></div>

    </if>



    __________________________________________________________________________________________ ______________________________________



    TAG_MANAGEBIT



    <li class="tag<if condition="$tag['ismine']"> mine</if>"<if condition="$tag['username']"> title="<phrase 1="$tag[username]">$vbphrase[added_by_x]</phrase>"</if>>

    <if condition="$show['tag_checkbox']">

    <label for="tag_$tag[tagid]"><input type="checkbox" name="tagskept[]" value="$tag[tagid]" id="tag_$tag[tagid]" checked="checked" />$tag[tagtext]</label>

    <input type="hidden" name="tagsshown[]" value="$tag[tagid]" />

    <else />

    <label for="tag_$tag[tagid]"><input type="checkbox" checked="checked" disabled="disabled" id="tag_$tag[tagid]" />$tag[tagtext]</label>

    </if>

    </li>



    __________________________________________________________________________________________ ______________________________________



    TAG_SEARCH



    $stylevar[htmldoctype]

    <html xmlns="[URL="http://www.w3.org/1999/xhtml%22"]http://www.w3.org/1999/xhtml"[/URL="http://www.w3.org/1999/xhtml%22"] dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">

    <head>

    $headinclude

    <title>$vboptions[bbtitle] - <phrase 1="$tag[tagtext]">$vbphrase[threads_tagged_with_x_title]</phrase><if condition="$pagenumber>1"> - <phrase 1="$pagenumber">$vbphrase[page_x]</phrase></if></title>

    <if condition="$show['inlinemod']"><script type="text/javascript" src="clientscript/vbulletin_inlinemod.js?v=$vboptions[simpleversion]"></script></if>

    </head>

    <body>

    $header

    $navbar



    <if condition="$pagenav">

    <table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-bottom:3px">

    <tr valign="bottom">

    <td align="$stylevar[right]">$pagenav</td>

    </tr>

    </table>

    </if>



    <form action="inlinemod.php" method="post" id="inlinemodform">

    <input type="hidden" name="url" value="$url" />

    <input type="hidden" name="s" value="$session[sessionhash]" />

    <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />



    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" id="threadslist">

    <tr>

    <td class="tcat" colspan="$columncount"><phrase 1="$tag[tagtext]">$vbphrase[threads_tagged_with_x]</phrase></td>

    </tr>

    <tr>

    <if condition="$show['threadicons']">

    <td class="thead" colspan="2">&nbsp;</td>

    <else />

    <td class="thead">&nbsp;</td>

    </if>

    <td class="thead" width="75%">$vbphrase[thread] / $vbphrase[thread_starter]</td>

    <td class="thead" width="150" align="center" nowrap="nowrap">$vbphrase[last_post]</td>

    <td class="thead" align="center" nowrap="nowrap">$vbphrase[replies]</td>

    <td class="thead" align="center" nowrap="nowrap">$vbphrase[views]</td>

    <td class="thead" width="25%">$vbphrase[forum]</td>



    <if condition="$show['inlinemod']">

    <if condition="$show['popups']">

    <td class="vbmenu_control" id="imod" align="center" title="$vbphrase[moderation]"> <script type="text/javascript"> vbmenu_register('imod'); </script> </td>

    <else />

    <td class="thead" align="center">

    <input type="checkbox" name="allbox" id="checkall_all" title="$vbphrase[check_uncheck_all]" onclick="inlineMod.check_all()" />

    </td>

    </if>

    </if>

    </tr>



    $threadbits



    </table>



    <if condition="$show['ajax_js']">

    <script type="text/javascript" src="clientscript/vbulletin_ajax_threadslist.js?v=$vboptions[simpleversion]"></script>

    <script type="text/javascript">

    <!--

    vB_AJAX_Threadlist_Init('threadslist');

    var titlemaxchars = parseInt("$vboptions[titlemaxchars]");

    //-->

    </script>

    </if>





    <if condition="$pagenav">

    <table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-top:3px">

    <tr valign="top">

    <if condition="$pagenav"><td align="$stylevar[right]">$pagenav</td></if>

    </tr>

    </table>

    </if>



    <if condition="$show['inlinemod']">

    <table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-top:3px">

    <tr valign="top">

    <td align="$stylevar[right]">

    <div class="smallfont" style="text-align:$stylevar[left]; white-space:nowrap; float:$stylevar[right]">

    <strong>$vbphrase[moderation]</strong><br />

    <select name="do">

    <if condition="$show['deletethread'] OR $show['spamctrls'] OR $show['openthread'] OR $show['approvethread'] OR $show['movethread'] OR $template_hook['inlinemod_thread_bottom']">

    <optgroup label="$vbphrase[option]">



    <if condition="$show['deletethread']">

    <option value="deletethread">$vbphrase[delete_threads]</option>

    <option value="undeletethread">$vbphrase[undelete_threads]</option>

    </if>



    <if condition="$show['spamctrls']">

    <option value="spamthread">$vbphrase[delete_threads_as_spam]</option>

    </if>



    <if condition="$show['openthread']">

    <option value="open">$vbphrase[open_threads]</option>

    <option value="close">$vbphrase[close_threads]</option>

    </if>



    <if condition="$show['approvethread']">

    <option value="approvethread">$vbphrase[approve_threads]</option>

    <option value="unapprovethread">$vbphrase[unapprove_threads]</option>

    </if>



    <if condition="$show['movethread']">

    <option value="stick">$vbphrase[stick_threads]</option>

    <option value="unstick">$vbphrase[unstick_threads]</option>

    <option value="movethread">$vbphrase[move_threads]</option>

    <option value="mergethread">$vbphrase[merge_threads]</option>

    </if>



    $template_hook[inlinemod_thread_bottom]

    </optgroup>

    </if>

    <optgroup label="____________________">

    <option value="viewthread">$vbphrase[view_selected_threads]</option>

    <option value="clearthread">$vbphrase[clear_thread_list]</option>

    </optgroup>

    </select><input type="submit" class="button" id="inlinego" value="$vbphrase[go]" />

    <script type="text/javascript">

    <!--

    inlineMod = new vB_Inline_Mod('inlineMod', 'thread', 'inlinemodform', '$vbphrase[go_x]');

    //-->

    </script>

    </div>

    </td>

    </tr>

    </table>

    </if>



    </form>



    <if condition="$show['inlinemod'] AND $show['popups']">

    <div class="vbmenu_popup" id="imod_menu" style="display:none" align="$stylevar[left]">

    $threadadmin_imod_menu

    </div>

    </if>



    $footer



    </body>

    </html>


    Comment

    • Lynne
      Former vBulletin Support
      • Oct 2004
      • 26255

      #3
      Help with customizing code is given over on vbulletin.org, the modification site.

      Please don't PM or VM me for support - I only help out in the threads.
      vBulletin Manual & vBulletin 4.0 Code Documentation (API)
      Want help modifying your vbulletin forum? Head on over to vbulletin.org
      If I post CSS and you don't know where it goes, throw it into the additional.css template.

      W3Schools &lt;- awesome site for html/css help

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...