What the heck is wrong with this line?!?!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JokerV
    New Member
    • Feb 2001
    • 10

    What the heck is wrong with this line?!?!

    when i try to run index.php3. I get this:

    Parse error: parse error, expecting `STRING' or `NUM_STRING' or `'$'' in /usr/home/samtseng.com.tw/htdocs/bbs/index.php3 on line 259

    I checked the line and it look like this:

    eval("\$forumbits.=\"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");

    if i comment it out, it works, of course, without any forums in between.

    HELP!! HELP!!
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    I got parse errors when installing vB2. But it turned out to be because the php files got botched in the unzipping process and where not recognized as text files on my server.

    Comment

    • JokerV
      New Member
      • Feb 2001
      • 10

      #3
      yeah, i thought of that and unzipped my index.php file and uploaded again. OR am I aiming at the wrong file as index is also associated with others, meaning i should unzip everything and try again?

      Like i said before, if i comment out that line, then the stuff works. So, any ideas?

      Comment

      • Freddie Bingham
        Former vBulletin Developer
        • May 2000
        • 14057
        • 1.1.x

        #4
        What version of PHP are you using?

        Comment

        • JokerV
          New Member
          • Feb 2001
          • 10

          #5
          PHP version 3.0.12

          Comment

          • JokerV
            New Member
            • Feb 2001
            • 10

            #6
            Help! Help!

            I've tried a couple of things but nothing seems to work.
            1. I tried unzipping everything once again, renaming everything from .php to .php3, careful that all the text is uploaded in ASCII and got the same result.
            2. Then I tried to running the code in PHP4.0.2, renaming everything to .php4. Well, that got index.php4 to start running with the exception of
            a) "Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in Unknown on line 6" started to show up 5 times with the contents showing normally below.
            b) none of the forums showing. I presume it just ignored that line all together.
            c) half of the admin panel functions starting to have parse errors.

            Therefore, I've decided to just stick with 3.0.12. It would seem to me that the only piece of code wrong is the one below. However this error message keeps coming up if I run it under php3.

            Parse error: parse error, expecting `STRING' or `NUM_STRING' or `'$'' in /usr/home/samtseng.com.tw/htdocs/bbs/forumdisplay.php3 on line 217

            So, what's wrong with this line?!?!?!

            eval("\$forumbits .= \"".gettemplate("forumdisplay_forumbit_level$depth$tempext")."\";");

            help help please!!!

            Comment

            • JokerV
              New Member
              • Feb 2001
              • 10

              #7
              Okay, I really think I gonna go crazy any minute cause I'm speaking to myself for the past few posts now...

              anyway, i've been trying to play around the code and here's what happening:

              ----------------------------------------------------------------
              // if ($forum['cancontainthreads']==1) {
              // $tempext = '_post';
              // } else {
              $tempext = '_nopost';
              // }

              eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");
              -----------------------------------------------------------------

              around line 257, i comment out the top lines and everything started to work except, well, go look for yourself:

              if i use the "$tempext = '_post'" line, it shows the same error line again.

              SO, oh great guru out there, what is the problem? My guess is the "$tempext", but what's there to do?

              Comment

              • doron
                Senior Member
                • Apr 2000
                • 669

                #8
                try this:

                replace eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");

                with:

                $templatename = "forumhome_forumbit_level".$depth.$tempext;
                eval("\$forumbits .= \"".gettemplate($templatename)."\";");

                i wonder if this mgiht help, but it is worth a try
                Last edited by doron; Thu 1 Mar '01, 6:32am.

                Comment

                • JokerV
                  New Member
                  • Feb 2001
                  • 10

                  #9
                  All right, mystery solved. Thank you doron but you didn't hit jackpot. However, your code explained what the previous code meant and I was able to hack through it. Jakeman, however, was more correct in the beginning.

                  After several playing around with the top code, I realized that anything with _post doesn't work. So I went into the template and found this:

                  <TD bgcolor="{firstaltcolor}" valign=top><B>
                  <A HREF="forumdisplay?s=$session[sessionhash]&forumid=$forum[forumid]"><normalfont>$forum[title]</normalfont></A></B><BR>
                  <smallfont>$forum[.php3description]</smallfont></td>

                  for some mysterious reason, "forumdisplay.php3?s=" was transformed to "forumdisplay?s" and [description] became [.php3description]. This was where the parse error was.

                  Then I went into the vbulletin.style file and there it is, somehow, when it unzipped, that part got messed up. But I had already updated with an errorous file and the templates were already messed up on very few places. Anyway, now all that is fixed and it seems to be working well.

                  Many thanks to those who tried to help. I learn a lot about php through this dreadful experience.

                  Comment

                  widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                  Working...