Hello -
I'm running v2.3 and matrix.
I would like the view count to display under the photos when I am logged in as admin, but not be displayed to visitors.
I found a lot of posts asking how to remove the views, but not how to remove them for visitors and leave them for admin.
How can this be accomplished?
Posts: 16503
There's some examples here:
http://codex.gallery2.org/Gallery2:Themes:Reference:Variables
{if $user.isAdmin}
SHOW YOUR STUFF
{/if}
__________
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 55
Hello
I tried your example
{if $user.isAdmin}
showViewCount=true
{/if}
Didn't work.
Tried mimicking the example on the page you linked to
{if $user.isAdmin}
showViewCount=true
{else}
showViewCount=false
{/if}
That didn't work either. Both times the result was blank pages, even when I tured on debug mode, so I have no errors to report.
What am I missing here?
Thanks,
bw
Posts: 16503
Try something like:
{if $user.isAdmin} {g->block type="core.ItemInfo" item=$child showDate=true showOwner=$showOwner showSize=true showViewCount=true showSummaries=true class="giInfo"} {else} {g->block type="core.ItemInfo" item=$child showDate=true showOwner=$showOwner showSize=true showViewCount=false showSummaries=true class="giInfo"} {/if}____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 55
I tried exactly what you posted, and it works great!
Thanks for coming back to see this through.
bw
Posts: 69
Hi,
I'd like to do the same thing regarding the view count. What module did you place this code in and where exactly in the module did you place it?
Sorry, I'm not very proficient in writing code...
many thanks,
manderly
Posts: 16503
No module. album.tpl of your theme's template files:
http://codex.gallery2.org/Gallery2:Editing_Templates
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 69
Thanks! Where do I put the code in album.tpl?
manderly
Posts: 16503
Open the file and take a look.
You'll see a block that looks like this:
{g->block type="core.ItemInfo" item=$child showDate=true showOwner=$showOwner showSize=true showViewCount=true showSummaries=true class="giInfo"}Replace that with what is posted above.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 69
It worked! Thank you so much!
manderly