adding # of comments to singlebody and albumbody question

drazin

Joined: 2002-11-23
Posts: 144
Posted: Thu, 2005-05-05 03:13

how can i add the # of comments available with a link to show them to my singlebody layout? i tried adding

{if ($child.viewCount > 0)}
{g->text text="Views: %d" arg1=$child.viewCount}
<br/>
{/if}

to my meta data under each image, but nothing shows.....

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2005-05-10 06:42

I'm confused. You ask for the # of comments, but the code you pasted is for the view count. The comments themselves are already listed on the singleBody page anyway. But anyway, if you want to add the text you can add this:

            {if $CommentItemDetails.totalComments > 0} 
              {g->text text="Comments: %d" arg1=$CommentItemDetails.totalComments} 
            {/if} 

On line 90 of singleBody.tpl (right under where we print the "Owner:"). You can wrap the text in a <a> and have it link anywhere you want...

 
drazin

Joined: 2002-11-23
Posts: 144
Posted: Tue, 2005-05-10 14:19

i must have slipped up and put the wrong code. thank you i put that code in my single body. now, i want to add that code to under each thumbnail, what file do i put that code in for under thumbnail view?

also, i want to display the comments (if any) under the photo in singlebody.tpl what code do i use to show comments if any?