Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Template Modifications
Pre-Defined Topic Tags for Zoints Thread Tags Details »»
Pre-Defined Topic Tags for Zoints Thread Tags
Version: 1.00, by SBlueman SBlueman is offline
Developer Last Online: Dec 2013 Show Printable Version Email this Page

Category: New Posting Features - Version: 3.6.8 Rating:
Released: 10-06-2007 Last Update: Never Installs: 5
Template Edits
 
No support by the author.

I run a NFL Football Forum at GridironFans.com, and we pride ourselves in bringing all the latest NFL news to the members of our community. We have one forum where I post all the NFL news. The forum is closed to posting new threads to everyone except for a group called "NFL News Reporters". When this group posts news they are required to to enter topic tags for each story. We use the Zoints Topic Tag Mod. People who use this modification should be used to this field:



On our site though the reporters are required to use pre-determined tags. How do they do this? By clicking on them from this field:



We use a custom code that replaces the default topic tagentry field with this pre-defined list. They click on the tags to select them and the tags are then added to each post. How did we pull this off? By using a custom code. I edited the "zointstags_tagform" template to this:

Code:
<br>
<!-- zoints tags field -->
<fieldset class="fieldset" style="margin:0px 0px 0px 0px">
		<legend>You Must Click Once On The Applicable Topic Tags:</legend>
		<div style="padding:$stylevar[formspacer]px">
			<table cellpadding="0" cellspacing="$stylevar[cellspacing]" border="0" width="95%">
<tr>
	<td><input type="hidden" class="bginput" id="tags" name="zointstags" value="$zointstags" size="40" tabindex="1" /></td>
</tr>
<tr>
<td><!-- BEGIN Topic Tags - TMO -->             
              <td width="100%" class="row1"><span class="gen"> 
                <style type="text/css">
	.selected { background-color: #7777FF; }
	.unselected { background-color: transparent; }
#popularTags span { font-size: 11px; font-family: monospace; }
#popularTags {width: 100%;}
</style>
                <script type="text/javascript">

Array.prototype.contains = function (ele) {
    for (var i = 0; i < this.length; i++) {
        if (this[i] == ele) {
            return true;
        }
    }
    return false;
};

Array.prototype.remove = function (ele) {
    var arr = new Array();
    var count = 0;
    for (var i = 0; i < this.length; i++) {
        if (this[i] != ele) {
            arr[count] = this[i];
            count++;
        }
    }
    return arr;
};

window.onload = function () {
        var taglist = document.getElementById('tags');
	taglist.value = taglist.value.replace (/\s+/g,'');  // strip space
        var tags = taglist.value.split(',');
        
        var populartags = document.getElementById('popularTags').getElementsByTagName('span');
        
        for (var i = 0; i < populartags.length; i++) {
            if (tags.contains(populartags[i].innerHTML)) {
                populartags[i].className = 'selected';
            }
        }
}

function doTag(ele) {
    var thisTag = ele.innerHTML;
    var taglist = document.getElementById('tags');
    var tags = taglist.value.split(',');
 
    // If tag is already listed, remove it
    if (tags.contains(thisTag)) {
        tags = tags.remove(thisTag);
        ele.className = 'unselected';
        
    // Otherwise add it
    } else {
        tags.splice(tags.length-1, 0, thisTag);
        ele.className = 'selected';
    }
    
    taglist.value = tags.join(',');
    document.getElementById('tags').focus();
}
</script>
                <table id="popularTags">
                  <tr> 
                    <td colspan=4><span onclick="doTag(this)">afc</span></td>
                    <td colspan=4><span onclick="doTag(this)">nfc</span></td>
                  </tr>
                  <tr> 
                    <td><span onclick="doTag(this)">afceast</span></td>
                    <td><span onclick="doTag(this)">afcnorth</span></td>
                    <td><span onclick="doTag(this)">afcsouth</span></td>
                    <td><span onclick="doTag(this)">afcwest</span></td>
                    <td><span onclick="doTag(this)">nfceast</span></td>
                    <td><span onclick="doTag(this)">nfcnorth</span></td>
                    <td><span onclick="doTag(this)">nfcsouth</span></td>
                    <td><span onclick="doTag(this)">nfcwest</span></td>
                  </tr>
                  <tr> 
                    <td><span onclick="doTag(this)">bills</span></td>
                    <td><span onclick="doTag(this)">bengals</span></td>
                    <td><span onclick="doTag(this)">colts</span></td>
                    <td><span onclick="doTag(this)">broncos</span></td>
                    <td><span onclick="doTag(this)">cowboys</span></td>
                    <td><span onclick="doTag(this)">bears</span></td>
                    <td><span onclick="doTag(this)">buccaneers</span></td>
                    <td><span onclick="doTag(this)">49ers</span></td>
                  </tr>
                  <tr> 
                    <td><span onclick="doTag(this)">dolphins</span></td>
                    <td><span onclick="doTag(this)">browns</span></td>
                    <td><span onclick="doTag(this)">jaguars</span></td>
                    <td><span onclick="doTag(this)">chargers</span></td>
                    <td><span onclick="doTag(this)">eagles</span></td>
                    <td><span onclick="doTag(this)">lions</span></td>
                    <td><span onclick="doTag(this)">falcons</span></td>
                    <td><span onclick="doTag(this)">cardinals</span></td>
                  </tr>
                  <tr> 
                    <td><span onclick="doTag(this)">jets</span></td>
                    <td><span onclick="doTag(this)">ravens</span></td>
                    <td><span onclick="doTag(this)">texans</span></td>
                    <td><span onclick="doTag(this)">chiefs</span></td>
                    <td><span onclick="doTag(this)">giants</span></td>
                    <td><span onclick="doTag(this)">packers</span></td>
                    <td><span onclick="doTag(this)">panthers</span></td>
                    <td><span onclick="doTag(this)">rams</span></td>
                  </tr>
                  <tr> 
                    <td><span onclick="doTag(this)">patriots</span></td>
                    <td><span onclick="doTag(this)">steelers</span></td>
                    <td><span onclick="doTag(this)">titans</span></td>
                    <td><span onclick="doTag(this)">raiders</span></td>
                    <td><span onclick="doTag(this)">redskins</span></td>
                    <td><span onclick="doTag(this)">vikings</span></td>
                    <td><span onclick="doTag(this)">saints</span></td>
                    <td><span onclick="doTag(this)">seahawks</span></td>
                  </tr>
                  <tr> 
                    <td><span onclick="doTag(this)">nfl</span></td>
                    <td><span onclick="doTag(this)">draft</span></td>
                    <td><span onclick="doTag(this)">injury</span></td>
                    <td><span onclick="doTag(this)">legal</span></td>
                    <td><span onclick="doTag(this)">rumor</span></td>
                    <td><span onclick="doTag(this)">score</span></td>
                    <td><span onclick="doTag(this)">topstory</span></td>
                    <td><span onclick="doTag(this)">transaction</span></td>
                  </tr>
                </table>
                <br/>
                <b>NOTE:</b> The 'nfl' tag is for league news only. You do not 
                have to tag everything with 'nfl'. 
                <!-- END Topic Tags - TMO --></td>
</tr>
</table></fieldset>
<!-- / zoints tags field -->
Now....once a story is posted they get grouped into the tags used. So say I want to check out the latest headlines for a particular team. On my site people can click on my custom navbar and choose the team, division, conference and other tags (League News, NFL Draft, Injury News, Legal News, NFL Rumors, Top Stories, Transactions, Scores). If I want to check out the latest headlines for the Bills I would click on "Buffalo Bills" under the AFC menu and it brings up all the NFL news posted for the Bills.

To create your own pre-defined list of tags just edit the table and the text within. Some basic html knowledge will be needed for this.

I hope people found this post informative and helpful. I am greatful to the people at Zoints for their great modification. I wish I could give support for this but I am still learning about vbulletin myself and am not 'up to speed' with many of the coders here. Hopefully this helps people as a step in the right direction if this is a feature they'd like on their site.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 10-07-2007, 03:12 AM
bdude's Avatar
bdude bdude is offline
 
Join Date: Dec 2005
Location: Australia
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Neat template mod, it'd be great if someone could convert this into a full-on hack, with admincp editable options and such
Reply With Quote
  #3  
Old 10-07-2007, 03:26 AM
SBlueman SBlueman is offline
 
Join Date: Jan 2006
Posts: 717
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah that would be great. I wish I had the know-how.

I also posted some ideas on additions that would be great for this modification:

Modification to Zoints Thread Tag Mod

One idea is RSS feeds for each topic tag and another idea is inline links for topic tags in posts. If I only knew how...
Reply With Quote
  #4  
Old 10-17-2007, 12:58 AM
kether1 kether1 is offline
 
Join Date: Jun 2006
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This looks promising! It would be great if a coder could set this up to work so that there were different tag options for different sections of a forum. For instance, one section of my forum might deal with short story publications where another might deal with writing techniques. If one could force users to select tags from a pre-determined list, it would help organize information and help with SEO (by selecting tags that are key to your particular forum).

Thanks. I plan to keep an eye on this modification.

K
Reply With Quote
  #5  
Old 10-17-2007, 04:42 AM
SBlueman SBlueman is offline
 
Join Date: Jan 2006
Posts: 717
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If anyone wants to take this modificaton up please feel free to do so. I am not a coder by any means and was just sharing what was on my site. It's a custom code that a member of my site put together for us. He's since left the site and doesn't code because his work schedule is way too hectic.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:56 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08804 seconds
  • Memory Usage 2,255KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete