Back to vBulletin 3.0 Add-Ons

Thread Category / Prefix Hack
Mod Version: 1.3.7, by Mystics

This modification is in the archives.
vB Version: 3.0.7 Rating: (3 votes - 5.00 average) Installs: 105
Released: 13 Feb 2004 Last Update: 25 May 2005 Downloads: 85
Not Supported DB Changes  

Thread Category / Prefix Hack

Version: 1.3.7
vBulletin Version: 3.0.7
Developer: Mystics (http://www.vbulletin-germany.com/)
Hack-Language: English & German & French (thanks to ReadWrite)
Install-difficulty: Medium
File-edits: 19
Template-edits: 16


Brief Description of the Hack

With this hack it is possible to assign a category/prefix to a thread. To do this you are able to select an appropriate category from a list beside the title while posting a new thread - for example 'Help', 'Problem', 'Search' etc.

The categories displayed in this list may be defined by a moderator for each of his moderated forums (Forum Tools -> Manage Categories); of course an administrator is allowed to do this for every forum.


Features
  • Moderators are able to create own categories for each of their moderated forums
    (Forum -> Forum Tools -> Manage Categories -> threadcategory.php)
  • Display of the categories on forum display, search results, subscribed threads and within the thread itself
  • It is possible to change the category with editing the first post of a thread or with the thread tools available for moderators at any time
Settings in the Admin CP
  • Maximum categories per forum
  • Thread Category required: Users have to select a thread category for their threads
  • Default Thread Categories: You may set default categories which will either be shown only in forums without own categories or be shown in addition to existing categories
  • Show Thread Categories in extra column or in front of the thread title in the same column
  • Alignment of the categories (if 'Show in extra column' is enabled): Align left, align right, center
  • Show Category in 'Last Post' column
  • Category HTML Markup: Specify an HTML tag with which to display the categories (bold, italic, red etc.)
  • Allow Thread Category search: If enabled, the categories of all forums the user has access to will be grouped in a list and displayed in the search engine.
  • Per Forum: Allow categories in this forum.
Screenshots

See attachments.


Version-History

1.3.7 (02-22-2005 - 09:00 pm)
  • Modified instructions for vBulletin 3.0.7
    (3 more changes within the search_results template)
1.3.6 (01-15-2005 - 06:10 pm)
  • Modified instructions for vBulletin 3.0.5
    (only the third modification of the template FORUMDISPLAY has changed)
1.3.5 (11-02-2004 - 11:00 pm)
  • Bugfix: File: newthread.php
    Preview error with categories containing "&" fixed
1.3.4 (09-25-2004 - 04:00 pm)
  • Update: Template SUBSCRIBE (colspan have to be increased since vB 3.0.2)
  • Bugfix: File: includes/functions_forumlist.php
    Include category length in length of the shown last thread title
1.3.3

Spoiler (click to open)


Small update to 1.3.3:

Edit forumdisplay.php and find:
Code:
 		$pagenav = construct_page_nav($totalthreads, "forumdisplay.php?$session[sessionurl]f=$forumid", "&sort=$sortfield&order=$sortorder&pp=$perpage&daysprune=$daysprune");
Replace it with:
Code:
 		$pagenav = construct_page_nav($totalthreads, "forumdisplay.php?$session[sessionurl]f=$forumid", "&sort=$sortfield&order=$sortorder&pp=$perpage&daysprune=$daysprune" . iif(!empty($_REQUEST['threadcategory']), '&threadcategory=' . urlencode($_REQUEST['threadcategory'])));
Otherwise the selected category got lost when browsing through multiple forumdisplay pages.

Close
(04-08-2004 - 08:55 pm)
  • Bugfix: File: forumdisplay.php
    Selected category got lost when browsing through forum pages
1.3.2

Spoiler (click to open)


New version released:

1.3.2 (03-27-2004 - 05:45 pm)
  • Bugfix: File: clientscript/vbulletin_quickreply.js
    Javascript error when using Quick Reply
  • Modified instructions for vBulletin 3.0.0 'Gold' (only the first modification of postings.php has changed)

To fix the Javascript error, edit the file clientscript/vbulletin_quickreply.js.

Find:
Code:
return validatemessage(fetch_object("qr_message").value, 0, temp_minchars, maxchars, false, tform);
Replace it with:
Code:
return validatemessage(fetch_object("qr_message").value, 0, temp_minchars, maxchars, false, tform, 0);

Close
(03-27-2004 - 05:45 pm)
  • Bugfix: File: clientscript/vbulletin_quickreply.js
    Javascript error when using Quick Reply
  • New: Added modification for postbit_legacy template (same as postbit modification)
  • Modified instructions for vBulletin 3.0.0 'Gold' (only the first modification of postings.php has changed)
1.3.1 (03-06-2004 - 00:20 am)
  • Bugfix

    Spoiler (click to open)


    I have a problem. I installed this hack.. which I love btw.. however I'm getting a display error on in the forums area.. when I staffer/user deletes a thread the deleted information is showing up all funny. (see attachement)

    Anyone know how to fix this? or where to look? I know it's got something to do with table span.. etc.. I think I just need to add a cell to account for the category cell and it should be fine..

    Aceman

    UPDATE: I have fixed the visual problem. This is how I did it.

    EDIT TEMPLATE: threadbit_deleted

    Code:
    <tr>
    	<td class="alt1"><img src="$stylevar[imgdir_statusicon]/thread$thread[statusicon].gif" alt="" /></td>
    	<if condition="$show['threadicons']">
    		<td class="alt2"><if condition="$show['threadicon']"><img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" /><else />&nbsp;</if></td>
    	</if>
    <!-- Accounting for Category Hack -->
    	<if condition="$show['threadcategories'] == 2">
    		<td class="alt1Active" align="$categoryalign" nowrap="nowrap"><if condition="$thread['category']">$categorymarkup[0]$thread[category]$categorymarkup[1]</if></td>
    	</if>
    <!-- Accounting for Category Hack END -->
    	<td class="alt1">
    		<div>
    			<if condition="$show['viewthread']"><span style="float:$stylevar[right]" class="smallfont"><a href="showthread.php?$session[sessionurl]t=$thread[threadid]">$vbphrase[view]</a></span></if>		
    			$thread[typeprefix]
    			<if condition="$show['threadtitle']"><em>$thread[threadtitle]</em></if>
    		</div>
    		<div class="smallfont">
    			<if condition="$show['managethread']"><span style="float:$stylevar[right]"><a href="postings.php?$session[sessionurl]do=editthread&amp;t=$thread[threadid]">$vbphrase[manage]</a></span></if>
    			<if condition="$show['guestuser']">
    				$thread[postusername]
    			<else />
    				<span style="cursor:pointer" onclick="window.open('member.php?$session[sessionurl]u=$thread[postuserid]')">$thread[postusername]</span>
    			</if>
    		</div>
    	</td>
    	<td class="alt2" colspan="3" align="center">
    		<div class="smallfont"><phrase 1="member.php?$session[sessionurl]u=$thread[del_userid]" 2="$thread[del_username]">$vbphrase[thread_deleted_by_x]</phrase></div>
    		<if condition="$show['deletereason']">
    			<div class="smallfont">$vbphrase[reason]: <em>$thread[del_reason]</em></div>
    		</if>
    	</td>
    </tr>
    Adding this to the template fixed my problem.
    Attached Images
    File Type: jpg problem.jpg (243.3 KB, 97 views)

    Close
    : Template: threadbit_deleted
    Incorrect display of category column in this template
1.3 (02-23-2004 - 08:40 pm)
  • Bugfix: Don't display a category in a thread if categories are not allowed in the forum
  • Bugfix: Critical bug in threadcategory.php related to the option 'Update existing threads with changed categories' fixed
Upload the new threadcategory.php as soon as possible!
1.2.1

Spoiler (click to open)


Quote by []\[]emesis
One very minor template error. Check attachment and you will see.
Thank you for discovering this, I really missed that

To fix it, open forumdisplay.php and find:
Code:
 // ### THREAD CATEGORY HACK START ###
// get categories
$threadcategories = fetch_thread_categories($foruminfo, urldecode($_REQUEST['threadcategory']), 0, $vbphrase['all_categories']);
$show['threadcategories'] = 0;
if (!empty($threadcategories) AND $foruminfo['allowcategories'])
{
if (!empty($_REQUEST['threadcategory']))
{
$sorturl .= '&amp;threadcategory=' . urlencode($_REQUEST['threadcategory']);
}
$show['threadcategories'] = 1;
$categorymarkup = array();
$categorymarkup = explode('{1}', $vboptions['categorymarkup']);
if ($vboptions['showcategoryalign'] > 0)
{
$show['threadcategories'] = 2;
switch($vboptions['showcategoryalign'])
{
	case 1:
	 $categoryalign = 'left';
	 break;
	case 2:
	 $categoryalign = 'right';
	 break;
	case 3:
	 $categoryalign = 'center';
	 break;
	default:
	 $categoryalign = 'left';
}
}
} 
// ### THREAD CATEGORY HACK END ###
Move that bunch of code above this code:
Code:
 // get announcements
Now find (still in forumdisplay.php):
Code:
 $sorturl = "forumdisplay.php?$session[sessionurl]f=$forumid&amp;daysprune=$daysprune";
And replace it with:
Code:
 $sorturl = "forumdisplay.php?$session[sessionurl]f=$forumid&amp;daysprune=$daysprune" . $sorturl;
Now edit the template forumdisplay_announcement and find:
Code:
<if condition="$show['threadicons']">5<else />4</if>">
Replace it with:
Code:
<if condition="$show['threadicons']"><if condition="$show['threadcategories'] == 2">6<else />5</if><else /><if condition="$show['threadcategories'] == 2">5<else />4</if></if>">
I will update the hack to v1.2.1 later.

Close
(02-14-2004 - 02:15 pm)
  • Bugfix

    Spoiler (click to open)


    Quote by []\[]emesis
    One very minor template error. Check attachment and you will see.
    Thank you for discovering this, I really missed that

    To fix it, open forumdisplay.php and find:
    Code:
     // ### THREAD CATEGORY HACK START ###
    // get categories
    $threadcategories = fetch_thread_categories($foruminfo, urldecode($_REQUEST['threadcategory']), 0, $vbphrase['all_categories']);
    $show['threadcategories'] = 0;
    if (!empty($threadcategories) AND $foruminfo['allowcategories'])
    {
    if (!empty($_REQUEST['threadcategory']))
    {
    $sorturl .= '&amp;threadcategory=' . urlencode($_REQUEST['threadcategory']);
    }
    $show['threadcategories'] = 1;
    $categorymarkup = array();
    $categorymarkup = explode('{1}', $vboptions['categorymarkup']);
    if ($vboptions['showcategoryalign'] > 0)
    {
    $show['threadcategories'] = 2;
    switch($vboptions['showcategoryalign'])
    {
    	case 1:
    	 $categoryalign = 'left';
    	 break;
    	case 2:
    	 $categoryalign = 'right';
    	 break;
    	case 3:
    	 $categoryalign = 'center';
    	 break;
    	default:
    	 $categoryalign = 'left';
    }
    }
    } 
    // ### THREAD CATEGORY HACK END ###
    Move that bunch of code above this code:
    Code:
     // get announcements
    Now find (still in forumdisplay.php):
    Code:
     $sorturl = "forumdisplay.php?$session[sessionurl]f=$forumid&amp;daysprune=$daysprune";
    And replace it with:
    Code:
     $sorturl = "forumdisplay.php?$session[sessionurl]f=$forumid&amp;daysprune=$daysprune" . $sorturl;
    Now edit the template forumdisplay_announcement and find:
    Code:
    <if condition="$show['threadicons']">5<else />4</if>">
    Replace it with:
    Code:
    <if condition="$show['threadicons']"><if condition="$show['threadcategories'] == 2">6<else />5</if><else /><if condition="$show['threadcategories'] == 2">5<else />4</if></if>">
    I will update the hack to v1.2.1 later.

    Close
    : Template: forumdisplay_announcement
    Wrong 'colspan' value used, if categories are displayed in an extra
    column and forum contains announements in addition
1.2 (02-11-2004 - 11:30 pm)
  • New: Display category in notify mail next to the thread title
  • Bugfix: Improved display of the categories in "Who's Online"
1.1 (02-10-2004 - 11:55 pm)
  • New: Display of last category in the 'Last Post' column (may be disabled in the admin cp)
  • New: Display of hack version in the admin cp at the vBulletin options (for example 'Thread-Category Hack v1.1')
  • Bugfix: Show link to 'Manage Categories, if DHTML menus are disabled
  • Bugfix: Don't show categories from forums where categories are not (longer) allowed
  • Bugfix: Convert HTML code within categories
1.0.1 (02-08-2004 - 11:30 pm)
  • Bugfix: Correct display in "Who's Online" while managing categories
1.0.0 (02-08-2004 - 4:49 pm)
  • First version
Installation
  1. Upload the files categoryinstall.php and categoryinstall_text.php to the admincp directory of your forum
  2. Open this file with your browser:
    http://www.yourdomain.de/forum/admincp/categoryinstall.php
  3. Log in and follow the instructions
  4. You may delete the two files after the installation of the hack
Time needed for installation: approx. 30-60 min.
Tested for version: 3.0.0 RC 3 (and above).

Note: If you have already used the http://people.freenet.de/vbhacks/prefix/prefix.html of this hack (only available in german) and the categories are still stored in the vB3 database, you may convert them for the vB3 version. You will see a note to that in step 2 of the hack installation.


Update hack
  1. Upload the files categoryinstall.php and categoryinstall_text.php to the admincp directory of your forum
  2. Open this file with your browser:
    http://www.yourdomain.de/forum/admincp/categoryinstall.php
  3. Log in, select the version you want to update from (at Step 2 -> 'Update Hack') and follow the instructions
Short overview of the needed modifications

1. Files that need to be edited:
  • editpost.php
  • forumdisplay.php
  • moderator.php
  • newthread.php
  • postings.php
  • search.php
  • showthread.php
  • subscription.php
  • admincp/forum.php
  • clientscript/vbulletin_global.js
  • clientscript/vbulletin_quickreply.js
  • clientscript/vbulletin_stdedit.js
  • clientscript/vbulletin_wysiwyg.js
  • includes/functions.php
  • includes/functions_databuild.php
  • includes/functions_forumlist.php
  • includes/functions_newpost.php
  • includes/functions_online.php
  • includes/functions_search.php
2. New files:
  • threadcategory.php
3. Templates that need to be edited:
  • editor_clientscript
  • editpost
  • FORUMDISPLAY
  • forumdisplay_announcement
  • forumhome_lastpostby
  • newthread
  • postbit
  • postbit_legacy
  • search_forums
  • search_results
  • search_results_postbit
  • SHOWTHREAD
  • SUBSCRIBE
  • threadadmin_editthread
  • threadbit
  • threadbit_deleted
4. New templates:
  • threadcategory_listbit
  • threadcategory_modify
5. New phrases:
  • Too many to list them all - they will be created automatically by the install script
Final words

If the hack doesn't work correct after installation, please verify all modifications you have made within the files and the templates. Be sure you have uploaded all edited and new files.

The hack was tested extensive and will function properly if installed correct.

Thanks to ReadWrite for his french translation.

Have fun with the hack.

Please click Install if you have installed it

Download

This modification is archived and cannot be downloaded.

Screenshots

       

   

Similar Mods

Mini Mods Prefix in the url of thread 1.0 vBulletin 3.7 Add-ons

vblts.ru supports vBulletin®, 2022-2024