So I found this coding in another section on this forum for rotating banner ads and having them be clickable and I have a number of questions when implementing this into the VB cloud platform and some of it stems from being a complete beginner...but I also think this may help a lot of others too so I'll put the dunce cap on and ask the questions.
This is the code I have found to allow rotating banners/ads on a site but in the instructions provided it mentions that it is to be added into the template portion of the site which is not really allowed in VB cloud as far as I understand ... so please see my questions below the instructions/code:
Instructions:
1) - Create a directory on your server to host the image files.
2) - Put your banner images in there and name them something unique.
3) - Go to Styles >> Style Manager
4) - In the "Choose Action" drop down select "Edit Templates" for the style you wish to modify.
5) - When the page refreshes, scroll down the list of default style templates until you see "header".
6) - Click header to highlight it and then click Customize (if file is unedited) or Edit (if it's been modified).
7) - When the template editor opens, scroll through the code to around line 368 or so and you'll see "<div class="toolbar">"
8) - Create a new line under that entry and add the following code:
Code:
Here are my questions
I apologize if some of these questions are stupid/crazy beginner... To say that I am a beginner with this stuff is an understatement so thank you to anyone who has the patience to help
This is the code I have found to allow rotating banners/ads on a site but in the instructions provided it mentions that it is to be added into the template portion of the site which is not really allowed in VB cloud as far as I understand ... so please see my questions below the instructions/code:
Instructions:
1) - Create a directory on your server to host the image files.
2) - Put your banner images in there and name them something unique.
3) - Go to Styles >> Style Manager
4) - In the "Choose Action" drop down select "Edit Templates" for the style you wish to modify.
5) - When the page refreshes, scroll down the list of default style templates until you see "header".
6) - Click header to highlight it and then click Customize (if file is unedited) or Edit (if it's been modified).
7) - When the template editor opens, scroll through the code to around line 368 or so and you'll see "<div class="toolbar">"
8) - Create a new line under that entry and add the following code:
Code:
Code:
<div align="right"> <script language="JavaScript"> function your_banner(){ var myimages=new Array() //Add Banner images below. Add as many as you'd like. myimages[1]="http://www.yoursite.com/yourfolder/your_banner_1.png" myimages[2]="http://www.yoursite.com/yourfolder/your_banner_2.png" myimages[3]="http://www.yoursite.com/yourfolder/your_banner_3.png" //Add link to image below. Correspond bracketed ID. var imagelinks=new Array() imagelinks[1]="http://www.youbanner1link.com" imagelinks[2]="http://www.youbanner2link.com" imagelinks[3]="http://www.youbanner3link.com" var ry=Math.floor(Math.random()*myimages.length) if (ry==0) ry=1 document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>') } your_banner() </script> </div>
Here are my questions
- Rather than put this in the header or anywhere else in the template - Can I enter this code into an ad module box and still have it work?
assuming the answer is yes... then I have the following remaining questions: - I don't need anything to align to the "right" so can I just eliminate the line: <div align = "right"> ?
- I am assuming that to make the above work I would upload my banner images to VBCloud File Manager...but how would I get the proper "http://www.yoursite.com/yourfolder/your_banner_1.png" because all I see is core/css/0/0/ a few other numbers my image name.jpg or .png ...there is no http:// or www. anything in front of the file?
- I would like to rotate more than 3 images - what would I need to edit in the code to allow that? my first thought is replicating these two lines but changing the "[3]" to a "[4]" : myimages[3]="http://www.yoursite.com/yourfolder/your_banner_3.png" imagelinks[3]="http://www.youbanner3link.com" but I am sure there must be something with math calculation in there maybe as well?
- I am assuming that the above code is set to randomize the banners based on every refresh or landing of the page and not via a specific time limit like every 30 seconds correct?
- Lastly, I am assuming that with the above code it would insert the ad/banner image at the same size that it was uploaded into VBCloud file manager correct? so if I uploaded a 300x50 banner it would insert it at that size, but if I uploaded another file in that rotation that was 300x250 it would insert at that size?
I apologize if some of these questions are stupid/crazy beginner... To say that I am a beginner with this stuff is an understatement so thank you to anyone who has the patience to help
Comment