MyBB Community Forums

Full Version: Ad Rotator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am using MYBB Ad Rotator [url=http://www.jimmyscode.com/php/ad-rotator-mybb-plugin/][/url](0.0.1) plugin by Jimmy Pena. This plugin selects ads randomly. Is there a way to change code to get plugin to select ads in order, not randomly?
Does the license of the plugin allow you to modify it?
I believe so. Copy and paste from download.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Is possible, random order is in this case easier than in serie. You must keep track of the ad which was shown last. But I think that can easily be handled by a few cookies.

I could do it, but not immediately. The coming 2 days I am fully occupied with other activities.
Question: do you need to keep track of the series per visitor (eg. every visitor sees ad 1, ad 2, etc) or is it per page view regardless of the visitor (eg. visitor 1 sees ad 1, visitor 2 sees ad 2, visitor 1 sees ad 3, etc)?
Good Question. I would prefer (eg. every visitor sees ad 1, ad 2, etc), the second option will work also.
This is to inform you that I have not forgotten you. I will have a look now, but most times Sundays are filled with visitors, so I think it will be tomorrow.

OK, ready somewhat earlier than expected. I overestimated the work because most times it is difficult to "read" code from someone else. But this was rather straightforward.

I used a cookie to keep a counterĀ for both header and footer ads.

Code is attached, try it and report any problems back.
Error message at ACP Plugins after upload:
Fatal error: Cannot redeclare inject_ad_code_header() (previously declared in /home2/poilkj/public_html/inc/plugins/MyBBAdRotator.php:157) in /home2/poilkj/public_html/inc/plugins/MyBBAdRotatorSeq.php on line 232.

I removed original AD Rotator from cPanel. That seems to have been the problem. Will test for a few minuets and if there is a problem, I will let you know.

Thanks for your help.
(2015-08-02, 04:31 PM)1801cuz Wrote: [ -> ]
I removed original AD Rotator from cPanel.

Did you als remove the original from the /inc/plugin directory?
Yes I did.
Pages: 1 2