Thread: Zen Colorbox

Results 1 to 10 of 350

Threaded View

  1. #9
    Join Date
    Mar 2011
    Location
    Pensacola, FL
    Posts
    88
    Plugin Contributions
    4

    Default Re: Zen Colorbox

    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>

    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
    ?>
    Haven't tackled body_onload yet, but tentatively planning on it.
    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.
    Last edited by mutinyzoo; 31 May 2012 at 12:43 AM.

 

 

Similar Threads

  1. v155 Attribute image swapped for main image using Colorbox
    By soxophoneplayer in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 2 Jun 2016, 02:34 PM
  2. Trying to fix inline code with colorbox...
    By toomanyknots in forum General Questions
    Replies: 2
    Last Post: 5 Apr 2015, 04:26 PM
  3. IH and Zen Colorbox vs Zen Lightbox?
    By Feznizzle in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 28 Jan 2015, 02:29 AM
  4. Lightbox OR Colorbox
    By Rizla in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 2 May 2014, 11:55 AM
  5. LightBox, SlimBox, ColorBox, which one is better?
    By waterbender in forum General Questions
    Replies: 0
    Last Post: 13 Aug 2013, 07:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg