68 Classifieds Forums
Go Back   68 Classifieds Forums > v3.0.x Help & Support > v3.0 Questions & Support > photo display in Viewlisting
 
Thread Tools Search this Thread Display Modes
(#1)
Bucketman Bucketman is offline
Member
Bucketman is on a distinguished road
 
Posts: 90
Join Date: Mar 2006
Location: Brisbane, Australia
Cool photo display in Viewlisting - 04-06-2006, 10:23 PM

I've noticed in a few 68 classifieds sites that people have a viewlisting page where it displays a photo in large size with the other photos small - and if you click on the small photo's , the larger changes to that clicked photo.(www.gotodetails.com is a prime example).

I would like to know is it a mod/code hack or a template thing.


Regards,

Ashley McKinnon
Site Administrator

GoBuyItBrisbane
(#2)
juven14's Avatar
juven14 juven14 is offline
Moderator
juven14 is on a distinguished road
 
Posts: 1,253
Join Date: Mar 2006
Location: NJ/NYC Area
Default 04-06-2006, 11:36 PM

Add this to viewlisting.tpl.php:
HTML Code:
<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>

Replace your view image part with this one:

HTML Code:
{* This the image display portion *} {if $viewphotos=="Y"} {if $data<>""} <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="80%"> {if $data} {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> </tr> <tr> <td> <DIV STYLE="height:100px; width:400px;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> {/if} </td> </tr> </table> {/if} {/if} {* This ends the image display portion *}

it's strickly on the template level.

This is code from one of Eric's classifieds site.


Regards,

John
mods.auscity.com
v3.1.4 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
(#3)
Bucketman Bucketman is offline
Member
Bucketman is on a distinguished road
 
Posts: 90
Join Date: Mar 2006
Location: Brisbane, Australia
Default Thanks for that but it gives weird results - 04-07-2006, 07:19 AM

I put the code into the Viewlistings file and it works fine for the first Ad I place, but any subsequant ads I put on, when you click on a thumbnail it will open the picture in another window.

To understand what I mean you can go to my test site www.gobuyitsydney.com and have a loo. If you look at the Total Gym ad it works fine - the first one I placed after doing the code change. But if you have a look at the Jornada Ad (Pics are a little misleading), when you click on one of the thumbnails, it opens it up in another window. Weird'o'rama. Wonder why the first one works

Any ideas


Regards,

Ashley McKinnon
Site Administrator

GoBuyItBrisbane
(#4)
juven14's Avatar
juven14 juven14 is offline
Moderator
juven14 is on a distinguished road
 
Posts: 1,253
Join Date: Mar 2006
Location: NJ/NYC Area
Default 04-07-2006, 07:21 AM

In my experience, this behavior only occurs when the images have no titles. I just made image titles manditory and it solved my problems.


Regards,

John
mods.auscity.com
v3.1.4 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
(#5)
quickbiz quickbiz is offline
Member
quickbiz is on a distinguished road
 
Posts: 62
Join Date: Mar 2006
Location: Sweden
Send a message via ICQ to quickbiz Send a message via MSN to quickbiz
Talking manditory - 04-07-2006, 09:36 AM

Quote:
Originally Posted by juven14
In my experience, this behavior only occurs when the images have no titles. I just made image titles manditory and it solved my problems.

Hi

How did you do images title manditory? i have placed a .

Regads

//Bosse
(#6)
Bucketman Bucketman is offline
Member
Bucketman is on a distinguished road
 
Posts: 90
Join Date: Mar 2006
Location: Brisbane, Australia
Default Got it working but .... - 04-08-2006, 12:29 AM

Yes it only works if the user enters a description for the image. Is there a way to make it mandatory for the user to enter a description, or alternatively, for the page to recognise that nothing has been entered for description, and to default it to "." or similar.

Sorry, I'm no coder so don't really know how this is done - investigating though.


Regards,

Ashley McKinnon
Site Administrator

GoBuyItBrisbane
(#7)
juven14's Avatar
juven14 juven14 is offline
Moderator
juven14 is on a distinguished road
 
Posts: 1,253
Join Date: Mar 2006
Location: NJ/NYC Area
Default 04-08-2006, 09:19 AM

Yes, I did this at my site. Let me dig up the code.

Edit: Can't find it, I have one suggestion though, you might change the default value of title in the db, currently it is NULL.


Regards,

John
mods.auscity.com
v3.1.4 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton

Last edited by juven14 : 04-08-2006 at 09:28 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB 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 Total Number of Users suzkaw v3.0 Modifications 5 05-10-2006 11:22 AM
Display an image over another image Bucketman v3.0 Questions & Support 2 04-21-2006 11:27 AM
Show county and city in display. free2take v3.0 Modifications 2 04-20-2006 03:54 PM
Adding viewlisting and showlisting templates sleepy Template Design Questions 2 04-08-2006 05:56 PM
Display Total Number of Listings suzkaw v3.0 Modifications 2 03-30-2006 02:29 PM



Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2006, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com