how to show ads of adultmoda and admoda ?

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

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

3 participants
abipol Junior · 11 posts #1

any1 know how to show ads of adultmoda and admoda? or maybe they blocked opera and mozilla browser? pls help! 🙁

simple things can be a great sample!

GumSlone Administrator Principal · 1,690 posts #3
function adultmoda()
{
    $ZONEID     = 2152; // PUT HERE YOUR ID
    $SERVER_URL = 'http://www.adultmoda.com/ads/fetch.php'; 

// --------------------------------------------------------

    $ip = (isset($_SERVER['REMOTE_ADDR'])) 
        ? $_SERVER['REMOTE_ADDR'] : "0.0.0.0";
    $ua  = (isset($_SERVER['HTTP_USER_AGENT'])) 
        ? $_SERVER['HTTP_USER_AGENT'] : '';

    if (isset($HTTP_SERVER_VARS['HTTP_X_OPERAMINI_PHONE_UA'])) {
      $ua = $HTTP_SERVER_VARS['HTTP_X_OPERAMINI_PHONE_UA'];
      $ip = $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'];
    }

    $url = sprintf("%s?v=2&l=php&z=%d&a=%s&ua=%s",
        $SERVER_URL, $ZONEID, $ip, urlencode( $ua )
    );

    $packed = '';
    $request = curl_init();
	$request_timeout = 1; // 1 second timeout
	curl_setopt($request, CURLOPT_URL, $url);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($request, CURLOPT_TIMEOUT, $request_timeout);
	curl_setopt($request, CURLOPT_CONNECTTIMEOUT, $request_timeout);
	curl_setopt($request, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);

	$packed = curl_exec($request);
	curl_close($request);

    if ($packed != '') {
        $banner = explode('|', $packed);
        @$bannerid  = $banner[0];
        $tmp = str_replace( "&", "&", $banner[1] );
        @$image_url = str_replace( "&", "&", $tmp);
        $tmp = str_replace( "&", "&", $banner[2] );
        @$click_url = str_replace( "&", "&", $tmp);
        $tmp = str_replace( "&", "&", $banner[3] );
        @$text = str_replace( "&", "&", $tmp);
        if ($bannerid) {
            $text = ($text) ? $text : "Click here...";
            
            if ($image_url) {
                $ad .= "\n<a href=\"$click_url\"><img src=\"$image_url\" alt=\"Advert\" /></a><br />\n";
            }
            $ad .= "<a href=\"$click_url\">$text</a><br />\n";
            return $ad;
        }
    }
}

USAGE:

echo adultmoda();

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

Write your reply now; next you create a free account (or sign in) and it is posted right away. 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