modify index.tmpl template [message #25174] |
Mon, 30 May 2005 02:15 |
enicholse
Messages: 30 Registered: May 2005
Karma: 0
|
Member |
|
|
I want to force any user to login before they see anything, even headers or footers. I tried to wrap the whole INDEX_PAGE in IF: __fud_real_user__ but I get an eror message.
This is 2.6.13 with a copy of default theme. Any suggestions?
Aloha, Eric
The error message is:
Parse error: parse error in /Library/WebServer/Documents/theme/copy/index.php on line 373
Here is the modified index_page template:
{IF: __fud_real_user__}
{TEMPLATE: header}
{TEMPLATE: usercp}
{IF: _uid}<span class="GenText">{MSG: welcome_message}</span><br />{ENDIF}
{TEMPLATE: show_links}{TEMPLATE-DATA: admin_cp}
{TEMPLATE-DATA: cat_path}
<table cellspacing="1" cellpadding="2" class="ContentTable">
<tr>
<th colspan=3 class="wa">{MSG: index_forum}</th>
<th nowrap>{MSG: posts}</th>
<th nowrap>{MSG: threads}</th>
<th nowrap>{MSG: last_post}</th>
</tr>
{TEMPLATE-DATA: forum_list_table_data}
</table>
{IF: _uid}<div class="SmallText ar">[<a href="{TEMPLATE: mark_all_read_lnk}" title="{MSG: mark_all_read_desc}">{MSG: mark_all_read}</a>]</div>{ENDIF}
{TEMPLATE: loged_in_list}
<br /><fieldset>
<legend>{MSG: legend}</legend>
<img src="{THEME_IMAGE_ROOT}/new_content.png" alt="{MSG: index_new_posts}" /> {MSG: index_new_posts}
<img src="{THEME_IMAGE_ROOT}/existing_content.png" alt="{MSG: index_no_new_posts}" /> {MSG: index_no_new_posts}
</fieldset>
{TEMPLATE: curtime}
{TEMPLATE-DATA: page_stats}
{TEMPLATE: footer}
{ELSE}{TEMPLATE: quick_login_on}{END}
This works but does not provide any functionality. As soon as any more arguments/variables are added after IF the thing chokes.
{IF: __fud_real_user__}{TEMPLATE: header}
{ELSE}{TEMPLATE: quick_login_on}{END}
[Updated on: Mon, 30 May 2005 02:16] Report message to a moderator
|
|
|
Re: modify index.tmpl template [message #25196 is a reply to message #25174] |
Tue, 31 May 2005 03:00 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
If you want to do this, your best bet is to modify code inside user_init() function and redirect any anonymous user to the login page if $_GET['t'] != 'login' || $_GET['t'] != 'logout' already.
FUDforum Core Developer
|
|
|
|
|
|
Re: modify index.tmpl template [message #25228 is a reply to message #25221] |
Wed, 01 June 2005 00:07 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Just edit users.inc inside include/theme/default and fix the parse error or comment out the offending code.
FUDforum Core Developer
|
|
|