Thread: Miscellaneous Hacks - Thread Prefixes
View Single Post
  #414  
Old 12-19-2007, 06:14 PM
Pottsy Pottsy is offline
 
Join Date: Sep 2006
Location: UK
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by paulmjno View Post

What I've done is pre-created the native thread prefixes matching the ones I currently use.

If only it were that easy (it doesn't work!!).


For each old forum that had prefixes, you need a new prefixset.

Table: prefixset
prefixsetid, varchar(25), for example if we are reading forumid 14, import14
displayorder, int(10)


The prefixset title needs to be inserted into the phrase table:

Table: phrase

languageid: 0
fieldname: prefix
product= vbulletin
text = prefix set title (eg "imported from forum 14, Off topic")
varname: prefixset_xx_title

where xx = prefixsetid eg prefixset_import14_title


This prefixsetid has to be assigned to the forum number:

Table: forumprefixset

forumid, int(10), eg 14
prefixsetid, varchar(25)


In each prefixset, the individual prefix ids are inserted:

Table: prefix

prefixid, varchar(25), no spaces! so maybe forumid like 14_001 then 14_002 etc. If you had 10 prefixes in forum 14, then we need 10 prefixids.
prefixsetid, varchar(25), from above
displayorder, int(10)

Each prefixid needs the prefix text read from the original thread prefix list for the forum inserted into 2 fields (title plain text and rich text). These are stored in the phrase table:


languageid: 0
fieldname: global
product= vbulletin
text = the old thread prefix text
varname: prefix_xx_yy

where

xx = prefixid
yy = title_rich or title_plain

eg prefix_import14_title_plain


Then each thread in the forum with a prefix from the old system has the corresponding new prefixid inserted into it:

Table: thread

prefixid, varchar(25)


The only bit I'm not sure about is:


Table: forum

lastprefixid, varchar(25)


Repeat for all forums.
Optionally transfer forum settings from old to new (mandatory thread prefix etc, but this can easily be done manually).
Finally, you have to rebuild languages.


Right, there's the challenge!
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01189 seconds
  • Memory Usage 1,766KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete