1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Site sift mods to make work directory script run under php 5.4 (deprecated functions)

Discussion in 'Directories' started by Paz, Jul 12, 2014.

  1. #1
    Hi,

    (I'm a php hacker and would appreciate it if anyone who really knows php regular expressions could modify my code to improve/correct as nec).

    I don't know how many of you are still using Site Sift's directory script but it is very seo friendly and very free provided you link back to the site.

    Alas the script is no longer supported and won't run reliably under php 5.3 and will have particular problems under php 5.4 as you won't be able to login to the admin area.

    My host upgraded to php 5.4 and I mmediately had problems with error messages on every inner page with front end messages warning about ;

    Deprecated: Function eregi_replace() is deprecated in /home/xxx/yyy.com/spages.php on line 14
    To fix this open up spages.php and replace the following line 14;

    $query_spages = "SELECT * FROM pages where " . eregi_replace("^ and", "", $mid_str) . " active = 'Yes' and catID = '" . $_REQUEST['id'] . "' ORDER BY mid DESC";
    with
    $query_spages = "SELECT * FROM pages where " . preg_replace("/^ and/", "", $mid_str) . " active = 'Yes' and catID = '" . $_REQUEST['id'] . "' ORDER BY mid DESC";
    SEMrush
    And similar on add_page.php

    On the admin login page you won't be able to log in to the admin area under php 5.4 because the login will fail with the following error on an otherwise blank page;
    Fatal error: Call to undefined function session_register() in /home/xxx/yyyy.com/admin/login.php on line 32

    To fix this problem open the admin/login.php file and just comment out the following lines by putting a // in front of them;
    line 9 session_register('PrevUrl');
    line 32 session_register("MM_Username");
    line 33 session_register("MM_UserGroup");

    Hope this helps :)

    Cheers,
    Paz.
     
    Paz, Jul 12, 2014 IP
    SEMrush