Problems with vB 3.0.17 and php 5.3.3

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sv1cec
    Senior Member
    • May 2004
    • 162

    Problems with vB 3.0.17 and php 5.3.3

    Hey folks,

    Sorry for reviving this old version of vB, but I am using it in a heavily hacked site and upgrading is (I am afraid) our of the question. However, I needed to upgrade php and mysql, in order to run another site and I am facing a very strange issue with the old (heavily altered) vB code. Needless to say, any ideas will be greatly appreciated.

    Here is my system description and problem.

    Copied vB 3.0.17 (heavily patched, I stress) from a server running php 4.4.9 to one running 5.3.3. My code is running perfectly on 4.4.9, but on 5.3.3 I am facing a weird problem. Take for example forumdisplay.php. For some reason, on 5.3.3 the code doesn't work, the links in the pagenav box which allow you to move from one page of the forum display to the next, do not work. I tried to troubleshoot the issue and what I found was that the $_GET variables passed by the pagenav links are converted fine to $_REQUEST['pp] and $_REQUEST['page'] and then to $_REQUEST['perpage'] and $_REQUEST['pagenumber'], as soon as the global.php file is required_once. However, when a couple of lines further down, I require_once functions_newpost.php, from then on, the $_REQUEST['perpage'] and $_REQUEST['pagenumber'] are vanished. They loose their values.

    This is weird, because functions_newpost.php contains only some functions, which are not called at that point, they are just required_once, so there is nothing which could "unset" $_REQUEST['perpage'] and $_REQUEST['pagenumber']. Of course, if $_REQUEST['perpage'] and $_REQUEST['pagenumber'] are not set, the globalize function called further down the code, to convert these variable to the global $perpage and $pagenumber does not work, so the pagenav links do not work.

    What is also weird is that if I move the require_once functions_newpost.php above require_once global.php, then the $_REQUEST['perpage'] and $_REQUEST['pagenumber'] are not lost, obviously since they are generated by global.php and init.php after the require_once functions_newpost (code section for working and not working code are attached below).

    The fact that the code works fine in php 4.4.9 and does not work in 5.3.3 makes me think that there has been a change to the php code, but for the name of God, I can't find anything in the documentation. And of course, seeing such a problem with the new php makes me question other parts of my code. I have already discovered the same anomaly in showthread.php where again, pagenav was not working, until I moved some require_once statements before the require_once global.php statement.

    Here is the non-working code:

    PHP Code:
    // ######################### REQUIRE BACK-END ############################
    require_once('./global.php');
    require_once(
    './includes/functions_forumlist.php');
    require_once(
    './includes/functions_bigthree.php');
    require_once(
    './includes/functions_forumdisplay.php');
    require_once(
    './includes/functions_newpost.php'); 
    And here is the working code:

    PHP Code:
    // ######################### REQUIRE BACK-END ############################
    require_once('./includes/functions_newpost.php'); 
    require_once(
    './global.php');
    require_once(
    './includes/functions_forumlist.php');
    require_once(
    './includes/functions_bigthree.php');
    require_once(
    './includes/functions_forumdisplay.php'); 
    Is there something that has been changed in php 5.0.0 (or 5.3.3) that would create such inconsistency? And if yes, is there a general fix I can apply to make my code work again? I am afraid that I might have to go through all parts of my site to make sure everything works, since I do not know which other quirks the new php brings with it.

    Many thanks for your attention gentlefolks.
    John Caradimas
  • Mark.B
    vBulletin Support
    • Feb 2004
    • 24287
    • 6.0.X

    #2
    You might honestly be better asking this on vbulletin.org. It's beyond the remit of this site since its going to involve quite a bit of manual code changes.

    Sent from my iPhone using Forum Runner
    MARK.B
    vBulletin Support
    ------------
    My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
    My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

    Comment

    • Wayne Luke
      vBulletin Technical Support Lead
      • Aug 2000
      • 74125

      #3
      There have been a lot of changes in PHP between 4.4.9 and 5.3.3. Your software doesn't support running under 5.3.3. You would either need to upgrade to vBulletin 3.8.7 or have extensive code modifications done as previously stated.
      Translations provided by Google.

      Wayne Luke
      The Rabid Badger - a vBulletin Cloud demonstration site.
      vBulletin 5 API

      Comment

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