Log Out

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rascal
    Senior Member
    • Feb 2002
    • 242

    Log Out

    How do I add a "Log out" functions at the header whereby only members are able to see it after logging in.

    Those who have not logged in will not see it.
    Focusing on the Amateur Soccer Scene
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    i have that on my site. put this in your phpinclude template:

    PHP Code:
    // if user is know, then welcome
    if ($bbuserinfo['userid']!=0) {
      eval(
    "\$logincode = \"".gettemplate('forumhome_logoutcode')."\";");
    } else {
      eval(
    "\$logincode = \"".gettemplate('forumhome_logincode')."\";");

    then in my header i use the $logincode variable up towards the top. edit your forumhome_logoutcode and forumhome_logincode templates to change the look of the login box and logout link if you want.

    Comment

    • RavenBeauty
      Member
      • Mar 2002
      • 48

      #3
      I did as you said above Jake concerning the php include tho I wasn't sure where it needed to go. I just put it after header.

      But then to start here is the code given in forum home logout

      <smallfont><a href="member.php?s=$session[sessionhash]&action=logout">Log Out</a> | <a href="member.php?s=$session[sessionhash]&action=markread">Mark All Forums Read</a> | <a href="showgroups.php?s=$session[sessionhash]">Forum Leaders</a></smallfont>

      I have a log out button and its also in the row of buttons at the top. BUT it never shows up and everybody always asks how in the WORLD do i get OUT. So I keep on making the log out button and nobody ever sees it at the top or the bottom.

      I'm sorry Im just not advanced enough in this yet to know exactly what you mean verbatim, by the above instructions.

      THE HUNTER'S LIFE FORUMS

      Comment

      • rascal
        Senior Member
        • Feb 2002
        • 242

        #4
        Jakeman, how do you make only the "Log Out" link to appear together with the buttons on top when a member login?

        So if a non-member browse the site, the link will not appear.
        Focusing on the Amateur Soccer Scene

        Comment

        • RavenBeauty
          Member
          • Mar 2002
          • 48

          #5
          There you go! thats what i want to!!

          Comment

          • rascal
            Senior Member
            • Feb 2002
            • 242

            #6
            Originally posted by RavenBeauty
            There you go! thats what i want to!!
            I was looking for this thread too. Almost forgotten all about it..
            Focusing on the Amateur Soccer Scene

            Comment

            • Jake Bunce
              Senior Member
              • Dec 2000
              • 46598
              • 3.6.x

              #7
              RavenBeauty - phpinclude template:

              Admin CP -> Templates -> Modify -> [expand list] -> phpinclude -> [edit] / [change original]

              Jakeman, how do you make only the "Log Out" link to appear together with the buttons on top when a member login?

              So if a non-member browse the site, the link will not appear.
              erm...

              edit your forumhome_logoutcode and forumhome_logincode templates to change the look of the login box and logout link if you want.
              the code in the phpinclude template will make it so the forumhome_logoutcode template is used if the user is logged in, and vice versa.

              Comment

              • rascal
                Senior Member
                • Feb 2002
                • 242

                #8
                I added this code at the top;

                ><a href="member.php?s=$session[sessionhash]&action=logout">Log Out</a>

                But even after logging out, the link would still be there.
                Focusing on the Amateur Soccer Scene

                Comment

                • Andy Z
                  Senior Member
                  • Nov 2001
                  • 443
                  • 3.0.5

                  #9
                  Now put this code into the phpinclude template, in place of what Jakeman put to control the buttons that show:
                  PHP Code:
                  // if user is know, then welcome
                  if ($bbuserinfo['userid']!=0) {
                    eval(
                  "\$headerbutton = \"".gettemplate('logoutheader')."\";");
                  } else {
                    eval(
                  "\$headerbutton = \"".gettemplate('loginheader')."\";");

                  Create two custom templates: "logoutheader" and "loginheader", then
                  put the HTML code for the buttons you want to appear in each state, so buttons that should show when you're logged in put into "logoutheader" template you created,
                  and the butttons that should show when you're logged out/not registered into the "loginheader" template you created.

                  Now in your header template take out the header buttons and replace them with "$headerbutton" (no quotes).

                  Now if they are logged OUT they see the stuff in the "loginheader" template, and when they are logged IN they see the stuff in the "logoutheader" template.
                  - AJ Zmudosky

                  Comment

                  • rascal
                    Senior Member
                    • Feb 2002
                    • 242

                    #10
                    It works perfectly.

                    Utmost gratitude to Andy and Jakeman. Sure hope Raven's problem is solved too.
                    Focusing on the Amateur Soccer Scene

                    Comment

                    • Jake Bunce
                      Senior Member
                      • Dec 2000
                      • 46598
                      • 3.6.x

                      #11
                      Originally posted by rascal
                      ><a href="member.php?s=$session[sessionhash]&action=logout">Log Out</a>

                      But even after logging out, the link would still be there.
                      use the forumhome_logoutcode and forumhome_logincode templates, not the header. use the variable $logincode in your header.

                      Comment

                      • rascal
                        Senior Member
                        • Feb 2002
                        • 242

                        #12
                        Originally posted by Jakeman


                        use the forumhome_logoutcode and forumhome_logincode templates, not the header. use the variable $logincode in your header.
                        I used Adam's code cos I still want to use the settings in forumhome_logoutcode & forumhome_logincode to be used at the bottom of the main table and the welcome panel.

                        Thanks, I appreciate it!
                        Focusing on the Amateur Soccer Scene

                        Comment

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