I'm very happy with the results as well and thank you very much, niestudio.
Am also using to display a random slideshow of all products on a e-zpage and would like to share method.
Added following code to /includes/templates/MY_TEMPLATE/templates/tpl_page_default.php
IMMEDIATELY FOLLOWING:
<h1 id="ezPagesHeading"><?php echo $var_pageDetails->fields['pages_title']; ?></h1>
Haven't tackled body_onload yet, but tentatively planning on it.Code:<?php /*Sequence for listing image paths for slideshow */ // do we want slideshow on this page? if (isset($ezpage_id) and $ezpage_id == 'MY_EZ_PAGE_ID_#'){ //Hidden div to feed invisible images to jscript echo "<div style=\"display:none\">"; // query database table for image paths $this_sql_for_images = mysql_query("SELECT products_image FROM zen_products ORDER BY RAND()"); // loop through image paths and create array while ($row = mysql_fetch_array($this_sql_for_images, MYSQL_NUM)) { //assign string to variable $the_url = $row[0]; if (file_exists("images/".$the_url)) { // RegEx pattern to separate image path from extension $pattern = '|(^.*)\.(.*)|'; //insert "_LRG" in image name so we are displaying large images $replacement = '$1'."_LRG.".'$2'; //assemble path for large image $LRG_URL = preg_replace($pattern, $replacement, $the_url); $full_path = "images/large/".$LRG_URL; if (file_exists($full_path)) { //echo "The large file $full_path exists<hr/>"; //list images with "style = display:none" so they are not visible on page echo "<a href= \"".$full_path."\""." rel=\"renmanimage\"><img src=\"".$full_path."\" style=\"display:none;padding:0;margin:0;height:1px\"></a><br/>"; } } else { //echo "The small file, $the_url exists<hr/>"; //list images with "style = display:none" so they are not visible on page echo "<a href= \"images/".$the_url."\""." rel=\"renmanimage\"><img src=\"images/".$the_url."\" style=\"display:none;padding:0;margin:0;height:1px\"></a><br/>"; } // End LRG file condition } // End DB file exists Condition //End hidden div tag echo "</div>"; //display image - which will need to be uploaded - to click to begin slideshow echo "<a href= \"images/clickhere.jpg\" rel=\"renmanimage\"><img src=\"images/clickhere.jpg\"></a><br/>"; } // End EZ Page ID Condition ?>
Would also like to have main/trigger image excluded from slideshow, WHILE keeping main images from product pages in slideshow.
If body_onload works this may be less of an issue.
Am always open to suggestions on improving code. Am thinking of ultimately adding features for use on Category listing pages.


Reply With Quote
