Ozzy47

Former Developer
Customer
@Fillip H. Cosmic
I have made a small mod to rotate the product images that you guys have on here, it shows a new image every page refresh.

I have it running on my site so you can see it in action, also provided a screen shot.

The code posted on here is coded for this site, it pulls the images from your dbtech/product_images/ folder

EDIT: I have this code placed in ForumHome template below {vb:raw header} so it only shows on Forum Home page

14dbc856907515.png


Code:
<!--START MOD LOGO ROTATOR-->

<center><font size="4"><font color="black"><b>DragonByte Tech Random Mod </b></font></font size></center><br>
<SCRIPT LANGUAGE="JavaScript">
 
<!-- Begin Random Logo In Header Script
 
var theImages = new Array() // do not change this
var theLinks = new Array() // set up the container for the links

<!-- Edit the url images to match yours
theImages[0] = 'http://www.dragonbyte-tech.com/dbtech/product_images/vbshout.png'
theLinks[0] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=2'
theImages[1] = 'http://www.dragonbyte-tech.com/dbtech/product_images/vbquiz.png'
theLinks[1] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=101'
theImages[2] = 'http://www.dragonbyte-tech.com/dbtech/product_images/postbit.png'
theLinks[2] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=86'
theImages[3] = 'http://www.dragonbyte-tech.com/dbtech/product_images/profilehover.png'
theLinks[3] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=83'
theImages[4] = 'http://www.dragonbyte-tech.com/dbtech/product_images/forumon.png'
theLinks[4] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=76'
theImages[5] = 'http://www.dragonbyte-tech.com/dbtech/product_images/vbdownloadsv1.png'
theLinks[5] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=78'
theImages[6] = 'http://www.dragonbyte-tech.com/dbtech/product_images/vbshop.png'
theLinks[6] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=50'
theImages[7] = 'http://www.dragonbyte-tech.com/dbtech/product_images/credits.png'
theLinks[7] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=40'
theImages[8] = 'http://www.dragonbyte-tech.com/dbtech/product_images/vboptimise.png'
theLinks[8] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=1'
theImages[9] = 'http://www.dragonbyte-tech.com/dbtech/product_images/vbactivity.png'
theLinks[9] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=3'
theImages[10] = 'http://www.dragonbyte-tech.com/dbtech/product_images/infopanels.png'
theLinks[10] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=4'
theImages[11] = 'http://www.dragonbyte-tech.com/dbtech/product_images/usertag.png'
theLinks[11] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=20'
theImages[12] = 'http://www.dragonbyte-tech.com/dbtech/product_images/thanks.png'
theLinks[12] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=22'
theImages[13] = 'http://www.dragonbyte-tech.com/dbtech/product_images/triad.png'
theLinks[13] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=23'
theImages[14] = 'http://www.dragonbyte-tech.com/dbtech/product_images/random_questions.png'
theLinks[14] = 'http://www.dragonbyte-tech.com/vbecommerce.php?do=purchase&act=product&id=33'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<div align="center"><a href="'+theLinks[whichImage]+'" target="_blank"><img src="'+theImages[whichImage]+'" border="0" alt="{vb:raw vboptions.bbtitle}" /></a></div>');
} 
// End -->
</script>

<!-- logo -->
<a name="top"></a> 
<td align="$stylevar[left]"><a href="{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}"><SCRIPT LANGUAGE="JavaScript"> 
showImage(); 
</script>
<!-- /logo -->
<!--END MOD LOGO ROTATOR-->
 
Last edited:
=) Nice. We actually had something like this originally, it tended to distract rather than inform though. We'll look into alternative methods of utilising it though - thanks for taking the time.

Cosmic
 
You do know that your stealing bandwidth, ask DBT if you can copy the images and hard code them to your own server!

Your forum would run faster IMO.
 
Freekoid I coded it on here to run off their server, as it is on my site it runs from my server, images are stored there, I would not steal anything from DB Tech!!
 

Similar threads

Back
Top