WordPress.org

Support

Support » Your WordPress » Refer WordPress WORKING

Refer WordPress WORKING

  • I feel like a martyr, but I sledgehammered Dean Allen’s refer to work with WordPress 1.3 Alpha 4. The patch is ugly as sin, but functional:
    diff -c refer-orig/refer.php refer/refer.php
    *** refer-orig/refer.php Thu Nov 27 09:45:02 2003
    — refer/refer.php Sat Oct 9 20:26:54 2004
    ***************
    *** 97,105 ****
    — 97,127 —-
    // END CONFIGURATION —————————————- //
    + $wpdbbackup = $wpdb;
    + $oldusr = $usr;
    + $oldpw = $pw;
    + $oldhost = $host;
    + $olddb = $db;
    + $oldtable = $table;
    +
    refer();
    + $usr = $oldusr;
    + $pw = $oldpw;
    + $host = $oldhost;
    + $db = $olddb;
    + $table = $oldtable;
    +
    + mysql_close();
    +
    + if (isset($wp_version)) {
    + $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
    + $wpdb = $wpdbbackup;
    + }
    +
    + unset($oldusr, $oldpw, $oldhost, $olddb, $oldtable, $wpdbbackup);
    +
    function refer()
    {
    extract(rcfg());
    ***************
    *** 110,116 ****
    $uri = dbPrep(‘REQUEST_URI’);
    $ip = ipPrep(‘REMOTE_ADDR’);
    $ref = dbPrep(‘HTTP_REFERER’);
    ! $ref = (preg_match(“/^http:\/\/[^\.]*\.?$mydomain/”, $ref))?”:$ref;
    $ref = str_replace(“www.”,””, $ref);
    — 132,138 —-
    $uri = dbPrep(‘REQUEST_URI’);
    $ip = ipPrep(‘REMOTE_ADDR’);
    $ref = dbPrep(‘HTTP_REFERER’);
    ! $ref = (preg_match(‘/’.$mydomain.’/’, $ref))?”:$ref;
    $ref = str_replace(“www.”,””, $ref);

Viewing 1 replies (of 1 total)
  • i dont understand this. i use refer and just use HTA file to include the required files with wordpress files… what this code is supposed to do?

Viewing 1 replies (of 1 total)
  • The topic ‘Refer WordPress WORKING’ is closed to new replies.
Skip to toolbar