Guest darthfury Posted December 9, 2008 Share Posted December 9, 2008 Hello i develop and maintain www.coruscantcollectibles.com and im looking for a way for my banner on the mainpage to refresh to a diff. pic every time you refresh the page, is there some code for this and if so how would i go about applying it, im super new but a quick study. or is there a way (like a mod) for cubecart that someone has written ? Jim Sitzler a.k.a. - Darth Fury Quote Link to comment Share on other sites More sharing options...
Guest Posted December 9, 2008 Share Posted December 9, 2008 I did it using a very simple code file on www.sensualelegance.com. Where you want the image to appear - adjust width & height settings to match your images (such as in skins/yourskin/styletemplate/content/index.tpl): <img src="../images/rotate/rotator.php" height="200" width="530" alt="alternate image text."> and create a folder in images called "rotate" (or rename as desired), along with a new file (rotator.php in my example above), with the following code... <?php $files = glob('{*.jpg,*.gif}', GLOB_BRACE); readfile($files[array_rand($files)]); ?> basically this pulls any images in the same directory as the file in randomly. Quote Link to comment Share on other sites More sharing options...
Guest kaskudoo Posted December 17, 2008 Share Posted December 17, 2008 mh. That is simpler than I thought Misty .... and I was looking for sth. like that for a while (I guess I just wasn't looking hard enough!). Will implement it after Christmas - Thanks and have a Merry Christmas :angry: Quote Link to comment Share on other sites More sharing options...
Guest Posted December 17, 2008 Share Posted December 17, 2008 Yup, it was easier than I thought it was going to be too I think I googled "random image php" or something and finally found a scripting site with an example good luck and happy holidays to you too. Quote Link to comment Share on other sites More sharing options...
Guest speckled Posted October 6, 2010 Share Posted October 6, 2010 I know that this is an old topic, but is there a way to add a url to each rotating banner? Thanks, Nancie Quote Link to comment Share on other sites More sharing options...
vokf Posted October 6, 2010 Share Posted October 6, 2010 You can obviously add a fixed URL; <a href="url"><img src...... /></a> Howevever, I assume you want a different url per image. This really needs something a bit more complex, either to read a text file for the image url and target url, or a database. This mod really won't be a 3-liner, and its best to take this over to cubecartforums.org to discuss. Jason Quote Link to comment Share on other sites More sharing options...
Guest speckled Posted October 7, 2010 Share Posted October 7, 2010 Thanks Jason, I was over there looking a little, will have to look more. Thanks again for the info. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.