View Full Version : Upgrade from 2.3.0 to 2.3.2 VIA code changes
This hack will allow you to upgrade your board from 2.3.0 to 2.3.2 by using code changes instead of over writing the files.
I will try and help support this hack, if you run into any problems come here and ask for help.
Notice: You still need to run upgrade.php!!
Be Sure to backup your files and database before applying the changes!
I take no responsobility for any damages!
This hack is ONLY for vBulletin 2.3.0!
There may be some mistakes in the file edits if you find any let me know ASAP so I can update the hack.
Hostc
09-18-2003, 11:35 PM
My bad. Pressed Enter too soon.
I'm not done with it yet so please stand by.
This sounds great but why do you still have to run upgrade php? I mean if its via code means you need to replace/add all the new stuff that came in vb2.3.2 right? or ..am I mistaken oO.
kaotic3252
09-19-2003, 01:01 AM
*I think* upgrade.php is still required to make the changes to the database.
I look forward to upgrading to vb2.3.2 the Hostc way, because replacing all the files and then rehacking them would take me several hours.
I agree same here kaotic ^^ and I see..about the database thing I guess Hostc will explain better once hes done.
Hostc
09-19-2003, 03:09 AM
I agree same here kaotic ^^ and I see..about the database thing I guess Hostc will explain better once hes done.
The upgrade script will update the database to the current version.
Hostc
09-19-2003, 05:43 AM
Update:
I should have this finished by tomorrow.
MaDCaT75
09-19-2003, 05:46 AM
But this will affect all current hacks, right?
Logician
09-19-2003, 09:16 AM
But this will affect all current hacks, right?
No it will not (unless by luck a modified part of version upgrade is already a modified part of one of your hacks) and this is the whole point of this hack: You can upgrade your board without losing your hacks.. :)
I like these hacks much, unfortunately people don't take time to release them much as they require a lot of work to note what you are doing while upgrading.. So thx to hostc!
kaotic3252
09-20-2003, 11:34 PM
So... you're going to set it up today?
Bison
09-21-2003, 01:40 AM
What file???
CeleronXL
09-21-2003, 03:29 AM
Er, is this actually going to be done?
iggy123
09-21-2003, 07:20 AM
Yea,
I was wondering the same thing!! Should this be in the full release forums when there is nothing there?
X-Fan
09-21-2003, 07:29 AM
Yeah, I hate being teased like this...
Erwin
09-21-2003, 08:01 AM
Moving this thread to General Hacking Discussion... since the hack is not ready yet...
Hostc
09-22-2003, 06:12 PM
Sorry for being slow. I've been busy the last couple of days.
I'm at work so I do not have the files on this system.
I have a couple of touch ups to do and I will release it.
Hostc
09-22-2003, 10:53 PM
Hack Added Enjoy :)
bluecat
09-23-2003, 11:10 AM
Man, great idea hack, but that's a lot of work.
shorty
09-23-2003, 11:24 AM
Man, great idea hack, but that's a lot of work.
It's that or rehack your board. Baring in mind how many hacks some people have (25/30+ :rolleyes: ) I can understand this being quicker ;)
Hostc
09-23-2003, 06:01 PM
I did not include the & changes because there were too many file edits.
These are not needed in vb 2.3.2 :)
Now if someone would just do the same but from a 2.2.9 version ... :D
Hostc
09-24-2003, 12:59 AM
Now if someone would just do the same but from a 2.2.9 version ... :D
I will be doing one for that version too soon enough.
iggy123
09-24-2003, 08:01 PM
Is this ready now? and if so has anyone tried it? Please can you let me know. My board is heavily hacked and i don't want to ruin it by running this and it not working.
Thnx
Hostc
09-24-2003, 08:08 PM
Be Sure to backup your files and database before applying the changes!
MaDCaT75
09-24-2003, 09:56 PM
i'm too scared to try it
Hostc
09-25-2003, 12:35 AM
i'm too scared to try it
Read my above post....
MaDCaT75
09-25-2003, 03:56 AM
I WOULD BACK UP MY DATABASE BUT I AM NOT IN CONTROL OF THE FORUM'S SERVER
Hostc
09-25-2003, 07:38 AM
Then have your host do it.
iggy123
09-25-2003, 08:06 AM
I WOULD BACK UP MY DATABASE BUT I AM NOT IN CONTROL OF THE FORUM'S SERVER
Look at this hack - https://vborg.vbsupport.ru/showthread.php?t=37655 - it allows you to run a backup of your Db from the admin panel and also do a restore if anything goes wrong.
It is an excellent hack which has saved me a hell of a lot of work on several occasions.
But to ask again has anyone tried this hack?
edit:
Ok, I have done all the code changes - as laid out in the install.txt and I came across 2 issues:
1.
FIND:
if (!isset($mailcache["$touser[templatesetid]"]['email_notify']))
REPLACE WITH:
if (!isset($mailcache["$touser[templatesetid]"]['emailsubject_notify']))
I couldn't find the if (!isset($mailcache["$touser[templatesetid]"]['email_notify']))
and
2.
FIND:
makeforumjump();
REPLACE THE BELOW IT with THIS:
// set default value for $daysprune
if (empty($daysprune) OR $daysprune < 1) {
$daysprune = 30;
}
replace what???
apart from that everything is working ok - I am not sure (because of the two issues above) if it is perfect but if you can let me know about these two issues then thnx it has saved me a hell of a lot of work.
edit: 21:46 GMT
Ok, i have played with it a bit and there is some errors still, there is one } which have to be deleted from both the index.php and forumdisplay.php - but can't remember where exactly sorry - think it was about line 890 - 900
Also when someone tries to vote on a poll I am getting the following error message.
Database error in vBulletin 2.3.2:
Invalid SQL: UPDATE forum SET lastpost=1064522787 WHERE forumid IN ()
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
mysql error number: 1064
Date: Thursday 25th of September 2003 08:46:27 PM
any ideas?
Hostc
09-25-2003, 08:53 PM
Give me a bit, will update it.
iggy123
09-25-2003, 09:23 PM
Give me a bit, will update it.
Ok thnx
cirisme
09-25-2003, 09:36 PM
I will be doing one for that version too soon enough.
Really?
* cirisme can't wait...
Hostc
09-25-2003, 09:55 PM
Jiggy,
To fix your poll problem.
in POLL.PHP
Find:
// don't do this any more - see http://www.vbulletin.com/forum/showthread.php?t=77713
//$foruminfo=getforuminfo($threadinfo['forumid']);
//$DB_site->query("UPDATE forum SET lastpost=$ourtimenow WHERE forumid IN ($foruminfo[parentlist])");
And Remove that. Thats fixed.
NOW For the rest of the updates:
OPEN ROOT\MEMBER2.PHP
FIND:
makeforumjump();
REPLACE THE CODE BELOW IT WITH:
// set default value for $daysprune
if (empty($daysprune) OR $daysprune < 1) {
$daysprune = 30;
}
(Updated coding in showthread.php)
FIND AND REMOVE:
$perpage = intval($perpage);
FIND AND REMOVE: (First instance)
if ($getpagenum[posts]%$perpage==0) {
$pagenumber=$getpagenum[posts]/$perpage;
} else {
$pagenumber=intval($getpagenum[posts]/$perpage)+1;
}
FIND:
if ($getpagenum[posts]%$perpage==0) {
$pagenumber=$getpagenum[posts]/$perpage;
} else {
$pagenumber=intval($getpagenum[posts]/$perpage)+1;
}
REPLACE WITH:
}
if ($bbuserinfo['maxposts']!=-1 and $bbuserinfo['maxposts']!=0 and $bbuserinfo['maxposts'] <= $newmaxposts) {
sanitize_pageresults($getpagenum[posts], $pagenumber, $perpage, $newmaxposts, $bbuserinfo['maxposts']);
} else {
sanitize_pageresults($getpagenum[posts], $pagenumber, $perpage, $newmaxposts, $maxposts);
}
$pagenumber = ceil($getpagenum['posts']/$perpage);
iggy123
09-25-2003, 10:58 PM
Nope - the poll.php is still not working.... I get the error message
Database error in vBulletin 2.3.2:
Invalid SQL: UPDATE forum SET lastpost=1064534122 WHERE forumid IN ()
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
also you are still not very clear about what should be replaced in the member2.php...
you say find makeforumjump(); and REPLACE THE CODE BELOW IT WITH:
well below it i have...
// set defaults
$perpage = intval($perpage);
if ($perpage==0 or $perpage>200) { //max of 200, per several users requests
$perpage=$maxthreads;
}
$pagenumber = intval($pagenumber);
if (!isset($pagenumber) or $pagenumber==0) {
$pagenumber=1;
}
// display threads
$limitlower=($pagenumber-1)*$perpage+1;
$limitupper=($pagenumber)*$perpage;
// set default value for $daysprune
if (empty($daysprune) OR $daysprune < 1) {
$daysprune = 30;
}
// look at thread limiting options
$datecut='';
unset ($daysprunesel);
if ($daysprune!=1000) {
$datecut="AND lastpost >= ".(time() - ($daysprune*86400));
}
$daysprunesel[$daysprune]="selected";
if (trim($bbuserinfo[ignorelist])!="") {
$ignoreusers="AND thread.postuserid<>".implode(" AND thread.postuserid<>",explode(" ",trim($bbuserinfo[ignorelist])));
} else {
$ignoreusers="";
}
$threadscount=$DB_site->query_first("SELECT COUNT(*) AS threads
FROM thread,subscribethread
WHERE subscribethread.threadid=thread.threadid
AND subscribethread.userid='$bbuserinfo[userid]'
AND thread.visible=1 $datecut $ignoreusers");
$totalallthreads=$threadscount[threads];
sanitize_pageresults($totalallthreads, $pagenumber, $perpage, 200, $maxthreads);
// display threads
$limitlower=($pagenumber-1)*$perpage+1;
$limitupper=($pagenumber)*$perpage;
if ($limitupper>$totalallthreads) {
$limitupper=$totalallthreads;
if ($limitlower>$totalallthreads) {
$limitlower=$totalallthreads-$perpage;
}
}
if ($limitlower<=0) {
$limitlower=1;
}
if ($showdots and $bbuserinfo[userid] >= 1) {
$dotuserid = "DISTINCT post.userid,";
$dotjoin = "LEFT JOIN post ON (thread.threadid = post.threadid AND post.userid = '$bbuserinfo[userid]' AND post.visible = 1)";
} else {
$dotuserid = "";
$dojoin = "";
}
$getthreadids=$DB_site->query("SELECT thread.threadid
FROM thread,subscribethread
WHERE subscribethread.threadid=thread.threadid
AND subscribethread.userid='$bbuserinfo[userid]'
AND thread.visible=1 $datecut $ignoreusers
ORDER BY lastpost DESC
LIMIT ".($limitlower-1).",$perpage
");
$totalthreads=$DB_site->num_rows($getthreadids);
if ($totalthreads>0) {
// check to see if there are any threads to display. If there are, do so, otherwise, show message
$threadids="thread.threadid IN (0";
while ($thread=$DB_site->fetch_array($getthreadids)) {
$threadids.=",".$thread[threadid];
}
$threadids.=")";
$threads=$DB_site->query("SELECT $dotuserid icon.title as icontitle,icon.iconpath,thread.threadid,thread.tit le,
lastpost,forumid,pollid,open,replycount,postuserna me,postuserid,lastposter,thread.dateline,views,
thread.iconid,notes,thread.visible
FROM thread
LEFT JOIN icon ON (icon.iconid = thread.iconid)
$dotjoin
WHERE $threadids
ORDER BY lastpost DESC");
$pagenumbers = '';
$threadbits = '';
while ($thread=$DB_site->fetch_array($threads)) {
if (($bbuserinfo[maxposts] != -1) and ($bbuserinfo[maxposts] != 0))
{ $maxposts = $bbuserinfo[maxposts]; }
if (($thread[replycount]+1)>$maxposts and $linktopages) {
$totalpages=($thread[replycount]+1)/$maxposts;
if ($totalpages!=intval($totalpages)) {
$totalpages=intval($totalpages)+1;
}
$acurpage=0;
$pagenumbers="";
while ($acurpage++<$totalpages) {
if ($acurpage==$maxmultipage) {
eval("\$pagenumbers .= \"".gettemplate("forumdisplay_multipagenav_more")."\";");
break;
} else {
eval("\$pagenumbers .= \"".gettemplate("forumdisplay_multipagenav_pagenumber")."\";");
}
}
eval("\$thread[pagenav] = \"".gettemplate("forumdisplay_multipagenav")."\";");
} else {
$thread[pagenav]="";
}
$thread[icon]=" ";
if ($thread[iconid]!=0)
{
$thread[icon]="<img src=\"$thread[iconpath]\" alt=\"$thread[icontitle]\" width=\"15\" height=\"15\" border=\"0\">";
}
if ($thread[pollid]!=0) {
$thread[icon]="<img src=\"{imagesfolder}/poll.gif\" alt=\"Poll\" width=\"15\" height=\"15\" border=\"0\">";
}
if ($wordwrap!=0) {
$thread[title]=dowordwrap($thread[title]);
}
$replies=$thread[replycount];
$views=$thread[views];
$thread[lastreplydate]=vbdate($dateformat,$thread[lastpost]);
$thread[lastreplytime]=vbdate($timeformat,$thread[lastpost]);
$thread[gotonew]="";
$thread[newoldhot]="folder";
if (!$thread[open]) {
$thread[newoldhot]="lock".$thread[newoldhot];
}
if ($thread[replycount]>=$hotnumberposts or $thread[views]>=$hotnumberviews and $usehotthreads) {
$thread[newoldhot]="hot".$thread[newoldhot];
}
if ($bbuserinfo[lastvisitdate]=="Never") {
$thread[newoldhot]="new".$thread[newoldhot];
} elseif ($thread[lastpost]>$bbuserinfo[lastvisit]) {
if (get_bbarraycookie('threadview', $thread['threadid']) < $thread['lastpost']) {
$thread[newoldhot]="new".$thread[newoldhot];
}
eval("\$thread[gotonew] = \"".gettemplate("forumdisplay_gotonew")."\";");
}
if ($showdots and $bbuserinfo[userid] >= 1 and $bbuserinfo[userid] == $thread[userid]) {
$thread[newoldhot] = "dot_" . $thread[newoldhot];
}
eval("\$threadbits .= \"".gettemplate("subscribe_threadbit")."\";");
}
$DB_site->free_result($threads);
$pagenav = getpagenav($totalallthreads,"member2.php?s=$session[sessionhash]&action=viewsubscription&daysprune=$daysprune&perpage=$perpage");
eval("\$threadslist = \"".gettemplate("subscribe_threads")."\";");
} else {
eval("\$threadslist = \"".gettemplate("subscribe_nothreads")."\";");
}
// draw cp nav bar
$cpnav[1]="{secondaltcolor}";
$cpnav[2]="{secondaltcolor}";
$cpnav[3]="{secondaltcolor}";
$cpnav[4]="{secondaltcolor}";
$cpnav[5]="{secondaltcolor}";
$cpnav[6]="{secondaltcolor}";
$cpnav[7]="{secondaltcolor}";
$cpmenu[8]="class=\"fjsel\" selected";
eval("\$cpnav = \"".gettemplate("usercpnav")."\";");
eval("dooutput(\"".gettemplate("subscribe")."\");");
}
?>
which is a hell of a lot of code to work...
another issue i have - and its making me more and more tempted to remove this and restore my forums to the way they were before - is that when i try to lauch the hack vbwar i get an error in the functions.php
Warning: Division by zero in /home/unklem/public_html/forums/admin/functions.php on line 794
which is part of logicans hack - but when i uninstall that hack the page is just blank... any ideas before i resort back to my old site?
Hostc
09-25-2003, 11:53 PM
You need to check the vBwar hack and find the file edit that contains edits for functions.php and see what has changed.
in poll.php
Find:
$DB_site->query("UPDATE thread SET lastpost=$ourtimenow WHERE threadid=$threadinfo[threadid]");
Below that add
$DB_site->query("UPDATE forum SET lastpost=$ourtimenow WHERE forumid IN ($foruminfo[parentlist])");
Ok, for MEMBER2.php
Find:
makeforumjump();
// set defaults
$perpage = intval($perpage);
if ($perpage==0 or $perpage>200) { //max of 200, per several users requests
$perpage=$maxthreads;
}
$pagenumber = intval($pagenumber);
if (!isset($pagenumber) or $pagenumber==0) {
$pagenumber=1;
}
// display threads
$limitlower=($pagenumber-1)*$perpage+1;
$limitupper=($pagenumber)*$perpage;
if (!isset($daysprune) or $daysprune==0 or $daysprune==-1) {
$daysprune=30;
}
Replace with:
makeforumjump();
// set default value for $daysprune
if (empty($daysprune) OR $daysprune < 1) {
$daysprune = 30;
}
iggy123
09-26-2003, 08:03 AM
Nope that didn't work. Sorry but i have had to revert back to my old forums - I am sure that this hack works, everything else apart from the poll and the wars did so I assume that it was due to the vbwars hack that it failed.
I will ask in that thread if there is any solution and then i will redo your hack.
Thanks for your help in trying to fix it though.
Hostc
09-26-2003, 06:22 PM
Hmm, did you try uninstalling vbwar on 2.3.0 then try reupgrading? Then reinstall vbwar?
What do you get by upgrading to 2.3.2 this way? if anyone can say ><
I installed and get these errors :(
Invalid SQL: SELECT *
FROM user,userfield
WHERE 1=1 AND
user.userid = userfield.userid
AND usergroupid NOT IN (1,3,4)
ORDER BY username ASC
LIMIT 0,
mysql error: You have an error in your SQL syntax near '' at line 7
mysql error number: 1064
And
Invalid SQL:
SELECT
post.*,post.username AS postusername,post.ipaddress AS ip,style.title AS styletitle,user.*,userfield.*,icon.title as icontitle,icon.iconpath,
attachment.attachmentid,attachment.filename,attach ment.visible AS attachmentvisible,attachment.counter,LENGTH(attach ment.filedata)/1024 AS attachsize
,avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline
FROM post
LEFT JOIN icon ON icon.iconid=post.iconid
LEFT JOIN user ON user.userid=post.userid
LEFT JOIN userfield ON userfield.userid=user.userid
LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid
LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid
LEFT JOIN style ON style.styleid = user.styleid
WHERE post.threadid='1342'
ORDER BY dateline LIMIT 0,
mysql error: You have an error in your SQL syntax near '' at line 16
mysql error number: 1064
Hostc
09-27-2003, 07:09 AM
Possible a installed hack problem.
squawell
09-27-2003, 09:35 AM
hello Hostc i got those error messages below:
SQL: SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
SQL:
SELECT
post.postid, thread.visible
FROM
post LEFT JOIN thread ON thread.threadid=post.threadid
WHERE
post.visible=1 AND thread.visible=1 AND 1=1 AND post.userid='1451'
ORDER BY
post.dateline DESC,post.dateline DESC
LIMIT 0,25
LIMIT 0, 25
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 25' at line 10
how to fix that? thankz~
Hostc
09-27-2003, 09:42 AM
hello Hostc i got those error messages below:
SQL: SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
SQL:
SELECT
post.postid, thread.visible
FROM
post LEFT JOIN thread ON thread.threadid=post.threadid
WHERE
post.visible=1 AND thread.visible=1 AND 1=1 AND post.userid='1451'
ORDER BY
post.dateline DESC,post.dateline DESC
LIMIT 0,25
LIMIT 0, 25
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 25' at line 10
how to fix that? thankz~
For the last one,
see the Limit 0, 25?
Take out the space before 25
squawell
09-27-2003, 09:44 AM
For the last one,
see the Limit 0, 25?
Take out the space before 25
yes,i see that after i posted...i will try it and report here if it work~~
and the first one still need ur help thankz~~
Any idea about mine? the second one is in showthread.php and first one in memberlist.
Private
09-27-2003, 10:51 PM
I couldn't find the hack in this thread, where is it?
Hostc
09-28-2003, 12:16 AM
<i>Last edited by Hostc on 09-27-03 at 08:10 AM. Reason: Hack is currently unstable</i>
iggy123
10-28-2003, 06:51 AM
any chance of this getting any work done on it?
MaDCaT75
10-28-2003, 06:59 AM
Is this hack worth it or not?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.