Jump to content

Recommended Posts

<?php
// ###################### Start process logout #######################
function process_logout()
{
global $vbulletin;

// clear all cookies beginning with COOKIE_PREFIX
$prefix_length = strlen(COOKIE_PREFIX);
foreach ($_COOKIE AS $key => $val)
{
	$index = strpos($key, COOKIE_PREFIX);
	if ($index == 0 AND $index !== false)
	{
		$key = substr($key, $prefix_length);
		if (trim($key) == '')
		{
			continue;
		}
		vbsetcookie($key, '', 1);
	}
}

if ($vbulletin->userinfo['userid'] AND $vbulletin->userinfo['userid'] != -1)
{
	// init user data manager
	$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT);
	$userdata->set_existing($vbulletin->userinfo);
	$userdata->set('lastactivity', TIMENOW - $vbulletin->options['cookietimeout']);
	$userdata->set('lastvisit', TIMENOW);
	$userdata->save();


//BEGIN Insert Data into history
//print "userid is $userid";
//$rlemail = $vbulletin->db->query_first("SELECT email FROM " . TABLE_PREFIX . "user WHERE userid = " . $vbulletin->userinfo['userid'] . ) or die(" rlemail error: $userid" . mysql_error());
    


mysql_connect("localhost","user","1234567") or die ("Unable to connect to MySQL server.");
$rlemail = mysql_query("SELECT email FROM Myforum.user WHERE userid = " . $vbulletin->userinfo['userid'] . "") or die(" rlemail error: ".$vbulletin->userinfo['userid']. mysql_error());
    $db = mysql_select_db("Mycustomers") or die ("Unable to select requested database.");
 $totalrows = mysql_num_rows($rlemail);
       //print "$totalrows";
	//print "rlemail is $rlemail";
	//$rlemail = "admin@MyCustomers.com";		
	$Update2 = mysql_query("UPDATE Mycustomers.customers SET lastforumvisit = Now() WHERE Email = '$rlemail'") or die(" Update2 Insert error:" . mysql_error());

// END Insert Data into history


	// make sure any other of this user's sessions are deleted (in case they ended up with more than one)
	$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "session WHERE userid = " . $vbulletin->userinfo['userid']);
}

$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "session WHERE sessionhash = '" . $vbulletin->db->escape_string($vbulletin->session->vars['dbsessionhash']) . "'");

if ($vbulletin->session->created == true)
{
	// if we just created a session on this page, there's no reason not to use it
	$newsession =& $vbulletin->session;
}
else
{
?>

Link to comment
https://forums.phpfreaks.com/topic/120939-totally-blank-page/#findComment-623558
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.