function viewMessage($uid = '0', $option) { global $database, $my, $acl; $row = null; $database->setQuery("SELECT a.*, u.name AS user_from" . "\nFROM #__messages AS a" . "\nINNER JOIN #__users AS u ON u.id = a.user_id_from" . "\nWHERE a.message_id='{$uid}'" . "\nORDER BY date_time DESC"); $database->loadObject($row); $database->setQuery("UPDATE #__messages SET state='1' WHERE message_id='{$uid}'"); $database->query(); HTML_messages::viewMessage($row, $option); }
function viewMessage($uid = '0', $option) { $db =& JFactory::getDBO(); $query = 'SELECT a.*, u.name AS user_from' . ' FROM #__messages AS a' . ' INNER JOIN #__users AS u ON u.id = a.user_id_from' . ' WHERE a.message_id = ' . (int) $uid . ' ORDER BY date_time DESC'; $db->setQuery($query); $row = $db->loadObject(); $query = 'UPDATE #__messages' . ' SET state = 1' . ' WHERE message_id = ' . (int) $uid; $db->setQuery($query); $db->query(); HTML_messages::viewMessage($row, $option); }