Update of /cvsroot/openfirst/forum
In directory sc8-pr-cvs1:/tmp/cvs-serv26638
Added Files:
forumvisit.php
Log Message:
"Include" script for forum module. Tracks new/read messages.
--- NEW FILE: forumvisit.php ---
<?php
/*
* openFIRST.forum - forumvisit.php
*
* Copyright (C) 2003,
* openFIRST Project
* Original Author: Greg Inozemtsev <gr...@si...>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
//(include module for forum)
//This code is used to determine which messages have been viewed
if(isset($user->user)){
if(!isset($_SESSION["forumvisit".$user->user])){
$_SESSION["forumvisit".$user->user]=0;
$q=ofirst_dbquery("SELECT forumvisit FROM ofirst_members WHERE user='$user->user';");
if(ofirst_dbnum_rows($q)!=0){
$visit=ofirst_dbfetch_object($q);
$_SESSION["forumvisit".$user->user]=$visit->forumvisit;
unset($visit);
}
unset($q);
ofirst_dbquery("UPDATE ofirst_members SET forumvisit='".date("Y-m-d H:i:s")."' WHERE user='$user->user';");
}
}
else{
$_SESSION["forumvisit"]=date("Y-m-d H:i:s");
}
?>
|