Coder Social home page Coder Social logo

osclass-banners's Introduction

Banners

An Osclass plugin to manage banners and its positions in the site.

Banners

Copyright and Licenses

Copyright 2021 CodexiLab. Code released under the MIT license.

osclass-banners's People

Contributors

adrianolmedo avatar

Stargazers

 avatar  avatar

Watchers

 avatar

osclass-banners's Issues

PHP Warning in v1.0.3

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

Multiple images/banners per position

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!

Click bombing prevention

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?

Banner clicks when Admin is logged in

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!

View banner position on first click

As you can see in the below screenshot, when you first click on View banner in the Manage banners section, the dialog box opens low on the page, out of the users' view.
banner1

If you close the dialog box and open it again, then it works fine.
banner2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.