News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Help me to add ads in wap2

Started by Kevin1, March 02, 2012, 06:50:32 AM

Previous topic - Next topic

Kevin1

Hey guys i want to add Adiquity ad in my wap2 mode.. I read may tutorial but cant able to place ads.

I want to place this code

Quote<?php
    /**************************************************************************
     *  Adiquity Ad Code - Adiquity.com
     *  Copyright Guruji.com Software Pvt Ltd . All rights reserved.
     *   Language: PHP (Curl)
     *   Version: 18072011
     **************************************************************************/

   $adq_params = array(
         "ADQ_PARAMS"  => array(
               "pazid"=>"adqk35sh-14eoezzm-qqdqq",//PAZID      
               "adbgcolor"=>"FFFFFF", //Ad Unit Background color
               "adtcolor"=>"0063DC",  //Ad Unit Text color
                 )
         );

   /////////////////////////////////
   // Do not edit below this line //
   /////////////////////////////////

   $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);
   $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_CONNECTTIMEOUT, $request_timeout);
   curl_setopt($request, CURLOPT_HTTPHEADER, array("Content-Type: application/x-www-form-urlencoded", "Connection: Close", "X-ADQ-pazid: adqk35sh-14eoezzm-qqdqq"));
   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);
   
?>

Get free Gprs tricks for all telecom operators here.
http://teknotech.in

Oldiesmann

Where do you want these ads to appear?
Michael Eshom
Christian Metal Fans

Kevin1

Get free Gprs tricks for all telecom operators here.
http://teknotech.in

NanoSector

Quote from: Akram210712 on March 02, 2012, 03:36:29 PM
At the top and bottom
At what places, there?

After the linktree, above the menu, ...?
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Kevin1

Get free Gprs tricks for all telecom operators here.
http://teknotech.in

pkrack

Edit wireless.template.php file , there you can add your ad code. Place your ad code in a seperate file i.e ad.php and then call it in wireless.template.php as include (ad.php) to keep the stuff clean

NanoSector

Quote from: pkrack on March 03, 2012, 09:54:37 AM
Edit wireless.template.php file , there you can add your ad code. Place your ad code in a seperate file i.e ad.php and then call it in wireless.template.php as include (ad.php) to keep the stuff clean
No, that breaks the model SMF uses.
I'm able to make something in a moment, just not now.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

pkrack


InfoStrides

At the end of Wireless.template.php file, create a function as below:

function template_adiquity_ads()
{
//Starts Adiquity
echo' <center>

<<<<PUT AD CODE HERE>>>>

</center>';
//Ends Adiquity
}


Then call the function wherever you want it to appear in the template as shown below:

template_adiquity_ads();

I used the same stuff here (http://www.theinfostrides.com/index.php?wap2) and it works.

Let me know if it works for you.

Kevin1

Now i have just copied the ads and placed it at the end of Wireless.template.php file

but the ads are displayiong at the top of the page. please i want to place my one ads below the menu and the other one at the footer.

please check here
http://technotech.tk/index.php?;wap2
Get free Gprs tricks for all telecom operators here.
http://teknotech.in

pkrack

It isnt necessary that the footer of your site comes at the end of your site. At least read the code. Each line has a comment describing the its function, so search the footer and place the code. I again recommend that dont put your ad code directly in wireless.template.php , save it some where else and call it in wireless.template.php . It will be very beneficial because if in future you wana change the code , then you can simply edit the ad file while your wireless.template.php will also remain clean.
      Moreover wireless.template.php contains three versions , so for sure , the end of one will be the begining of other.

Kevin1

QuoteI again recommend that dont put your ad code directly in wireless.template.php , save it some where else and call it in wireless.template.php .
Please tell in details how can i do that.
Get free Gprs tricks for all telecom operators here.
http://teknotech.in

pkrack

     Create a file name it as myads.php the put your code in that file and save it.
      In your wireless.template.php file add the kind include('myads.php'); where you want to display your ads, although yoshi is wants to give you some other solution but i think he is busy

NanoSector

Quote from: pkrack on March 05, 2012, 02:38:27 AM
     Create a file name it as myads.php the put your code in that file and save it.
      In your wireless.template.php file add the kind include('myads.php'); where you want to display your ads, although yoshi is wants to give you some other solution but i think he is busy
Yeah I'm having health issues and I'm having some other project going.
Don't expect any code for me in a while, sorry.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Kevin1

@yoshi
get well soon.
@pkrack
ya i did that bt nt work no ads is displaying.. I hav created the ads php file n uploaded in the public_html directory.
Get free Gprs tricks for all telecom operators here.
http://teknotech.in

pkrack

Have you specified the proper path? Check the syntax also. You must echo the code in ads.php file i.e echo 'your ad code';

Advertisement: