function sendChat($pageId) { $from = $_SESSION['username']; $to = Filter::text($_POST['to']); $message = $_POST['message']; $_SESSION['openChatBoxes'][$to] = date('Y-m-d H:i:s', time()); $fromUsername = User::load($from)->getUsername(); $messagesan = sanitize($message); if (!isset($_SESSION['chatHistory'][$to])) { $_SESSION['chatHistory'][$to] = ''; } $_SESSION['chatHistory'][$to] .= <<<EOD \t\t\t\t\t { \t\t\t"s": "1", \t\t\t"f": "{$fromUsername}", \t\t\t"m": "{$messagesan}" \t }, EOD; unset($_SESSION['tsChatBoxes'][$to]); $chat = new Chat(array('sender' => mysql_real_escape_string($from), 'recipient' => mysql_real_escape_string($to), 'message' => mysql_real_escape_string($messagesan), 'sent' => '2013-05-03 12:02:48')); $chat->save(); $newId = $chat->getID(); if (empty($_SESSION['openChatBoxes']["{$pageId}"])) { $_SESSION['openChatBoxes']["{$pageId}"] = $newId; } else { if ($newId - 1 == $_SESSION['openChatBoxes']["{$pageId}"]) { $_SESSION['openChatBoxes']["{$pageId}"] = $newId; } } echo formatParagraphs($messagesan, true); exit(0); }
echo $slash; } if (!empty($sex)) { echo $sex; } if (!empty($sex) && !empty($loc)) { echo $slash; } if (!empty($loc)) { echo 'from ' . $loc; } echo '</p>'; ?> <p>last login <?php echo formatTimeTag($user->getSecondLastLogin()); ?> </p> <?php // biography if (!empty($bio)) { echo '<div class="line" style="margin: 1em 0 0 55px;"></div>'; echo '<p class="biography">' . formatParagraphs($bio) . '</p>'; } ?> <div class="clear"></div> </div><!-- .view --> <?php $fork->endBlockSet(); $fork->render('site/partial/panel');
function formatPitch($pitch) { return formatParagraphs($pitch); }