replace session management routines with memcached
This commit is contained in:
@@ -252,22 +252,13 @@ function pHttpDate($sDate) {
|
||||
*/
|
||||
function addmsg($shText, $color = "black")
|
||||
{
|
||||
if($color)
|
||||
$shText = "<font color='$color'> $shText </font>\n";
|
||||
|
||||
$sQuery = "INSERT INTO sessionMessages VALUES (null, ?, '?', '?')";
|
||||
if (!query_parameters($sQuery, "NOW()", session_id(), $shText))
|
||||
{
|
||||
echo "An error has occurred in addmsg()";
|
||||
echo $shText;
|
||||
}
|
||||
$GLOBALS['session']->addmsg($shText, $color);
|
||||
}
|
||||
|
||||
|
||||
function purgeSessionMessages()
|
||||
{
|
||||
$sQuery = "truncate sessionMessages";
|
||||
query_parameters($sQuery);
|
||||
$GLOBALS['session']->purgemsg();
|
||||
}
|
||||
|
||||
|
||||
@@ -276,19 +267,17 @@ function purgeSessionMessages()
|
||||
*/
|
||||
function dumpmsgbuffer()
|
||||
{
|
||||
$hResult = query_parameters("SELECT * FROM sessionMessages WHERE sessionId = '?'", session_id());
|
||||
if(!$hResult)
|
||||
return;
|
||||
$GLOBALS['session']->dumpmsgbuffer();
|
||||
|
||||
while($oRow = query_fetch_object($hResult))
|
||||
echo html_frame_start("","300","",5);
|
||||
foreach ($GLOBALS['session']->msg as $msg)
|
||||
{
|
||||
echo html_frame_start("","300","",5);
|
||||
echo "<div align=center> $oRow->message </div>";
|
||||
echo html_frame_end(" ");
|
||||
echo "<br>\n";
|
||||
if ($msg['color'] == "red")
|
||||
$msg['color'] = "{$msg['color']};text-decoration:blink";
|
||||
echo "<div align=\"center\" style=\"font-color:{$msg['color']};\"> {$msg['msg']} </div>";
|
||||
}
|
||||
|
||||
query_parameters("DELETE FROM sessionMessages WHERE sessionId = '?'", session_id());
|
||||
echo html_frame_end(" ");
|
||||
echo "<br>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user