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)

paulmjno 12-18-2007 02:28 PM

^ Moment of stupidity. It's all in the "thread" table. Will see what I can whip up. :D

paulmjno 12-18-2007 02:46 PM

Mwahaha! I've done it. ;) Easy peasy. I'll post some code here - I'm not really one for writing scripts for other people (with the random problems people run into), but this should assist someone else (I've used the ezSQL class here):

PHP Code:

<?php

include_once("db.php");

$threads $db->get_results("SELECT threadid, threadprefix FROM thread");

foreach (
$threads as $thread) {
    if (
$thread->threadprefix) {
        
$db->query("UPDATE thread SET prefixid = '" strtolower($thread->threadprefix) . "' WHERE threadid = $thread->threadid");
    }
    print 
"Done threadid: {$thread->threadid}<br />";
}

?>

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

Pottsy 12-19-2007 06:14 PM

Quote:

Originally Posted by paulmjno (Post 1403622)

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!

paulmjno 12-20-2007 01:01 AM

Dude, it was real easy for me. All of my thread prefixes have been transfered over. All I did was create my old prefixes in 3.7 admincp, the prefixids matched my old prefixes.

Pottsy 12-20-2007 04:17 AM

I see what you've done. It works, so long as your existing prefixes have no spaces in, and you only have one "set" of prefixes. My different forum id's all have different sets, and I have spaces in my old prefixes. :(

Hoffi 12-20-2007 09:49 AM

The Spaces can not be a big Problem. With only one Query you can turn all Spaces to Underscore that can be used in the native Prefix Mod.

It's just the Problem to create hundreds of Prefix-Sets by Hand.

Pottsy 12-20-2007 02:08 PM

I am half way there.... :)

Pottsy 12-21-2007 06:35 AM

OK, I have written a script that does the whole job of converting to 3.7.

To keep things separate, I've posted it here:

https://vborg.vbsupport.ru/showthread.php?t=165761

hyppa 01-06-2008 05:34 PM

I hvae to reinstall all of it because it f...t up my forum, i can not see new threads or anything.

This is the message i get.

Parse error: syntax error, unexpected $end in /home/3/h/hjornet/www/hjornet/includes/functions_databuild.php on line 1841

what is the easiest way to get by this??

hyppa 01-06-2008 07:57 PM

Had to upload and revert the templates to fix it.


All times are GMT. The time now is 05: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.02518 seconds
  • Memory Usage 1,745KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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