Page 1 of 1

Question about page access based on settings stored in DB

Posted: Sun Aug 22, 2010 3:48 pm
by paladin
Hey guys im trying to work out how to do a bit more with custom content.

So that if a setting in a table in the DB is set to ON then content A will be displayed or if its set to OFF content B would be displayed.

We use custom content at the moment im just trying to work out how to make my own function that can be accessed from the templates.

Atm i use this code

Code: Select all

{if $ccuser->loggedin() && $ccuser->memberof('basicmembers')}
{content} 
{else}{/if}
I would like to have something like

Code: Select all

{if $ccuser->loggedin() && $ccuser->memberof('basicmembers')}
{if $mymod->systemstatus() == 'OFF'}
{content} 
{else}
please wait until this page is online
{/if}
{else}{/if}
I just cant work out how to write a function so that it can be used here

Any help would be great

Re: Question about page access based on settings stored in DB

Posted: Sun Aug 22, 2010 6:26 pm
by owr_bgld
Take a look at the module AdvancedContent from NaN - there you have more possivilities with different contents aso.