[Phpfreechat-svn] SF.net SVN: phpfreechat: [453] branches/0.x/src
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-04-19 12:11:33
|
Revision: 453 Author: kerphi Date: 2006-04-19 05:11:17 -0700 (Wed, 19 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=453&view=rev Log Message: ----------- Bug fix: the oldmsg CSS class was not set in some cases Modified Paths: -------------- branches/0.x/demo/demo5_customized_style_data/mytheme/templates/style.css.tpl.php branches/0.x/src/pfccommand_connect.class.php branches/0.x/src/pfccommand_getnewmsg.class.php Modified: branches/0.x/demo/demo5_customized_style_data/mytheme/templates/style.css.tpl.php =================================================================== --- branches/0.x/demo/demo5_customized_style_data/mytheme/templates/style.css.tpl.php 2006-04-19 07:28:12 UTC (rev 452) +++ branches/0.x/demo/demo5_customized_style_data/mytheme/templates/style.css.tpl.php 2006-04-19 12:11:17 UTC (rev 453) @@ -24,6 +24,7 @@ div.<?php echo $prefix; ?>oldmsg { background-image: url(<?php echo $c->getFileUrlFromTheme('images/oldmsg.gif'); ?>); + background-color: #EEE; } span.<?php echo $prefix; ?>heure { @@ -63,4 +64,4 @@ } .<?php echo $prefix; ?>cmd_msg { color: #555; -} \ No newline at end of file +} Modified: branches/0.x/src/pfccommand_connect.class.php =================================================================== --- branches/0.x/src/pfccommand_connect.class.php 2006-04-19 07:28:12 UTC (rev 452) +++ branches/0.x/src/pfccommand_connect.class.php 2006-04-19 12:11:17 UTC (rev 453) @@ -12,6 +12,8 @@ // i.e. be ready to re-get all last posted messages $container =& $c->getContainerInstance(); $_SESSION[$c->prefix."from_id_".$c->getId()."_".$clientid] = $container->getLastMsgId()-$c->max_msg; + // initialize the number of new read messages in order to be able to know how old a message is + $_SESSION[$c->prefix."nbreadmsg_".$c->getId()."_".$clientid] = 0; // reset the nickname cache $_SESSION[$c->prefix."nicklist_".$c->getId()."_".$clientid] = NULL; @@ -58,4 +60,4 @@ } } -?> \ No newline at end of file +?> Modified: branches/0.x/src/pfccommand_getnewmsg.class.php =================================================================== --- branches/0.x/src/pfccommand_getnewmsg.class.php 2006-04-19 07:28:12 UTC (rev 452) +++ branches/0.x/src/pfccommand_getnewmsg.class.php 2006-04-19 12:11:17 UTC (rev 453) @@ -24,6 +24,7 @@ $container =& $c->getContainerInstance(); $from_id = isset($_SESSION[$c->prefix."from_id_".$c->getId()."_".$clientid]) ? $_SESSION[$c->prefix."from_id_".$c->getId()."_".$clientid] : $container->getLastMsgId()-$c->max_msg; + $nbnewmsg = isset($_SESSION[$c->prefix."nbreadmsg_".$c->getId()."_".$clientid]) ? $_SESSION[$c->prefix."nbreadmsg_".$c->getId()."_".$clientid] : 0; $new_msg = $container->readNewMsg($from_id); $new_from_id = $new_msg["new_from_id"]; @@ -48,7 +49,7 @@ $m_cmd = "cmd_me"; } - $js .= "Array(".$m_id.",'".addslashes($m_date)."','".addslashes($m_heure)."','".addslashes($m_nick)."','".addslashes($m_words)."','".addslashes($m_cmd)."',".(date("d/m/Y") == $m_date ? 1 : 0).",".($from_id <= 0? 1 : 0)."),"; + $js .= "Array(".$m_id.",'".addslashes($m_date)."','".addslashes($m_heure)."','".addslashes($m_nick)."','".addslashes($m_words)."','".addslashes($m_cmd)."',".(date("d/m/Y") == $m_date ? 1 : 0).",".($nbnewmsg == 0 ? 1 : 0)."),"; $msg_sent = true; } if ($js != "") @@ -62,6 +63,7 @@ { // store the new msg id $_SESSION[$c->prefix."from_id_".$c->getId()."_".$clientid] = $new_from_id; + $_SESSION[$c->prefix."nbreadmsg_".$c->getId()."_".$clientid] = $nbnewmsg + count($messages); } // remove the lock This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |