Read this thread
its from me JALOKIM

Post new topic  Reply to topic

Alt Banners

Written on Sun Feb 14, 2010 9:33 pm

kewlkreator
Loyal Member
I think everyone thinks that the ego-one banners are absolutely beautiful. Sometimes, we even like one banner better than another!

So, what if we could flip through the banners?

We could put "<" and ">" buttons underneath the logo and when you press one, the logo flips to another.

Taking it even further, we could incorporate some jQuery for some nice slideshow effects.

EVEN more, we could add user made logos that could be accepted and added by members of the team.


________________
   Bookmark and Share

Re: Alt Banners

Written on Mon Feb 15, 2010 12:43 am

Admin
Manager
I've always wanted a rotating banner
each time you refresh there is a new one.


I could add that... but I'm not to sure.


but call me monkeyfoot ... or are you posting so many suggestions just to get a badge?

   Bookmark and Share

Re: Alt Banners

Written on Mon Feb 15, 2010 1:43 am

CodyCFS
Contributor
jalo just read my mind...

i wold like the refresh thing. not the arrows thing so much. i think it would cause a major lag


________________
ForuMotion addict since: 2007

Owner of CLUB FAIR SHARE
http://www.ClubFairShare.com
   Bookmark and Share

Re: Alt Banners

Written on Mon Feb 15, 2010 2:05 am

kewlkreator
Loyal Member
Hrmm. And Jalo, you're right. I just got excited about the badges. Silent I'll wait a bit before I make another suggestion.

But, on this topic, can't we make a refresh thing?

I actually made a tutorial on another site about how to do this:
http://www.dreamincode.net/code/snippet4295.htm

I think we could modify it to something like this:
Code:

<script>
function changeLogo() {
var img=new Array()
img[0]='www.ad.com/ad1.gif';
img[1]='www.ad.com/ad2.gif';
img[2]='www.ad.com/ad3.gif';
img[3]='www.ad.com/ad4.gif';
var xy = Math.floor(Math.random()*img.length);
document.getElementById('logoid').src = ad[xy];
//Insert logoid above
}
</script>


Then we could call it with a body onLoad statement.

Would that work?


________________
   Bookmark and Share

Re: Alt Banners

Written on Mon Feb 15, 2010 2:15 am

CodyCFS
Contributor
nice code. i think it would work Big Grin


________________
ForuMotion addict since: 2007

Owner of CLUB FAIR SHARE
http://www.ClubFairShare.com
   Bookmark and Share

Re: Alt Banners

Written on Mon Feb 15, 2010 3:07 am

Dion
Expert Advisor
That script would cause the banner to be blank (or worse, have a big red X in it!) until the page is fully loaded. Since ego-one pages can take quite a while to load, a script activated on page load would be unacceptable.

On the other hand, since this is a PunBB board, adding a script in the overall_header_new template to write out a random banner image would be pretty easy to do. The script would be similar to yours, in fact...

   Bookmark and Share

Re: Alt Banners

Written on Mon Feb 15, 2010 6:39 am

Josh
Loyal Member
You could always just have a random banner each time as well.

   Bookmark and Share

Re: Alt Banners

Written on Mon Feb 15, 2010 6:47 am

kewlkreator
Loyal Member
What if we removed the function brackets so that the code ran automaticaly? Would that kill the dreaded "red x"?


________________
   Bookmark and Share

Re: Alt Banners

Written on Mon Feb 15, 2010 6:59 am

Dion
Expert Advisor
Your code could run immediately after the banner element was defined in the overall_header_new template, and it would work as advertised. Even better would be to rework the code slightly so it directly wrote out the banner element. In that way each page is only loading one image, not four as your code would load...

   Bookmark and Share

Re: Alt Banners

Written on Mon Feb 15, 2010 5:01 pm

kewlkreator
Loyal Member
Ah. Could we do it like this?

Code:
<script>
function changeLogo() {
var img=4;
//Change to number of images above^^
var xy = Math.floor(Math.random()*img);
document.write('<a href="ego-one.com"><img src="url.com/"' + xy + "'">');
}
</script>


That would save the problem of image loading. However, we would need to host the images in the same directory. Forumotion doesn't do this, or TinyPic, or ImageShack, or Photo Bucket. Someone would have to make a free website somewhere and place the images in a directory. Then change the number of images in the variable in the code. And finally, edit the url to the directory of the images.

PS: someone check my document.write statement for validity. It seems weird. Razz


________________
   Bookmark and Share

Re: Alt Banners

Written on Mon Feb 15, 2010 8:24 pm

Dion
Expert Advisor
Your original source was closer to what you need. Here's a code snippet for you:
Code:
var img=new Array('www.ad.com/ad1.gif','www.ad.com/ad2.gif','www.ad.com/ad3.gif','www.ad.com/ad4.gif');
var xy = Math.floor(Math.random()*img.length);
document.write('<a href="/index.htm"><img src="'+img[xy]+'"></a>');

One of four images will then be written out at random.

(This topic should be in the javascript forum. Can a global mod take care of that? Thanks!)

   Bookmark and Share

Re: Alt Banners

Written on Mon Feb 15, 2010 10:11 pm

kewlkreator
Loyal Member
Yes. That looks good. But the problem is that causes a bunch of images to load (from what I understand) which makes the site run slow. But, say we had a directory on ad.com with images called 1, 2, etc. Then, we grab a random number to call the images. In that sense, the only wait time is the amount of time it takes to grab a random number and load a single image. That's why my code above should work.

And by the way, the forum location is forum.htm not indes. Big Grin


________________
   Bookmark and Share

Re: Alt Banners

Written on Tue Feb 16, 2010 12:09 am

Admin
Manager
actually dion the thread is still categoried as a suggestion.

Till its implementation it'll remain here.
We can later move it.


I still have my old random image code somewhere on my disk, so don't fry your brains over it.

it uses a math code like the codes above...
its a varied version of the quote rotator we have at the bottom of the forum

   Bookmark and Share

Re: Alt Banners

Written on Tue Feb 16, 2010 12:15 am

Dion
Expert Advisor
You can use either /forum.htm or /index.htm to load the homepage. However, there is a benefit to using /index.htm and I'll keep that in my bag of tricks. Big Grin

If the image URL is added properly, the code above will only load one image.

   Bookmark and Share

Re: Alt Banners

Written on Tue Feb 16, 2010 3:00 am

kewlkreator
Loyal Member
Ahh. Big Grin
Thanks for the confirmation. Big Grin


________________
   Bookmark and Share

Post new topic  Reply to topic




Site powered by Forumotion
Copyright 2006-2010 | JalokimGraphics | EgoOne