Image and Thumbnail Display Changes

Discussion in 'Technical Support' started by a68designer, Jul 22, 2008.

Thread Status:
Not open for further replies.
  1. a68designer New Member

    Hello,

    I am using viewlisting.tpl and here is what I am trying to do...

    If a user uploads 5 images, thus creating 5 thumbnails, I only want the first thumbnail to show (1 thumbnail total) and I want all of the large images to display underneath my description rather than a popup. A link to "Enlarge this Image" will be under the 1 thumbnail and when clicked, it will bring you down to the section under the description where all of the large images are displayed.

    I'm not a php programmer so any assistance with this request would be very much appreciated.
  2. Eric Barnes Guest

    I have just done something similiar. Here is the code I used which you may need to modify:

    Code:
    <!-- // Image // -->
    			{foreach from=$data item=image name=foo}
    				{if $smarty.foreach.foo.first}
    					<a href="javascript:void(viewer.show(0))">
    						<img src="photos/{$image.image}" hspace="5" vspace="5" width="330" class="image" border="0" alt="{$image.title}" />
    					</a>
    				{/if}
    			{foreachelse}
    				 <img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/nophoto.gif" width="100" hspace="5" vspace="5" border="1" />
    			{/foreach}
    			<br />
    			<!-- // Thumbs // -->
    			{counter start=-1 print=0}
    			{if $viewphotos=="Y" && $data <> ''}
    			<table width="100%">
    			{section name=tr loop=$data step=3}
    				<tr>
    					{section name=td start=$smarty.section.tr.index loop=$smarty.section.tr.index+3}
    					<td valign="top">
    						{if $data[td]<>""}
    							<a href="javascript:void(viewer.show({counter}))">
    								<img src="thumbs/small_{$data[td].image}" hspace="2" vspace="2" class="image" border="0" width="100" height="100" />
    							</a>
    						<br />
    						{/if}
    					 
    					</td>
    					<td>
    					{/section}
    				</tr>
    			{/section}
    			</table>
    
    {/if}
  3. Eric Barnes Guest

    I also had to add this to the top of viewlisting.tpl for the slideshow:
    Code:
    <script type="text/javascript"
    	src="http://slideshow.triptracker.net/slide.js"></script>
    <script type="text/javascript">
    <!--
    	{literal}
    		var viewer = new PhotoViewer();
    	{/literal}
    		{if $viewphotos=="Y" && $data <> ''}
    			{foreach from=$data item=image}
    				viewer.add('photos/{$image.image}');
    			{/foreach}
    		{/if}
    //--></script>
    
  4. bowers01 Genius At Work

    Hi,
    When finished could i please have a link to the site it was done on. I would really like to see what it ends up like.
    Cheers
  5. bowers01 Genius At Work

  6. cliff Customer

    Very Nice, I added to my site. Many thanks.
  7. a68designer New Member

    That looks great, but I need something very simple...

    Let's say a user uploads 8 images - I just need the 1st thumbnail image to appear on top next to the listing views, expiration, title, etc., and when clicked on, it would take you below the description where the 8 larger images are displayed (so I need the large images to display on the viewlisting.tpl file just under my description rather than in a new popup window...)

    I can try to work with the data you provided, but I doubt I will get very far. Can anyone offer any sort of assistance as to how I can achieve my client's request?

    A good starting point would be just to get the large images to display on the same page in a defined area (under the description)...

    Your help is very much appreciated.
  8. Maffo The Master

    Posts like this are excellent. Posts like this should be added to the instructions.

    The last post should be started as a new thread and hoppefully a solution found
  9. a68designer New Member

    Still have not found a solution...

    Does anyone have any initial steps I can take or thoughts/ideas of how to achieve the format described below...? I need this as soon as possible and any help is much appreciated. I really need the large images to display on the same page in a defined location.

    Thanks in advance...

  10. Lhotch curmudgeon

    Edited since it apparently has no value.
  11. a68designer New Member

    Lhotch,

    I do not intend to use this board to prove myself as a designer, I can show you my work when I'm finished, or you can check out www.mydivorcesales.com to see a previous project I did.

    Clearly I am using v4 as this is a v4 thread, and I understand that the updates have had no effect on the viewlisting.tpl files so I did not find it necessary to point that out. Also, I in fact DID state which file I am using, viewlisting.tpl, if you read my post above.

    In addition, this work is in fact for a "client" (not sure why you quoted that word, maybe you find it hard to believe?), and I do have an extensive knowledge of HTML even though I studied completely different topics throughout my education.

    I do not appreciate the 1st half of your post; it did not benefit me nor anyone else on this board and it adds absolutely no value to this conversation or site as a whole. As for the second half of your response, I appreciate your logic; I tried approaching it the same way yet I am still unsuccessful. I have very limited php skills and if you can help out in any way I would appreciate it. Otherwise please don't challenge me on my knowledge or whether I have "clients" or not or anything else for that matter.

    If anyone on this board needs help I am always willing if I am capable...
    Thanks
  12. Lhotch curmudgeon

    I dont doubt your skills as a designer but how much info do you need? Do I need to create the whole template file for you or are you competent enough with html to be able to modify a template?

    I dont know what your skill level is but since you stated your client requested it I made the assumption you had some decent html skills and didnt need me to recreate the wheel or build a whole template for you and simply needed a point in the right direction.

    As for your skills with PHP, for this question thats a moot point since there is no PHP being used/modified.

    As for further help, the question has been answered, the name of the image is stored in the smarty variable $image.image. Stick that behind a IMG tage (just like is done for the thumbnails but to the proper directory for the full size photos) and replace the thumbnail/link generation stuff with just an img tag.

    Instead of having us tell you what you may or may not have already tried perhaps you could tell us what you have tried and show us the code. Maybe you were on the right track and just needed a little syntax correction?

    And on a side note there are different templates that are for sale for 68C. If you dont specify which you are using and someone spends a bunch of time spoon feeding you template changes only to find out they dont apply because your using something other than the default template, its a bit inconsiderate to those offering free help. As for the 68C vesion, there are 5 versions of V4.0.x. If im going to do digging and try and figure something out for someone I like to make sure I am looking at the same version. Sometimes there are changes in code and templates.

    I just dont understand why people cant offer up some decent info when asking for help?
  13. Maffo The Master

    Maybe A68 has took a little too much offence there. Its not a personal attack but we do have a lot of posts on this board that dont fully explain themselves. We dont know the users level and from my own experiences the majority dont know that much. If you know HTML, great, with this system you should be able to pick up mySQL and PHP as well.
  14. seymourjames All Hands On Deck

    Silence Is Golden
  15. a68designer New Member

    Excellent point Maffo,
    My response was not meant to display an offensive acceptance of words... Just trying to make a point that I am not here to accept/refute judgemental remarks. I present myself professionally and I expect the same in return, especially from someone who represents a remarkable software package that I am ultimately trying to glorify to my fullest ability...

    Lhotch,
    I apologize if I did not provide enough information. I am using the default template, I believe the software version is 4.0.3? I am away from my laptop at the moment so I am unable to post the code I've been working on... I will reply this evening with an attachment.

    Thank you for your suggestions, I do appreciate them...
  16. Lhotch curmudgeon

    I wasnt being judgmental at all, you can claim to be the pope for all I care. You seemed to be getting a bit impatient in your quest for an answer to your question so the first part of my now deleted post was to simply justify the amount(or lack of) info I furnished.

    68C offers free support but that support is geared toward getting the software running as it was created and modifying that software is not their obligation. These forums are also not their official support system, their ticket system is. This forum is here so users can help users and like you, I am just another user. It just so happens I was given mod powers to help keep these forums spam free.

    With the above in mind, lets put our feelings aside and simply look at the facts, please dont take it personally, just try and look at it from the other side.

    So here we are, you getting paid to do something you are incapable of doing on your own (or so I assume since you are here asking how to do it) asking others to do something for you for free and getting impatient when an answer isnt forthcoming. Not only that but you dont furnish even the basic information needed by someone to give you a 100% accurate answer(ie 68C version, template in use and edition). In addition to asking for others to bail you out by solving your problem for you, you also want us to ask you all the needed questions(thereby wasting more of our time) so we can answer your question accurately and completely because your own time is too valuable to offer it to us up front.

    So, to cut to the chase, I simply made some assumptions about your skill level based on your posts in this thread and gave you the info to accomplish what you wanted based on those assumptions. The first half of my post that seems to have upset you was simply me trying to explain why my answer was in the terse format it was in and thats because A) you are an experienced designer with clients B) you didnt furnish enough info to encourage me to be any more complete.


    Personally I dont care if I get a pat on the back or even a thank you from people I help here I just wish people would have a little consideration when asking for free help from others in the community.

    I need to delete the bookmark for this forum, its simply not worth the headache
  17. a68designer New Member

    Other members seem to have different viewpoints (above); maybe you are just having a bad day...

    I am not impatient by any means, my time is definately not worth more than your time or anyone else's here, and I am not here to get "bailed" out. This is a support forum; I am looking for support! Simple as that.

    I honestly thought I provided enough info and based on what I provided, I received a somewhat helpful response (thank you Suzkaw). Besides, what constitutes "enough" info? Obviously to some people, that WAS enough info... If you needed additional information for yourself (thinking that you may be interested in helping me out), you could have asked, "what version and template are you using? - a very simple 7 word question. Perhaps this would have steered this series of posts in a different direction; however, you chose otherwise.

    Since I am a new member of this forum, I was unsure as to what is required of me when I make a post. My previous post was answered without the version and template in the discussion... must have been some strange phenomenon I guess.

    At any rate, if you'd like to help or if you can further steer me in the right direction so that I can get the results I'm looking for, please feel free to respond. Otherwise, go to a different post. The topic of discussion from here on should be in regards to the initial question. Please do not respond with anymore negative/judgemental comments that add ZERO value to this forum/thread.

    Thanks.
  18. seymourjames All Hands On Deck

    You can do this with viewlistings2.tpl (make sure you have it set in your admin panel to horizontal viewlisting). It is a start for what you wish to do - I think if I have understood correctly.


    {* Now show the main table *}
    <table class="tableborder">
    <tr>
    <th colspan="3"><strong>{$title}</strong></th>
    </tr>

    <tr>
    <td valign="top" class="pformleft">
    <div class="detail_view"><table width="100%">
    {if $viewseller=="Y"}
    <tr>
    <td><strong>{$smarty.const.LANG_SELLER}: </strong></td>
    <td>
    {if $preview!="Y"}
    <a href="member/{$owner}.html" rel="nofollow">{$username}</a>
    {else}
    {$username}
    {/if}
    </td>
    </tr>
    {/if}
    {if $viewaddress=="Y"}
    <tr>
    .
    .
    .
    .
    <td colspan="2"><strong>{$smarty.const.LANG_DESCRIPTION}: </strong><br />{$description|nl2br}<br /><br /></td>
    </tr>
    <tr>
    <td colspan="2" valign="top" class="pformleft">
    {* This the image display portion *}
    {if $viewphotos=="Y"}

    {if $data<>""}
    {html_table_adv loop=$data cols=$cols table_attr='width="100%"'}

    <div class="photo_view">
    <div class="feat_img"><img src="photos/[[image]]" width="254" height="218" class="image" border="0" alt="[[title]]" /></div>
    <div class="photo_text">[[title]]</div></div>
    {/html_table_adv}
    {else}
    <img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/nophoto.gif" width="100" hspace="5" vspace="5" border="1" alt="french property" />
    {/if}
    {/if}
    {* This ends the image display portion *}
    </td>
    </tr>
    </table><br />

    {include file=contact/contactowner.tpl}



    The CSS part you will need to put in your style sheet is here

    .photo_view{width:315px; height:255px; float:left; padding:10px 10px 10px 10px; margin: 0 5px 5px 0; border:#CCCCCC 1px solid; }
    .photo_text {width:100%; color:#666666; font-size:10px; padding-top:10px; text-align:center; }
    .feat_img {width:100%; text-align:center;}

    You can see the effect - I actually have it turned the other way up with my photos on top. Property In France - Charming Stone Property In Gironde
  19. a68designer New Member

    Thanks for the reply seymourjames.. I'll see if I can integrate some of the viewlisting2.tpl details into the viewlisting.tpl file...

    In the mean time, does anyone know if the large images can be brought onto the page with a php include?

    Something like:
    <?php include("{$smarty.const.URL}/viewimage.php?photo={$image.id}"); ?>
  20. seymourjames All Hands On Deck

    Why would you wish to do that? You can put all your large photos and thumbnails for a listing on the same page if you wish with the description in between. Look at my example page. I just do not bother with thumbnails but I could place them as standard at the top if I wanted to.

    If someone clicks on a thumbnail then what you are probably looking for is a php anchor (try google for the syntax) to scroll them to the specific big photo at the bottom of the page. - Is that what you are basically tying to do?
Thread Status:
Not open for further replies.

Share This Page