Announcement

Collapse
No announcement yet.

How to place Login/logout link on all pages for vB 2.2.1

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to place Login/logout link on all pages for vB 2.2.1

    Hello,
    I've asked this question for vB 2.0.3 a few months ago. (http://www.vbulletin.com/forum/showt...threadid=26303)

    I upgraded to vB 2.2.1 today and I cannot get the links to work. I get a Parse Error if I place the same code in the global.php
    PHP Code:
    if ($bbuserinfo['userid']==0) {
      eval(
    "\$loginlink= \"".gettemplate("loginlink")."\";");
    } else {
      eval(
    "\$loginlink= \"".gettemplate("logoutlink")."\";");

    Any idea on how to make it work on vB 2.2.1 ?

    Thanks

  • #2
    I believe it isn't:

    PHP Code:
    $loginlink 
    and
    PHP Code:
    $logoutlink 
    but rather:

    PHP Code:
    $logincode 
    and
    PHP Code:
    $logoutcode 
    .

    At least that's all I've seen...I haven't seen any of the tags like the ones you posted.

    Comment


    • #3
      But that ins't exactly what I need, if you see the original post for vB 2.0.3 you'll see what I mean. FireFly helped me with that custom code and tags, but it seems they don't work for the new version.

      Comment


      • #4
        You don't need any code for 2.2.1 I beleive. Just place $logincode in your header template and it will parse fine, trust me
        Like at http://board.pixeljunction.com thats how Sinecure did it

        Comment


        • #5
          Ok that all works fine, but how do you put the $unregmessage and $welcometext on all pages? I tried putting it in the header, but it doesn't work.

          For some reason I can only get this to function correctly on the index page.
          - James
          http://forums.smaaash.com

          Comment


          • #6
            You will have to edit index.php, removing the code that parses "welcome text" so that it goes into global.php above header..

            Comment


            • #7
              Originally posted by Prolex
              You don't need any code for 2.2.1 I beleive. Just place $logincode in your header template and it will parse fine, trust me
              Like at http://board.pixeljunction.com thats how Sinecure did it
              I added the $logincode to the header and it did nothing.

              Comment


              • #8
                Open index.php
                Go to line 53 (Provided you have not modified it!)
                CUT the following from index.php

                PHP Code:
                // if user is know, then welcome
                if ($bbuserinfo['userid']!=0) {
                  
                $username=$bbuserinfo['username'];
                  eval(
                "\$welcometext = \"".gettemplate('forumhome_welcometext')."\";");
                  eval(
                "\$logincode = \"".gettemplate('forumhome_logoutcode')."\";");
                  eval(
                "\$newposts = \"".gettemplate('forumhome_newposts')."\";");

                } else {
                  
                $welcometext "";
                  eval(
                "\$newposts = \"".gettemplate('forumhome_todayposts')."\";");
                  eval(
                "\$logincode = \"".gettemplate('forumhome_logincode')."\";");

                Open global.php

                Go to line 269 in global.php.
                Incase you don't have a prog that shows line numbers, do the following
                1) In global.php find $header='';
                2) Paste the code that you cut from index.php and paste it ABOVE $header="";

                Save global.php and index.php and upload. $logincode should now work in your header template
                Board of the Month: November
                Websites: Pixeljunction , vBulletin.org
                Button Sets: XP and Aqua Button sets! FREE!
                vB Customization: My sig is now vbulletin compliant. Contact me to make yours compliant too!

                Comment


                • #9
                  Thanks.. I'll try it tonight.

                  Comment


                  • #10
                    Originally posted by pulsorock
                    Thanks.. I'll try it tonight.
                    I don't know if I can wait that long :P
                    Board of the Month: November
                    Websites: Pixeljunction , vBulletin.org
                    Button Sets: XP and Aqua Button sets! FREE!
                    vB Customization: My sig is now vbulletin compliant. Contact me to make yours compliant too!

                    Comment


                    • #11
                      Thanks a lot! I'll let you know how it turns out.
                      - James
                      http://forums.smaaash.com

                      Comment


                      • #12
                        Sounds like fun
                        Board of the Month: November
                        Websites: Pixeljunction , vBulletin.org
                        Button Sets: XP and Aqua Button sets! FREE!
                        vB Customization: My sig is now vbulletin compliant. Contact me to make yours compliant too!

                        Comment


                        • #13
                          Lyle you stud, thanks a bunch!
                          Need a job done? Get in contact with me and we'll see what we can work out.

                          Comment


                          • #14
                            Originally posted by Valkyre
                            Lyle you stud...
                            Thats the ladies call me
                            Board of the Month: November
                            Websites: Pixeljunction , vBulletin.org
                            Button Sets: XP and Aqua Button sets! FREE!
                            vB Customization: My sig is now vbulletin compliant. Contact me to make yours compliant too!

                            Comment


                            • #15
                              Hello,
                              It worked what you said, but it isn't what I'm looking for exactly. I've attached an image with a screenshot of what I want and that it worked on vB 2.0.3 but don't know how in vB 2.2.1

                              What is shown in the image is what appeared in the board if I added the code that FireFly (see linked forum topic) gave me and the custom templates that I created, that are:
                              loginlink template:
                              <a href="usercp.php?s=$session[sessionhash]" class="portadainfo">Entrar/Login</a>
                              logoutlink template:
                              <a href="member.php?s=$session[sessionhash]&action=logout" class="portadainfo">Salir/Logout [$bbuserinfo[username]]</a>
                              Any idea how to make that work on vB 2.2.1?

                              Thanks for the help

                              Comment

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