An Osclass plugin to manage banners and its positions in the site.
Copyright 2021 CodexiLab. Code released under the MIT license.
Manage banners and its positions in the site
License: MIT License
Please note that I'm getting the following warning:
PHP Warning: implode(): Invalid arguments passed in \oc-content\plugins\banners\controller\admin\set-banner.php on line 52
Plugin v1.0.3
PHP 7.4.24
At the moment, the plugin allows us to add only 1 Image/Script per banner.
It would be nice if we had the option to upload multiple images per every banner, as we'll have cases where a partner wants to promote 2 or more products on the same banner position.
For this I was using a simple JS that allowed me to show random banners on each page reload, based on a predefined list.
Example:
<script type="text/javascript">
var imageUrls = [
"https://www.5banners.com/store/img/cms/00045.gif" ,
"https://www.bannereasy.com/assets/templates/2/1071.png"
];
var imageLinks = [
"http://www.stackoverflow.com" ,
"http://www.google.com"
];
function tangoAdBoxTall() {
var dataIndex = Math.floor(Math.random() * imageUrls.length);
var img = '<a href=\"' + imageLinks[dataIndex] + '"><img src="';
img += imageUrls[dataIndex];
img += '\" title=\"Your Text!\"/></a>';
return img;
}
</script>
<script type="text/javascript" defer>
document.write(tangoAdBoxTall());
</script>
Maybe this can be adapted to the Banners plugin.
Thanks!
At the moment, the plugin registers every time a user clicks on the banner. So if a user clicks 50 times in 50 seconds, the plugin will return 50 clicks.
Is there a way/reason to prevent this by using a JS like this one?
The idea is to generate a cookie with an expiration of 24 hours (maybe) or longer, each time a user clicks on the banner.
There's no need for complicated IP storing/checks, as it would be too much, and would complicate stuff, so a cookie would be the easiest way.
What do you think?
Please note that the plugin registers banner clicks even when the admin is logged in, and he clicks on the banner to test it.
This can lead to fake clicks.
So a condition with osc_is_admin_user_logged_in()
can be added to check weather if the admin is logged in or not, and if he's logged in, not to register the banner clicks.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.