68 Classifieds Forums

large image w/ surrounding thumbnails in viewlisting page

This is a discussion on large image w/ surrounding thumbnails in viewlisting page within the v3.1 Questions & Support forums, part of the v3.1 Legacy Help & Support category; Anyone know where I might find a thread explaining the code to create one large listing image on the viewlisting ...


Go Back   68 Classifieds Forums > v3.1 Legacy Help & Support > v3.1 Questions & Support

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 09-25-2007, 12:04 AM
Senior Member
 
Join Date: Aug 2006
Posts: 129
Rep Power: 12
spaceboy is on a distinguished road
Default large image w/ surrounding thumbnails in viewlisting page

Anyone know where I might find a thread explaining the code to create one large listing image on the viewlisting page with smaller thumbnails to the side or underneath the large image?

__________________
Lindsay

developer v3.1.5 and v4
abletrader.com
Reply With Quote
  #2  
Old 09-25-2007, 10:24 AM
Eric Barnes's Avatar
68 Classifieds Staff
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,305
Rep Power: 99
Eric Barnes is a jewel in the rough
Default

Do you mean something like this?
http://www.oceanlakesclassifieds.com...-Highrise.html
__________________
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 | Twitter
Reply With Quote
  #3  
Old 09-25-2007, 03:08 PM
Senior Member
 
Join Date: Jan 2007
Posts: 123
Rep Power: 11
HotAir is on a distinguished road
Default

I like that better than the pop-up photo viewer! is the code around somewhere?

Thanks,
HotAir
__________________
V3.1.10 Developer - live
V4.1.0 Beta 2 - sandbox
Reply With Quote
  #4  
Old 09-25-2007, 03:33 PM
Eric Barnes's Avatar
68 Classifieds Staff
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,305
Rep Power: 99
Eric Barnes is a jewel in the rough
Default

Sure since that is our site I will share the code.

viewlisting.tpl.php file

Add:
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;
  if (whichpic.title) {
   document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
  } else {
   document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
  }
  return false;
 } else {
  return true;
 }
}
{/literal}
</script>
                 {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:170px;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 *}
__________________
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 | Twitter
Reply With Quote
  #5  
Old 09-25-2007, 06:07 PM
VanWertAds*com's Avatar
Member
 
Join Date: Feb 2007
Location: Ohio
Posts: 56
Rep Power: 9
VanWertAds*com is on a distinguished road
Thumbs up

Nice... I think I'll add this to my site also... Man just when I thought I was almost done I keep finding more things to change... thanks for the code! -Josh
__________________
V3.1.5b Hosted
vanwertads*.com

"Do unto others as you would expect others to do unto you"
Reply With Quote
  #6  
Old 09-26-2007, 11:35 AM
Senior Member
 
Join Date: Jan 2007
Posts: 123
Rep Power: 11
HotAir is on a distinguished road
Default

Thank you Eric, that's great!

I was testing it in a clean install, nd found one minor bug. If there are no captions for the photos it generates a javascript error. So I added a non breaking space to the end of each photo caption (the image title) and it fixed the problem. Here is the adjusted code:

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;
  if (whichpic.title) {
   document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
  } else {
   document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
  }
  return false;
 } else {
  return true;
 }
}
{/literal}
</script>
                 {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}&nbsp;</p></strong>
            {/section}</td>
          <td>
          <DIV STYLE="height:320px; width:170px;overflow:auto">
               <div align="center">
                         {foreach from=$data item="entry"} <a onclick="return showPic(this)" href="photos/{$entry.image}" title="{$entry.title}&nbsp;"><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 *}
__________________
V3.1.10 Developer - live
V4.1.0 Beta 2 - sandbox
Reply With Quote
  #7  
Old 09-27-2007, 03:02 AM
VanWertAds*com's Avatar
Member
 
Join Date: Feb 2007
Location: Ohio
Posts: 56
Rep Power: 9
VanWertAds*com is on a distinguished road
Thumbs up

Just added to my site and looks great!... Thanks again for the code. -Josh
__________________
V3.1.5b Hosted
vanwertads*.com

"Do unto others as you would expect others to do unto you"
Reply With Quote
  #8  
Old 09-30-2007, 12:32 AM
Senior Member
 
Join Date: Aug 2006
Posts: 129
Rep Power: 12
spaceboy is on a distinguished road
Default

looks great!

the only bug is how to not show the thumbnail if they only upload one image

any ideas on how to do this?
__________________
Lindsay

developer v3.1.5 and v4
abletrader.com
Reply With Quote
  #9  
Old 10-01-2007, 04:04 PM
Member
 
Join Date: Sep 2007
Posts: 58
Rep Power: 7
Jessej is on a distinguished road
Default Placing it

This looks really nice, where do I go to place this code?
Reply With Quote
  #10  
Old 10-04-2007, 01:22 PM
Member
 
Join Date: Oct 2007
Posts: 36
Rep Power: 6
whoazone is on a distinguished road
Default where do i put the image viewer code

I'm sorry, but where exactly do I plug this code in? do I add it or replace something with it? waiting anxiously...
(this is re: the code which will allow one large image w/caption and clickable thumbnails on the side)
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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing the categories on home page with an image map.. margaretm HTML, CSS, and Design Help 1 08-07-2007 09:00 PM
Disable image on Table Page barrysmith v3.1 Questions & Support 16 09-30-2006 12:46 PM
Show image #1 large on viewlisting page macagent v3.1 Modules & Modifications 4 07-12-2006 05:56 PM
more large image errors frosty v3.1 Questions & Support 2 05-17-2006 12:28 PM
view large image error frosty v3.1 Questions & Support 8 05-16-2006 10:39 PM


All times are GMT -4. The time now is 01:42 PM.


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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22