Jump to content

tzflorida

New Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by tzflorida

  1. I'd like to pass a value from a URL to an iframe. This would look as follows: URL: http://www.mysite.com?www.mysite2.com The value (www.mysite2.com) will be an actual web address which should then be inserted into an iframe on www.mysite.com via php. Since I know little to no php, I don't know how the URL has to be structured and what php coding I need to use to include the web address in the iframe. Any suggestions are highly appreciated
  2. That line was there from the initial code that darkhappy suggested. But now it's working like a charm... yeah Anyhow, I really appreciate your help. You really know what you are doing. Now I know who to go to personally for any future PHP problems
  3. Am still getting: This is the current code: <?php $_product = $this->getProduct() ?> <?php if (count($this->getGalleryImages()) > 0): ?> <div class="more-views"> <h4><?php echo $this->__('Sample Images') ?></h4> <ul> <?php $counter = 0; foreach ($this->getGalleryImages() as $_image) { $counter = counter + 1; if ($counter % 2 == 0) { $class =1; } else { $class=2; } $counter++; } ?> <li><a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image); ?>', 'gallery', 'scrollbars=yes,width=300,height=300,resizable=yes');return false;"> <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->directResize(140, 300, 1); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()); ?>" title="<?php echo $this->htmlEscape($_image->getLabel()); ?>" <?php echo 'class="myclass' . $class . '"'; ?> /></a> </li><?php } ?></ul></div><?php endif; ?>
  4. That gives me: Parse error: syntax error, unexpected '}' in
  5. I added that to the image tag but I get the following error message: Here is the current code: <?php $_product = $this->getProduct() ?> <?php if (count($this->getGalleryImages()) > 0): ?> <div class="more-views"> <h4><?php echo $this->__('Sample Images') ?></h4> <ul> <?php $counter = 0; foreach ($this->getGalleryImages() as $_image) { $counter = counter + 1; if ($counter % 2 == 0) { $class =1; } else { $class=2; } $counter++; } ?> <li><a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'scrollbars=yes,width=300,height=300,resizable=yes');return false;"> <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->directResize(140, 300, 1); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>" echo 'class="myclass' . $class . '"';/></a> </li><?php endforeach; ?></ul></div><?php endif; ?> I really hope this can be done
  6. I feel stupid ??? I added the semicolon (that was the easy part) but I think I did not correctly insert the code as you specified. Here is what I did: <?php $_product = $this->getProduct() ?> <?php if (count($this->getGalleryImages()) > 0): ?> <div class="more-views"> <h4><?php echo $this->__('Sample Images') ?></h4> <ul> <?php $counter = 0; foreach ($this->getGalleryImages() as $_image) { $counter = counter + 1; if ($counter % 2 == 0) { $class = 1; } else { $class=2; } $counter++; } ?> <li> <a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'scrollbars=yes,width=300,height=300,resizable=yes');return false;"> <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->directResize(140, 300, 1); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"/> </a> </li> <?php endforeach; ?> </ul> </div> <?php endif; ?> Thanks
  7. Thanks for the help. So I tried implementing it however, I seem to be running into the following error message: This is how I implemented the piece of code: <?php $_product = $this->getProduct() ?> <?php if (count($this->getGalleryImages()) > 0): ?> <div class="more-views"> <h4><?php echo $this->__('Sample Images') ?></h4> <ul> <?php $counter = 0 foreach ($array as $value) { $counter = counter + 1; if ($counter % 2 == 0) { $class = 1; } else { $class=2; } $counter++; }?> <?php foreach ($this->getGalleryImages() as $_image): ?> <li> <a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'scrollbars=yes,width=300,height=300,resizable=yes');return false;"> <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->directResize(140, 300, 1); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"/> </a> </li> <?php endforeach; ?> </ul> </div> <?php endif; ?> Did I put it in the right place? I am not at all familiar with PHP. Thanks
  8. I would like to give thumbnails in a gallery alternating CSS classes. In other words, I would like to give the first thumbnail the “.mycssclass1”, the second thumbnail “.mycssclass2”, and then repeat in that order, always alternating between the two classes. Here is the code I am working with: <?php foreach ($this->getGalleryImages() as $_image): ?> <li> <a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'scrollbars=yes,width=300,height=300,resizable=yes');return false;"> <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->directResize(140, 300, 1); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"/> </a> </li> <?php endforeach; ?> The reason I need such function is to float half of the thumbnails to the left and half to the right. I really appreciate any help in this. P.S. Sorry if the title of this post does not make sense, but as I am a layman when it comes to PHP, I did not quite know how to express this problem.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.