NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page Simple Ad manager for Vbulletin

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 06-13-2006, 12:13 PM THREAD STARTER               #1 (permalink)
JFS
NamePros Regular
 
JFS's Avatar
Join Date: Oct 2005
Location: Portugal
Posts: 800
JFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to all
 



Simple Ad manager for Vbulletin


greetings,

this have some limitations but it does do the work - it is the one i'm using at the moment - although it may not be the best way to do it.
it was done is like 10 mins so don't expect much stuff

the adsense_728x90.php and adsense_468x60.php contains the code for adsense for my case, just create a new file copy and paste your code and save it.

demo: www.sotaopt.com

For VBulletin

in the globals.php add this
Code:
srand( microtime() * 1000000);
//if you have 5 ads you shoud change this into  $var = rand(1,5);  and add the case's
// makes a random number from 1 to 2
$var = rand(1,2); 
switch($var)
{
     case 1: $ad="ad/adsense_728x90.php";
             $title_ad= "Google Adsense";
             break;
     case 2: $ad="ad/adsense_468x60.php";
             $title_ad= "Google Adsense";
             break;

}
ob_start();
include($ad);
$show_ads = ob_get_contents();
ob_end_clean();
in your template you can call $show_ads to show the ad
i loved the way NP put the ad on the forum tops so i'm using a similiar one hehehe

on the template
Code:
<div align="center" style="border: 2px dotted #CCCCCC; background-color:#EFF1FA;">
<table border="0" cellpadding="2" cellspacing="3" bgcolor="#EFF1FA">
<tr>
 <td align="left">
 <strong>$title_ad</strong></td>
 <td>
 <div align="right">
 <font color="#999999">Forum Sponsor</font>
 </div>
 </td>
 </tr>
  <tr>
   <td colspan="2" align="center">
$show_ads
   </td>
   </tr> 
</table> 
</div>

????: NamePros.com http://www.namepros.com/code/206887-simple-ad-manager-for-vbulletin.html
i don't know if this will be usefull for someone but here it is...
__________________
Joćo Fernandes Silva
Last edited by JFS; 06-16-2006 at 05:18 AM. Reason: adding demo as requested
JFS is offline  
Old 06-15-2006, 10:37 PM   #2 (permalink)
NamePros Expert
 
redhippo's Avatar
Join Date: Oct 2003
Location: ANForum
Posts: 5,218
redhippo is a splendid one to beholdredhippo is a splendid one to beholdredhippo is a splendid one to beholdredhippo is a splendid one to beholdredhippo is a splendid one to beholdredhippo is a splendid one to beholdredhippo is a splendid one to beholdredhippo is a splendid one to behold
 



do you have a live demo of it somewhere? would be helpful!
__________________
|www.vb-skins.com|- Quality Premade Vbulletin skins for Your VB forum makeover |www.Banjir.com|-Free image hosting?[B]For Sale!|AlphaScripts|Money Generating Scripts
FREE VB Skins
redhippo is offline  
Old 06-16-2006, 05:17 AM THREAD STARTER               #3 (permalink)
JFS
NamePros Regular
 
JFS's Avatar
Join Date: Oct 2005
Location: Portugal
Posts: 800
JFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to all
 



sure, i added it on the topic
__________________
Joćo Fernandes Silva
JFS is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 09:15 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger