MyBB Community Forums

Full Version: Banner Rotation / Random Logo
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey colleagues,

coming from WBB i just needed a very small plugin to achieve a random Logo/Banner picker extension, so i created one, fully configurable in AdminCP. Just provide a path to the folder with all available images. Activate it and you're done. Everytime your board is rendered a random image is picked an displayed.

Name : ZD Banner Rotation
Version : 1.0.0
Description : Implements a random image picker to display as logo

https://community.mybb.com/mods.php?acti...w&pid=1586
thank you for sharing!
I did add your project link to your OP.

As a suggestion: perhaps cache your files and refresh every X minutes, as it is likely the files won't change frequently as to run the file system logic with every page load.

Also, you repeat your logic twice, once at global_intermediate and another time at global_end. Only once should be necessary.

Regards.
(2024-02-07, 12:52 AM)Omar G. Wrote: [ -> ]I did add your project link to your OP.

As a suggestion: perhaps cache your files and refresh every X minutes, as it is likely the files won't change frequently as to run the file system logic with every page load.

Also, you repeat your logic twice, once at global_intermediate and another time at global_end. Only once should be necessary.

Regards.

Thanks for the input. You're right, i missed to remove one hook Big Grin 

caching... hrm... do you really think it's worth moving performance from sys IO to DB IO to build/retrieve the cache... its a simple random function and i dont think the cache is worth it until someone is piling up thousands of images Smile
You are probably correct, in most cases you could be saving more resources (time) simply not updating your script to use the cache system Toungue
new release 1.0.1 is out Smile removed the unnecessary hook.
Nice plugin.

Keep up the good work!