mod referer..
http://www.archaicbinary.net/general/do ... r.zip.htmlbut i need to change the mod_referer.php somehow or it will show this error
Quote:
Warning: strpos() [function.strpos]: Empty delimiter. in /home/wangmasy/public_html/stesma/modules/mod_referer.php on line 49
search.yahoo.com
Warning: strpos() [function.strpos]: Empty delimiter. in /home/wangmasy/public_html/stesma/modules/mod_referer.php on line 49
http://www.google.com.myWarning: strpos() [function.strpos]: Empty delimiter. in /home/wangmasy/public_html/stesma/modules/mod_referer.php on line 49
Open, copy and paste this code into mod_refere.php
Code:
<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$url = $_SERVER['HTTP_REFERER'];
$showlines = intval( $params->get( 'showlines', 10 ) );
$newwindow = intval( $params->get( 'newwindow', 1 ) );
$ignoresite = $params->get( 'ignoresite' );
$database->setQuery( "SELECT * FROM #__abreferer_data" );
if (!$database->query()) {
$database->setQuery( "CREATE TABLE `#__abreferer_data` (`id` int(10) NOT NULL auto_increment, `url` varchar(200) NOT NULL default '', `hits` int(10) NOT NULL default '', PRIMARY KEY (`id`), UNIQUE (`url`)) TYPE=MyISAM AUTO_INCREMENT=2 ;" );
$database->query();
}
$pos = strpos($url, $mosConfig_live_site);
if ($pos===false){
$query = "SELECT * FROM #__abreferer_data WHERE url='$url' LIMIT 1";
$database->setQuery( $query );
$rows = $database->loadObjectList();
$row = $rows[0];
$hits = $row->hits + 1;
$url = str_replace("http://", "", $url);
$url = explode("/", $url);
$url = $url[0];
$database->setQuery( "INSERT INTO #__abreferer_data (url) VALUES ('$url')" );
$database->query();
$database->setQuery( "UPDATE #__abreferer_data SET hits='$hits' WHERE url='$url'" );
$database->query();
}
$sql = "SELECT * FROM #__abreferer_data ORDER BY hits LIMIT $showlines";
$database->setQuery($sql);
$rows = $database->loadObjectList();
foreach($rows as $row){
$str = $row->url;
{
$str = str_replace("http://", "", $str);
if ($newwindow="1"){
echo '<a href="http://' . $row->url . '" target="_blank">' . $str . '</a><br />';
}else{
echo '<a href="http://' . $row->url . '">' . $str . '</a><br />';
}
}
}
?>
