MyBB Community Forums

Full Version: Random banner mod
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everyone,

I'm redoing our DeLorean club website to include myBB as a forum on it and one of the things I did on the old site is have a random picture that displayed from our photo album on the welcome page. Now with the new setup I'm working on I wanted to do something a little different and have the banner change on every page load.

Now I don't take any credit for the idea, I blatently stole it from one of my favorite boards http://www.scifi-meshes.com that change their banner picture randomly aswell.

It also sounded like a nice and easy little challenge to get into the world of plugin writing for myBB as I'm totally new to this.

Also here I totally admit stealing ideas, after taking a good look at Jeff Chan's really nice attachment gallery mod it showed me all the tricks I needed to know.

The idea is simple, make a topic in one of your admin only forums and add some attachments of the proper size to it.
On my board the category can only be viewed/edited by the admin group but the subforum in which my topic resides is viewable by all, else it won't work Smile

Then install the plugin and set the topic id to the id of the topic you created.

The plugin will randomly select from the attachments of any of the posts in the topic and view that as the banner picture.

This is my first plugin and I've only tested this on my test site on myBB 1.2.10 so no idea if it will work properly or not.
Its free for all, no limitations. Use at your own risk, don't come crying to me if you kill your board because I did something stupid Wink Suggestions are very welcome!

Owh and mods, if I posted this in the wrong section, I'm new here so please don't shoot me, just move the post Smile
Owh, also forgot,

After installing it will include the banner picture above the site logo. In my screenshot the site logo is above the banner picture, thats something I just changed in the templates myself. I'm not even sure if I am going to keep the logo or not but just in case some people wonder why their logo will turn up below the random banner... Smile
This is a really interesting concept - thank you for the plugin! Smile A forum member just suggested having random forum banners (or rotating ones) and so I hot-footed it to the forums to have a look. I guess in our case, we might put the topic in a public-viewable forum anyway, so that everyone could see the contributions by the forum members. Does it simply just ignore posts/replies in the topic thread that don't have any attachments?

Thanks Smile
Flick, yes it ignores the replies, it simply checks for attachments in the topic and chooses from there.

I later on found someone else did a similar plugin that chooses the banner from a directory with pictures, so I am far from the first to implement this ideaSmile
@bastiaan, thank you for the info! I think the forum thread idead works for us, mainly because then it allows users to submit entries (pending approval) and make comments as well, but thank you also for letting me know about an alternative.
its really fantastic
It's a year old and won't work with 1.4x probably.
Reference URL's