Author Topic: Adsense only for search engine visitors  (Read 6647 times)

0 Members and 1 Guest are viewing this topic.

Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Adsense only for search engine visitors
« on: December 16, 2010, 01:08:40 PM »
Hi,

is there a plugin that shows Google Adsense only for visitors came via search engines? I could not found one.

Many Thanks!

For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: Adsense only for search engine visitors
« Reply #1 on: December 16, 2010, 02:05:27 PM »
Hi,

use htaccess to redirect referer that came from google yahoo bing etc. to present another
template page.

There is no solution but thats the way you should use.


Greetz X23

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Adsense only for search engine visitors
« Reply #2 on: December 17, 2010, 04:16:51 AM »
You can try this:
in includes/functions.php above ?> insert this:
function search_engine_query_string($url false)
{
	
static 
$search_engines = array(
	
	
'bing' => 'q',
	
	
'google' => 'q',
	
	
'yahoo' => 'p',
	
);

	
$return "";
	
if(!
$url)
	
	
$url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : false;

	
if(!empty(
$url))
	
{
	
	
$parts parse_url($url);
	
	
parse_str($parts['query'], $query);
	
	
preg_match('/(' implode('|'array_keys($search_engines)) . ')\./'$parts['host'], $matches);
	
	
$return = isset($matches[1]) && isset($query[$search_engines[$matches[1]]]) ? $query[$search_engines[$matches[1]]] : '';
	
}
	
return 
$return;
}


In includes/page_header.php below
  "total_images" => $total_images,

insert this:
  "se_referrer" => search_engine_query_string(),


In templates use:
Code: [Select]
{if se_referrer} your adcsense here {endif se_referrer}
function taken from:
http://www.electrictoolbox.com/php-keywords-search-engine-referer-url/
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Re: Adsense only for search engine visitors
« Reply #3 on: December 17, 2010, 10:59:50 AM »
Was genau bewirkt das ganze?

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: Adsense only for search engine visitors
« Reply #4 on: December 17, 2010, 04:59:26 PM »
Was genau bewirkt das ganze?

Hi,

das Ding baut dir nen Tag das zulässt Leuten Code nur dann anzuzeigen wenn Sie als
referer eine der großen Suchmaschinen tragen.

Also jemand googelt dich und klickt sich über den Link von google direkt auf deine Seite
dann steht im Referer des Browsers sofern nicht deaktiviert (die url von google).


Gruß Jens

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: Adsense only for search engine visitors
« Reply #5 on: December 17, 2010, 10:18:07 PM »
Wow!

many thanks, V@no.

I´ll try it!
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline ilaslan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Charset Problem in details.html
« Reply #6 on: January 20, 2011, 10:03:00 PM »
hello

i want to use this code

in details html

code <center> {if se_referrer} {se_referreraram&#305;&#351;&#305;n&#305;z... {endif se_referrer}</center>

if se_referrer has turkish chracter this is problem in details.html also   aramışınız..  = aramıÅ�ınız... 

also
if i have a php array in details.html this is a problem.

my 4images tema is turkish. and there is no problem. Categories and pic name , details , links ...


i find internet in php
header("Content-Type: text/html; charset=ISO-8859-9");
and i used in details html but. problem is contiuning

i don't know. this is a charset problem.
or i need have a function ...

Edit

i am using this code now

function cevir($Str) {
$Str str_replace("&#196;&#176;","I",$Str);$Str str_replace("&#196;&#177;","i",$Str);
$Str str_replace("&#195;&#8211;","O",$Str);$Str str_replace("&#195;&#182;","o",$Str);
$Str str_replace("&#195;&#339;","U",$Str);$Str str_replace("&#195;&#188;","u",$Str);
$Str str_replace("&#195;&#8225;","C",$Str);$Str str_replace("&#195;&#167;","c",$Str);
$Str str_replace("&#196;z","G",$Str);$Str str_replace("&#196;&#376;","g",$Str);
$Str str_replace("&#197;z","S",$Str);$Str str_replace("&#197;&#376;","s",$Str);
return 
$Str;
}

« Last Edit: January 21, 2011, 01:01:34 AM by ilaslan »