| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Shortest random image method | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Shortest random image method
Seen lots of debate over random image methods, here's one for the pot
If your on x-cart 3.3.8 or over use Code:
hows this work? Notice the image{"1"|mt_rand:5}.gif Generating a random number between 1 and 5 using smarty so in the html it's image5.gif or image3.gif etc etc Simply name your images image1.gif, image2.gif, image3.gif etc and set the mtrand:X to the amount you have in the folder. If your running on an older x-cart then the smarty that is installed doesnt support the random function.
__________________
Groovico Used by X-carters the world over: Marketing Manager Pro Bundle For X-cart Featured Product Manager for X-cart Feed manager pro for X-cart http://www.firetanksoftware.com Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X |
|||||||||
#2
|
|||||||||
|
|||||||||
...And if are running an older version of X-cart less than version 3.3.8:
Save the following code to Smarty-2.1.1/plugins/function.random.php. Note your Smarty-2.1.1 directory may differ. Code:
How to use it in .tpls? Code:
Kudos!
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#3
|
|||||||
|
|||||||
Quiet a old post but the random image method given by
groovico still works great for me. Because I want to have different images than the product or detailed images random loaded. But I also would like it to load several images at the same time and on the same page, and in a way there are no duplicate images loaded. Would that be possibe? Furthermore, is there a way to make the random loaded images clickable, so that clicking on them will open the corresponding product page? I hope that somebody can help or knows another way to load clickable images other than the product or detailed images. Thanks in advance!
__________________
X-Cart 4.0.12 Heavy modified with paid, free and forum mods. PHP 5.2.5 | MYSQL 5.0.51a |
|||||||
#4
|
|||||||
|
|||||||
Wow, this is so easy to do its amazing. I was researching how to add a bunch of javascript to do this for the last couple hours until I found this post.
Excellent, fantastic, amazing, easy. thank you thank you thank you
__________________
X-Cart Newbie! - X-Cart Gold v4.1.5 and v4.0.17- Windows 2003 Server, IIS6, PHP 5.2.13 |
|||||||
#5
|
|||||||||
|
|||||||||
__________________
"The point is, to make so much money, that money isn't the point anymore." Pro Version 4.0.19 Gold Version 4.1.3 Linux |
|||||||||
#6
|
|||||||||
|
|||||||||
Quote:
You don't need it for my example above, it's not javascript, it's done in smarty.
__________________
Groovico Used by X-carters the world over: Marketing Manager Pro Bundle For X-cart Featured Product Manager for X-cart Feed manager pro for X-cart http://www.firetanksoftware.com Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X |
|||||||||
#7
|
|||||||||
|
|||||||||
Sorry, is for the link that I post, it use Java
__________________
"The point is, to make so much money, that money isn't the point anymore." Pro Version 4.0.19 Gold Version 4.1.3 Linux |
|||||||||
|
|||
X-Cart forums © 2001-2020
|