zest-adz simple php install code

Started on the old forum in July 2010 · view the original in the archive · old links redirect here

2 replies · 884 views · started 16 years ago · 1 min read

2 participants
GumSlone Administrator Principal · 1,690 posts #1

i have edited the zest-adz php install code because the default one looked a bit weird for me, so here is a simple zest-adz php install code for text ads:

function zestad() 
{
	$cid_zest ="14131C047A5041444E5A465C4153405E88882D"; // your zest-adz site id
           $mt_zest="Your meta data here";#
           //CHANGE THE AD TYPE AS YOUR PREFERRENCE 
	$ad_type = urlencode("Text");

	// request ZestADZ ad 
	

	//DO NOT EDIT BELOW THIS LINE
	$ua_zest = urlencode(getenv("HTTP_USER_AGENT")); 
	$ip_zest = urlencode($_SERVER['REMOTE_ADDR']); 
	//CHANGE THE TIME OUT MESSAGE AS YOUR PREFERNCE
	$mt_zest = urlencode($mt_zest);
	$page_url  = sprintf("http%s://%s%s",(isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == TRUE ? "s": ""),$_SERVER["HTTP_HOST"],$_SERVER["REQUEST_URI"]);
	$page_url= urlencode($page_url);
	
	$url_zest='http://a.zestadz.com/waphandler?cid='.$cid_zest.'&ua='.$ua_zest.'&ip='.$ip_zest.'&meta='.$mt_zest.'&ad_type='.$ad_type.'&url='.$page_url.'&userid=&pageviewid='; 
	$adrequest = curl_init(); 
	curl_setopt( $adrequest, CURLOPT_URL, $url_zest); 
	curl_setopt( $adrequest, CURLOPT_RETURNTRANSFER, 1 );
	curl_setopt( $adrequest, CURLOPT_TIMEOUT, 1 ); 
	curl_setopt( $adrequest, CURLOPT_CONNECTTIMEOUT, 1 );
	curl_setopt( $adrequest, CURLOPT_HTTPHEADER, array("Content-Type: application/x-www-form-urlencoded","Connection: Close")); 
	$content = curl_exec($adrequest); 
	curl_close($adrequest); 
	
	
	// output content 
	$content_zest = explode("~",$content);
	if(isset($content_zest[2]))
	{
		$lm_zest=$content_zest[0];
		$lm_zest = $lm_zest.("~").("ck"); 
		$xr_zest = $content_zest[2];
		$ad_landing_zest = 'http://a.zestadz.com/waplanding?lm='.$lm_zest.''; 
		return '<a href="'. $ad_landing_zest .'">'.$xr_zest .'</a>'; 
	}
} 

usage:

echo zestad();

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

wapking.in Newbie · 5 posts #2

i want also image code plz give me

GumSlone Administrator Principal · 1,690 posts #3

wapking.in wrote: i want also image code plz give me

for image + text use this function:

function zestad()  
{ 
    $cid_zest ="14131C047A5041444E5A465C4153405E88882D"; // your zest-adz site id 
    $mt_zest="Your meta data here";
           //CHANGE THE AD TYPE AS YOUR PREFERRENCE  
    $ad_type = urlencode("Text+Picture"); 

    // request ZestADZ ad  
     

    //DO NOT EDIT BELOW THIS LINE 
    $ua_zest = urlencode(getenv("HTTP_USER_AGENT"));  
    $ip_zest = urlencode($_SERVER['REMOTE_ADDR']);  
    //CHANGE THE TIME OUT MESSAGE AS YOUR PREFERNCE 
    $mt_zest = urlencode($mt_zest); 
    $page_url  = sprintf("http%s://%s%s",(isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == TRUE ? "s": ""),$_SERVER["HTTP_HOST"],$_SERVER["REQUEST_URI"]); 
    $page_url= urlencode($page_url); 
     
    $url_zest='http://a.zestadz.com/waphandler?cid='.$cid_zest.'&ua='.$ua_zest.'&ip='.$ip_zest.'&meta='.$mt_zest.'&ad_type='.$ad_type.'&url='.$page_url.'&userid=&pageviewid=';  
    $adrequest = curl_init();  
    curl_setopt( $adrequest, CURLOPT_URL, $url_zest);  
    curl_setopt( $adrequest, CURLOPT_RETURNTRANSFER, 1 ); 
    curl_setopt( $adrequest, CURLOPT_TIMEOUT, 1 );  
    curl_setopt( $adrequest, CURLOPT_CONNECTTIMEOUT, 1 ); 
    curl_setopt( $adrequest, CURLOPT_HTTPHEADER, array("Content-Type: application/x-www-form-urlencoded","Connection: Close"));  
    $content = curl_exec($adrequest);  
    curl_close($adrequest);  
     
     
    // output content  
     $content_zest = explode("~",$content); 
    if(isset($content_zest[2])) 
    { 
        $lm_zest=$content_zest[0]; 
        $lm_zest = $lm_zest.("~").("ck");  
        $xr_zest = $content_zest[2]; 
        $ad_landing_zest = 'http://a.zestadz.com/waplanding?lm='.$lm_zest.'';  
        if($content_zest[1]!=2) $xr_zest = '<img src="'.$xr_zest.'" alt=""/>';
        return '<a href="'. $ad_landing_zest .'">'.$xr_zest .'</a>';  
    }
    return $content_zest;
} 

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close