PDA

View Full Version : Hello. I am currently having a problem in functions.php.


Scrub
07-13-2002, 07:57 PM
Hello all,
I've installed countless hack that have included the editing of functions.php. I get this error whenever viewing the thread.


Parse error: parse error, unexpected '}', expecting ']' in /home/www/theonlinelounge/forums/admin/functions.php(432) : eval()'d code on line 28


Now here is the lines between 1 and 55.


<?php
error_reporting(7);

// start prep shutdown function
$noshutdownfunc = 0; // #CHANGE ME IF YOU CAN'T USE register_shutdown_function
$ourtimenow = time(); // Make this available to all files

// Defined constants used for user field.
// Hope to convert all user fields into one integer.
define ("SHOWSIGNATURES", 1);
define ("SHOWAVATARS", 2);
define ("SHOWIMAGES", 4);
define ("SHOWVBCODE", 8);

unset($templatecache);

// ###################### 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")."\";");
}
if ($pagenumber<$totalpages) {
$nextpage = $pagenumber+1;
eval("\$nextlink = \"".gettemplate("pagenav_nextlink")."\";");
}
while ($curpage++<$totalpages) {
if ( ( $curpage <= $pagenumber-$pagenavpages || $curpage >= $pagenumber+$pagenavpages ) && $pagenavpages!=0 ) {
if ($curpage==1) {
eval("\$firstlink = \"".gettemplate("pagenav_firstlink")."\";");
}
if ($curpage==$totalpages) {
eval("\$lastlink = \"".gettemplate("pagenav_lastlink")."\";");
}
} else {
if ($curpage==$pagenumber) {
eval("\$pagenav .= \"".gettemplate("pagenav_curpage")."\";");
} else {
eval("\$pagenav .= \"".gettemplate("pagenav_pagelink")."\";");
}
}
}
eval("\$pagenav = \"".gettemplate("pagenav")."\";");
return $pagenav;

}


Would one you of you be as to so kind to help me on this? The site co-owner thinks it may be with the away hack. But I did a search on the forums and found nothing! :(. This error only show up in in showthread. I mean it works fine on my localhost, but not on web server. The first post does not show up in the showthread, neither do the replys. :o. Could it be because of the other errors we were having with the FTP about the Warning: 206 errors and junk. :o

nuno
07-13-2002, 09:30 PM
There's nothing wrong with code between line 1 and 55.
Most certainly you have one extra closing tag in functions.php near line 432

Scrub
07-13-2002, 09:42 PM
Thank you for your reply, nuno. I will check to make sure, and if I find nothing I will report it back here. :)

Scrub
07-13-2002, 09:51 PM
Here is the code between 402 and 456:


// 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]="";
}

$post[message]=bbcodeparse($post[pagetext],$forum[forumid],$post[allowsmilie]);

//highlight words for search engine
if (isset($highlight) && $highlight != '') {
if ((isset($postid) and $postid==$post[postid]) or !isset($postid)) {
reset($replacewords);
while (list($key,$val)=each($replacewords)) {
$post['message']=preg_replace("#(^| |\n|\r|\t|\]|>|\")(".$val.")(([\.,]+[ $\n\r\t])|$|\"|<|\[| |\n|\r|\t)#si", "\\1<highlight>\\2</highlight>\\3", $post['message']);
}
}
}
// do posts from ignored users
if (($ignore[$post[userid]] and $post[userid] != 0)) {
eval("\$retval = \"".gettemplate("postbit_ignore")."\";");
} else {
eval("\$retval = \"".gettemplate("postbit")."\";");
}
return $retval;
}

// ###################### Start gettextareawidth #######################
function gettextareawidth() {
// attempts to fix idiotic Nutscrape textarea width problems
global $HTTP_USER_AGENT;

if (eregi("MSIE",$HTTP_USER_AGENT)) { // browser is IE
return "{textareacols_IE}";

} elseif (eregi("Mozilla/5.0",$HTTP_USER_AGENT)) { // browser is NS 6
return "{textareacols_NS6}";

} elseif (eregi("Mozilla/4.",$HTTP_USER_AGENT)) { // browser is NS4
return "{textareacols_NS4}";

} else { // unknown browser - stick in a sensible value
return 60;

}

}


I do not think I have an extra bracket, but I could be looking over it. :(.

nuno
07-13-2002, 11:25 PM
replace that code with

// 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]="";
}

$post[message]=bbcodeparse($post[pagetext],$forum[forumid],$post[allowsmilie]);

//highlight words for search engine
if (isset($highlight) && $highlight != '') {
if ((isset($postid) and $postid==$post[postid]) or !isset($postid)) {
reset($replacewords);
while (list($key,$val)=each($replacewords)) {
$post['message']=preg_replace("#(^| |\n|\r|\t|\]|>|\")(".$val.")(([\.,]+[ $\n\r\t])|$|\"|<|\[| |\n|\r|\t)#si", "\\1<highlight>\\2</highlight>\\3", $post['message']);
}
}
}
// do posts from ignored users
if (($ignore[$post[userid]] and $post[userid] != 0)) {
eval("\$retval = \"".gettemplate("postbit_ignore")."\";");
} else {
eval("\$retval = \"".gettemplate("postbit")."\";");
}
return $retval;
}

// ###################### Start gettextareawidth #######################
function gettextareawidth() {
// attempts to fix idiotic Nutscrape textarea width problems
global $HTTP_USER_AGENT;

if (eregi("MSIE",$HTTP_USER_AGENT)) { // browser is IE
return "{textareacols_IE}";

} elseif (eregi("Mozilla/5.0",$HTTP_USER_AGENT)) { // browser is NS 6
return "{textareacols_NS6}";

} elseif (eregi("Mozilla/4.",$HTTP_USER_AGENT)) { // browser is NS4
return "{textareacols_NS4}";

} else { // unknown browser - stick in a sensible value
return 60;

}

}

Scrub
07-14-2002, 12:15 AM
Hey,
Thanks nuno! But we decided to reinstall the forum and it works like a a charm! but if we have this problem again, I will add what you just said. :). Anyway, I have another problem now. We have the modlog installed and we get an error on line 57. On line 57, we have the following code:


htmlheader();


The error claims it to unidentified. Or something close to it. Would you know it is doing this? Thanks again. :)