?
Solved

PHPBB switch problem

Posted on 2006-04-11
3
Medium Priority
?
227 Views
Last Modified: 2013-12-12
I am trying to create a switch in my PHPBB board to display a welcome message when the user is logged in and display a login form when the user is logged out. I am using the built in switches for the site, switch_user_logged_in and switch_user_logged_out.

This is what I have done...

 <!--BEGIN switch_user_logged_in -->
  <tr>
      <td colspan="3" bgcolor="#E8DECC" >{L_LOGIN_LOGOUT}<span class="style10"><a href="{U_LOGIN_LOGOUT}" class="mainmenu">[{L_LOGOUT}]</a></span></td>
  </tr>
  <!--END switch_user_logged_in -->

...

and

<!--BEGIN switch_user_logged_out -->
            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><strong>Login</strong></td>
          </tr>
          <tr>
            <td><form name="form1" method="post" action="">
                <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                  <tr>
                    <td><span class="name"><strong>Username: </strong>
                          <input name="username" type="text" class="name" id="username" size="15">
                    </span> </td>
                  </tr>
                  <tr>
                    <td><span class="name"> <strong>Password: </strong>
                          <input name="Password" type="password" class="name" id="Password" size="15">
                    </span></td>
                  </tr>
                  <tr>
                    <td><input type="submit" name="Submit" value="Go">
                        <input type="reset" name="Reset" value="Reset"></td>
                  </tr>
                </table>
            </form></td>
          </tr>
          <tr>
            <td class="maintext">Not a Memeber? <a href="{U_REGISTER}">{L_REGISTER} here! </a></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
        </table>
             <!-- END switch_user_logged_out -->

When I run the file, this is the error I am getting...

Parse error: parse error, unexpected '}' in /homepages/26/d95179444/htdocs/phpBB2/beta/forum/includes/template.php(127) : eval()'d code on line 90

Please help...

I don't really know PHP well, and I have followed the instructions from the tutorial that PHPBB has offered.

Thank you,

Sylvia Carroll
0
Comment
Question by:peanutoma
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
whardeman earned 500 total points
ID: 16430363
Anywhere you have this:

<!--BEGIN switch_user_logged_in -->

...there must be at least one space between the comment tag and 'BEGIN', like this:

<!-- BEGIN switch_user_logged_in -->


The same goes for your 'END' tags. Otherwise, phpBB can't recognize the BEGIN and END commands, which breaks the switch.

Hope this helps. =)

W
0
 

Author Comment

by:peanutoma
ID: 16433417
That helps tremendously... I feel like a bonehead! Thank you so much!
0
 
LVL 2

Expert Comment

by:whardeman
ID: 16433427
Glad to help. Been there MANY times myself. =D

W
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question