(2013-03-27, 05:48 AM)WebDevandPhoto Wrote: [ -> ]I think this might be what you're looking for:
http://mybbhacks.zingaburga.com/showthread.php?tid=260
if so click the link in my sig ;D
thank you, i will try it
(2013-03-27, 07:58 AM)Cedric Wrote: [ -> ]This is easy to do, put this code in index.php [Only main site page] , or global.php [Display everywhere!]
// Considering the ADcodes as an array!
$ads = array(
"1st AD Code Here. Note: Remember about Escape Sequences or PHP will pull out error!",
"2nd AD Code Here. Note: Remember about Escape Sequences or PHP will pull out error!",
"3rd AD Code Here. Note: Remember about Escape Sequences or PHP will pull out error!",
);
$randomadcodes = $ads[rand(0, count($quotes) - 1)];
Then go to your header template & put {$randomcodes} to display them
Enjoy!
for this column
1st AD Code Here. Note: Remember about Escape Sequences or PHP will pull out error!
whether to code JS ads that will appear?
because my PHP language is still low,
I am superior in CSS and HTML. I am not for the arrogant to you.
Put escaped HTML/JS code there, each ad in new "". So copy the code and if there are PHP characters (for example ") in it, escape them using \ before them.
By Escape sequences I meant, for example this is your AD code:
<script type="text/javascript" src="ads.js"></script>
Then in PHP you write it as: <script type=\"text/javascript\" src=\"ads.js\"></script>
OK now I understand.
if you write PHP code above to support plugin "MyAdvertisement"?
No i don't write for MyAdvertisements. Just put my code in your files & you will get it to work without a plugin.
(2013-03-27, 03:04 PM)Cedric Wrote: [ -> ]No i don't write for MyAdvertisements. Just put my code in your files & you will get it to work without a plugin.
okay this is very good to use.
however I've been using a plugin MyAdvertisement
I'm confused is how to add the combination to display ads in this section:
[
attachment=28866]
attachment above is JS code to display an image in the form of ads
I think you are really not understanding me
Follow these steps:
-> Edit Your Global.php [Open cPanel -> MYBB DIRECTORY -> Right-Click On Global.php & Select EDIT]
Find this:
// Set up some of the default templates
eval("\$headerinclude = \"".$templates->get("headerinclude")."\";");
eval("\$gobutton = \"".$templates->get("gobutton")."\";");
eval("\$htmldoctype = \"".$templates->get("htmldoctype", 1, 0)."\";");
eval("\$header = \"".$templates->get("header")."\";");
Add just above it:
// Considering the AD codes as an array.
$ads = array(
1 => "AD Code 1",
2 => "AD Code 2",
3 => "AD Code",
4 => "AD Code",
5 => "AD Code",
6 => "AD Code"
);
$randnum = rand(1,6);
$randomadcodes = $ads[$randnum];
***If you can provide me your AD codes, I will add them for you.
Now go to -> Themes & Templates -> Templates -> YOUR THEME -> Header -> header ->
Add this where you want to display the ADS:
{$randomadcodes}
*I tested it on my localhost, works perfectly like HELL!
okay
This has worked for me to do.
thank you so much you have helped me.
if there is anything I can do I will do for you
once again thanks
Glad that I was able to help
Sorry to bump an old thread but version 2.0.3 already does this
http://forums.mybb-plugins.com/Thread-My...ents-2-0-3
You just add the adverts you want to the zone so new ads to the same zone, and they will be randomly shown.
Test it by creating a new advert with just text like "this ad is random1" then another "this ad is random 2" and you will see them randomly displayed.
I am thinking of adding priority to it as well so you can choose priority so that say you have a campaign of 1000 views for an advert and want it random you can add weighting to the randomness so it is shown say at least 1 every 5 pageloads