Hello;
so you need to have a random stamp when sending an e-card?
Let's say you've got a few tamps called
stamp_01.gif to
stamp_05.gif, in your folder
templates/your_template/images. For instance, these ones:
So let us put that code in the file
templates/your_template/header.html, before the closing tag
</head>:
<script language="JavaScript" type="text/javascript">
var theImages = new Array()
theImages[0] = 'templates/your_template/images/stamp_01.gif'
theImages[1] = 'templates/your_template/images/stamp_02.gif'
theImages[2] = 'templates/your_template/images/stamp_03.gif'
theImages[3] = 'templates/your_template/images/stamp_04.gif'
theImages[4] = 'templates/your_template/images/stamp_05.gif'
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('<img src="'+theImages[whichImage]+'" alt="stamp">');
}
</script>
Now, edit your file
templates/your_template/postcard_send.html and change:
<img src="{template_url}/images/stamp.gif" border="0" />
to:
<script language="JavaScript" type="text/javascript">showImage()</script>
Please change in any code "your_template" for your template name.
Note I've not yet tested it, and don't really know how it works. Maybe same changes have to be done in
templates/your_template/postcard_preview.html.
Please find in attachment the five stamps.
Hope it could help a little.