View Full Version : Thread Prefixes upgrade from Mystics to 3.7
Thread prefixes upgrade.
This script upgrades the old Thread Prefixes hack by Mystics to the new thread prefixes found in 3.7+. The only guarantee is that it works on my test server, going from 3.6.8 to 3.7.0B3.
It is a one-run operation. The script reads the details of the old thread prefix system from your database, and then writes new entries for the new system into your database. The code is rough and ready (OK, it's my first ever script), so do NOT use it unless you have backed up your database and are prepared to restore it.
It will create a fully populated prefixset for each forum with prefixes, and then assign the prefixes to the threads in that forum.
The rich text format of the new prefix is set to be bold with square brackets around, although if you want to change that you can edit tpup.php (there is a commented out version of the query, that will make the text plain - it should be obvious).
Instructions.
1. Upgrade to 3.7 and revert all templates.
2. Open dp.php in a text editor and enter your database login details.
3. Upload all 4 .php files to a new folder on your server (or test server).
4. Backup your database.
5. Browse to tpup.php in your browser to run it.
6. When it's done, close the browser window and delete the files from your server.
7. Now you must rebuild all languages in AdminCP > Languages & Phrases > Language Manager > Rebuild All Languages. If you miss this step, nothing will work!
8. Please report any success or failure in this thread.
Versions:
1.00 First go.
1.01 Added the facility to specify a database table prefix.
1.04 Got the table prefix right, thanks to Mystics.
I have only tested this on my forum, on a test server.
I would suggest testing this on a test server first, until we have had a bit of feedback. If it works for you, please post your success (or not) here.
Delazar
21 Dec 2007, 11:02
Hi Pottsy,
for my system your add-on doesnīt work, because the system accept the tableprefix.
My tapleprefix is fantasy.
regards
Delazar
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Delazar,
Have a go with ver 1.01. There is now another variable you can specify in db.php where you can enter your table prefix.
Delazar
21 Dec 2007, 12:59
Sorry, but the tableprefix is still not being accepted.
regards
Delazar
Warning: Table 'vbtest.forum' doesn't exist in /var/www/xxx/htdocs/test/ez_sql_mysql.php on line 204
Warning: Invalid argument supplied for foreach() in /var/www/xxx/htdocs/test/tpup.php on line 10
Done.
Now you MUST rebuild all languages in AdminCP > Languages & Phrases > Language Manager > Rebuild All Languages.
my db.php
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Mystics
21 Dec 2007, 13:08
Remove this line in tpup.php:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
And change:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Dalazar,
Just updated it.
Mystics, if I remove that line, then it errors because the table name is tableprefixtable not tableprefix.table. Have I missed something?
PS thanks for dropping by, and many thanks for the original hack!
Mystics
21 Dec 2007, 13:26
You can't just add "." to the table prefix as the user itself has to choose if and which delimiter he uses. Most users uses "_", not "." :)
Just compare it with the vBulletin Code, they don't add "." to the prefix.
FROM " . TABLE_PREFIX . "forum AS forum
You may define such a prefix for example:
$config['Database']['tableprefix'] = 'vb3_';
Aha!
Can you tell I picked up a "How to program php" book 2 days ago?
I'll make the appropriate changes.
Delazar
21 Dec 2007, 13:45
Thanks Pottsy and Mystics,
itīs working now:up:
regards
Delazar
Thanks a lot. Will try it soon - and give my vote for MOTM :)
Great converter - works perfectly on my testboard.
Thanks for this.
Okay, tested, working well, nominated for MOTM :)
Thank you again!
DS MrSinister
21 Dec 2007, 19:39
thanks for sharing... works great..
:D:D:D
just so im understanding .......
i must have your original from http://www.vbulletin.org/forum/showthread.php?t=123033 installed on my 3.6.x board before i try the upgrade to 3.7
then once i upgrade to 3.7 i have to use this to convert over so it will work again?
id love to use this .... just want to be clear.
thanks
just so im understanding .......
i must have your original from http://www.vbulletin.org/forum/showthread.php?t=123033 installed on my 3.6.x board before i try the upgrade to 3.7
then once i upgrade to 3.7 i have to use this to convert over so it will work again?
id love to use this .... just want to be clear.
thanks
Basically, yes.
If you're using Mystics prefix hack a lot in your forums, then this hack is for you if you're upgrading to vB3.7.
Otherwise not. ;)
firstrebel
22 Dec 2007, 10:55
This is greatly appreciated. At what stage do we:
remove the product
remove the files: threadprefix.php and includes/functions_threadprefix.php
remove the templates: threadprefix_listbit and threadprefix_modify
revert the two templates that are not changed for 3.7: threadbit_announcement and SUBSCRIBE
Bob
I would do that once you know you are never going to need the old data. So for me it will be once I upgrade my live site to 3.7.? and get it happily running, and take a "I'm happy with it" backup.
just so im understanding .......
i must have your original from http://www.vbulletin.org/forum/showthread.php?t=123033 installed on my 3.6.x board before i try the upgrade to 3.7
then once i upgrade to 3.7 i have to use this to convert over so it will work again?
id love to use this .... just want to be clear.
thanks
If you want to continue using Mystics hack with 3.7, then you do NOT need to run this converter. Just revert and re-modify a whole load of templates.
If you want to abandon Mystics hack and start using the native vbulletin thread prefixes, then this script will move your data from Mystics hack into the right place so the native vbulletin system can see it.
If you want to continue using Mystics hack with 3.7, then you do NOT need to run this converter. Just revert and re-modify a whole load of templates.
If you want to abandon Mystics hack and start using the native vbulletin thread prefixes, then this script will move your data from Mystics hack into the right place so the native vbulletin system can see it.
gotcha ..... Thanks.
Nice, I'll be looking at this for the upgrade of vb.org to 3.7 as we use prefixes.
LightInClouds
23 Dec 2007, 20:36
Worked perfectly great :)
I happy for this script :) , and I would be very happy if you fixed this problem ;)
I have Arabic language "UTF-8" and I use Collation "utf8_general_ci" in mysql for my forum.
And I test this script, after the script was used on the characters to "?????"
http://www.vbulletin.org/forum/attachment.php?attachmentid=73665&stc=1&d=1198455472
And see this error in running
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Thanks
Rageem, I'm sorry I have no experience with non-Roman characters in databases like this.
Pottsy, do you have ideas about how to merge prefixes or prefix sets?
Alfa1, it was me at vb.com... I think I know what you want, and shall try to achieve this when I test and re-build on the next beta release. In essence, I shall try to get the script to (optionally) read all prefixes everywhere and make one set, then apply that one set to all forums.
That would be a big enhancement. Is it possible to add a feature where the admin can select which sets to merge?
Alfa1, it was me at vb.com... I think I know what you want, and shall try to achieve this when I test and re-build on the next beta release. In essence, I shall try to get the script to (optionally) read all prefixes everywhere and make one set, then apply that one set to all forums.
Please see this modification request:
http://www.vbulletin.org/forum/showthread.php?p=1484367
Before vbulletin 3.7 I used this hack: Thread Prefixes (http://www.vbulletin.org/forum/showthread.php?t=123033) to have this functionality. Since vbulletin 3.7 thread prefixes are built into vbulletin.
I used this hack to import my thread prefixes into vb 3.7: Thread Prefixes upgrade from Mystics to 3.7 (http://www.vbulletin.org/forum/showthread.php?t=165761)
This hack created one prefixes set per forum, because vbulletin 3.7 introduced prefixes sets. This means that I now have 46 almost identical sets of prefixes. Each set contains between 10 and 25 prefixes. Most sets and most prefixes are almost identical. I would like to merge many thread prefixes and sets, so that I just have a few different prefixes sets left. But I do not want to loose prefixes on the thousands of threads that have been categorized with them.
As far as I understand this would be a simple script to code. I may be wrong. Either way; it will be very helpful to many admins and safe loads of work.
antialiasis
30 Apr 2008, 23:38
I was just attempting to use this on my 3.7.0 installation, but all the prefixes I get now have no names. Any idea why?
Does this work as a stand-alone script or is it just an upgrade? I am looking to have prefixes for my new vB 3.7
hmm it doesnt really import all the prefixes for me . just in some forums :( it add prefixes to some forums that i havent any prefix on them !!
also now all the prefixes are like this > [[prefix]]
Any idea ?
i can not open my forum until i can fix this as we are really using prefixes in our forum .
Used this for real now on my forum - went from 3.6.8 PL1 to 3.7.1 PL1 without a hitch.
I suspect that this will fall over if you have special characters in your prefixes, so apologies if it doesn't work for you. Feel free to pick up the code and do what you like with it!
hmm it doesnt really import all the prefixes for me . just in some forums :( it add prefixes to some forums that i havent any prefix on them !!
also now all the prefixes are like this > [[prefix]]
Any idea ?
i can not open my forum until i can fix this as we are really using prefixes in our forum .
You can get rid of the formatting by changing the query in tpup.php (open the file and follow the instructions about commenting out one query and uncommenting the other).
No idea why it should invent prefixes, unless you have old ones in your database that shouldn't be there.
I was just attempting to use this on my 3.7.0 installation, but all the prefixes I get now have no names. Any idea why?
Does this work as a stand-alone script or is it just an upgrade? I am looking to have prefixes for my new vB 3.7
This script converts Mystics prefixes from his TP hack found in 3.6 into prefixes in 3.7 format. You run it once and then delete it.
I get following error
Warning: Unknown column 'threadprefix' in 'field list' in C:\xampp\htdocs\board\tpup\ez_sql_mysql.php on line 204
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\board\tpup\tpup.php on line 10
Done.
The connection through database is correct :( Has anyone some tips?!
hoangminh
28 Jun 2008, 06:00
This script does not work with the Unicode Character, it will make a lot prefix become empty and error.
Any ideas ?
vBulletin® v3.6.12, Copyright ©2000-2009, Jelsoft Enterprises Ltd.