Advertisement:

Author Topic: Rotating Logo/Banner (not an ad)  (Read 3508 times)

Offline AxS Voldsom

  • Semi-Newbie
  • *
  • Posts: 13
  • Gender: Male
    • Abyss Studios
Rotating Logo/Banner (not an ad)
« on: October 27, 2007, 12:51:25 PM »
Hi, I have a javascript for rotating the banner or logo which ever you prefer to say when the page is refreshed. However I can't seem to get it to work anywhere within template.index.php or for that matter anywhere else I have attempted to put any sort of code to make it appear. Any help?

PS - For any of those who want to refer me to the ad management mod I want the rotating images to appear where the simple machines logo is on the top left of every page on this site.

SMF Version: 1.1.4

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Rotating Logo/Banner (not an ad)
« Reply #1 on: October 27, 2007, 09:06:02 PM »
Link to your site will help. Is it SMF version 2.0 Beta? Post the code that you are using so others will know what is wrong with it.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline nebula_1979

  • Newbie
  • *
  • Posts: 9
Re: Rotating Logo/Banner (not an ad)
« Reply #2 on: October 27, 2007, 09:08:52 PM »
Link to your site will help. Is it SMF version 2.0 Beta? Post the code that you are using so others will know what is wrong with it.

 .... SMF Version: 1.1.4 .... written quite clear

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Rotating Logo/Banner (not an ad)
« Reply #3 on: October 27, 2007, 09:49:23 PM »
Link to your site will help. Is it SMF version 2.0 Beta? Post the code that you are using so others will know what is wrong with it.

 .... SMF Version: 1.1.4 .... written quite clear

opsss hehe sorry. I was working on 3 things at a time and got things messed up.  :P
Post the codes so others can see it. I am using rotator too but very simple to use. Just post it as an image and it will rotate all the images in the folder randomly.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline AxS Voldsom

  • Semi-Newbie
  • *
  • Posts: 13
  • Gender: Male
    • Abyss Studios
Re: Rotating Logo/Banner (not an ad)
« Reply #4 on: October 28, 2007, 01:31:44 PM »
Aight, rather slow replaying because I don't have much free time, but this is my site [nofollow]. I need the rotating banner to go where my current banner is in the top left. Um as for code I am completely clueless for this and clueless with javascript so I just used a basic template off the internet, here:

Code: [Select]
<SCRIPT language=JavaScript>
/*
 +---------------------------------------------------------+
 | Ad Simple                 Copyright www.YugDesign.com   |
 +---------------------------------------------------------+
 | This program may be used and hosted free of charge by   |
 |anyone for personal purpose as long as this copyright    |
 |notice remains intact.                                   |
 +---------------------------------------------------------+
*/

var img_width = "444";
var img_height = "150";
var img_title = "Home";


var ad=new Array()
//insert here your images src
ad[0]='http://www.abyss-studios.com/media/images/banner-1.png';
ad[1]='http://www.abyss-studios.com/media/images/banner-2.png';
ad[2]='http://www.abyss-studios.com/media/images/banner-3.png';
ad[3]='http://www.abyss-studios.com/media/images/banner-4.png';
ad[4]='http://www.abyss-studios.com/media/images/banner-5.png';

var links=new Array()
//insert here your links
links[0]='http://www.abyss-studios.com';
links[1]='http://www.abyss-studios.com';
links[2]='http://www.abyss-studios.com';
links[3]='http://www.abyss-studios.com';
links[4]='http://www.abyss-studios.com';

var xy=Math.floor(Math.random()*ad.length);
document.write('<a href="'+links[xy]+'" target="_blank"><img src="'+ad[xy]+'" width="'+img_width+'" height="'+img_height+'" alt="'+img_title+'"></a>');
</SCRIPT>

Also unlike the above code says, I am not using this for ads, just a banner that preferably changes when the page is refreshed, but if its time I can live, I think.

Offline Neorics

  • Sophist Member
  • *****
  • Posts: 1,084
  • Gender: Male
  • I eat SMF codes for breakfast!
Re: Rotating Logo/Banner (not an ad)
« Reply #5 on: October 28, 2007, 01:40:51 PM »
Code: [Select]
echo '<div valign="top">';
echo '<img src="http://www.abyss-studios.com/media/images/banner-';
echo rand(1, 5);
echo'.png"/></div>';

try this code
[For Hire] I can help you with anything regarding Simple Machines Forum and TinyPortal  ~ My Portfolio

Offline AxS Voldsom

  • Semi-Newbie
  • *
  • Posts: 13
  • Gender: Male
    • Abyss Studios
Re: Rotating Logo/Banner (not an ad)
« Reply #6 on: October 28, 2007, 02:16:17 PM »
Aight, works perfect, but I just realized I really need to change the banner size, but beyond that the code is perfect.
« Last Edit: October 28, 2007, 02:23:03 PM by AxS Voldsom »

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Rotating Logo/Banner (not an ad)
« Reply #7 on: October 28, 2007, 08:18:18 PM »
Try adding width and height after the img tag.

Code: [Select]
<img width="100%" height="175" src="http://www.abyss-studios.com/media/images/banner-';

or to the last echo.

Code: [Select]
echo '.png" width=100%" height="175" alt="" /></div>';
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline Neorics

  • Sophist Member
  • *****
  • Posts: 1,084
  • Gender: Male
  • I eat SMF codes for breakfast!
Re: Rotating Logo/Banner (not an ad)
« Reply #8 on: October 28, 2007, 10:46:02 PM »
i think adding it once is enough
[For Hire] I can help you with anything regarding Simple Machines Forum and TinyPortal  ~ My Portfolio

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Rotating Logo/Banner (not an ad)
« Reply #9 on: October 29, 2007, 12:22:09 AM »
I know that, that's why I use the word "or" and not "and". I gave him choice whatever is convenient for him.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline Neorics

  • Sophist Member
  • *****
  • Posts: 1,084
  • Gender: Male
  • I eat SMF codes for breakfast!
Re: Rotating Logo/Banner (not an ad)
« Reply #10 on: October 29, 2007, 12:24:20 AM »
oops my bad... i didnt see "or"
[For Hire] I can help you with anything regarding Simple Machines Forum and TinyPortal  ~ My Portfolio

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Rotating Logo/Banner (not an ad)
« Reply #11 on: October 29, 2007, 12:28:57 AM »
oops my bad... i didnt see "or"

NP. Sometimes I make that mistake too. 
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline Stuart

  • Full Member
  • ***
  • Posts: 421
Re: Rotating Logo/Banner (not an ad)
« Reply #12 on: February 03, 2008, 09:17:24 AM »
Code: [Select]
echo '<div valign="top">';
echo '<img src="http://www.abyss-studios.com/media/images/banner-';
echo rand(1, 5);
echo'.png"/></div>';

try this code

Super, thank you so much!