HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Show block only if logged

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#55085 (In Topic #11990)
Avatar

Fan in training

Hi,
sorry for the stupid question, but I'm totally new to ocPortal.
I added a new page to my site, and I'd like to show a part of it (a simple html form) only if the user is logged (and in future if he has a right rank). I've looked into api and guide for something usefull, but without success. Can you point me in the right way?

TIA,
Daniele
Back to the top
 
Posted
Rating:
#55162
Avatar

Honoured member

I have something in tempcode that checks if the username isn't Guest (so the user must be logged in if he isn't Guest).

Code

{+START,IF,{$NEQ,{$USERNAME},Guest}}
Here you can put everything that logged in people may see.
{+END}
Back to the top
 
Posted
Rating:
#55170
Avatar

Fan in training

Thanks, it seems to work!
But, now the question is: is possible to add a user with username 'Guest'? :lol: I hope that the answer is no, but I will try later :thumbs:
Back to the top
 
Posted
Rating:
#55178
Avatar

Community saint

B[L]A[D]E said

… the question is: is possible to add a user with username 'Guest'?

Admin >> Setup >> Configuration >> Forum options >> Restricted usernames (second last cat) …

That should do it.

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: