try another color scheme:


Go Back   TECH6.0 > Web Design/Development and SEO > Internet Forum Softwares > vBulletin


Determine if someone is logged in

This is a discussion on Determine if someone is logged in within the vBulletin section, part of the Internet Forum Softwares category; OK, one more for you I have created buttons that "replace" or "enhance" the "new post" buttons in some of ...

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 26-09-2008, 09:57 AM
No Avatar

Techie
 
Join Date: Aug 2008
Location: United States
Posts: 54
MisawaPlayer is on a distinguished road
Send a message via Yahoo to MisawaPlayer
Default Determine if someone is logged in

OK, one more for you

I have created buttons that "replace" or "enhance" the "new post" buttons in some of my forums. What I am doing, is a lot of database manipulation specific to the forum and the thread, so I do not want to touch the standard newreply.php.

I've created my own versions of this, and it works fine. I get exactly what I need, except for under one condition. I have to do my database queries, and inserts before the actual post is made, because part of the post is a result of this database work.

My problem is this: Occassionally a user gets logged out before he clicks the button for timeout reasons. My database work goes forward, because no login is necessary for this, but when standard vB calls are made to generate the actual post, it fails because the user has been logged out. He is asked to log in again, but then vB restarts the submission process, causing my database activities to happen twice, which is not good.

So, I am positive there is a method of doing this. How do I determine if the user is currently logged in? (from within php code)?

Thank you.
Reply With Quote
  #2  
Old 26-09-2008, 10:19 AM
webwizzy's Avatar

Administrator
 
Name: Vinayak
Join Date: Feb 2008
Location: India
Phone: Samsung Wave
Posts: 1,116
webwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nice
Send a message via Yahoo to webwizzy
Default

How do I determine if the user is currently logged in? (from within php code)?
From PHP in vbulletin, it is easy to check if a user is logged in:-

PHP Code:
if ($vbulletin->userinfo['userid'])
{
    
// Logged in code
}
else
{
    
// Not logged in code

__________________
Always TAG and SHARE your threads
Submit your site to TECH6 Directory
TECH6 on Facebook - Like Us

Would you like to Link To Us | Support TECH6 by going Premium
Know more about me at Vinayaks.com | Follow TECH6 at Twitter


Reply With Quote
  #3  
Old 26-09-2008, 09:51 PM
No Avatar

Techie
 
Join Date: Aug 2008
Location: United States
Posts: 54
MisawaPlayer is on a distinguished road
Send a message via Yahoo to MisawaPlayer
Default

Such a simple answer. Thank you.
Reply With Quote
Reply

Bookmarks

Tags
check user, logged in


Thread Tools
Display Modes




All times are GMT +5.5. The time now is 09:01 AM.

Contact Us - Tech6.com - Link to Us - Advertise - Submit Site - Privacy Statement - TOS - Top