vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - Thread Prefixes (https://vborg.vbsupport.ru/showthread.php?t=123033)

Mystics 08-03-2006 10:00 PM

Thread Prefixes
 
Thread Prefixes

Version: 1.6.2
vBulletin Version: 3.6.10
Developer: Michael (Mystics) Koenig (www.vbulletin-germany.com)
Modification-Language: English & German & French (thanks to ReadWrite - Note: Readme has not yet been translated to french.)
Install-difficulty: Medium
File-edits: 5
Template-edits: 10


Brief Description of the Modification

This modification allows your users to choose a thread prefix for each thread. To do this you are able to select an appropriate prefix from a list beside the title while posting a new thread - for example 'Help', 'Problem', 'Search' etc.

This prefix will be displayed in front of the thread title. The result will be for example:
Problem - I can't find this setting

Problem is the thread prefix, I can't find this setting is the title of the thread.

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


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

See attachments.


Version-History

1.6.2 (2008-05-24 - 9:30 pm CET)
  • Fixed XSS security issue:
    Import the updated xml file (product-threadprefix_*.xml) to fix the security issue!
  • Changes for vBulletin 3.6.10 (Updated Template modifications)
  • Bugfix: It's possible again to search for prefixes
  • Installation script prefixinstall.php now works with IE7 too.
1.6.1 (2006-08-29 - 11:30 pm CET)
  • Bugfix: It's possible again to change the prefix by editing the first post of a thread.
  • Bugfix: The prefix will be forwarded correctly and without an error to the advanced editor while editing the first post via AJAX.
  • New: Thread Prefixes for discussion threads for user infractions and reported posts.
    You can enter those thread prefixes within your vBulletin settings.
  • New: Ability to sort the thread prefixes in descending order.
    (Forum Tools -> Manage Thread Prefixes)
  • New: Version check for the Thread Prefix Product within the AdminCP.
  • Import the updated xml file (product-threadprefix_*.xml) and upload the updated file /upload/threadprefix.php to your server.
1.6.0 (2006-08-04 - 07:00 pm CET)
  • Changes for vBulletin 3.6.0
  • Because you have to upload all files of vBulletin 3.6, there are no instructions for the update. Just follow the standard instructions for the file and template changes.
  • Fixed error within the search engine.
  • New: Prefixes are displayed within Content Syndication (external.php)
  • Do not forget to import the updated xml file (product-threadprefix_*.xml)!
1.5.5 (2006-04-09 - 03:00 pm CET)
  • Fixed database error within the search engine.
    (if prefix was selected and results were shown as posts)
  • Just import the updated xml file.
1.5.4 (2006-03-20 - 01:30 am CET)
  • Fixed small error within the search engine.
  • Just import the updated xml file.
1.5.3 (2006-03-19 - 03:30 pm CET)
  • Changes in includes/class_dm_threadpost.php for vB 3.5.4
  • Changes in includes/functions_threadprefix.php for vB 3.5.4
  • New: Search for prefixes only is now possible (without keywords)
  • New: Prefixes are displayed in "Similar Threads"
  • New: Separator between prefix and thread title within threads/emails may now be defined in your Admin Control Panel (used to be always " - ").
  • New: Save Thread Prefix in Search Preferences
1.5.2 (2005-11-03 - 07:30 pm CET)
  • Missing phrase: updateprefixes
  • Fixed small error in /threadprefix.php
1.5.1 (2005-11-02 - 09:30 pm CET)
  • First version for vBulletin 3.5.1
1.5.0 (2005-11-02 - 09:30 pm CET)
  • First version for vBulletin 3.5.0 (only one file edit more because of a missing hook)
Installation
  1. Upload all files from the upload directory to your vBulletin directory on your server.

    Overview of the files and corresponding directories:
    • /threadprefix.php
    • /admincp/prefixinstall.php
    • /admincp/prefixinstall_text.php
    • /includes/functions_threadprefix.php
  2. Import the file "product-threadprefix_english.xml" with 'Manage Products':
    Admin Control Panel -> Plugin System -> Manage Products ->
    [Add/Import Product] -> Select file -> Import
  3. Open this file with your browser:
    http://www.yourdomain.com/forum/admincp/prefixinstall.php
  4. Log in as administrator and follow the instructions
Time needed for installation: approx. 30 min.
Tested for version: 3.5.0 (and above).

Note: If you have used the Thread Category / Prefix Hack in vBulletin 3.0.x, don't worry: all existing prefixes will be imported during the installation. You just have to re-do your thread prefix settings in your vBulletin Options.

Update Product
  1. Upload all files from the upload directory to your vBulletin directory on your server.

    Overview of the files and corresponding directories:
    • /threadprefix.php
    • /admincp/prefixinstall.php
    • /admincp/prefixinstall_text.php
    • /includes/functions_threadprefix.php
  2. Import the file "product-threadprefix_english.xml" with 'Manage Products':
    Admin Control Panel -> Plugin System -> Manage Products ->
    [Add/Import Product] -> Select file -> Import

    You have to select 'Allow Overwrite' -> 'Yes' before clicking on Import!
  3. Open this file with your browser:
    http://www.yourdomain.com/forum/admincp/prefixinstall.php
  4. Log in, select the version you want to update from (at Step 2 -> 'Update Modification') and follow the instructions.
Short overview of the needed modifications

1. Files that need to be edited:
  • /showthread.php (Display prefix in 'Similar Threads')
  • /clientscript/vbulletin_textedit.js (JavaScript error message if no prefix was selected)
  • /includes/class_dm_threadpost.php (Prefix within emails to moderators)
  • /includes/functions_databuild.php (Update prefix in column 'Last Post' for mod functions)
  • /includes/functions_online.php (Display prefix in 'Who's online')

    It is your decision if you need the above functions or if you decide do use the product without file modifications!
    You don't have to do the file modifications as the product will work even though without them!
2. New files:
  • /threadprefix.php
  • /includes/functions_threadprefix.php
3. Templates that need to be edited:
  • editpost
  • FORUMDISPLAY
  • newthread
  • search_forums
  • search_results
  • SUBSCRIBE
  • threadadmin_editthread
  • threadbit
  • threadbit_announcement
  • threadbit_deleted
4. New templates:
  • threadprefix_listbit
  • threadprefix_modify
5. New phrases:
  • Too many to list them all - they will be created automatically while importing the xml file
Final words

If the modification 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 modification was tested extensive and will function properly if installed correct.

Thanks to ReadWrite for his french translation.

Special Thanks to Andreas for his help with the hooks.

Have fun with the modification!

Please click Install if you have installed it :)

Mike

firstrebel 08-04-2006 04:28 PM

Thanks for the vB 3.6 update version.

Bob

X Quiz 08-04-2006 05:30 PM

Thanks alot!

*Install*

Benj 08-04-2006 08:27 PM

couple of questions :D

has anyone tried using this with GARS? does it work ok ?
how hard would it be to make a "newest threads with prefix" block for vbadvanced?

Slave 08-04-2006 08:42 PM

Any change of making it so you can use the colour tag when you enter a prefix?

Ascor 08-04-2006 10:52 PM

Thanks for the update

*Install

snowlion 08-05-2006 01:16 AM

thank Mystics for updated

HMBeaty 08-05-2006 01:55 AM

Might have to test this out, could possibly use this in the future.

Wolf42 08-05-2006 07:21 AM

Thx for the update Mike!!

/me clicks install!

GNDI 08-05-2006 09:06 AM

Thanks, I'll be wathing this before installing

Snake 08-05-2006 04:35 PM

Thanks for this! :)

BlueEyesOnly 08-05-2006 06:42 PM

very great. many thanks. that was fast :D

JollyJack 08-10-2006 08:10 PM

iam having a few problems with this, i am running two styles on my forum.

Enlighten
splashblue

ths is working great in splashblue, but in enlighten the stickys have moved themselves in the prefix box,

http://www.sharewithus.co.uk/forums/...splay.php?f=47
this is the splashblue page

http://www.sharewithus.co.uk/forums/...f=47&styleid=2
this is the style its gone funny on

i have checked it over and i am sure i have done it right, and i know these hacks are done for none modded styles, but could you have a look at these 2 pages and tell me where in your template changes i need to look abit closely again.

Thanks great hack

bing11 08-15-2006 11:54 AM

very nice thank you

nix 08-17-2006 08:41 PM

Nice hack! Thanks!

ForumDog 08-18-2006 03:41 PM

I see it's not currently possible :) but a suggestion for the future: For the automatic creation of Reported Posts and Infractions threads it would be quite cool to be able to have them created with a prefix.

Or come to that, allow other plugins that create threads to make use of the Thread Prefix plugin if it is installed.

Regardless, superb plugin as it is, thank you.

Kriminal 08-18-2006 04:07 PM

Quote:

Originally Posted by ForumDog
I see it's not currently possible :) but a suggestion for the future: For the automatic creation of Reported Posts and Infractions threads it would be quite cool to be able to have them created with a prefix.

Or come to that, allow other plugins that create threads to make use of the Thread Prefix plugin if it is installed.

Regardless, superb plugin as it is, thank you.

That would be WONDERFUL!

Dennis Olson 08-19-2006 05:20 PM

Just installed vB 3.6.0. In your installation instructions for file modifications, when I edit

showthread.php

looking for: thread.title

I cannot find that text, except in a comment line and as part of the SELECT. Any ideas?

Dennis Olson 08-19-2006 08:50 PM

Okay, I figured that out (sorry about that). HOWEVER, when I have my individual forum set to require prefixes, and then I don't enter one, I don't get the error message. Where should I go to fix this, and what might be wrong? I edited the js file just as I was supposed to.

Dennis Olson 08-19-2006 11:58 PM

*sigh*

I hate it when I'm an idiot. Issue resolved....

rnmcd 08-20-2006 03:27 AM

Quote:

Originally Posted by Dennis Olson
*sigh*

I hate it when I'm an idiot. Issue resolved....

Dennis, what was your fix?

Dennis Olson 08-20-2006 01:02 PM

There's an option in the AdminCP to "Require prefixes". I'd left that set to OFF, which is the default when the hack is installed. I set it to "By Forum" (or whatever it says) and then went into the Forum Manager for certain forums and set it to Required = Yes there.

I DO have a legitimate issue now though (and it MAY be my own fault, but I'd welcome a little input). For threads that currently have no profix, when I go to Quick Edit, then select Go Advanced, I naturally get the error notice to Select a prefix. I do that, then click SAVE. BUT - the prefix DOES NOT GET ADDED to the thread.

This only happens on EDIT, not on post a new thread, which works perfectly. Any ideas out there folks?

Mystics 08-20-2006 01:12 PM

Quote:

Originally Posted by Dennis Olson
There's an option in the AdminCP to "Require prefixes". I'd left that set to OFF, which is the default when the hack is installed. I set it to "By Forum" (or whatever it says) and then went into the Forum Manager for certain forums and set it to Required = Yes there.

I DO have a legitimate issue now though (and it MAY be my own fault, but I'd welcome a little input). For threads that currently have no profix, when I go to Quick Edit, then select Go Advanced, I naturally get the error notice to Select a prefix. I do that, then click SAVE. BUT - the prefix DOES NOT GET ADDED to the thread.

This only happens on EDIT, not on post a new thread, which works perfectly. Any ideas out there folks?

I noticed this too. It did work in vB 3.5. I will fix it in the next version.

Dennis Olson 08-20-2006 02:18 PM

One feature you might also consider:

Copying the DEFAULT prefixes from a forum where they're already defined. For example, I'd defined all the prefixes for my "general" room, then had to copy/paste those into the defaults in AdminCP after-the-fact. (Redundant, yes I know, but I had my reasons.) It might be nice to have an option like:

SET DEFAULTS FROM THIS FORUM:

Which would do that automatically. This might be useful if you wanted to instantly and globally change your default prefixes.

Just a thought...

yellowbird 08-20-2006 07:18 PM

I'm trying to install this and I *believe* I've made the correct edits. It doesn't appear to be the case though as when I click on 'Forum Tools' I don't have the 'Manage Thread Prefixes' option. Any idea where to look for the error?

Thanks!

antialiasis 08-20-2006 10:45 PM

I have one quick question:

Have the template edits changed at all since the 3.5 version? I'm upgrading now, but not reverting all my templates (preferring to update them manually) and I'm just wondering if I have to check every one of the template edits to see if they're still the same as before or not...

marlita 08-21-2006 12:29 AM

:ermm: *deep sigh* ok, so I thought I was paying attention when I installed this, but now I get this error when I try to read/edit/create posts:
Code:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /forum/showthread.php on line 2

Parse error: syntax error, unexpected T_STRING in /forum/showthread.php on line 2

:confused: I don't even know what parse means, let alone that whole message. Any help would be appreciated! Oh, and feel free to check out what i mean by clicking on any post at http://virginiareia.com/forum/index.php. I just hope that it didn't cause any other errors & that this one can be fixed.

Thanks!

nix 08-21-2006 12:31 AM

open showthread.php and see whats wrong with line 2.

marlita 08-21-2006 12:36 AM

=/ Yeah, I tried that, but I can't figure out what line 2 is... not only that, as far as i can tell, the only change i made to the showthread.php was way down low... i don't think it was line 2... any other suggestions? i'm open to them.

thanks.

nix 08-21-2006 12:54 AM

google a program called editplus. Use that to open the file. Line 2 is just two lines down. maybe you hit a key and didn't realize it or something.

mine looks like this.

Quote:

/*================================================= =====================*\

marlita 08-21-2006 04:20 AM

:surprised: argh! so i got the original showthread, which prior to altering it for this mod, had, to my knowledge been the same. i replaced my showthread with that one, and even without making the necessary showthread changes, i was able to access my posts again... of course, i went back and made the changes and all was good... OR SO I THOUGHT! =(

Now I don't have control over my quick reply button, nor do i have access to change the font, size or color... who knows what else... within the post...

Please help!

Thank you!

PS - you may log into my forum at http://www.virginiareia.com with Username: test & password: test if you'd like. Thank you.

Mystics 08-21-2006 02:02 PM

Quote:

Originally Posted by antialiasis
I have one quick question:

Have the template edits changed at all since the 3.5 version? I'm upgrading now, but not reverting all my templates (preferring to update them manually) and I'm just wondering if I have to check every one of the template edits to see if they're still the same as before or not...

You should pay attention to newthread, editpost and SUBSCRIBE.
Quote:

Originally Posted by yellowbird
I'm trying to install this and I *believe* I've made the correct edits. It doesn't appear to be the case though as when I click on 'Forum Tools' I don't have the 'Manage Thread Prefixes' option. Any idea where to look for the error?

Check your FORUMDISPLAY template.

marlita 08-21-2006 02:08 PM

Mystics, do you have an idea as to what I may have done wrong that would have caused my quickedit & wysiwyg to stop working? my forum is located at http://www.virginiareia.com and the sign in and password are both set to 'test'. Any help is appreciated.

Thank you!

Mystics 08-21-2006 02:08 PM

Quote:

Originally Posted by marlita
Now I don't have control over my quick reply button, nor do i have access to change the font, size or color... who knows what else... within the post..

Take a look at your file:
http://virginiareia.com/forum/client...in_textedit.js

You never ever should edit php or *.js files with programs like Word - and if you have to, save it as plain text.

Take the original vbulletin_textedit.js, open it with Notepad and do the modifications again. Upload the file and be happy :)

(you might wanna check the other modified files as well...)

marlita 08-21-2006 02:13 PM

Thank you, I will try those right now! I hope you're still online by the time I'm done lol. It's funny, I used to always use Notepad, but then I read in one of these forums that I should use Word. *sigh* live and learn.

Thanks again. I'll post soon.

marlita 08-21-2006 02:25 PM

:D Oh, thank you so much! It worked! I'm nervous to check the others, but I know I should.

Sidenote: is it possible to have more than one prefix?

Thanks again!

PS - I've removed the test username & password.

PPS - In case this happens to anyone else: what happened to me was that somehow when I saved, it added /pars to the end of each line, probably because i was saving in rich text format. it created a mess, so nothing was working. Just make sure that this doesn't happen to you. It was a crazy pain to undo. :-)

yellowbird 08-21-2006 03:16 PM

Quote:

Originally Posted by Mystics
Check your FORUMDISPLAY template.

Any idea specifically where in this template?

Thanks... I'll take a look.

yellowbird 08-21-2006 05:45 PM

Quote:

Originally Posted by yellowbird
Any idea specifically where in this template?

Thanks... I'll take a look.

Found it. Thanks mystics!

yellowbird 08-21-2006 06:39 PM

Another question:

I see at the bottom under display options you can select to display only threads with a certain prefix. It's a great feature but I'd like to integrate it more. What code do I need to use to actually link the name of the prefix to that sort option?

So for example if the prefix was 'version 2', I want to make that 'version 2' prefix text a link so that when it's clicked on it does what the display option does and only shows threads with 'version 2' as the prefix. What code do I need to do this?

I found where the prefix is in the threadbit template and I looked that the code for the display option but I don't know how to write the code to bring pull and pass on the prefix dynamically.

Thanks in advance for your help.

Dennis Olson 08-22-2006 03:48 PM

One more issue:

On the INDEX page (index.php), in the Last Post column, if the latest thread DOES NOT have a prefix, the prefix from whatever one HAS a prefix is used. In my screen-cap below, the thread specified does not have a prefix. However, the thread immediately under that (in the forumdisplay for that room) has the prefix "DOGS". So DOGS is shown as the prefix for the Last Post, even though it has no prefix at all.


All times are GMT. The time now is 01:25 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01692 seconds
  • Memory Usage 1,857KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete