943,614 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 8422
  • PHP RSS
Feb 18th, 2008
0

Vbulletin login box on a non vbulletin page

Expand Post »
I am looking for a script which will allow me to place a vbulletin login box on a non vbulletin page. There are couple of scripts, but they are for older versions. I am using v3.6.8
Does anyone know where to find one for 3.6.8?

The closest I could find was this:
http://forums.clantemplates.com/show...ght=code+login

(offcourse I will ask them permission before using it as I'm not using it on one of their templates)

I tested it and it worked, but I have a problem.

When I'm logged out of my forum I go to the page that I inserted the script in, I then log in, and it redirects me to the forum page, logs me in and redirects me back, just how it should.
I am logged into the forum then, but it doesn't show on the page that I'm logged in, it still shows the login form. So, all we need to do is to tell the script that when the user is logged in, it must replace the login box with this:

Quote ...
Welcome, Deidre.
You last visited: Today at 07:03 PM
Private Messages: Unread 0, Total 0.
My programing knowlege is not very good.... Anyone who will give me a tip or two here?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Deidredup is offline Offline
1 posts
since Feb 2008
Feb 18th, 2008
0

Re: Vbulletin login box on a non vbulletin page

Having the login form is no problem.
html Syntax (Toggle Plain Text)
  1. <!-- login form -->
  2. <form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)">
  3.  
  4. <script type="text/javascript" src="clientscript/vbulletin_md5.js?v=370b5h"></script>
  5. <table cellpadding="0" cellspacing="3" border="0">
  6. <tr>
  7. <td class="smallfont"><label for="navbar_username">User Name</label></td>
  8. <td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="User Name" onfocus="if (this.value == 'User Name') this.value = '';" /></td>
  9. <td class="smallfont" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />Remember Me?</label></td>
  10. </tr>
  11.  
  12. <tr>
  13. <td class="smallfont"><label for="navbar_password">Password</label></td>
  14. <td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td>
  15. <td><input type="submit" class="button" value="Log in" tabindex="104" title="Enter your username and password in the boxes provided to login, or click the 'register' button to create a profile for yourself." accesskey="s" /></td>
  16. </tr>
  17. </table>
  18. <input type="hidden" name="s" value="" />
  19. <input type="hidden" name="do" value="login" />
  20. <input type="hidden" name="vb_login_md5password" />
  21.  
  22. <input type="hidden" name="vb_login_md5password_utf" />
  23. </form>
  24. <!-- / login form -->
However, when you start talking about it knowing when you're logged in, and displaying your user information, now you're talking about a dynamic page that pulls information from the database. Since you self-acknowledged you're not a PHP programmer, I would check out vBulletin.org and, more specifically, the vBAdvanced CMPS product. It might be just what you're looking for.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Dec 31st, 2011
0
Re: Vbulletin login box on a non vbulletin page
PHP Syntax (Toggle Plain Text)
  1. <?php
  2. $curdir = getcwd();
  3. chdir('YOURROOTTOFORUMS');
  4. require_once('YOURROOTTOFORUMS/forums/global.php');
  5. chdir($curdir);
  6. if ($vbulletin->userinfo['userid'] == 0) {
  7. echo "<center><form id=\"login\" action=\"/forums/login.php?do=login\" method=\"post\" onsubmit=\"md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)\">
  8. <script type=\"text/javascript\" src=\"clientscript/vbulletin_md5.js?v=364\"></script>
  9. <a href=\"/forums/register.php\">Register</a>
  10. <label for=\"navbar_username\">Username</label>
  11. <input type=\"text\" class=\"bginput\" style=\"font-size: 11px\" name=\"vb_login_username\" id=\"navbar_username\" size=\"10\" accesskey=\"u\" tabindex=\"101\" onfocus=\"if (this.value == 'User Name') this.value = '';\" />
  12. <label for=\"navbar_password\">Password</label>
  13. <input type=\"password\" class=\"bginput\" style=\"font-size: 11px\" name=\"vb_login_password\" id=\"navbar_password\" size=\"10\" tabindex=\"102\" />
  14. <label for=\"cb_cookieuser_navbar\"><input type=\"checkbox\" name=\"cookieuser\" value=\"1\" tabindex=\"103\" id=\"cb_cookieuser_navbar\" accesskey=\"c\" />Remember Me?</label>
  15. <input type=\"submit\" class=\"button\" value=\"Login\" tabindex=\"104\" title=\"Enter your username and password in the boxes provided to login, or click the 'register' button to create a profile for yourself.\" accesskey=\"s\" />
  16. <input type=\"hidden\" name=\"s\" value=\"\" />
  17. <input type=\"hidden\" name=\"do\" value=\"login\" />
  18. <input type=\"hidden\" name=\"vb_login_md5password\" />
  19. <input type=\"hidden\" name=\"vb_login_md5password_utf\" />
  20. </form>";
  21. } else {
  22. echo "<center>Welcome Back, <b>".$vbulletin->userinfo['username']."</b>";
  23. if ($vbulletin->userinfo['usergroupid'] == '6' ) {
  24. echo "&nbsp;|&nbsp;<a href=\"/forums/member.php?1-".$vbulletin->userinfo['username']."\">My Profile</a>";
  25. echo "&nbsp;|&nbsp;<a href=\"/forums/egncadmincp/index.php\">AdminCP</a>";
  26. echo "&nbsp;|&nbsp;<a href=\"/forums/egncmodcp/index.php\">ModCP</a>";
  27. }
  28. }
  29. ?>
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lordicon is offline Offline
2 posts
since Dec 2011
Dec 31st, 2011
0
Re: Vbulletin login box on a non vbulletin page
Sorry the above code works 100% its a great way of logging people in you may need to edit the way the form looks in the echo however it works great.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lordicon is offline Offline
2 posts
since Dec 2011
Message:
Previous Thread in PHP Forum Timeline: web and matlab
Next Thread in PHP Forum Timeline: change option from database into file system. how to recognize?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC