vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Hello. I am currently having a problem in functions.php. (https://vborg.vbsupport.ru/showthread.php?t=41038)

Scrub 07-13-2002 07:57 PM

Hello. I am currently having a problem in functions.php.
 
Hello all,
I've installed countless hack that have included the editing of functions.php. I get this error whenever viewing the thread.

Quote:

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 Code:

<?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!=) {
            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:

PHP Code:

    // 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
Code:

// 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:

PHP Code:

htmlheader(); 

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


All times are GMT. The time now is 03:35 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01151 seconds
  • Memory Usage 1,777KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete