Support Forums


Go Back   68 Classifieds Forums > Help & Support > Modules / Plugins / Modifications

Notices

 
LinkBack Thread Tools Display Modes
Old 02-27-2008, 11:11 PM   #1
cwp
Senior Member
 
cwp's Avatar
 
Join Date: Jun 2007
Posts: 297
Rep Power: 16
cwp is a jewel in the rough
Default MODIFICATION: Changing the photo layout on the viewlisting.tpl page.

There are currently 2 different ways that I know of to change the way the photos appear. Credit goes to spaceboy for example one, and for example two the credit goes to suzkaw. Just plug the code into your viewlisting.tpl template. Remember to have a backup on hand if you find out that you don't either of them.

Example 1:

Code:
{* This the image display portion *}
<script type="text/javascript" language="javascript">
{literal}
function showPic (whichpic) {
 if (document.getElementById) {
  document.getElementById('placeholder').src = whichpic.href;
  return false;
 } else {
  return true;
 }
}
{/literal}
</script>
                 {if $viewphotos=="Y"}
                     {if $data<>""}
    <table width="375" height="350" border="0" align="center" cellpadding="0" cellspacing="0">
     <tr>
          <td width="350" height="300" align="center">
          {section name=image loop=$data max=1}
			<table border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#FFFBE7" bgcolor="#333333" style="border-collapse: collapse">
				<tr>
					<td>
					<p align="center">
					<img id="placeholder" src="photos/{$data[image].image}" alt="" class="imageborder" style="border-left:2px solid #999999; border-right:2px solid #999999; border-top:2px solid #999999; border-bottom:2px solid #999999; " width="350" />{/section}</p>					</td>
				</tr>
			</table></td>
     </tr>
     <tr>
          <td valign="top" height="60" align="center">
                <table border="0" cellpadding="10" cellspacing="0" bgcolor="#E3E4E6">
  <tr>
    <td height="10">
             {foreach from=$data item="entry"}
			<a onClick="return showPic(this)" href="photos/{$entry.image}">
			<img src="thumbs/small_{$entry.image}" hspace="0" vspace="0" border="0" class="imageborder" width="60" height="45" alt="" align="center" style="border: 2px solid #666666; "/></a>
                         {/foreach}    </td>
  </tr>
</table>
                    </div></td>
     </tr>
</table>
 {/if}
                 {/if}
                 {* This ends the image display portion *}
Example 2:

Code:
  {* This the image display portion *}
			     {if $viewphotos=="Y"}
				     {if $data<>""}
	<table width="100%"  border="0" cellspacing="0" cellpadding="0">
     <tr>
          <td width="80%">
		  {section name=image loop=$data max=1}
<p align="center"><img id="placeholder" src="photos/{$data[image].image}" alt="" class="imageborder" /></p>
			<strong><p align="center" id="desc">{$data[image].title}</p></strong>
			{/section}</td>
          <td>
		  <DIV STYLE="height:320px; width:180px;overflow:auto">
		       <div align="center">
					     {foreach from=$data item="entry"} <a onclick="return showPic(this)" href="photos/{$entry.image}" title="{$entry.title}"><img src="thumbs/small_{$entry.image}" hspace="5" vspace="5" border="0" class="imageborder" /></a>
					     {/foreach}
		            </div>
		  </div>
		  </td>
     </tr>
</table>
 {/if}
			     {/if}
			     {* This ends the image display portion *}
__________________
Version 4.0.3 Developer

Last edited by cwp; 02-28-2008 at 02:33 AM.
cwp is offline   Reply With Quote
Old 04-25-2008, 06:32 AM   #2
Senior Member
 
Join Date: Jun 2007
Posts: 110
Rep Power: 11
crystal is on a distinguished road
Thumbs up

Excellent mod... thank you cwp! I am using the first one in the viewlisting2.tpl template (so the photos are on top). Also looks good with the photos on the right (in viewlisting.tpl).

Is there any way to add to the code so that if the user only has one photo the thumbnail does not appear? This would be an awesome addition.
crystal is offline   Reply With Quote
Old 04-25-2008, 11:09 AM   #3
cwp
Senior Member
 
cwp's Avatar
 
Join Date: Jun 2007
Posts: 297
Rep Power: 16
cwp is a jewel in the rough
Default

Quote:
Originally Posted by crystal View Post
Excellent mod... thank you cwp! I am using the first one in the viewlisting2.tpl template (so the photos are on top). Also looks good with the photos on the right (in viewlisting.tpl).

Is there any way to add to the code so that if the user only has one photo the thumbnail does not appear? This would be an awesome addition.
I'm sure theres a way to do this with smarty, but I don't know how. I didn't even write the code that you see above, I just gathered it from the forums and put it here so people months or a year in the future would be able to find it easily.
__________________
Version 4.0.3 Developer
cwp is offline   Reply With Quote
Old 04-25-2008, 06:59 PM   #4
Senior Member
 
Join Date: Jun 2007
Posts: 110
Rep Power: 11
crystal is on a distinguished road
Default

Quote:
Originally Posted by cwp View Post
I'm sure theres a way to do this with smarty, but I don't know how. I didn't even write the code that you see above, I just gathered it from the forums and put it here so people months or a year in the future would be able to find it easily.
Right, well thank you spaceboy for the code and thanks cwp for the gathering of. If anyone could point me in the right direction of how to do an {if} statement on those thumbnails, that would be great!
__________________
Crystal
v4.0.8 Dev
crystal is offline   Reply With Quote
Old 05-01-2008, 12:17 AM   #5
Senior Member
 
Join Date: Jun 2007
Posts: 110
Rep Power: 11
crystal is on a distinguished road
Default

Still working on trying to get the thumbnail to only appear when there are 2 or more photos. Any suggestions? I am also wondering how to show the title of the images and have them change when clicking a thumbnail.

In version 2 of the image changes that were posted, the title appears under the first photo, but it does not change when clicking different thumbs. How do I change the title with the photo? There is an error in the version 2 code that was posted... it does not work unless you add the javascript (the code between and including the <script> tags) from the first example.

Any help is always appreciated!
__________________
Crystal
v4.0.8 Dev

Last edited by crystal; 05-01-2008 at 12:25 AM.
crystal is offline   Reply With Quote
Old 05-26-2009, 01:35 AM   #6
Member
 
Join Date: Apr 2009
Posts: 52
Rep Power: 3
JP2 Designs is on a distinguished road
Default

Thanks for providing these parts of code. exactly what i needed

Thanks
__________________
Jermayn Parker
v4.1.3 Developer
using deapsea as a template for hack m y own
JP2 Designs is offline   Reply With Quote
Old 05-26-2009, 05:23 AM   #7
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 1,257
Rep Power: 32
seymourjames has a spectacular aura about
Default

Tongue in cheek CWP. The debug feature of 68C shows you the variables available and you can see it in the template file.

Google is your friend.

Smarty :: View topic - How to find the length of an array?

You can make a test on {$data|@count} to see if you have 2 images in the array. Any logic you like. Like this

{if $data|@count == 1}
Hello Everyone
{/if}
__________________
TemplateCodes.com
seymourjames is offline   Reply With Quote
Old 06-15-2009, 10:55 PM   #8
Member
 
Join Date: Apr 2009
Posts: 52
Rep Power: 3
JP2 Designs is on a distinguished road
Default

Hey,
Just trying to do a mixture of both where you have the images listed to the right with the thumbnails below but when you click on the bigger image. It will use the thickbox JavaScript.

Example: Trading Hub Classifieds Australia Pram
Code:

HTML Code:
<script type="text/javascript" language="javascript">
{literal}
function showPic (whichpic) {
 if (document.getElementById) {
  document.getElementById('placeholder').src = whichpic.href;
  return false;
 } else {
  return true;
 }
}
{/literal}
</script>
 {if $viewphotos=="Y"}
   {if $data<>""}
     <table border="0" align="center" cellpadding="5" cellspacing="0">
     <tr>
          <td>
          {section name=image loop=$data max=1}
		<table border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#000" style="border-collapse: collapse">
			<tr>
				<td> 
				 <a href="photos/{$data[image].image}" title="{$data[image].title}" class="thickbox" rel="gallery">
				  <img id="placeholder" src="photos/{$data[image].image}" alt="" class="imageborder" width="250" /></a>{/section}
				</td>
			</tr>
		</table>
</td></tr>
<tr>
   <td valign="top" align="center">
       <table border="1" cellpadding="5" cellspacing="0" bordercolor="#000" style="border-collapse: collapse" width="100%">
<tr>
    <td height="10">
        {foreach from=$data item="entry"}
	   <a onClick="return showPic(this)" href="photos/{$entry.image}">
	   <img src="thumbs/small_{$entry.image}" hspace="0" vspace="0" border="0" class="imageborder" height="70" alt="" /></a>
        {/foreach}
    </td>
</tr>
</table>
Any idea on how to make it so the thickbox will bring up the image and then you can go to the next image etc.

Thanks
__________________
Jermayn Parker
v4.1.3 Developer
using deapsea as a template for hack m y own
JP2 Designs is offline   Reply With Quote
Old 06-15-2009, 11:11 PM   #9
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,150
Rep Power: 119
Eric Barnes is a jewel in the rough
Default

I believe you can just add rel="gallery" to your small images and that will make them apart of the set. Not sure if that will cause them to popup in the lightbox though.
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 06-15-2009, 11:47 PM   #10
Member
 
Join Date: Apr 2009
Posts: 52
Rep Power: 3
JP2 Designs is on a distinguished road
Default

Quote:
Originally Posted by Eric Barnes View Post
I believe you can just add rel="gallery" to your small images and that will make them apart of the set. Not sure if that will cause them to popup in the lightbox though.
Yes adding the rel="gallery" to the a:link does add it to the gallery...
Only problem is that it adds an extra image in the gallery but you cannot view it. Not a big issue though
__________________
Jermayn Parker
v4.1.3 Developer
using deapsea as a template for hack m y own
JP2 Designs is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display full size photo of first photo on viewlisting.tpl cwp v4 Questions & Support 2 02-23-2008 09:49 PM
Changing the name of a field and changing page backgound Sandy68Classi v3.1 Modules & Modifications 7 10-16-2007 01:31 AM
Changing look of categories on home page Baz HTML, CSS, and Design Help 2 11-09-2006 01:29 PM
Modification so the Add creation page Unregistered Pre Sales Questions 4 10-12-2006 11:05 AM
Changing Yahoo Maps layout GSP v3.1 Modules & Modifications 1 10-01-2006 08:57 AM


All times are GMT -4. The time now is 10:52 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0