View Full Version : Functions.php Error From Hell
Hi. I tried to do a very easy hack. change the name "Guest". Now I can't see the individual threads and I get this error:
Parse error: parse error, expecting `']'' in /home/diva/public_html/test/admin/functions.php(281) : eval()'d code on line 31
Here's the weird part. I tried putting back the original functions.php and even a new one... I still get that error. Any ideas?
DrkFusion
07-27-2002, 02:03 AM
Hmm...did you edit functions.php alot?
You can maybe try reuploading the original functions.php if the hack was the only one, if not, just paste what you modified.
Imyself am not good with php, I get thrown off with parseerrors hehe, but I can compare and try to find a solution.
Drk
Hi! Thanks for answering so fast. Actually, I hadn't really hacked a lot at that point. But even when I replaced the functions.php, it stayed there. I had a friend set up another test board and he thinks it may have something to do with the style design. But it says it's the function.php. :\
DrkFusion
07-27-2002, 02:10 AM
Can you paste whats on line 31 in functions.php?
Did you replace functions.php with the one you downloaded in vb members area? If not, then try download fresh copy of vb and replacing the file.
Drk
Sure! This is lines 28-31:
if ($pagenumber>1) {
$prevpage = $pagenumber-1;
eval("\$prevlink = \"".gettemplate("pagenav_prevlink")."\";");
}
DrkFusion
07-27-2002, 02:17 AM
I am assuming that } is at line 31?
DrkFusion
07-27-2002, 02:19 AM
Try this,
find
// ###################### Start getpagenav #######################
all the way to line 31, which I hopefully think it is ) and replace it with
// ###################### Start getpagenav #######################
// template-based page splitting system from 3dfrontier.com
function getpagenav($results,$address) {
global $perpage,$pagenumber,$pagenavpages;
if ($results <= $perpage) {
return "";
}
$totalpages = ceil($results/$perpage);
if ($pagenumber>1) {
$prevpage = $pagenumber-1;
eval("\$prevlink = \"".gettemplate("pagenav_prevlink")."\";");
}
DrkFusion
07-27-2002, 02:22 AM
Sorry about that smilie in the code
Drk
is line 31 a blank space?
DrkFusion
07-27-2002, 02:25 AM
No } is there.
Drk
d'oh! I'm sorry... I meant line 32...
DrkFusion
07-27-2002, 02:31 AM
No you should have
if ($pagenumber<$totalpages) {
$nextpage = $pagenumber+1;
eval("\$nextlink = \"".gettemplate("pagenav_nextlink")."\";");
}
from line 32-35
Drk
Argh!!! I'm so mad I could just spit! It just isn't working... :(
DrkFusion
07-27-2002, 02:38 AM
Hold on let me PM you with something that may help
Drk
DrkFusion
07-27-2002, 02:39 AM
...Actually, just head over to www.vbulletin.com and download fresh copy of vb2.2.6 and upload functions.php
Drk
SIGH..... I've tried that. This is the fifth time so far... No dice.
I really appreciate all of your help. Thank you, DrkFusion. Kinda like a Superhero's name! Yeah, I'm lame.
DrkFusion
07-27-2002, 03:06 AM
Sorry, I really don't know why there is an error, it seems to be alright, its similar to my functions.php...sorry I couldn't help, maybe one of the other experienced guys like Xenon or Firefly can help :)
Drk
Sparkz
07-27-2002, 06:33 AM
It looks like you have a bug in some template. That's what the errormessage is saying, at least.
DrkFusion
07-27-2002, 01:56 PM
Yea, thats what she told me over PM...hund down that man, and ask him what html he added.
Drk
so, he can't be reached right now. Any clues on how I can search this? Remember... You are working with a blonde here. That's worse than a newbie at times. :/
Sparkz
07-27-2002, 09:30 PM
Is this happening in showthread.php?
We kind of need to filter the amount of possible templates :)
Ummm.... I think so. It's when I click on an individual thread to view that post. The post does not show and the error is above the forum design.
Sparkz
07-28-2002, 06:44 AM
Then it looks like it could be in the postbit-templates somewhere.
What we're looking of is probably a variable looking something like this $varname['key] or something.
This is driving me bonkers! I couldn't find any "$varname" or "['key]". Thank you for your help!
I'm going to ^BUMP^ this baby up, in hopes that someone else might know what is wrong. Any and all help appreciated!
Still hoping for a miracle..... Anyone? ^^BUMP^^
Here's the template [I hope!], FireFly!
<a href="$address&pagenumber=$prevpage" title="previous page">«</a>
Do your magic! :) *Crosses fingers and toes*
Admin
08-02-2002, 03:10 PM
Ack, that's not it, sorry. You pasted the wrong line. Paste here line 281. :)
But that's all that was there! Where am I looking?
Admin
08-02-2002, 04:01 PM
I mean line 281 of functions.php.
(And don't tattoo my name on your arse! :o)
What if I already did? :rolleyes:
Here's line 271 - 284. Line 281 is a"}"
// do ip addresses
if ($post[ip]!="") {
if ($logip==2) {
eval("\$post[iplogged] .= \"".gettemplate("postbit_ip_show")."\";");
}
if ($logip==1) {
eval("\$post[iplogged] .= \"".gettemplate("postbit_ip_hidden")."\";");
}
if ($logip==0) {
$post[iplogged]="";
}
} else {
$post[iplogged]="";
}
Admin
08-02-2002, 05:51 PM
That can't be. Line 281 must contain a eval() call.
Okay. Sigh... I was told it was the birthday hack, so I removed the php, postbit and installed yet another fresh copy of vb functions.php. No dice. Now it gives me an error about not finding the birthday.php. I even updated all the counters, etc...
Any suggestions? I really liked that hack, too. :/
Admin
08-03-2002, 07:57 AM
The error is not in the files, it's in one of your templates (the one that is used in line 281, which is why that line MUST contain a eval() call, or you're not talking in the right file).
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.