PDA

View Full Version : Please help. Bad error.


Dark Shogun
10-18-2002, 11:58 PM
I was told by one of my php coders that this error means that a chunk of code is missing and I didn't delete a chunk of code. Here is the error.

Fatal error: Call to undefined function: gettemplate() in /web/dark/public_html/testvb/member.php on line 1297

PLEASE help. I have to leave for job corp on tuesday and will not be back for 6 months to 1 year and I need to finish this forum before I go.

Dark Shogun

Ps. I get this error when I click on the name of my newest member on the forum homepage.

http://www.thatfinalfantasysite.com/testvb

Velocd
10-19-2002, 12:10 AM
Wow, your PHP coder friend sure was a lot of help with that advice :p

Anyway, it's too hard to tell exactly what could be the problem with just the information you've provided, but I recommend if your member.php is barely modified with hacks, then just to replace it with the original. If it is modified to an extent you don't feel like replacing, then I would try comparing the unmodified member.php and your version.

But first, let's try to help you ....can you post a chunk of the code around line 1297, but NOT the entire member.php (as that's against rules). ;)

Dark Shogun
10-19-2002, 12:12 AM
Ok. I will get the code around that line. I have used beyond compare and could see a chuck of code missing.

Dark SHogun

Dark Shogun
10-19-2002, 12:14 AM
// ############################### start get info ###############################
if ($action=="getinfo") {
$templatesused = "getinfo_sendpm,aol,icq,yahoo,getinfo_birthday,geti nfo_customfields,getinfo";
// +++++++ User Most Active Forum Hack [ g-force2k2 ] +++++++
$templatesused = ",getinfo_forumactive";
// +++++++ User Most Active Forum Hack [ g-force2k2 ] +++++++

// +++++++ Warning Hack 2.0 [ g-force2k2 ] +++++++
$templatesused = ",warn_getinfo_warning,warn_userinfo";
// +++++++ Warning Hack 2.0 [ g-force2k2 ] +++++++

eval("\$customfields .= \"".gettemplate
***************line 1297*******************
("getinfo_customfields")."\";");
***************line 1297*******************
}
// +++++++ Warning Hack 2.0 [ g-force2k2 ] +++++++
$userinfo[warnlink] = "";
$warntype = checkwarnlink($bbuserinfo[usergroupid], 0);
if($warntype == 1) {
eval("\$userinfo[warnlink].= \"".gettemplate('warn_seelink')."\";");
} else {
$userinfo[warnlink].= "";
}
$warntype2 = checkwarnlink($bbuserinfo[usergroupid], 1);
if($warntype2 == 1) {
eval("\$userinfo[warnlink].= \"".gettemplate('warn_userinfo')."\";");
} else {
$userinfo[warnlink].= "";

Dark Shogun

Velocd
10-19-2002, 12:18 AM
Try a quick execution test, to see if the page loads without line 1297. In other words, find:


eval("\$customfields .= \"".gettemplate
***************line 1297*******************
("getinfo_customfields")."\";");
***************line 1297*******************
}


And remove it, then save and run to see if it loads. This will zero in if that particular area is the problem.

Dark Shogun
10-19-2002, 12:23 AM
When I do that I get this error:

Parse error: parse error, unexpected $ in /web/dark/public_html/testvb/member.php on line 1690

and this is the code around line 1690

eval("\$sendmessage = \"".gettemplate("email_usermessage",1,0)."\";");

mail($destuserinfo[email],$subject,$sendmessage,"From: \"$bbuserinfo[username]\" <$bbuserinfo[email]>");

// parse this next line with eval:
$sendtoname=$destuserinfo[username];
eval("standardredirect(\"".gettemplate("redirect_sentemail")."\",\"usercp.php?s=$session[sessionhash]\");");
----------------------line 1690--------------------------
}
----------------------line 1690--------------------------
?>

Dark Shogun

Velocd
10-19-2002, 12:27 AM
My bad, I accidentally told you to remove a neccessary bracket. In this code which I told you to remove:

eval("\$customfields .= \"".gettemplate
***************line 1297*******************
("getinfo_customfields")."\";");
***************line 1297*******************
}


You should have only removed this:

eval("\$customfields .= \"".gettemplate
***************line 1297*******************
("getinfo_customfields")."\";");
***************line 1297*******************

Dark Shogun
10-19-2002, 12:30 AM
Ok doing that I get this error:

Fatal error: Call to undefined function: checkwarnlink() in /web/dark/public_html/testvb/member.php on line 1302

This is the lines.

}
// +++++++ Warning Hack 2.0 [ g-force2k2 ] +++++++
$userinfo[warnlink] = "";
--------------------------------line 1302---------------------------------
$warntype = checkwarnlink($bbuserinfo[usergroupid], 0);
--------------------------------line 1302---------------------------------
if($warntype == 1) {
eval("\$userinfo[warnlink].= \"".gettemplate('warn_seelink')."\";");
} else {
$userinfo[warnlink].= "";
}

Dark Shogun

Velocd
10-19-2002, 12:33 AM
Is the hack you are trying to install (or did recently) a hack by g-force2k2? Just curious.

I noticed this a bit above:
$templatesused = "getinfo_sendpm,aol,icq,yahoo,getinfo_birthday,geti nfo_customfields,getinfo";
// +++++++ User Most Active Forum Hack [ g-force2k2 ] +++++++
$templatesused = ",getinfo_forumactive";
// +++++++ User Most Active Forum Hack [ g-force2k2 ] +++++++

// +++++++ Warning Hack 2.0 [ g-force2k2 ] +++++++
$templatesused = ",warn_getinfo_warning,warn_userinfo";
// +++++++ Warning Hack 2.0 [ g-force2k2 ] +++++++


For some reason there is no added . notation before the equal sign to keep adding onto the $templateused variable.

So replace the above with:

$templatesused = "getinfo_sendpm,aol,icq,yahoo,getinfo_birthday,geti nfo_customfields,getinfo";
// +++++++ User Most Active Forum Hack [ g-force2k2 ] +++++++
$templatesused .= ",getinfo_forumactive";
// +++++++ User Most Active Forum Hack [ g-force2k2 ] +++++++

// +++++++ Warning Hack 2.0 [ g-force2k2 ] +++++++
$templatesused .= ",warn_getinfo_warning,warn_userinfo";
// +++++++ Warning Hack 2.0 [ g-force2k2 ] +++++++


And see if that does anything.

Dark Shogun
10-19-2002, 12:45 AM
Now I get this error.

Fatal error: Call to undefined function: checkwarnlink() in /web/dark/public_html/testvb/member.php on line 1300

This is line 1300:

}
// +++++++ Warning Hack 2.0 [ g-force2k2 ] +++++++
$userinfo[warnlink] = "";
--------------------------------line 1300------------------------------
$warntype = checkwarnlink($bbuserinfo[usergroupid], 0);
-------------------------------line 1300-------------------------------
if($warntype == 1) {
eval("\$userinfo[warnlink].= \"".gettemplate('warn_seelink')."\";");
} else {
$userinfo[warnlink].= "";

Dark Shogun

Dark Shogun
10-19-2002, 12:59 AM
Ok just to let you know this happens everytime I try to view a persons profile.

Dark Shogun

Velocd
10-19-2002, 01:07 AM
Even after the fix you continue to recieve the errors, hmm.

Well, I'm not sure what to say, since the line references aren't helping.

If I were you I'd replace my member.php with the original. Either that, or work back from the last hacks you installed and figure out what's missing.

Try backing up your member.php, then replacing it with the original unmodified. See if the page will load without errors, and if it does then you know it's an error in member.php. If it doesn't, then it could be external like in functions.php. But if it does load, then you'll have to figure it out somehow.

Regards,
Velocd

Dark Shogun
10-21-2002, 02:30 AM
Ok I just check when I replace it with the original it works BUT when I check both the hacked and original side by side in Beyond compare I don't see any code missing at all. Then I add the hacks to the member.php file and it goes back to the orginal error:

Fatal error: Call to undefined function: gettemplate() in /web/dark/public_html/testvb/member.php on line 1282

Please help :( If I don't finish hacking my forum tomorrow I will not beable to do so for 6-months to 1 year. :(

Dark Shogun

Erwin
10-21-2002, 02:57 AM
In your member.php, this line is incomplete:




eval("\$customfields .= \"".gettemplate



This is why you get this error:



Fatal error: Call to undefined function: gettemplate() in /web/dark/public_html/testvb/member.php on line 1297



Reinstall g2force's warning hack again, making sure you complete that line of PHP code.

Dark Shogun
10-21-2002, 02:59 AM
eval("\$customfields .= \"".gettemplate("getinfo_customfields")."\";");
}

Thats not the full line?

Dark Shogun

Erwin
10-21-2002, 03:04 AM
I was referring to your post here:

https://vborg.vbsupport.ru/showthread.php?postid=311330#post311330

12th line in the code you posted.

Dark Shogun
10-21-2002, 03:06 AM
Oh I am sorry. For some reason when I posted it, it didn't come out on one line like it was supposed to.

Dark Shogun

PS. Post number 15 is the right line.

http://www.thatfinalfantasysite.com/testvb/member.php?action=getinfo&userid=6

Erwin
10-21-2002, 03:17 AM
Try this:

Change this:



eval("\$customfields .= \"".gettemplate("getinfo_customfields")."\";");



to this:



eval("\$customfields .= \"".gettemplate('getinfo_customfields')."\";");

Dark Shogun
10-21-2002, 03:19 AM
Didn't work. I tried that.

Dark Shogun

Erwin
10-21-2002, 03:24 AM
Are you sure? The error is telling you that what is between the gettemplate() brackets are in error - make sure that template exists, and you use ' instead of " because using " confuses the code with the other " in that line.

Dark Shogun
10-21-2002, 03:28 AM
Ok I made sure the templates are there and they are. I changed that line to:

eval("\$customfields .= \"'.gettemplate('getinfo_customfields').'\";");

I got this error: Fatal error: Call to undefined function: checkwarnlink() in /web/dark/public_html/testvb/member.php on line 1286

If I change it to: eval("\$customfields .= \"".gettemplate('getinfo_customfields')."\";");

I get the original error.

Dark Shogun

Erwin
10-21-2002, 03:29 AM
The error I see now is this one:



Fatal error: Call to undefined function: checkwarnlink() in /web/dark/public_html/testvb/member.php on line 1286



What is on that line 1286?

Erwin
10-21-2002, 03:29 AM
What is between the checkwarnlink() brackets?

Erwin
10-21-2002, 03:30 AM
Btw, the 2 codes in your post above are the same - which one is which?

Dark Shogun
10-21-2002, 03:32 AM
Here is the template.

Dark Shogun

Dark Shogun
10-21-2002, 03:32 AM
One has " and the other has '

Dark Shogun

Erwin
10-21-2002, 03:34 AM
Look at this post of yours:

https://vborg.vbsupport.ru/showthread.php?postid=312095#post312095

They both have ' :)

Use ', don't use ". We can then look at the next error and figure out why...

Erwin
10-21-2002, 03:34 AM
Tell me what is on line 1286?

Erwin
10-21-2002, 03:37 AM
I see what you did... don't change the " that is outside the brackets - as long as the variable in the bracket is ' then you are fine. Change the ' back to " OUTSIDE the brackets - use the code I posted in my previous post.

Erwin
10-21-2002, 03:38 AM
In your post, use the SECOND example you posted. The first one will give an error.

Dark Shogun
10-21-2002, 03:39 AM
Line 1286: $warntype = checkwarnlink($bbuserinfo[usergroupid], 0);

Dark shogun

Dark Shogun
10-21-2002, 03:42 AM
Now we are back to the original error:

Fatal error: Call to undefined function: gettemplate() in /web/dark/public_html/testvb/member.php on line 1282

Dark Shogun

Dark Shogun
10-21-2002, 03:44 AM
If I send you both member.php files (modded and original) do you think that will help?

Dark Shogun

Erwin
10-21-2002, 03:44 AM
Makes no sense to me. :) Something is very wrong in the way you installed the warning's hack. I suggest you remove it, and reinstall it. You are missing something essential in your members.php. Try posting in that thread itself to see if you get a response.

Erwin
10-21-2002, 03:44 AM
Okay, just PM me your members.php and I will have a look at them.

Erwin
10-21-2002, 04:05 AM
You completely installed the warning hack wrong in your member.php - next time read the installation text for the hack properly. You put the code in the wrong place and as a result had 2 occurences of the line that calls the same template.

I have PMed you the member.php that I fixed.

Dark Shogun
10-21-2002, 04:06 AM
Ok I uploaded that member.php and now I get this error:

Parse error: parse error, unexpected $ in /web/dark/public_html/testvb/member.php on line 1680


Dark Shogun

Dark Shogun
10-21-2002, 04:24 AM
OMEG. I got it up. :) Thanks Erwin. After I put up the member.php file you gave me it didn't work but then I changed the " to ' and added another }

Dark Shogun

Erwin
10-21-2002, 04:27 AM
Ok. You misread gforce2k's instruction - the 2 chunks of code for member.php is in 2 separate places. I just copied your code to where it's supposed to be. Obviously the code you had was not completely original. :) Good to hear it works now. If you look at your original member.php you can see how your code is located too high up - it should have been at the end - as a result you had to lines with the same code - one at the top, the other at the end. You were meant to add code BELOW the template line, not add the whole thing below the templatesused line. :)