Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 12:39 pm EDT

Geeklog Forums

A Little Code Help Needed


Status: offline

samstone

Forum User
Full Member
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.

Text 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
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
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)
One of the Geeklog Core Developers.
 Quote

Status: offline

samstone

Forum User
Full Member
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
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
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
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
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...
One of the Geeklog Core Developers.
 Quote

All times are EDT. The time is now 12:39 pm.

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