MyBB Community Forums

Full Version: Random Advertisement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello i was thinking to iframe this on my forum but thought it could cause problems and be annoying...
I was creating a random advertisement that shows for people with a post count less than 50 (in the code it says 500000 that is for testing purposes)

Can anyone change this to a plugin so i don't need iframes all over my site???

<?php
define('IN_MYBB', 0); 
require "./global.php"; 
if(intval($mybb->user['postnum']) < 5000000000){

$number = rand(1, 5);

if($number == 1){
//Walmart Offer
echo '<a href="http://cw.nu/click?aid=8078&linkid=B16962&subid=&subid2=&subid3=&subid4=&subid5="><img border="0" width="728" height="90" src="http://cw.nu/banner?aid=8078&linkid=B16962"></a>';
}

if($number == 2){
//Free iPad2
echo '<a href="http://cw.nu/click?aid=8078&linkid=B18276&subid=&subid2=&subid3=&subid4=&subid5="><img border="0" width="468" height="60" src="http://cw.nu/banner?aid=8078&linkid=B18276"></a> ';
}

if($number == 3){
echo '<a href="http://cw.nu/click?aid=8078&linkid=B16195&subid=&subid2=&subid3=&subid4=&subid5="><img border="0" width="468" height="60" src="http://cw.nu/banner?aid=8078&linkid=B16195"></a> ';
}
}
?>


Thanks! :/
Think i found one that was created already <3
http://mods.mybb.com/view/my-advertisements
I want the advertisements to be on the header - not a post :/

I also wanted to exclude users with a post count higher than x but neither plugins have this :'(.
^ myadvertisements has "Exempt Groups" field. it can be used !!
(2011-06-09, 06:49 PM)ranjani Wrote: [ -> ]^ myadvertisements has "Exempt Groups" field. it can be used !!

But i want to hide it aswell from users with a post count higher than x.. :'(
(2011-06-09, 07:17 PM)ReCaptcha Wrote: [ -> ]
(2011-06-09, 06:49 PM)ranjani Wrote: [ -> ]^ myadvertisements has "Exempt Groups" field. it can be used !!

But i want to hide it aswell from users with a post count higher than x.. :'(

You can use group promotions for that. Setup a new group and then a promotion from the registered group to the new group at a certain post count. Then add the new group to the exempt groups option in the plugin settings.
(2011-06-09, 09:35 PM)AJS Wrote: [ -> ]
(2011-06-09, 07:17 PM)ReCaptcha Wrote: [ -> ]
(2011-06-09, 06:49 PM)ranjani Wrote: [ -> ]^ myadvertisements has "Exempt Groups" field. it can be used !!

But i want to hide it aswell from users with a post count higher than x.. :'(

You can use group promotions for that. Setup a new group and then a promotion from the registered group to the new group at a certain post count. Then add the new group to the exempt groups option in the plugin settings.

I used http://community.mybb.com/thread-31860.html instead but thanks for the idea <3.