SnakeV
08-17-2009, 11:06 PM
Hello,
I'm trying to setup a code for display ads only for visitors that come from a search engine.
This is the code that i need to put for check if a visitor come from a search engine or not it this:
$ref = $_SERVER['HTTP_REFERER'];
$SE = array('/search?', 'images.google.', 'web.info.com', 'search.', 'del.icio.us/search', 'soso.com', '/search/', '.yahoo.');
foreach ($SE as $source) {
if (strpos($ref,$source)!==false) {
setcookie("sevisitor", 1, time()+3600, "/", ".YOURDOMAIN.com");
$sevisitor=true;
}
}
function fromasearchengine(){
global $sevisitor;
if ($sevisitor==true || $_COOKIE["sevisitor"]==1) {
return true;
}
return false;
}
I want it to be displayed in Showthread.
Which hook i need to choose?.
Thanks!!
I'm trying to setup a code for display ads only for visitors that come from a search engine.
This is the code that i need to put for check if a visitor come from a search engine or not it this:
$ref = $_SERVER['HTTP_REFERER'];
$SE = array('/search?', 'images.google.', 'web.info.com', 'search.', 'del.icio.us/search', 'soso.com', '/search/', '.yahoo.');
foreach ($SE as $source) {
if (strpos($ref,$source)!==false) {
setcookie("sevisitor", 1, time()+3600, "/", ".YOURDOMAIN.com");
$sevisitor=true;
}
}
function fromasearchengine(){
global $sevisitor;
if ($sevisitor==true || $_COOKIE["sevisitor"]==1) {
return true;
}
return false;
}
I want it to be displayed in Showthread.
Which hook i need to choose?.
Thanks!!