Moving login/welcome to HEADER??!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Luggruff
    Senior Member
    • Apr 2005
    • 206
    • 3.6.x

    Moving login/welcome to HEADER??!

    Hi there!
    I've tried to move THIS code:

    Code:
        <if condition="$show['member']">
        
    <tr cellspacing="0" cellpadding="0" border="0" margin="0" padding="0">
            <td class="alt2" valign="top" nowrap="nowrap">
            <div class="smallfont">
                <strong><phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]</phrase></strong><br />
                <phrase 1="$pmbox[lastvisitdate]" 2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase>
                <if condition="$show['pmstats']"><br /><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl_q]">$vbphrase[private_messages_nav]</phrase></if>
                <if condition="$show['pmwarning']"><br /><strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></if>
            </div>
            </td>
            
        <else />
            
            <td class="alt2" nowrap="nowrap" style="padding:0px">
                
            <!-- login form -->
            <form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
            <script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script>
            <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
            <tr>
                <td class="smallfont"><label for="navbar_username">$vbphrase[username]</label></td>
                <td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
                <td class="smallfont" colspan="2" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />$vbphrase[remember_me]</label></td>
            </tr>
            <tr>
                <td class="smallfont"><label for="navbar_password">$vbphrase[password]</label></td>
                <td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td>
                <td><input type="submit" class="button" value="$vbphrase[log_in]" tabindex="104" title="$vbphrase[enter_username_to_login_or_register]" accesskey="s" /></td>
            </tr>
            </table>
            <input type="hidden" name="s" value="$session[sessionhash]" />
            <input type="hidden" name="do" value="login" />        
            <input type="hidden" name="vb_login_md5password" />
            <input type="hidden" name="vb_login_md5password_utf" />
            </form>
            <!-- / login form -->
                
            </td>
    </tr>
            
        </if>
    ..to my HEADER template. The thing is, it is not showing. How come?
  • reefland
    Senior Member
    • Sep 2000
    • 1131

    #2
    Not sure, but try this one:

    HTML Code:
    <if condition="$show['member']">
        
    <table cellspacing="0" cellpadding="0" border="0" margin="0" padding="0">
    <tr>
            <td class="alt2" valign="top" nowrap="nowrap">
            <div class="smallfont">
                <strong><phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]</phrase></strong><br />
                <phrase 1="$pmbox[lastvisitdate]" 2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase>
                <if condition="$show['pmstats']"><br /><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl_q]">$vbphrase[private_messages_nav]</phrase></if>
                <if condition="$show['pmwarning']"><br /><strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></if>
            </div>
            </td>
            
        <else />
            
            <td class="alt2" nowrap="nowrap" style="padding:0px">
                
            <!-- login form -->
            <form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
            <script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script>
            <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
            <tr>
                <td class="smallfont"><label for="navbar_username">$vbphrase[username]</label></td>
                <td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
                <td class="smallfont" colspan="2" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />$vbphrase[remember_me]</label></td>
            </tr>
            <tr>
                <td class="smallfont"><label for="navbar_password">$vbphrase[password]</label></td>
                <td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td>
                <td><input type="submit" class="button" value="$vbphrase[log_in]" tabindex="104" title="$vbphrase[enter_username_to_login_or_register]" accesskey="s" /></td>
            </tr>
            </table>
            <input type="hidden" name="s" value="$session[sessionhash]" />
            <input type="hidden" name="do" value="login" />        
            <input type="hidden" name="vb_login_md5password" />
            <input type="hidden" name="vb_login_md5password_utf" />
            </form>
            <!-- / login form -->
                
            </td>
    </tr>
    </table>
            
        </if>
    sigpic
    Nation of Blue - Kentucky Wildcats Sports


    Some CMS Goodness: Add Avatar to Article

    Comment

    • Luggruff
      Senior Member
      • Apr 2005
      • 206
      • 3.6.x

      #3
      Huh? That's the code I posted.. as you can see..

      Comment

      • reefland
        Senior Member
        • Sep 2000
        • 1131

        #4
        No, the code is different, line 3 specifically. In your code you never open the table.
        sigpic
        Nation of Blue - Kentucky Wildcats Sports


        Some CMS Goodness: Add Avatar to Article

        Comment

        • Luggruff
          Senior Member
          • Apr 2005
          • 206
          • 3.6.x

          #5
          Duh, sorry about that.. That was how I had the code when I tried it out, and that it was placed in a tablecolumn should not make a difference, right?
          (in between a <td></td>)

          Comment

          • Luggruff
            Senior Member
            • Apr 2005
            • 206
            • 3.6.x

            #6
            Originally posted by reefland
            Not sure, but try this one:

            HTML Code:
            <if condition="$show['member']">
                
            <table cellspacing="0" cellpadding="0" border="0" margin="0" padding="0">
            <tr>
                    <td class="alt2" valign="top" nowrap="nowrap">
                    <div class="smallfont">
                        <strong><phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]</phrase></strong><br />
                        <phrase 1="$pmbox[lastvisitdate]" 2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase>
                        <if condition="$show['pmstats']"><br /><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl_q]">$vbphrase[private_messages_nav]</phrase></if>
                        <if condition="$show['pmwarning']"><br /><strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></if>
                    </div>
                    </td>
                    
                <else />
                    
                    <td class="alt2" nowrap="nowrap" style="padding:0px">
                        
                    <!-- login form -->
                    <form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
                    <script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script>
                    <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
                    <tr>
                        <td class="smallfont"><label for="navbar_username">$vbphrase[username]</label></td>
                        <td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
                        <td class="smallfont" colspan="2" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />$vbphrase[remember_me]</label></td>
                    </tr>
                    <tr>
                        <td class="smallfont"><label for="navbar_password">$vbphrase[password]</label></td>
                        <td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td>
                        <td><input type="submit" class="button" value="$vbphrase[log_in]" tabindex="104" title="$vbphrase[enter_username_to_login_or_register]" accesskey="s" /></td>
                    </tr>
                    </table>
                    <input type="hidden" name="s" value="$session[sessionhash]" />
                    <input type="hidden" name="do" value="login" />        
                    <input type="hidden" name="vb_login_md5password" />
                    <input type="hidden" name="vb_login_md5password_utf" />
                    </form>
                    <!-- / login form -->
                        
                    </td>
            </tr>
            </table>
                    
                </if>
            When I place the login, pm and welcome code into my table cell i get the whole forum within that table cell (not when logged out, still it's all messed up). When removing the login, pm and welcome code, the table looks fine =\


            Last edited by Luggruff; Mon 6 Nov '06, 1:48am.

            Comment

            • Marco van Herwaarden
              Senior Member
              • Nov 2004
              • 6999
              • 3.8.x

              #7
              Why do you want to move it to your header?

              Some variables are not yet available when the header template is evaluated.
              Want to take your board beyond the standard vBulletin features?
              Visit the official Member to Member support site for vBulletin Modifications: www.vbulletin.org

              Comment

              • Luggruff
                Senior Member
                • Apr 2005
                • 206
                • 3.6.x

                #8
                Because I want it on top of everything..

                Comment

                • Zachery
                  Former vBulletin Support
                  • Jul 2002
                  • 59097

                  #9
                  How does it not show, the code itself assuming the coditinal is true will show. Have you tried removing the conditional?

                  Comment

                  • Luggruff
                    Senior Member
                    • Apr 2005
                    • 206
                    • 3.6.x

                    #10
                    As written in my last post, it shows, now.. dunno why it didn't from the start.

                    The only thing is..

                    I have a table in the header, that allows one cell to be expandable (so that the script will fit there no matter the browser or font settings)
                    But when I insert the script into that cell, the whole forum gets moved in to that cell.. and I just can't see what in that cell is causing it =\

                    Is there a simpler way, to like create an own for example $navbar tag?
                    Tried making a new template and just writing $newtemplatename in the header, only it didn't show.
                    Maybe have to write something like $GLOBALS[newtemplatename] ?

                    Comment

                    • Luggruff
                      Senior Member
                      • Apr 2005
                      • 206
                      • 3.6.x

                      #11
                      Ok, now I've learned how to include just $mytemplate to the header, and not having all the code there.

                      Still got one tiny little problem though: I can login via the form, but it does not recognise that I'm logged in.. (the code itself, the forum does).
                      It just stays the same, showing the login form..

                      Code:
                      <table cellspacing="0" cellpadding="0" border="0" margin="0" padding="0">
                      <tr>
                      
                      <if condition="$show['member']">
                          
                              <td class="pmloginwelcome" valign="top" nowrap="nowrap" style="padding:0px">
                              <div class="smallfont">
                                  <strong><phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]</phrase></strong><br />
                                  <phrase 1="$pmbox[lastvisitdate]" 2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase>
                                  <if condition="$show['pmstats']"><br /><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl_q]">$vbphrase[private_messages_nav]</phrase></if>
                                  <if condition="$show['pmwarning']"><br /><strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></if>
                              </div>
                              </td>
                      
                              
                          <else />
                              
                              <td class="pmloginwelcome" nowrap="nowrap" style="padding:0px">
                                
                      
                              <!-- login form -->
                              <form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
                              <script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script>
                              <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
                              <tr>
                                  <td class="smallfont"><label for="navbar_username">$vbphrase[username]</label></td>
                                  <td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
                                  <td class="smallfont" colspan="2" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input class="checkbox" type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />$vbphrase[remember_me]</label></td>
                              </tr>
                              <tr>
                                  <td class="smallfont"><label for="navbar_password">$vbphrase[password]</label></td>
                                  <td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td>
                                  <td><input type="submit" class="button" value="$vbphrase[log_in]" tabindex="104" title="$vbphrase[enter_username_to_login_or_register]" accesskey="s" /></td>
                              </tr>
                              </table>
                              <input type="hidden" name="s" value="$session[sessionhash]" />
                              <input type="hidden" name="do" value="login" />        
                              <input type="hidden" name="vb_login_md5password" />
                              <input type="hidden" name="vb_login_md5password_utf" />
                              </form>
                              <!-- / login form -->
                                  
                              </td>
                              
                      </if>
                      
                      </tr>
                      </table>
                      is it simply because it's in the header or have I messed up somewhere? :S

                      ..I've gotta messed up, because loging in itself worked fine before.. may it be that I'm now calling the template? o_0

                      Is there some way to place all this on the absolute top, without going through the header (if that's the problem)
                      Last edited by Luggruff; Tue 7 Nov '06, 4:37am.

                      Comment

                      • Zachery
                        Former vBulletin Support
                        • Jul 2002
                        • 59097

                        #12
                        IF i had to guess, $show['member'] might not be valid in the header template.

                        Comment

                        • Luggruff
                          Senior Member
                          • Apr 2005
                          • 206
                          • 3.6.x

                          #13
                          So, what should I do about that? =/

                          Comment

                          • Zachery
                            Former vBulletin Support
                            • Jul 2002
                            • 59097

                            #14
                            First figure out if it is working there or not

                            Put $show['member'] into the template by itself, not in a conditional, and see if a true, 1, 0, false comes back.

                            Comment

                            • tvtalk
                              New Member
                              • Nov 2006
                              • 7
                              • 3.6.x

                              #15
                              on the note of the welcome message, how does one force this to stay after logging in?

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...