View Full Version : random banner
Hi,
I wondered if someone had vb4 compatible code to display a random banner among a pool of banners. Some code has been posted for vb3 but it isn't vb4 compatible. Also I know there are various banner mods, but they are focused on advertising banners, not site banner.
Thanks
squidsk
03-16-2015, 05:13 PM
I'm fairly sure that https://vborg.vbsupport.ru/showthread.php?t=188328 can be tweaked to do what you want.
thx but I've already tried it, that's a huge and bloated mod for advertisement banners
so it's unrelated with what I'm looking for
squidsk
03-17-2015, 03:09 PM
That have been what it was originally designed for, but as the creator noted it can be used for more or less anything. It doesn't have to be ad banners that are placed by the mod.
For example if you edit the header template and comment out <vb:comment></vb:comment> the code for the banner and replace it with a placeholder (i.e. %mybanner%). Then create however many banners you want that get assigned to that placeholder.
That's pretty simple to implement and should do for what your after.
I am not interested in that mod thank you.
First it uses external content and is not even flagged as such. A quick look at the xml shows tons of calls for pagead2.googlesyndication.com
On top of that I'd have to deal with all the security issues going along huge mods.
12 lines of codes should be enough for a random banner, and you're asking me to install an huge Heath Robinson device to slice some eggs
squidsk
03-17-2015, 07:20 PM
I am not interested in that mod thank you.
First it uses external content and is not even flagged as such. A quick look at the xml shows tons of calls for pagead2.googlesyndication.com Maybe take a longer look at the code next time. Those links to external content are sample banners provided by the author so that users can have banners to start with. Could/should those be made internal, I'd argue yes, but that doesn't change the fact that removing those ads takes a tiny bit of time.
On top of that I'd have to deal with all the security issues going along huge mods. You'd also have to deal with that for any mod you install on your system, big or small, or even custom code you write yourself. So this statement is pointless to make.
12 lines of codes should be enough for a random banner, and you're asking me to install an huge Heath Robinson device to slice some eggs If it's so simple that it takes only 12 lines of code and you're so good you can handle security issues on your own, why are you wasting your time and ours asking for a solution when you apparently already know the solution. You've already wasted more time telling me why you can't use the mod than it would have taken you write those 12 hypothetical lines of code, especially if you're as good a coder as you claim to be.
The chances of someone creating a solution for you when a viable solution already exists is basically zero, unless you choose to pay someone to do it for you, in which case you're posting in the wrong section and should post in the paid request section.
you seem to be very angry dude
but if you're a coder yourself, I shouldn't have to explain you why you can't expect people to install an huge Heath Robinson device to slice some eggs
as for why I don't do it myself, it's because I'm not familiar with the vb framework
I have tried to get an image from a php file url but vb is making it difficult for people who are not familiar
squidsk
03-18-2015, 01:24 PM
if you're a coder yourself, I shouldn't have to explain you why you can't expect people to install an huge Heath Robinson device to slice some eggs If you're half the coder you claim to be then you should know that as a coder you aren't going to reinvent the wheel if there's a perfectly good wheel that already exists and can be used.
as for why I don't do it myself, it's because I'm not familiar with the vb framework
This is pretty clear from the fact that you keep calling the mod a heath robinson machine but have no clue what would be required to actually code the functionality you are after, other than a vague reference to 12 lines of code. I can guarantee it would likely not be 12 lines of code, and code that small and short would require you to alter core files and would not allow you to make changes through admincp and even then the chances of being able to do it in 12 lines are remote.
Does it have features you aren't interested in using, almost certainly, but that's true with any piece of software you use that you don't code yourself. Did you write your own webserver software because apache is a "heath robinson machine" for doing a whole bunch of things as a webserver that you don't need it to do. Of course not. As I pointed out in my last response no one is going to code you something if a viable free alternative exists unless you pay them to do so, in which case post in the paid section.
I just did it with 8 lines of codes
thanks for your help man
TheLastSuperman
03-18-2015, 06:54 PM
I'd of went with this https://vborg.vbsupport.ru/showthread.php?t=188328 like Squid mentioned, by the way he knows his stuff and when replies is only trying to be helpful - he doesn't know why you like or dislike a mod nor should he care nor do I we simply offer suggestions and don't expect replies such as you've posted no one on here does.
If you did it in 8 lines of code we could have all been spared this thread, more so since you declined to share the few lines (see my sig, its ok to share lol). It's ok to say you don't understand how a mod works, we will help so next time just ask (https://vborg.vbsupport.ru/forumdisplay.php?f=252) OR ask how to code something, we will help with that too :cool:.
^i don't mind to share
I've just added a random_banner.php file and point the banner image source to it.
tbh I don't know if he's really trying to help when I posted in op that I didn't want of these ad banners mods, yet he pointed me to the very thread where I posted earlier it was overly complicated for the simple thing I needed. maybe it's just my imagination but it seemed like baiting.
squidsk
03-18-2015, 08:54 PM
tbh I don't know if he's really trying to help when I posted in op that I didn't want of these ad banners mods, yet he pointed me to the very thread where I posted earlier it was overly complicated for the simple thing I needed. maybe it's just my imagination but it seemed like baiting.
Your op just said you didn't want a mod focused on advertising banners as opposed to site banners. In reality a banner is a banner, the difference between the two types is that the ad banner directs you to some other site or product or service while the site banner does not (i.e. an ad banner is surrounded by a url and site banner is not). So any mod that can be used for advertising banners can also be used for site banners and visa versa. I knew about the rotating banner mod because a site I administer uses it and recall the mod creator saying it could be used for any purpose, he in fact mentioned posting random quotes from famous people using his mod. Now looking back for that post I realize that was in response to you.
I don't regularly read the threads of all mods on this site so I had no idea you'd posted in there, nor would I necessarily associate a post in one section of site with a response to a thread in another. Also just because you found the mod difficult to use didn't mean it wouldn't work, which is why I explained how you would go about using the mod to meet your needs.
I will also point out that your code, unless I'm missing something in your code, which I could very well be, still needs to be tied into your forum for it to display that file as your top banner. You'd also need to edit that code, as opposed to working with a ui, to make changes to the number of links for any banners you want to have displayed. So that code might be shorter but it is more difficult to work with long term. If that code does what you want then that's great because your problem is solved.
^ok then sorry dude it was just a misunderstanding on my side
about the code it also requires an edit of the header template of course, where the default titleimage is located
TheLastSuperman
03-18-2015, 09:53 PM
See simple misunderstanding was all, I hoped it might be that :p. Remember ladies and gents, we chat on a forum but one thing we simply can't convey too well is "tone" (unless you overuse smilies like me trying too do just that lol) so sometimes we tend to read too far into things OR take them the wrong way heck I'm guilty of that too sometimes just ask my wife!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.