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 |
|
||||||
![]() ![]() ![]() ![]() ![]() 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 |
||||||
|
|||||||
| Laugh |
|
||||||
![]() ![]() ![]() ![]() ![]() 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) |
||||||
|
|||||||
| samstone |
|
||||||
![]() ![]() ![]() ![]() ![]() 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 |
||||||
|
|||||||
| suprsidr |
|
||||||
![]() ![]() ![]() ![]() ![]() 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 |
||||||
|
|||||||
| Dirk |
|
||||||
![]() ![]() ![]() ![]() ![]() 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 |
||||||
|
|||||||
| Laugh |
|
||||||
![]() ![]() ![]() ![]() ![]() 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...
|
||||||
|
|||||||
| Content generated in: 1.30 seconds |
|
|
|