Making banner change on refresh in a better spot
4 posters
Page 1 of 1
Making banner change on refresh in a better spot
What I want : A banner on top to change every time I refresh.
What I searched : This https://help.forumotion.com/t93201-banner-script?highlight=banner+changes+every+time+you+refresh
So I used the generator located in that OLD thread.
Changed the coding to adjust the size
So basically this is the code
One of the posts in that thread says to put it in Display >Generalities >Home page message
It works but I don't like how it's in the box/table
Is there a way to make it on top where normal banners are usually located?
edit: SORRY I DON'T KNOW IF THIS IS THE RIGHT SECTION
What I searched : This https://help.forumotion.com/t93201-banner-script?highlight=banner+changes+every+time+you+refresh
So I used the generator located in that OLD thread.
Changed the coding to adjust the size
So basically this is the code
- Code:
<script type="text/javascript">
<!-- Begin
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
function rnd() {
rnd.seed = (rnd.seed*9301+49297) % 233280;
return rnd.seed/(233280.0);
};
function rand(number) {
var result = Math.ceil(rnd()*number);
if (!result)result++;
return result
};
var ad_cnt3 = 3;
var ad3 = rand(ad_cnt3);
var link3;
var adBanner3;
var width3
var height3
if (ad3==1) {
link3="http://www.maple-guide.com/";
adBanner3="http://i909.photobucket.com/albums/ac298/iroxsta/v2.png";
width3="800";
height3="200";
alt3="";
}
if (ad3==2) {
link3="http://www.maple-guide.com/";
adBanner3="http://i52.tinypic.com/2lc63j4.jpg";
width3="657";
height3="140";
alt3="";
}
if (ad3==3) {
link3="http://www.maple-guide.com/";
adBanner3="http://i53.tinypic.com/11jut5v.jpg";
width3="318";
height3="150";
alt3="";
}
document.write('<center><a href="' + link3 + '" target="_top">');
document.write('<img src="' + adBanner3 + '" width=' + width3 + ' height=' + height3 + ' border=0 alt="' + alt3 + '"></a>');
document.write('</center>');
// End -->
</SCRIPT>
One of the posts in that thread says to put it in Display >Generalities >Home page message
It works but I don't like how it's in the box/table
Is there a way to make it on top where normal banners are usually located?
edit: SORRY I DON'T KNOW IF THIS IS THE RIGHT SECTION
Toucan- Forumember
- Posts : 27
Reputation : 0
Language : English
Re: Making banner change on refresh in a better spot
Hi,
This should help you https://help.forumotion.com/t93791-multi-banners#608754 . I'd use Vlajki's example. It's the simpiest and works.
This should help you https://help.forumotion.com/t93791-multi-banners#608754 . I'd use Vlajki's example. It's the simpiest and works.
Nera.- Energetic
- Posts : 7078
Reputation : 2017
Language : English
Location : -
Re: Making banner change on refresh in a better spot
so i can't use coco's post since it's ph3 only
so i went on to the randimg thing
Every time i upload my banner it keeps saying upload fail.
Does it not support PNG images? just wondering.
edit:I guess it only supports jpg... which is bad since the quality on those things are horrid.
so i went on to the randimg thing
Every time i upload my banner it keeps saying upload fail.
Does it not support PNG images? just wondering.
edit:I guess it only supports jpg... which is bad since the quality on those things are horrid.
Toucan- Forumember
- Posts : 27
Reputation : 0
Language : English
Re: Making banner change on refresh in a better spot
It should. Click on this link a fiew times you'll see three different pictures
http://pile.randimg.net/0/29/7425/moje.png
http://pile.randimg.net/0/29/7425/moje.png
Nera.- Energetic
- Posts : 7078
Reputation : 2017
Language : English
Location : -
Re: Making banner change on refresh in a better spot
What program did you use to save it? How did you save it?
I have a banner with some transparent areas. Tried to upload it, still nothing.
I have a banner with some transparent areas. Tried to upload it, still nothing.
Toucan- Forumember
- Posts : 27
Reputation : 0
Language : English
Re: Making banner change on refresh in a better spot
There is no program.
If you found a .png photo online when saveing it on computer with right click you have an option Save as: choose png.
The same thing is when makeing it in PS. Save as = transparent .png
If you upload it here even it will stay .png http://i.imm.io/7GpX.png
So is the same with randoming.net
Edit: You are aware that when you make a pile you have to click on the small link and take that link it offeres you like I did hare and use it as your logo. Do not save it or reupload it. It will look like mine here.
If you found a .png photo online when saveing it on computer with right click you have an option Save as: choose png.
The same thing is when makeing it in PS. Save as = transparent .png
If you upload it here even it will stay .png http://i.imm.io/7GpX.png
So is the same with randoming.net
Edit: You are aware that when you make a pile you have to click on the small link and take that link it offeres you like I did hare and use it as your logo. Do not save it or reupload it. It will look like mine here.
Nera.- Energetic
- Posts : 7078
Reputation : 2017
Language : English
Location : -
Re: Making banner change on refresh in a better spot
I know...
but this keeps happening
this is one of the banners im trying to use
https://2img.net/h/oi54.tinypic.com/2j64x37.jpg
but this keeps happening
this is one of the banners im trying to use
https://2img.net/h/oi54.tinypic.com/2j64x37.jpg
Toucan- Forumember
- Posts : 27
Reputation : 0
Language : English
Re: Making banner change on refresh in a better spot
My version works just fine I also couldn't get a thing to load on that site other than avatars
coco moco- Forumember
- Posts : 118
Reputation : 50
Language : English
Re: Making banner change on refresh in a better spot
You mean your "How to get a multibanner in PHPBB3" thing works for PHPBB2?coco moco wrote:My version works just fine I also couldn't get a thing to load on that site other than avatars
I didn't bother trying it seeing as you said it's only for PHP3.
Toucan- Forumember
- Posts : 27
Reputation : 0
Language : English
Re: Making banner change on refresh in a better spot
The method as I described will only work for PHPBB3, you could change the selector, though, and it would work for PHPBB2. There may be an easier way, though.
If I remember rightly, you have access to the overall header template? Found in templates=>general
Can you not just insert the code generated at http://www.htmlbasix.com/banner.shtml into the template?
I may be missing my guess, but surely that's where the banner is?
If I remember rightly, you have access to the overall header template? Found in templates=>general
Can you not just insert the code generated at http://www.htmlbasix.com/banner.shtml into the template?
I may be missing my guess, but surely that's where the banner is?
coco moco- Forumember
- Posts : 118
Reputation : 50
Language : English
Re: Making banner change on refresh in a better spot
coco moco wrote:The method as I described will only work for PHPBB3, you could change the selector, though, and it would work for PHPBB2. There may be an easier way, though.
If I remember rightly, you have access to the overall header template? Found in templates=>general
Can you not just insert the code generated at http://www.htmlbasix.com/banner.shtml into the template?
I may be missing my guess, but surely that's where the banner is?
I've done that, and strangely, nothing showed.
Toucan- Forumember
- Posts : 27
Reputation : 0
Language : English
Re: Making banner change on refresh in a better spot
Try this then - put the javascript in your homepage message.
The html that's created put in your header template (if it works can worry about styling afterwards).
The html that's created put in your header template (if it works can worry about styling afterwards).
coco moco- Forumember
- Posts : 118
Reputation : 50
Language : English
Re: Making banner change on refresh in a better spot
Wait a minute.. is it possible because I got a different kind of code?
*I tried this code in homepage message and it worked except, still dislike how it's not on top of the forum.
*I tried this code in homepage message and it worked except, still dislike how it's not on top of the forum.
- Code:
<script type="text/javascript">
<!-- Begin
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
function rnd() {
rnd.seed = (rnd.seed*9301+49297) % 233280;
return rnd.seed/(233280.0);
};
function rand(number) {
var result = Math.ceil(rnd()*number);
if (!result)result++;
return result
};
var ad_cnt3 = 3;
var ad3 = rand(ad_cnt3);
var link3;
var adBanner3;
var width3
var height3
if (ad3==1) {
link3="http://www.maple-guide.com/";
adBanner3="http://i909.photobucket.com/albums/ac298/iroxsta/v2.png";
width3="800";
height3="200";
alt3="";
}
if (ad3==2) {
link3="http://www.maple-guide.com/";
adBanner3="http://i52.tinypic.com/2lc63j4.jpg";
width3="657";
height3="140";
alt3="";
}
if (ad3==3) {
link3="http://www.maple-guide.com/";
adBanner3="http://i53.tinypic.com/11jut5v.jpg";
width3="318";
height3="150";
alt3="";
}
document.write('<center><a href="' + link3 + '" target="_top">');
document.write('<img src="' + adBanner3 + '" width=' + width3 + ' height=' + height3 + ' border=0 alt="' + alt3 + '"></a>');
document.write('</center>');
// End -->
</SCRIPT>
Toucan- Forumember
- Posts : 27
Reputation : 0
Language : English
Re: Making banner change on refresh in a better spot
A different code does seem to be the case, for a page reload.
Is what you get if you had it on a time delay. As you can see it generates html
Hmmm, I wonder if we tweaked it a bit, and used the code to replace your current banner. It does have an ID so should be fine to select, and you could put an empty gif up so as not to hinder page loading. I have a fair bit to do this morning, but leave it with me
- Code:
<script type="text/javascript">
var imgs1 = new Array("www.test.com","www.test.com","www.test.com");
var alt1 = new Array();
var currentAd1 = 0;
var imgCt1 = 3;
function cycle1() {
if (currentAd1 == imgCt1) {
currentAd1 = 0;
}
var banner1 = document.getElementById('adBanner1');
var link1 = document.getElementById('adLink1');
banner1.src=imgs1[currentAd1]
banner1.alt=alt1[currentAd1]
currentAd1++;
}
window.setInterval("cycle1()",30000);
</script>
<img src="www.test.com" id="adBanner1" border="0" width="468" height="60"></a>
Is what you get if you had it on a time delay. As you can see it generates html
- Code:
<img src="www.test.com" id="adBanner1" border="0" width="468" height="60"></a>
Hmmm, I wonder if we tweaked it a bit, and used the code to replace your current banner. It does have an ID so should be fine to select, and you could put an empty gif up so as not to hinder page loading. I have a fair bit to do this morning, but leave it with me
coco moco- Forumember
- Posts : 118
Reputation : 50
Language : English
Re: Making banner change on refresh in a better spot
thanks I guess.
I'm still gonna keep playing around til I get to work. Might even switch forum versions just to do it.
I'm still gonna keep playing around til I get to work. Might even switch forum versions just to do it.
Toucan- Forumember
- Posts : 27
Reputation : 0
Language : English
Re: Making banner change on refresh in a better spot
Hiya, sorry I didn't get back to you. I had an extremely busy day yesterday.
I had a little play around and I've had not much luck on pageload. However, it works absolutely perfectly on a timer. I will have another look when I get a chance, to see if it can't be cracked, and in the meantime maybe someone can see something I'm missing
If you want it on a timer (and I used your images, and got them looking pretty good on a 20 second loop), go to htmlbasix, input your code and set your time delay (it may be an idea to have all the images the same size as you don't have an option for each image, you could just put your smaller images on a transparent background).
The code it generates will be in 2 parts. The first part in <script></script> tags needs to go in your homepage message.
The HTML part generated at the end, needs to go in your overall header.
I replaced every link and image with the comparative code generated by htmlbasix
I tried changing the javascript
Into a function that's called on pageLoad, where a random number from the array is called, but where ever I put it, it wasn't playing ball. I'm probably missing something rather obvious, and I'm not sure when I'll get a chance to look again
I'd suggest, putting the banner up to rotate on a cycle, while looking for the ideal solution, it does look pretty good. Dion over at http://diondesigns.forumotion.com/ is quite a dab hand with the coding (though he doesn't like phpbb2), and he might be able to help you sort it out.
I had a little play around and I've had not much luck on pageload. However, it works absolutely perfectly on a timer. I will have another look when I get a chance, to see if it can't be cracked, and in the meantime maybe someone can see something I'm missing
If you want it on a timer (and I used your images, and got them looking pretty good on a 20 second loop), go to htmlbasix, input your code and set your time delay (it may be an idea to have all the images the same size as you don't have an option for each image, you could just put your smaller images on a transparent background).
The code it generates will be in 2 parts. The first part in <script></script> tags needs to go in your homepage message.
The HTML part generated at the end, needs to go in your overall header.
- Code:
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<!-- BEGIN switch_logo_left -->
<td><a href="{U_INDEX}"><img src="{LOGO}" id="i_logo" border="0" alt="{L_INDEX}" vspace="1" /></a></td>
<!-- END switch_logo_left -->
<td align="center" width="100%" valign="middle">
<!-- BEGIN switch_logo_center -->
<a href="{U_INDEX}"><img src="{LOGO}" id="i_logo" border="0" alt="{L_INDEX}" vspace="1" /></a>
<br />
<!-- END switch_logo_center -->
<div class="maintitle">{MAIN_SITENAME}</div>
<br />
<span class="gen">{SITE_DESCRIPTION}<br /> </span>
</td>
<!-- BEGIN switch_logo_right -->
<td><a href="{U_INDEX}"><img src="{LOGO}" id="i_logo" border="0" alt="{L_INDEX}" vspace="1" /></a></td>
<!-- END switch_logo_right -->
</tr>
</table>
I replaced every link and image with the comparative code generated by htmlbasix
- Code:
<a href=""blah1"" id="adLink1" target="_top">
<img src="blah" id="adBanner1" border="0" width="468" height="60"></a>
- Code:
<a href="{U_INDEX}"><img src="{LOGO}" id="i_logo" border="0" alt="{L_INDEX}" vspace="1" /></a>
I tried changing the javascript
- Code:
<script type="text/javascript">
var imgs1 = new Array("blah","blah");
var lnks1 = new Array("blah1","blah1");
var alt1 = new Array();
var currentAd1 = 0;
var imgCt1 = 2;
function cycle1() {
if (currentAd1 == imgCt1) {
currentAd1 = 0;
}
var banner1 = document.getElementById('adBanner1');
var link1 = document.getElementById('adLink1');
banner1.src=imgs1[currentAd1]
banner1.alt=alt1[currentAd1]
document.getElementById('adLink1').href=lnks1[currentAd1]
currentAd1++;
}
window.setInterval("cycle1()",10000);
</script>
Into a function that's called on pageLoad, where a random number from the array is called, but where ever I put it, it wasn't playing ball. I'm probably missing something rather obvious, and I'm not sure when I'll get a chance to look again
I'd suggest, putting the banner up to rotate on a cycle, while looking for the ideal solution, it does look pretty good. Dion over at http://diondesigns.forumotion.com/ is quite a dab hand with the coding (though he doesn't like phpbb2), and he might be able to help you sort it out.
coco moco- Forumember
- Posts : 118
Reputation : 50
Language : English
Re: Making banner change on refresh in a better spot
I appreciate the effort!
The timer works, although still unfavorable for my liking (xD I'm so picky) but I guess I'll stick with the timer for now.
The timer works, although still unfavorable for my liking (xD I'm so picky) but I guess I'll stick with the timer for now.
Toucan- Forumember
- Posts : 27
Reputation : 0
Language : English
Re: Making banner change on refresh in a better spot
send me the images and i will make you a new code.
I have a banner maker with a rotating banner option as well,
so ok you want it to change to a different banner each time you click to a different page or refresh, do you want the banners in a random order or in a certain back to back order?
So send me the images and i will put it together for you.
Oh i can only fit up to eight different images/banners but that should be plenty.
Oh i can add different links to each image as well, so dont know if you want different click-able links in the banners or not, but if you do be sure to send me the links and what one will go with what banner.
and as far as your images not uploading, you have to be sure you are useing a image host that allows png, depending on the size of the files they will not always upload right with servimg, so you may want to get a photobucket account, you cant even upload them to imageshack anymore without paying.. i hate it. it's bull dung... lol
I have a banner maker with a rotating banner option as well,
so ok you want it to change to a different banner each time you click to a different page or refresh, do you want the banners in a random order or in a certain back to back order?
So send me the images and i will put it together for you.
Oh i can only fit up to eight different images/banners but that should be plenty.
Oh i can add different links to each image as well, so dont know if you want different click-able links in the banners or not, but if you do be sure to send me the links and what one will go with what banner.
and as far as your images not uploading, you have to be sure you are useing a image host that allows png, depending on the size of the files they will not always upload right with servimg, so you may want to get a photobucket account, you cant even upload them to imageshack anymore without paying.. i hate it. it's bull dung... lol
kirk- Forumaster
- Posts : 11037
Reputation : 653
Language : English,Vulcan,Klingon, Romulan,& Gorn
Re: Making banner change on refresh in a better spot
kirk wrote:send me the images and i will make you a new code.
I have a banner maker with a rotating banner option as well,
so ok you want it to change to a different banner each time you click to a different page or refresh, do you want the banners in a random order or in a certain back to back order?
So send me the images and i will put it together for you.
Oh i can only fit up to eight different images/banners but that should be plenty.
Oh i can add different links to each image as well, so dont know if you want different click-able links in the banners or not, but if you do be sure to send me the links and what one will go with what banner.
and as far as your images not uploading, you have to be sure you are useing a image host that allows png, depending on the size of the files they will not always upload right with servimg, so you may want to get a photobucket account, you cant even upload them to imageshack anymore without paying.. i hate it. it's bull dung... lol
Basically just random.
I'd ask you what you're going to supply to see if I can simply edit it the "code" to my liking but then again...
https://2img.net/h/oi51.tinypic.com/2cok9yc.jpg
https://2img.net/h/oi56.tinypic.com/28tf08.jpg
https://2img.net/h/oi52.tinypic.com/2lc63j4.jpg
Thanks :}
Toucan- Forumember
- Posts : 27
Reputation : 0
Language : English
Similar topics
» Change header by refresh.
» Header change of refresh
» Logo Change on Refresh
» Banner Refresh
» Making a new banner.
» Header change of refresh
» Logo Change on Refresh
» Banner Refresh
» Making a new banner.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum