Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks


Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Wednesday, June 19 2013 @ 12:46 PM EDT


 Forum Index > Support > General Geeklog Support New Topic Post Reply
 A Little Code Help Needed
   
samstone
 06/18/12 03:56PM (Read 588 times)  
+++++
Full Member

Status: offline


Registered: 09/29/02
Posts: 820
I try to make Hit Counts only viewable by people who are in the "ViewHits" group. I put the following code in storytext.thtml, but the code shows up on page rather than getting executed.

PHP Formatted Code
{!!if SEC_inGroup('ViewHits') !!}
        {lang_views} {story_hits}
                {!endif}


What am I missing?

BTW, I am trying this on Geeklog 2.0beta.

Thanks!

Sam

 
Profile Email
 Quote
Laugh
 06/18/12 08:27PM  
AAAAA
Admin

Status: online


Registered: 09/27/05
Posts: 891
We do not yet allow php in our templates so it will not work.

One possible work around could be to install the Autotags plugin. The new version allows for php so you could create your own autotag and then place that in the template to do the same thing.This may not work though if the template variables are figured out before autotags are executed in a template (I cannot remember if they are)

 
Profile Email Website
 Quote
samstone
 06/18/12 08:33PM  
+++++
Full Member

Status: offline


Registered: 09/29/02
Posts: 820
Thanks for the explanation. It works on GLFusion, so I thought it would work here too.

I came back to try Geeklog 2.0 because I am crazy about the multiple topic feature. So far I am enjoying it, even though I am still getting adjusted.

Peace!

Sam

 
Profile Email
 Quote
suprsidr
 06/18/12 11:06PM  
+++++
Full Member

Status: offline


Registered: 12/29/04
Posts: 553
There should be an easy way for advanced users and theme designers to be allowed to use php where ever they want in templates(at their own risk).
a $_CONF option perhaps.

Personally I just hack the code on a site/site basis, but I always have to look back to remember how I did something in one place to the next - and upgrading those sites is a *censored*.

FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 
Profile Email Website
 Quote
Dirk
 06/19/12 04:04AM  
AAAAA
Admin

Status: offline


Registered: 01/12/02
Posts: 13035
You can define your own template variables, which may be a workaround in some cases. See CUSTOM_templateSetVars() in system/lib-custom.php

In this case (displaying the number of hits for a story), it would require some reengineering, though. You would have to figure out yourself which story is currently being displayed since that information is not readily available in CUSTOM_templateSetVars.

bye, Dirk

 
Profile Email Website
 Quote
Laugh
 06/19/12 09:25AM  
AAAAA
Admin

Status: online


Registered: 09/27/05
Posts: 891
THis is something we wanted to add to Geeklog 2.0.0 but ran out of time. Hopefully it will make it into the next version...

 
Profile Email Website
 Quote
Content generated in: 1.30 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to post 
Filtered HTML Allowed 
Censored Content