Results 1 to 3 of 3

Thread: script conflict

  1. #1
    Constant Pligger chad90382's Avatar
    Joined
    May 2006
    Posts
    129

    script conflict

    Hey guys I was wondering if someone could help with an issue I am having. Any ideas welcome... I recently installed Jarlite2, its a link trade script... the script requires me to put the following code below in my config.php or another php file that is on every page of my site....
    Code:
    include("./trade/log.php")
    The issue is that when I put this the other php scripts on my site go away for example at the bottom of my page the "most voted" "most commented" dont work after I call the log.php file.

    I have attached the script files . the file log.php is the file I have to include and the 2 other files are called in log.php

    If you need any more information please let me know.

    As you can see on my site now... http://www.theviraltrend.com I have the script installed and its working but if you scroll to the bottom of my site you see that the script is conflicting with other scripts like "most voted" etc

    When I remove the call to log.php the other php scripts work. So I know something in log.php is conflicting I just don't know what.
    Attached Files Attached Files

  2. #2
    Pligg Developer chuckroast's Avatar
    Joined
    Jun 2006
    Posts
    5,478
    Where did you end up adding the include call?
    Try moving it to the last part of the footer.tpl like this
    Code:
    {php}
    include("./trade/log.php")
    {/php}

  3. #3
    Constant Pligger chad90382's Avatar
    Joined
    May 2006
    Posts
    129
    Quote Originally Posted by chuckroast View Post
    Where did you end up adding the include call?
    Try moving it to the last part of the footer.tpl like this
    Code:
    {php}
    include("./trade/log.php")
    {/php}
    yea i tryed that thinking i can call it after all the other files but for some reason the include doesnt work in the tpl files. Just still stuck here. Do you see anything here in log.php that can be conflicting with my site?...
    Code:
    {
    if(basename($_SERVER["SCRIPT_FILENAME"])=="/trade/log.php") { exit; }
    include_once(dirname(__FILE__) . '/trade/config.php');
    include_once(dirname(__FILE__) . '/trade/jarl_db.php');
    $jarl_db = new jarl_db();
    
    // Obtain referring address
    $ref_address = $_SERVER["HTTP_REFERER"];
    
    // Determine referring domain
    preg_match("/^https?:\/\/(www\.)?([a-zA-Z0-9\.\-_]+)/", $ref_address, $ref_domain);
    $ref_domain = strtolower($ref_domain[2]);
    $wc = preg_match("/^([a-zA-Z0-9\-]+)\.(([a-z]{2,3})\.([a-z]{2,3}))?([a-z]{2,3})?(\*)?/", $ref_domain, $ext);
    $wildcard = $ext[1];
    
    // Only log hits from foreign referer
    if(!empty($ref_domain) && preg_match("/" . str_replace(".", "\.", JARL_DOMAIN) . "/", $ref_domain)==0) {
    	// Obtain IPs
    	preg_match("/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/", $_SERVER["HTTP_X_FORWARDED_FOR"], $fip);
    	preg_match("/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/", $_SERVER["HTTP_CLIENT_IP"], $cip);
    	preg_match("/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/", $_SERVER["REMOTE_ADDR"], $ip);
    	
    	// Clean them up to prevent SQL injection
    	$ref_address = $jarl_db->clean($ref_address);
    	$ref_domain = $jarl_db->clean($ref_domain);
    	$fip = $jarl_db->clean($fip[1]);
    	$cip = $jarl_db->clean($cip[1]);
    	$ip = $jarl_db->clean($ip[1]);
    	
    	// Check for most recent hit and determine whether this new hit will count
    	$ltime = $jarl_db->result("SELECT time FROM " . JARL_PREFIX . "in WHERE ref_domain='$ref_domain' AND ip='$ip' AND fip='$fip' AND cip='$cip' ORDER BY id DESC LIMIT 1");
    	if(!empty($ltime)) {
    		$ctime = time();
    		if(JARL_T_CONSTRAINT>($ctime-$ltime)/60) {
    			if(JARL_T_PREVDAY) {
    				$lday=floor($ltime/86400);
    				$cday=floor($ctime/86400);
    				$valid_hit = ($lday!=$cday) ? true : false;
    			} else {
    				$valid_hit = false;
    			}
    		} else {
    			$valid_hit = true;
    		}
    	} else {
    		$valid_hit = true;
    	}
    
    	// Hit it up
    	if($valid_hit) {
    		$geoip_data = $jarl_db->fetchrow("SELECT country,name FROM " . JARL_PREFIX . "ip WHERE MBRCONTAINS(ip_poly, POINTFROMWKB(POINT(INET_ATON('$ip'), 0)))");
    		$jarl_db->query("INSERT INTO " . JARL_PREFIX . "in (id, fip, cip, ip, co, coname, ref_address, ref_domain, wildcard, time) VALUES ('', '$fip', '$cip', '$ip', '" . $geoip_data["country"] . "', '" . $geoip_data["name"] . "', '$ref_address', '$ref_domain', '$wildcard', " . time() . ")");
    	}
    }
    $jarl_db->kill();}

Similar Threads

  1. EVB and Entrecard conflict please help
    By bbrian017 in forum Questions & Comments
    Replies: 0
    Last Post: 01-28-2008, 05:54 PM
  2. XML / RSS Script
    By formula in forum Questions & Comments
    Replies: 2
    Last Post: 01-19-2008, 05:51 AM
  3. Replies: 1
    Last Post: 11-21-2007, 06:35 AM
  4. Thickbox class= Conflict with Another Link's Class
    By MicroBerto in forum Questions & Comments
    Replies: 1
    Last Post: 09-14-2007, 12:21 PM
  5. Sidebar Stats and Sneak Conflict
    By The Humanaught in forum Questions & Comments
    Replies: 0
    Last Post: 01-27-2007, 07:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Donate to Pligg CMS Dreamhost Web Hosting Host Gator Web Hosting