View Full Version : ExpandContract Hack Help
Littlebit
10-03-2002, 11:39 PM
I messed something up and am getting a parse error after installing the expand contract forums hack. I've looked everywhere for an accidental extra space or something and can't seem to find where I screwed up. Will someone who's familiar with this hack please take a look at my index.php for me? :paranoid:
Littlebit
10-03-2002, 11:41 PM
Oops...it's officially called this hack:
Collapsable forums on forum home
Link14716
10-04-2002, 12:10 AM
You're not going to get much help. To be helped, you need to include the error message and 5 lines before and 5 lines after the line that the error was on.
Littlebit
10-04-2002, 12:32 AM
Sorry about that...here is the error:
Parse error: parse error, unexpected '{' in /home/differen/public_html/board/index.php on line 340
here is the code above and below that line on index.php:
if ($forum['cancontainthreads']==1) {
$tempext = '_post';
} else {
$tempext = '_nopost';
}
// expand collapse hack
if ($BrowserDOM==True) {
if ((!isset($z)) or ($depth==1)) {
$z=0;
} else {
$z++;
}
// get state of collapse
if ($forum[parentid]==-1) {
$collapsedstate=$forum['collapsed'];
}
// auto collapse forums based on forum setting
if ($collapsedstate==1) {
$fhomeexpandstyle="style=\"visibility:hidden; display:none;\"";
} else {
$fhomeexpandstyle="";
}
// auto collapse forums for user
Littlebit
10-04-2002, 12:34 AM
for reference this is line 340 on my index.php:
if ((!isset($z)) or ($depth==1)) {
Littlebit
10-04-2002, 12:45 AM
I'm scared to remove the { on line 340...thinking I'll just make the real problem worse. Any help would be great. My index is is inexcessible until I find my ++++ up.
Littlebit
10-04-2002, 12:46 AM
:speechless: ...I cussed.
That was too many posts at once...sorry about that.
I tried adding what you said and am still getting the same error for the same line 340.
:(
g-force2k2
10-04-2002, 12:57 AM
Littlebit: find this code:
// expand collapse hack
if ($BrowserDOM==True) {
if ((!isset($z)) or ($depth==1)) {
$z=0;
} else {
$z++;
}
under it add:
}
see if that fixes the problem ;)
and please try not to multiple post so much... when im online i will help as many as i can... thanks in advance...
g-force2k2
Littlebit
10-04-2002, 01:41 AM
no luck...any thing else you think I should try before I un-install? Shoot this is what I get for trying to go fast. :/
Thank you for being such a quick support team...really. :)
g-force2k2
10-04-2002, 02:03 AM
litlebit pm me the file... and i'll do a comparison and report any ideas for you regards...
g-force2k2
Littlebit
10-04-2002, 02:10 AM
I just deleted the changes for the index.php only so the board will be functional for the moment.
Could I still send you my index.php for a look to see if maybe I have something weird conflicting with the hack changes when added?
g-force2k2
10-04-2002, 02:13 AM
yeah send me the changes for installing the hack and the file and i will see what i can get working for you ;) regards...
g-force2k2
Littlebit
10-04-2002, 02:26 AM
You should have a pm now.
Thank you so much for your help...your time :)
g-force2k2
10-04-2002, 02:49 AM
Littlebit you said you wanted to continue in this thread... it worked... reason you got a blank page is because you have to reupload the required files that it is looking for... regards... (i assume they came with the hack)
require('./admin/getbrowser.php');
require('./admin/getforumview.php');
g-force2k2
Littlebit
10-04-2002, 01:41 PM
Hi g-force :classic:
I forgot to reupload those files just like you said...so I did and the hack works! Thank you again. What was causing the parse error?
Now I'm afraid to add the option that came with it. It effects that same file (index.php) that you fixed, but I need to dive in and do it. :nervous:
Stand by~
Erwin
10-04-2002, 01:45 PM
Originally posted by Littlebit
for reference this is line 340 on my index.php:
if ((!isset($z)) or ($depth==1)) {
Change that line to this:
if ((!isset($z) or ($depth==1)) {
You have an extra ) in the first variable. :)
g-force2k2
10-04-2002, 01:47 PM
good to hear Littlebit :)
i will be around today... so no worries... im not sure what was wrong with what you had done :p but probably just a small syntax... regards... no worries...
g-force2k2
Erwin
10-04-2002, 01:48 PM
Do you see it? You cannot open and close the brackets around the first variable in line 340, when you should encompass both variables for that function. An easy mistake to make, and easy to miss. :)
g-force2k2
10-04-2002, 01:49 PM
btw Erwin that'll parse out ;)
if ((!isset($z) or ($depth==1)) {
123 3442
you're missing the closing to one ;) hence the ')' that you removed :p regards...
g-force2k2
Erwin
10-04-2002, 01:52 PM
Oops! You're right... I jumped to conclusions there...
Keep that line the same! :)
if ((!isset($z)) or ($depth==1)) {
Sorry, I was the one who made the mistake. :)
It's 1 am here in Melbourne, so I better go to bed before I say something else that's stupid! ;)
Littlebit
10-04-2002, 01:55 PM
Hi Erwin,
I noticed that, but it's now working with it like that so it couldn't have been the problem causing the parse error. On a whim, I went in and took out the extra bracket on that line and it gave a parse error for that line again.
I still don't think all of the hack is working right. I thought the extra option was to make the forums able to be manipulated by the user (as of yet, I can only do it in the admin...the clickable images to collapse the forum as a user aren't showing up....ugg now what did I do.
Littlebit
10-04-2002, 01:57 PM
Erwin, you couldn't possibly feel stupid around me!
Sleep tight ;)
Littlebit
10-04-2002, 02:29 PM
G-force,
thanks for fixing my parse error :)
I've moved my new issue to the hacks thread:
https://vborg.vbsupport.ru/showthread.php?s=&threadid=33961
In case you're curious...ooorrr still willing to donate more time ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.