FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » modify index.tmpl template
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
modify index.tmpl template [message #25174] Mon, 30 May 2005 02:15 Go to next message
enicholse is currently offline  enicholse   United States
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}&nbsp;&nbsp;
<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 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #25202 is a reply to message #25174] Tue, 31 May 2005 06:49 Go to previous messageGo to next message
enicholse is currently offline  enicholse   United States
Messages: 30
Registered: May 2005
Karma: 0
Member
Would I replace line 35 in users.inc with your string?

$_GET['t'] != 'login' || $_GET['t'] != 'logout'

then rebuild?

aloha, eric
Re: modify index.tmpl template [message #25208 is a reply to message #25202] Tue, 31 May 2005 13:10 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You want to edit users.inc.t (source template) not the compiled file users.inc

FUDforum Core Developer
Re: modify index.tmpl template [message #25221 is a reply to message #25174] Tue, 31 May 2005 21:50 Go to previous messageGo to next message
enicholse is currently offline  enicholse   United States
Messages: 30
Registered: May 2005
Karma: 0
Member
I tried replacing line 35 in users.inc.t with that string and then rebuilt, but I got an error and had to revert to a backup of index.php before I could gain access to the UI to rebuild the themes/templates. Oops. I dont think thats going to work. Any other suggestions?

Aloha, Eric
Re: modify index.tmpl template [message #25228 is a reply to message #25221] Wed, 01 June 2005 00:07 Go to previous message
Ilia is currently offline  Ilia   Canada
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Access only for registed users
Next Topic: Table fud2613_themes field theme_opt
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Dec 18 07:44:56 GMT 2024

Total time taken to generate the page: 0.02398 seconds