+ Reply to Thread
Results 1 to 8 of 8

Thread: How and what is the best way to tell the user that is logon at the time.

  1. #1

    How and what is the best way to tell the user that is logon at the time.

    Let me explain

    Guest user

    Registered User


    What is the best way to expose the user that is currently logon to the forums in PHP script. What veriables where is this information stored and how can get access to this information.

    I have to tell a user that has not logon yet.

    I want to tell if posiable if the user is a spyder {if this is posiable at all to do in the first place}.

    I want to tell if the user is logon who his screen name that he used and more important is the userid.

    IF I CAN GET HIS USERID THEN I CAN SEARCH THE USER TABLE AND GET THE USERS SCREEN NAME AND OTHER DATA IF NEED BE?

    THANKS

    Frank H. Shaw

  2. #2
    Not sure if this is the answer to what you are asking.

    I would look at the who is online screen and copy the ip address and then go to the admincp and under users, search for the ip address.

  3. #3
    There isn't any log that will tell you log in and log off times for any member. The members profile will tell you when they were last active and when their last post was.

    You can install this mod that shows which members visited the site within the last 24 hours. It will also tell you what spiders visited too.

    http://www.vbulletin.org/forum/showthread.php?t=196458

    You can get an up to date list of spiders here...

    http://spiderlist.codeforgers.com/

  4. #4

    Hold that thought for now - I need to do this in PHP but before that I need to know

    Before I write my PHP script to do what i explained above in the last posting and i am at present only want the userid of the person that logon and how do I tell he is not logon.

    Where is this information being strored and how is the information being stored?

    THANKS

    Frank H. Shaw

  5. #5
    There are several login hook locations that you could extract login info from. See the functions_login.php file.

  6. #6

    Do i have to get the user logon out if a hook to a templete?

    There are several login hook locations that you could extract login info from. See the functions_login.php file.


    I have looked at the file many times: - HOW DO I USE THE HOOKS IF THIS IS WHAT YOU ARE REFERING TO?

    Line 51

    PHP Code:
     
    ($hook vBulletinHook::fetch_hook('usercp_nav_start')) ? eval($hook) : false

    Line 186

    PHP Code:
     
    ($hook vBulletinHook::fetch_hook('usercp_nav_complete')) ? eval($hook) : false
    Line 388

    PHP Code:
     
    ($hook vBulletinHook::fetch_hook('profile_fetch_profilefields_loc')) ? eval($hook) : false
    Line 411

    PHP Code:
     
    ($hook vBulletinHook::fetch_hook('profile_fetch_profilefields')) ? eval($hook) : false

    I asume you mean any one of the 4 hooks above?

    Please explain?

    These above are used to hook into a templete that is not the thing I think i am looking for?

    I want to pull the information somewhere out of a datastore I hope to at least.

    SO I KNOW THAT THE FOLLOWING


    PHP Code:
     $vbulletin->userinfo['userid'
    IS THIS THE CURRENT LOGON USER?



    From the userinfo array which should be global holds information about the user can I assume that it holds the information about the current user so at what point does the current user get vaildated and information put into the array?


    THANKS

    Frank H. Shaw
    Last edited by Frank H. Shaw; Thu 29th Jan '09 at 1:25am.

  7. #7

    Here is what i am having a problem with

    Get the following error message:

    Unable to add cookies, header already sent.
    File: C:\Inetpub\vhosts\burningtaper.org\httpdocs\forums \calendar.php
    Line: 134

    To recreate error

    In the file calendar.php right after the
    START MAIN SCRIPT


    Just add the following PHP code

    PHP Code:

    unset($mycurrentuser);

    $mycurrentuser $vbulletin->userinfo['userid'];
     
    ob_start();
     
    echo( 
    "My Current User is :" "   " $mycurrentuser);
     
     
    ob_end_flush();
     
    ob_end_clean(); 



    I do get my My Current User is :and a vaild value for the user when the user logon other wise a zero if no user logon that is.

    But unstead of my web page i get part of the web page with a error posted in the center of the page.

    How do i get around this error?



    THANKS

    Frank H. Shaw
    Last edited by Frank H. Shaw; Thu 29th Jan '09 at 1:23am.

  8. #8

    Strange please help - I did more testing and found out the print_r does and does work

    The following works just fine

    PHP Code:
     
    print($vbulletin->userinfo['userid']); // This works fine
     

    // But this does not work why

    unset($mycurrentuser);
    $mycurrentuser $vbulletin->userinfo['userid'];

    print_r"My Current User is :" "   " $mycurrentuser); // does not work 


    Why same location?

    In the file calendar.php right after the Next line after the line 119

    START MAIN SCRIPT

    Get the following error message:

    same error as before: Unable to add cookies, header already sent.

    THANKS

    Frank H. Shaw






    Last edited by Frank H. Shaw; Thu 29th Jan '09 at 1:22am.

+ Reply to Thread

Similar Threads

  1. Cookies time out set to 0 cant logon
    By nakz in forum vBulletin 3.6 Questions, Problems and Troubleshooting
    Replies: 1
    Last Post: Mon 6th Aug '07, 1:51am
  2. Display server time in postbit rather than user selected time
    By sebiv in forum vBulletin 3.6 Questions, Problems and Troubleshooting
    Replies: 1
    Last Post: Tue 24th Apr '07, 12:43pm
  3. User Last Login Time - Always Current time
    By markp_2000 in forum vBulletin 3.6 Questions, Problems and Troubleshooting
    Replies: 3
    Last Post: Sat 3rd Feb '07, 11:52am
  4. Force user to change userid/password on first logon?
    By Adam Ring in forum vBulletin 3.5 'How Do I' Questions and Troubleshooting
    Replies: 6
    Last Post: Fri 4th Nov '05, 6:58am
  5. Is lastactivity timestamp for each user in GMT, or server time, or user offset time?
    By Khashyar in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 4
    Last Post: Mon 15th Aug '05, 4:24am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts