Search code examples
phpvbulletin

vBulletin: Check if user read thread externally


Is there any possible way to check if a user who is logged in has read a certain thread? I'm currently using a seperate webpage (outside of the forum software) where I need to check if a user is logged in and if this user has read a certain thread. I've gotten to check if a user logged in or not by requiring global.php, but I am not sure how to check if the user read the thread.

I'm using PHP on this webpage and would preferably like to stick to it (which shouldn't be difficult since vBulletin is built in PHP)

Edit: using vBulletin 4.2.0

Thanks!


Solution

  • I managed to do this by reading the contentread table with a double WHERE clause of userid and contentid.

    $userid = $vbulletin->userinfo[userid];
    $chkthread = mysql_query("SELECT * FROM contentread WHERE userid = '$userid' AND contentid = 1");
    $chkthr = mysql_num_rows($chkthread);
    if($chkthr < 1){
    }