MyBB Community Forums

Full Version: Add Adiquity ads in mybb
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i got codes from them, but does not understand where to post it please can anyone explain.
.
Ad Type : Text and Image AdsSteps to implement the Ad-code :1. Copy the code snippet corresponding to selected zone.2. Paste it in the body of the source code of your mobile internet site.3. Paste it in all the pages where you want Adiquity ads to be displayed.Note: For ad codes in languages other than PHP(curl)or ASP,--------------------------------------------------------------------------------------------------------------------PHP - Curl ************** Insert this code once on the top of your page:<?php/***************************************************************************  Adiquity Ad Code - Adiquity.com*  Copyright Adiquity Technologies Pvt Ltd . All rights reserved.*  Language: PHP (Curl)*  Version: 18072011**************************************************************************/$Adq_COOKIE = "adq_site_cookie";//Set user cookiesetUserCookie();function adiquity_ad($adq_params){global $Adq_COOKIE;$gender = '';$age = '';$longitude = '';$latitude = '';$location = '';if(! empty($longitude) && ! empty($latitude)) {$location=$latitude.",".$longitude;}$ext_user_id=getadqCookie();$params = array();$params = array("ua=" . urlencode($_SERVER["HTTP_USER_AGENT"]),"TIP=". urlencode($_SERVER["REMOTE_ADDR"]),"aclang=". "php","acver=". "18072011" ,"cat"=>"s1,en");if (!empty($adq_params["ADQ_PARAMS"])){foreach ($adq_params["ADQ_PARAMS"] as$k => $v){$params[] = urlencode($k) . "=" . urlencode($v);}}foreach ($_SERVER as $k => $v) {if ((substr($k, 0, 4) == "HTTP") ||(substr($k, 0, 3)== "REQ"))  {$params[] = $k . "=" . urlencode($v);}}$post = implode("&", $params);$extras ="&gender=".$gender."&age=".$age."&location=".$location;if($ext_user_id != null) {$extras .= "&ext_user_id=".$ext_user_id;}$post.=$extras;$request = curl_init();$request_timeout = 10; // 10 seconds timeout$adq_url = "http://ads.adiquity.com/mads";curl_setopt($request, CURLOPT_URL, $adq_url);curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);curl_setopt($request, CURLOPT_TIMEOUT,$request_timeout);curl_setopt($request, CURLOPT_HTTPHEADER, array("Content-Type:application/x-www-form-urlencoded", "Connection: Close", "X-ADQ-pazid:adq5n22a-14zp49oj-uqqub"));curl_setopt($request, CURLOPT_POSTFIELDS,$post);$contents = curl_exec($request);if (curl_getinfo($request,CURLINFO_HTTP_CODE) == 200){if ($contents === true || $contents === false)$contents = "";echo $contents;}curl_close($request);}function getadqCookie(){global $Adq_COOKIE;$ext_user_id = null;if(isset($_COOKIE[$Adq_COOKIE])) {$ext_user_id = $_COOKIE[$Adq_COOKIE];}return $ext_user_id;}function setUserCookie() {global $Adq_COOKIE;if(! isset($_COOKIE[$Adq_COOKIE])) {$value =  time().rand();setcookie($Adq_COOKIE, $value, time()+3600*24*75, "/");}}?>___________________________________________________*******Insert this code where you want to place the Ad********<?php$adq_params = array("ADQ_PARAMS"  => array("pazid"=>"adq5n22a-14zp49oj-uqqub",//PAZID"adbgcolor"=>"FFFFFF", //Ad Unit Background color"adtcolor"=>"0063DC",  //Ad Unit Text color));adiquity_ad($adq_params);?>
I suggest you to use any ad manager plugin so that you don't have to mess up with the templates... "my advertisements" is one such plugin....
What do you want do you. Where do you want to show ads? Are you talking about PPC networks like Adsense or your own forum ads?


Sorry wrong reply.
yes ppc, i also have my ad manager main problem is that i can not understands the ads code do i have to post all the above codes in ad manager..?
You can check these topics and if you have further questions please feel free to ask there.

MyBB Advertisement in Posts

Or

MyBB Adsense after first post
i know to post ads in ad manager but there Adiquity's steps are very hard to understand please check the below images.
they give to two codes one is said to "Insert this code once on the top of your page" and another one is "Insert this code where you want to place the Ad"
[Image: 112aaaaaa.jpg]
Insert this code once on the top of your page - goes into headerinclude template

Insert this code where you want to place the Ad - goes into the ad manager plugin or in the templates where you want to show ads
You can't execute php scripts in templates (not without a plugin, even in that case it's a security RISK). @Rock On - you see that "HTML" tab in your screenshot (PHP - Curl | JSP | HTML) ? Click on it and provide a screenshot.
Thanks i added html codes, and ads are displaying now.