Go Back   68 Classifieds Forums > v4 Help & Support > v4 Modules / Modifications > Module Release

Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2008, 11:11 PM
cwp cwp is offline
Senior Member
 
Join Date: Jun 2007
Posts: 209
Rep Power: 10
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.1 Developer

Last edited by cwp; 02-28-2008 at 02:33 AM.
Reply With Quote
  #2  
Old 04-25-2008, 06:32 AM
crystal crystal is offline
Junior Member
 
Join Date: Jun 2007
Posts: 16
Rep Power: 4
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.
Reply With Quote
  #3  
Old 04-25-2008, 11:09 AM
cwp cwp is offline
Senior Member
 
Join Date: Jun 2007
Posts: 209
Rep Power: 10
cwp is a jewel in the rough
Default

Quote:
Originally Posted by crystal
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.1 Developer
Reply With Quote
  #4  
Old 04-25-2008, 06:59 PM
crystal crystal is offline
Junior Member
 
Join Date: Jun 2007
Posts: 16
Rep Power: 4
crystal is on a distinguished road
Default

Quote:
Originally Posted by cwp
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!
__________________
v4.0.1 Developer
Reply With Quote
  #5  
Old 05-01-2008, 12:17 AM
crystal crystal is offline
Junior Member
 
Join Date: Jun 2007
Posts: 16
Rep Power: 4
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!
__________________
v4.0.1 Developer

Last edited by crystal; 05-01-2008 at 12:25 AM.
Reply With Quote
Reply

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
Forum Jump

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 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 4 10-12-2006 11:05 AM
Changing Yahoo Maps layout GSP v3.1 Modifications 1 10-01-2006 08:57 AM



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Design by HTWoRKS