Welcome to Geeklog Monday, December 06 2021 @ 12:35 am EST

Geeklog Forums

HTTP_REFERER won't install in 1.3.9


kaptainkaffeine

Anonymous
I'm having some trouble with the http_referer plugin. It worked a while ago, then I decided to perform a new install of geeklog 1.3.9. Now that 1.3.9 is installed and working properly, http_referer won't work. I've placed all the files in all of the necessary directories, then head to http://mysite.com/admin/plugins/http_referer/install.php. I'm faced with my geeklog site (blocks, that is) with an empty middle section. Nothing I've tried will make it install. I have deleted the MySQL tables it used, thinking that it might be running into existing ones, but still nothing. Just nothing. Thanks in advance for the help!
 Quote

Status: offline

Peter_Apockotos

Forum User
Junior
Registered: 18/03/04
Posts: 29
What errors are you getting? I installed this on a fresh install of 1.3.9 and it is working fine.
 Quote

kaptainkaffeine

Anonymous
Quote by Peter_Apockotos: What errors are you getting? I installed this on a fresh install of 1.3.9 and it is working fine.


Absolutely none, that's the weird thing. All I get are the geeklog blocks and a blank middle area. No errors whatsoever. It never says "Trying to..." anything. It's like it's not even executing the .php.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 22/03/04
Posts: 1512
here is an error for you...
Warning: Wrong parameter count for str_replace() in "/pathtogeeklogpublic_html/plugins/http_referer/functions.inc on line 208"

any ideas.. installed on a clean 1.3.9 GL
 Quote

Status: offline

Peter_Apockotos

Forum User
Junior
Registered: 18/03/04
Posts: 29
This is what is around line 208 of the functions.inc:

// Unregister the plugin with Geeklog
// Always attempt to remove these entries or lib-common.php would still
// try and read our functions.inc file ...
COM_errorLog('Attempting to unregister the plugin from Geeklog',1);
DB_query("DELETE FROM {$_TABLES['plugins']} WHERE pi_name = 'http_referer'");
COM_errorLog('...success',1);

COM_errorLog('leaving plugin_uninstall_http_referer',1);

return true;

Which tells me that you had a previous version and did not follow the instructions before (re)installing the plugin.

4) Uninstallation

In order to prevent accidental uninstallation, a row is added to gl_var. The
var name is http_referer, if this is set to 1, you can NOT uninstall the plugin.

Delete this row, or set to 0 to uninstall the plugin, then delete using the
plugin admin option. Simple.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 22/03/04
Posts: 1512
never installed this plugin before... first time (on this site)
and as far as i can tell, there was no line created in the db for this.
 Quote

Status: offline

Peter_Apockotos

Forum User
Junior
Registered: 18/03/04
Posts: 29
The first time I installed this plugin I accidentally hit install twice and it didn't work. So look for the following then uninstall it and remove all instances of the plugin on your web server and reinstall it.

4) Uninstallation

In order to prevent accidental uninstallation, a row is added to gl_var. The
var name is http_referer, if this is set to 1, you can NOT uninstall the plugin.

Delete this row, or set to 0 to uninstall the plugin, then delete using the
plugin admin option. Simple.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 22/03/04
Posts: 1512
found it! the row wasn't added to gl_vars, but to gl_plugins.
thanks, tis all good. at least till i give it another shot. Razz
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 22/03/04
Posts: 1512
well, i dunno what file you're looking at, but line 208 in functions.inc says
PHP Formatted Code
$urlwww = str_replace( 'www.', '', $_CONF['site_url'], 1 )
 

the context is
PHP Formatted Code
/**
  * http_referer_log()
  * Log the HTTP_REFERER to the table <prefix>Http_referer
  */

function http_referer_log()
{
    global $_CONF,$_TABLES;
    $referer = getenv("HTTP_REFERER");

    // Ignore the following
    $urlwww = str_replace( 'www.', '', $_CONF['site_url'], 1 );
    if(
        $referer == "" // No referer
        OR eregi( "^unknown", $referer ) // Unknown referer
        OR substr( $referer, 0, strlen( $_CONF['site_url'] ) ) == $_CONF['site_url'] // starts with site url
        OR substr( $referer, 0, strlen( $urlwww ) ) == $urlwww // site url with www. removed
        )
    {
    } else {
        // Searches:
        if( $_CONF['http_referer_qsp'] == 1 )
        {
            http_referer_check_queries( $referer );
        }
        $referer = substr( $referer, 0, 255 );
        $ipaddress = $_SERVER['REMOTE_ADDR'];
        $timestamp = time();
        $sql = "insert into ".$_TABLES['http_referer']." (referer, ipaddress,"
             . "tstamp ) VALUES ('$referer','$ipaddress','$timestamp')";
        $result = DB_query( $sql );
    }
}

 


so anyways, i made sure everything was outa the database, and started over. no luck on 2 out of 3 sites all using GL_1.3.9
all i can figure is that maybe the INT parameter is not supported by the version of php on my host (but i really dunno what that 1 is doing there anyway). hmmm.. 4.3.5 works but 4.3.4 and 4.3.3 don't.
I remain clueless Big Grin
 Quote

Status: offline

jbpaul17

Forum User
Chatty
Registered: 14/05/04
Posts: 49
Location:New York City
confused
I'm getting the same error on my site (www.jeffandcrystal.com):
Warning: Wrong parameter count for str_replace() in /home/*******/public_html/plugins/http_referer/functions.inc on line 208.
I'm running the most current version of GL and PHP version 4.3.8.

Any thoughts?
 Quote

All times are EST. The time is now 12:35 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content