Looking on some input on how to do this.

Forum
Last Post
Threads / Messages

Infernette

CODE CODE CODE CODE CODE
Member
Joined
Jan 29, 2013
Messages
164
Points
0
Location
Where I live? I live home.
Mysidian Dollar
15,625
Currently I want to make it so after a user registers, they cannot use their account until they choose a few on-site options.

I was wondering how I would go about simply 'locking someone out of their account' and having the site show just the page to select an option if they do not have it set already (EX in users_options the user does not have the column "clan" set to anything yet(as in it is set to 'none' once they register, so no matter what page they go on it always displays a specific page(even if they go to the index or a level up page, it still shows this page).

Is this even possible? And if it is, is it able to have a sort of succession of pages that the user has to confirm with before they can use the account?

If its incredibly difficult or unheard of feel free to ignore my ramblings it's 1am and I'm still recovering from dentist work. :BIGO:
 
In smarty this is quite easy to do.

Open class_template, look for a function called assignTemplateVars(). Inside, get two variables, one for the clan (the one you talked about) and one with the content you want. Assign them to the template like this:

$this->assign("clan",$clanVariable);
$this->assign("optionalContent",$contentVariable);

In your template.tpl, search for the part where {$document_content} appears. Replace {$document_content} with:

{if $clan != 'none'}
{$document_content}
{else}
{$optionalContent}
{/if}

This basically makes it so that while their clan is "none", all they ever see is the optional content you created, in place of the document_content, in all pages
 
Last edited:
Try adding this:

$this->assign("logged_in",$mysidia->user->isloggedin);

And then doing this:

{if $clan != 'none' or !$logged_in}
{$document_content}
{else}
{$optionalContent}
{/if}
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,124
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top