function viewPosts($mode = 'normal', $criteria = NULL) { //Visar alla inlägg $query = makeQuery($mode, $criteria); $result = mysql_query($query) or die('Ett fel har upstått:<br/>' . mysql_error()); $genderlabels['P'] = 'Pojke'; $genderlabels['F'] = 'Flicka'; while ($data = mysql_fetch_assoc($result)) { $userage = date_get_age($data['birthday']); if ($data['gender'] == 'P') { $divbg = 'blue_faded_div'; } elseif ($data['gender'] == 'F') { $divbg = 'pink_faded_div'; } else { $divbg = 'grey_faded_div'; } if (isset($_SESSION['login']['username'])) { if (preg_match("/" . $_SESSION['login']['username'] . "/i", $data['text'])) { $divbg = 'orange_faded_div'; } elseif ($_SESSION['login']['username'] == $data['username']) { $divbg = 'green_faded_div'; } } echo '<div class="' . $divbg . '" style="repeat-x; margin-top: 10px; border: 1px solid #CCCCCC;">' . "\n"; echo '<table class="body" style="width: 100%;"><tr><td style="vertical-align: top; width: 75px;">' . "\n"; if ($data['image'] == 1 || $data['image'] == 2) { echo insert_avatar($data['userid']); } else { echo '<img src="/images/noimage.png" style="width: 75px; height: 75px; border: 1px solid #cccccc;" alt="Ingen visningsbild"/>' . "\n"; } echo '</td><td style="vertical-align: top;">'; echo fix_time($data['timestamp']) . ' (inlägg #' . $data['id'] . ') <a style="text-decoration:none;" href="javascript:#;" onclick="javascript:document.gbform.message.value=document.gbform.message.value+\'' . $data['username'] . ' : \';document.gbform.message.focus();">[^]</a><br/>' . "\n"; echo '<a href="' . $hp_url . '/traffa/profile.php?id=' . $data['userid'] . '">' . "\n"; echo '<b>' . $data['username'] . '</b></a> ' . "\n"; echo birthdaycake($data['birthday']) . ' ' . "\n"; echo $genderlabels[$data['gender']]; if ($userage > 1) { echo ' ' . $userage . 'år' . "\n"; } if (strlen($data['geo_location']) > 1) { echo ' från ' . htmlentities($data['geo_location']) . "\n"; } echo '<br/>' . "\n"; echo setsmilies($data['text']) . "\n"; echo '</td></tr></table>' . "\n"; echo '</div>' . "\n"; } //while-satsen för att skriva ut inlägg }
function live_chat_load_events($options) { $tail['filename'] = LIVE_CHAT_STORAGE_PATH . $options['type'] . '/' . $options['reference_id']; $tail['line_count'] = LIVE_CHAT_MAX_READ_LINES; $tail['buffer_length'] = LIVE_CHAT_STORAGE_BUFFER_LENGTH; $options['min_id'] = isset($options['min_id']) ? $options['min_id'] : 0; $rows = tail($tail); $events = array(); foreach ($rows as $row) { $event = unserialize(trim($row)); if ($event['id'] > $options['min_id']) { $event['message'] = clickable_links($event['message']); $event['message'] = setsmilies($event['message']); $events[] = $event; } } return $events; }
function list_entries($recipient, $entries, $offset = 0, $filter = 0) { global $hp_includepath; if ($offset < 1 || !is_numeric($offset)) { $offset = 0; } $list_sql = 'SELECT gb.id, gb.timestamp, gb.message, gb.sender, gb.read, gb.answered, gb.forum_post, login.username, info.image, '; $list_sql .= 'info.birthday, info.gender, is_private, zip_codes.* '; $list_sql .= 'FROM traffa_guestbooks AS gb, login, userinfo AS info, zip_codes '; if ($filter > 0) { $list_sql .= 'WHERE ('; $list_sql .= '(gb.recipient ="' . $recipient . '" AND gb.sender = "' . $filter . '") '; $list_sql .= 'OR (gb.recipient = "' . $filter . '" AND gb.sender = "' . $recipient . '") '; $list_sql .= ') AND login.id = gb.sender AND info.userid = gb.sender AND zip_codes.zip_code = info.zip_code '; } else { $list_sql .= 'WHERE gb.recipient = "' . $recipient . '" AND zip_codes.zip_code = info.zip_code '; } $list_sql .= 'AND login.id = gb.sender AND info.userid = gb.sender AND deleted = 0 '; if (isset($_SESSION['login']['id'])) { $list_sql .= 'AND (gb.is_private = 0 OR gb.sender = ' . $_SESSION['login']['id'] . ' OR gb.recipient = ' . $_SESSION['login']['id'] . ') '; } else { $list_sql .= 'AND gb.is_private = 0 '; } if ($filter > 0) { $list_sql .= 'ORDER BY gb.id DESC'; } else { $list_sql .= 'ORDER BY gb.id DESC LIMIT ' . $offset . ', ' . GUESTBOOK_MESSAGES_PER_PAGE; } $list_result = mysql_query($list_sql) or die(report_sql_error($list_sql)); if ($filter == 0) { echo '<p class="subtitle">Gästbok - ' . cute_number($entries) . ' inlägg</p>' . "\n"; } else { echo '<p class="subtitle">Gästbok - Visar historik</p>' . "\n"; } if ($offset > 0) { echo ' - sida ' . intval($offset / GUESTBOOK_MESSAGES_PER_PAGE + 1) . ' av ' . intval($entries / GUESTBOOK_MESSAGES_PER_PAGE + 1); } echo '</p>' . "\n"; $unread = array(); if (true) { while ($entry = mysql_fetch_assoc($list_result)) { if ($entry['read'] != 1) { rounded_corners_top(array('color' => 'orange_deluxe', 'id' => 'gb_entry_' . $entry['id'])); } else { rounded_corners_top(array('color' => 'blue_deluxe', 'id' => 'gb_entry_' . $entry['id'])); $button_color = 'blue_'; } echo '<div class="entry_picture">' . "\n"; if ($entry['image'] == 1 || $entry['image'] == 2) { echo ui_avatar($entry['sender']); } echo '</div>' . "\n"; echo '<div class="entry_main">' . "\n"; echo '<div class="entry_info">' . "\n"; echo '<span class="gb_private" id="gb_private_' . $entry['id'] . '_label">'; echo $entry['is_private'] == 1 ? 'Detta inlägg är privat' : ''; echo '</span>' . "\n"; echo '<span class="gb_unanswered" id="gb_unanswered_' . $entry['id'] . '_label">'; echo $entry['answered'] != 'Y' ? 'Obesvarat' : ''; echo '</span>' . "\n"; echo '<span class="timestamp">Skrevs ' . fix_time($entry['timestamp']) . '</span>'; echo '<a href="/traffa/profile.php?id=' . $entry['sender'] . '">' . $entry['username'] . '</a>' . "\n"; echo $entry['gender'] == 'm' ? ' Pojke' : ''; echo $entry['gender'] == 'f' ? ' Flicka' : ''; echo $entry['birthday'] != '0000-00-00' ? ' ' . date_get_age($entry['birthday']) . ' år' : ''; echo strlen($entry['spot']) > 0 ? ' från <a style="cursor: pointer;" onclick="window.open(\'http://www.hitta.se/LargeMap.aspx?ShowSatellite=false&pointX=' . $entry['y_rt90'] . '&pointY=' . $entry['x_rt90'] . '&cx=' . $entry['y_rt90'] . '&cy=' . $entry['x_rt90'] . '&z=6&name=' . $entry['username'] . '%20i%20' . urlencode($entry['spot']) . '\', \'user_map_3\', \'location=false, width=750, height=500\');">' . $entry['spot'] . '</a>' : ''; echo '</div>' . "\n"; echo '<p>' . "\n"; echo setsmilies(nl2br($entry['message'])); // preint_r($entry); echo '</p>' . "\n"; echo '</div>' . "\n"; echo '<div class="entry_controls">' . "\n"; echo $recipient == $_SESSION['login']['id'] && $entry['sender'] != $_SESSION['login']['id'] ? '<a href="/hamsterpaj/abuse.php?report_type=guestbook_entry&reference_id=' . $entry['id'] . '" class="abuse_button"><img src="http://images.hamsterpaj.net/abuse.png" /></a> ' . "\n" : ''; echo $recipient == $_SESSION['login']['id'] && $entry['sender'] != $_SESSION['login']['id'] ? '<button class="' . $button_color . 'button_70" onclick="gb_block_user(\'' . $entry['username'] . '\');">Blockera</button> ' . "\n" : ''; echo $recipient == $_SESSION['login']['id'] || $entry['sender'] == $_SESSION['login']['id'] ? '<button id="gb_private_' . $entry['id'] . '" class="' . $button_color . 'button_80" onclick="gb_private(' . $entry['id'] . ');"' . ($entry['is_private'] == 1 ? ' style="display: none;"' : '') . '>Privatisera</button> ' . "\n" : ''; echo $recipient == $_SESSION['login']['id'] && $entry['sender'] != $_SESSION['login']['id'] ? '<button id="gb_unprivate_' . $entry['id'] . '" class="' . $button_color . 'button_90" onclick="gb_unprivate(' . $entry['id'] . ');"' . ($entry['is_private'] == 1 ? '' : ' style="display: none;"') . '>Avprivatisera</button> ' . "\n" : ''; echo '<button class="' . $button_color . 'button_70" onclick="gb_history(' . $recipient . ', ' . $entry['sender'] . ');">Historik</button> ' . "\n"; echo '<button class="' . $button_color . 'button_60" onclick="gb_goto(' . $entry['sender'] . ');">Gå till</button> ' . "\n"; echo $recipient == $_SESSION['login']['id'] && $entry['sender'] != $_SESSION['login']['id'] ? '<button class="' . $button_color . 'button_60" onclick="gb_remove(' . $entry['id'] . ', \'' . $entry['username'] . '\', \'' . fix_time($entry['timestamp']) . '\');">Ta bort</button> ' . "\n" : ''; echo $recipient == $_SESSION['login']['id'] && $entry['sender'] != $_SESSION['login']['id'] ? '<button class="' . $button_color . 'button_50" onclick="gb_answer(\'' . $entry['username'] . '\', ' . $entry['sender'] . ', ' . $entry['id'] . ');">Svara</button> ' . "\n" : ''; echo '</div>' . "\n"; if ($entry['read'] != 1) { rounded_corners_bottom(array('color' => 'orange_deluxe')); } else { rounded_corners_bottom(array('color' => 'blue_deluxe')); } if ($entry['read'] == 0) { array_push($unread, $entry['id']); } } } else { while ($list_data = mysql_fetch_assoc($list_result)) { if ($list_data['read'] == 1) { echo '<div style="background: #f7f7f7">' . "\n"; } else { echo '<div style="background: #ffc777">' . "\n"; } echo '<table class="body"><tr><td style="width: 80px; vertical-align: top;">' . "\n"; if ($list_data['image'] == 1 || $list_data['image'] == 2) { echo insert_avatar($list_data['sender']); } echo '</td>' . "\n" . '<td style="vertical-align: top; width: 650px;">' . "\n"; if ($list_data['is_private'] == 1) { echo '<b>Detta inlägg är privat</b>' . "\n"; } if ($list_data['forum_post'] > 0) { echo '<div class="orange_faded_div" style="width: auto;">Detta är en kommentar på ett forumsinlägg. <a href="javascript: void(0);" onclick="window.open(\'/forum_new/read_post_popup.php?id=' . $list_data['forum_post'] . '\', Math.random(), \'width=600, height=450, scrollbars=yes\');">Läs inlägget i en popup</a> eller <a href="/forum_new/index.php?action=redirect_to_post&post_id=' . $list_data['forum_post'] . '">gå till tråden i forumet</a>.</div>'; } if ($_SESSION['login']['id'] == $recipient) { $reply_status = $list_data['answered'] == 'Y' ? null : ' Obesvarat'; } echo '<p style="color: grey;">'; echo $list_data['read'] == 0 ? '<strong>' : null; echo '(skrevs ' . fix_time($list_data['timestamp']) . $reply_status . ')'; echo $list_data['read'] == 0 ? '</strong>' : null; echo '<br />' . "\n"; echo '<a href="/traffa/profile.php?id=' . $list_data['sender'] . '"><b>' . $list_data['username'] . '</b></a> '; if ($list_data['gender'] == 'm') { echo 'Kille '; } elseif ($list_data['gender'] == 'f') { echo 'Tjej '; } $userage = date_get_age($list_data['birthday']); if ($userage > 0) { echo $userage . ' år '; } if (strlen($list_data['spot']) > 0) { echo 'från ' . $list_data['spot'] . ' '; } echo '</p>' . "\n"; echo '<p>'; echo setSmilies(nl2br($list_data['message'])); echo '</p>' . "\n"; echo '<p style="text-align: right;">' . "\n"; echo '<form action="/traffa/userblocks.php" method="post" style="display: inline; float: right;">' . "\n"; if ($_SESSION['login']['id'] == $recipient && $filter == 0) { echo '<input type="submit" value="Blockera" class="button_70" style="display: inline;" onclick="return confirm(\'Du är på väg att blockera avsändaren från att skicka fler gästboksinlägg och meddelanden till dig\');" />' . "\n"; } if ($filter == 0) { echo '<input type="button" onClick="window.location=\'' . $_SERVER['PHP_SELF'] . '?action=history&view=' . $recipient . '&remote=' . $list_data['sender'] . '\';" class="button_70" value="Historik" /> ' . "\n"; } echo '<input type="button" onclick="window.location=\'' . $_SERVER['PHP_SELF'] . '?view=' . $list_data['sender'] . '\';" class="button_60" value="Gå till" /> ' . "\n"; if ($_SESSION['login']['id'] == $recipient) { echo '<input type="button" onclick="window.open(\'/traffa/gb-reply.php?action=reply&username='******'username'] . '&userid=' . $list_data['sender'] . '&answereid=' . $list_data['id']; echo '\',\'\' ,\'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=250, height=200\');" value="Svara" class="button_50" /> ' . "\n"; if ($filter == 0) { echo '<input type="button" onclick="var name=confirm(\'Vill du verkligen ta bort inlägget?\'); if(name==true){ window.location=\'' . $_SERVER['PHP_SELF'] . '?action=delete&entry_id=' . $list_data['id'] . '&return_offset=' . $_GET['offset'] . '\'; }" value="Ta bort" class="button_70" />' . "\n"; echo '<input type="hidden" name="addblock" value="' . $list_data['username'] . '" />' . "\n"; } } echo '</form>' . "\n"; if ($_SESSION['login']['id'] == $recipient && $filter == 0) { echo '<button class="button_80" style="display: inline;" onclick="idiot_report(\'' . $list_data['sender'] . '\');" />Rapportera</button>' . "\n"; } echo '</p>' . "\n"; echo '</td></tr>' . "\n" . '</table>' . "\n"; echo '</div>' . "\n"; echo '<br />' . "\n"; if ($list_data['read'] == 0) { array_push($unread, $list_data['id']); } } } if ($offset > 0) { echo '<input type="button" onclick="window.location=\'' . $_SERVER['PHP_SELF'] . '?offset=' . intval($offset - GUESTBOOK_MESSAGES_PER_PAGE) . '&view=' . $recipient . '\';" value="<<Föregående sida" class="button" style="float: left;" />'; } if ($offset + GUESTBOOK_MESSAGES_PER_PAGE < $entries && $entries > GUESTBOOK_MESSAGES_PER_PAGE) { echo '<input type="button" onclick="window.location=\'' . $_SERVER['PHP_SELF'] . '?offset=' . intval($offset + GUESTBOOK_MESSAGES_PER_PAGE) . '&view=' . $recipient . '\';" value="Nästa sida>>" class="button" style="float: right;" />'; } echo '<div style="text-align: center; margin-bottom: 15px;">'; for ($pages = 1; $pages < intval($entries / GUESTBOOK_MESSAGES_PER_PAGE + 1) && $pages < 32; $pages++) { echo '<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $recipient . '&offset=' . ($pages - 1) * GUESTBOOK_MESSAGES_PER_PAGE . '">' . $pages . '</a> '; } echo '</div>'; if ($recipient == $_SESSION['login']['id'] && $filter == 0) { $read_sql = 'UPDATE traffa_guestbooks SET `read` = 1 WHERE id = 1 '; //Bara för att göra foreach-loopen smidigare :P foreach ($unread as $current) { $read_sql .= 'OR id = ' . $current . ' '; } mysql_query($read_sql) or die(report_sql_error($read_sql, __FILE__, __LINE__)); } }
function posts_list_old($posts, $discussions = null, $options) { $options['enable_quality_rank'] = $options['enable_quality_rank'] === false ? false : true; $options['quality_level'] = isset($options['quality_level']) ? $options['quality_level'] : 0; $options['mode'] = isset($options['mode']) ? $options['mode'] : 'forum'; echo '<input type="hidden" id="debug_input" />'; foreach ($posts as $i => $post) { /* Shall we display any discussion splits before the post? */ $display_discussions = array(); foreach ($discussions as $key => $discussion) { if ($discussion['timestamp'] <= $post['timestamp']) { $display_discussions[] = $discussion; unset($discussions[$key]); } } if (count($display_discussions) > 0) { discussions_list_splits($display_discussions); } /* Shall we hide this post, due to low quality? */ $low_quality = $post['quality_level'] >= 0 && ($i > 0 && $options['enable_quality_rank'] && $post['quality_rank'] < $options['quality_level'] - 0.4 ? true : false); $low_quality = false; if (in_array('private_gb', $post['flags'])) { echo '<h5 class="private_header">Privat inlägg</h5>' . "\n"; if ($_SESSION['login']['id'] != $post['author'] && $_SESSION['login']['id'] != $options['gb_recipient']) { continue; } } echo '<!-- Post #' . $post['post_id'] . ' by ' . $post['username'] . ' at ' . date('Y-m-d H:i:s', $post['timestamp']) . '-->' . "\n"; echo '<a name="post_' . $post['post_id'] . '_anchor"></a>' . "\n"; if (in_array('removed', $post['flags'])) { echo '<div class="removed_post">' . "\n"; echo '<h2>Borttaget inlägg, skrevs ' . fix_time($post['timestamp']) . ' av <a href="/traffa/profile.php?id=' . $post['author'] . '">' . $post['username'] . '</a></h2>' . "\n"; echo '</div>' . "\n"; $displayed_posts[] = $post['post_id']; continue; } if ($low_quality) { echo '<div class="low_quality">'; } echo '<div class="post" id="post_' . $post['post_id'] . '"'; if (login_checklogin() && strpos($post['content'], $_SESSION['login']['username'])) { echo ' style="background: #f9cc88;"'; } echo '>' . "\n"; echo '<div class="author">' . "\n"; if ($low_quality) { echo 'Detta inlägg har lägre kvalitét än vad skaparen av diskussionen vill ha.'; } elseif ($post['image'] == 1 || $post['image'] == 2) { echo user_avatar($post['author']) . "\n"; } echo '</div>' . "\n"; echo '<div class="date_time">Skrevs ' . fix_time($post['timestamp']) . '</div>' . "\n"; echo '<div class="author_text"><a href="/traffa/profile.php?id=' . $post['author'] . '">' . $post['username'] . '</a>'; echo ($post['gender'] == 'm' ? ', pojke' : ($post['gender'] == 'f' ? ', flicka' : '')) . ' ' . date_get_age($post['birthday']); if (strlen($post['spot']) > 0) { echo ' från ' . $post['spot']; } echo '</div>'; if ($post['userlevel'] >= 3) { echo '<img class="badge" src="' . IMAGE_URL . 'forum/ordningsvakt.png" alt="" />'; } if ($post['lastaction'] > time() - 600) { echo '<img class="badge" src="' . IMAGE_URL . 'forum/online.png" alt="" />'; } echo '<div id="post_content_' . $post['post_id'] . '" class="' . ($low_quality ? 'low_quality_content' : 'content') . '">' . "\n"; $options_markup['post_id'] = $post['post_id']; $options_markup['context'] = 'forum'; echo setsmilies(markup_parse($post['content'], $options_markup)); if (strlen($post['forum_signature']) > 0) { echo '<div class="signature">' . $post['forum_signature'] . '</div>' . "\n"; } echo '</div>' . "\n"; echo '<div class="controls">' . "\n"; if (login_checklogin()) { $control_buttons['answer'] = '<input type="button" class="post_answer_button" id="post_answer_button_' . $post['post_id'] . '_' . $post['username'] . '" value="[Svara]" />'; $control_buttons['quote'] = '<input type="button" class="post_quote_button" id="post_quote_button_' . $post['post_id'] . '_' . $post['username'] . '" value="[Citera]" />'; $control_buttons['history'] = '<input type="button" class="post_history_button" id="post_history_button_' . $post['post_id'] . '_' . $post['username'] . '" value="[Historik]" />'; $control_buttons['delete'] = '<input type="button" class="post_delete_button" id="post_delete_button_' . $post['post_id'] . '_' . $post['username'] . '" value="[Ta bort]" />'; $control_buttons['censor'] = '<input type="button" class="post_censor_button" id="post_censor_button_' . $post['post_id'] . '_' . $post['username'] . '" value="[Censurera]" />'; $control_buttons['addition'] = '<input type="button" class="post_addition_button" id="post_addition_button_' . $post['post_id'] . '_' . $post['username'] . '" value="[Tillägg]" />'; $control_set['forum'] = array('answer', 'quote'); $control_set['guestbook'] = array('answer', 'quote', 'history'); $control_set['admin'] = array('delete', 'censor', 'addition'); foreach ($control_set[$options['mode']] as $button) { echo $control_buttons[$button] . "\n"; } if (posts_admin_check($post)) { foreach ($control_set['admin'] as $button) { echo $control_buttons[$button] . "\n"; } } elseif ($post['author'] == $_SESSION['login']['id']) { echo $control_buttons['addition']; } } echo '</div>' . "\n"; echo '<div class="post_addition" id="post_addition_' . $post['post_id'] . '">' . "\n"; echo ' <textarea id="post_addition_content_' . $post['post_id'] . '" rows="3" cols="50" ></textarea>' . "\n"; echo ' <button class="button_30" id="post_addition_submit_' . $post['post_id'] . '" value="post_addition_' . $post['post_id'] . '">Spara</button>' . "\n"; echo '</div>'; echo '</div>' . "\n"; if ($low_quality) { echo '</div>' . "\n"; } echo "\n\n"; $displayed_posts[] = $post['post_id']; } if (login_checklogin()) { /* Remove all notices and answer notices for read posts */ $query = 'DELETE FROM notices WHERE post_id IN("' . implode('", "', $displayed_posts) . '") AND user_id = "' . $_SESSION['login']['id'] . '"'; mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__)); } /* List the remaining discussions */ if (count($discussions) > 0) { discussions_list_splits($discussions); } }
function messages_view($message_id, $user_id, $quoting = 0) { $query = 'SELECT m.id, m.timestamp, m.recipient_status AS recipient_status, CONCAT(mm.title, m.title) AS title, '; $query .= 'CONCAT(mm.message, m.message) AS message, '; $query .= 'm.discussion AS discussion, m.recipient AS recipient_id, m.sender AS sender_id, rlogin.username AS recipient_username, '; $query .= 'slogin.username AS sender_username, rinfo.birthday AS recipient_birthday, sinfo.birthday AS sender_birthday, '; $query .= 'rinfo.gender AS recipient_gender, sinfo.gender AS sender_gender, rzip.spot AS recipient_location, '; $query .= 'szip.spot AS sender_location, rinfo.image AS recipient_image, sinfo.image AS sender_image '; $query .= 'FROM messages_new AS m, mass_messages AS mm, login AS slogin, login AS rlogin, userinfo AS sinfo, userinfo AS rinfo, zip_codes AS szip, zip_codes AS rzip '; $query .= 'WHERE mm.id = m.mass_message_id AND rlogin.id = m.recipient AND slogin.id = m.sender AND rinfo.userid = m.recipient AND rzip.zip_code = rinfo.zip_code AND szip.zip_code = sinfo.zip_code AND '; $query .= 'sinfo.userid = m.sender AND (m.sender = ' . $user_id . ' OR m.recipient = ' . $user_id . ') AND m.id = "' . $message_id . '"'; $result = mysql_query($query) or die(report_sql_error($query)); if (mysql_num_rows($result) != 1) { return false; } $data = mysql_fetch_assoc($result); if ($data['recipient_status'] == 0 && $data['recipient_id'] == $user_id) { mysql_query('UPDATE messages_new SET recipient_status = 1 WHERE id = ' . $data['id'] . ' LIMIT 1'); $_SESSION['notices']['unread_messages'] -= 1; } echo '<div class="grey_faded_div">'; $tooltip_sender = '<b>' . $data['sender_username'] . '</b>'; if ($data['sender_image'] == 1 || $data['sender_image'] == 2) { $tooltip_sender .= '<br /><img src=' . IMAGE_URL . '/images/users/thumb/' . $data['sender_id'] . '.jpg />'; } if ($data['sender_gender'] == 'P') { $tooltip_sender .= '<br />Kön: kille'; } elseif ($data['sender_gender'] == 'F') { $tooltip_sender .= '<br />Kön: tjej'; } if (isset($data['sender_birthday']) && $data['sender_birthday'] != '0000-00-00') { $tooltip_sender .= '<br />Ålder: ' . date_get_age($data['sender_birthday']) . 'år'; } if (strlen($data['sender_location']) > 1) { $tooltip_sender .= '<br />Bor: ' . trim($data['sender_location']); } $sender_link = '<a href="/traffa/profile.php?id=' . $data['sender_id'] . '" '; $sender_link .= 'onmouseover="return makeTrue(domTT_activate(this, event, \'content\', \'' . $tooltip_sender . '\', \'trail\', true));">'; $sender_link .= $data['sender_username'] . '</a>'; $tooltip_recipient = '<b>' . $data['recipient_username'] . '</b>'; if ($data['recipient_image'] == 1 || $data['recipient_image'] == 2) { $tooltip_recipient .= '<br /><img src=' . IMAGE_URL . '/images/users/thumb/' . $data['recipient_id'] . '.jpg />'; } if ($data['recipient_gender'] == 'P') { $tooltip_recipient .= '<br />Kön: kille'; } elseif ($data['recipient_gender'] == 'F') { $tooltip_recipient .= '<br />Kön: tjej'; } if (isset($data['recipient_birthday']) && $data['recipient_birthday'] != '0000-00-00') { $tooltip_recipient .= '<br />Ålder: ' . date_get_age($data['recipient_birthday']) . 'år'; } if (strlen($data['recipient_location']) > 1) { $tooltip_recipient .= '<br />Bor: ' . trim($data['recipient_location']); } $recipient_link = '<a href="/traffa/profile.php?id=' . $data['recipient_id'] . '" '; $recipient_link .= 'onmouseover="return makeTrue(domTT_activate(this, event, \'content\', \'' . $tooltip_recipient . '\', \'trail\', true));">'; $recipient_link .= $data['recipient_username'] . '</a>'; echo '<h2 style="margin-bottom: 2px;">Meddelande '; if ($user_id != $data['sender_id']) { echo 'från ' . $sender_link; } if ($user_id != $data['recipient_id']) { echo ' till ' . $recipient_link; } echo '</h2>'; echo '<b style="margin-left: 3px;">Skickades ' . fix_time($data['timestamp']) . '</b>'; echo '<p style="margin-left: 3px;">'; echo '<b>' . $data['title'] . '</b><br />'; echo setsmilies($data['message']); echo '</p></div>'; if ($data['sender_id'] == $user_id) { echo '<input type="button" value="Nytt meddelande till ' . $data['recipient_username'] . '" class="button" '; echo 'onclick="window.location=\'' . $_SERVER['PHP_SELF'] . '?action=compose&recipient_id=' . $data['recipient_id'] . '\';" />'; } elseif ($quoting == 1) { return true; } else { if (substr($data['title'], 0, 5) != 'Svar:') { $title = 'Svar: ' . $data['title']; } else { $title = $data['title']; } $answer_url = $_SERVER['PHP_SELF'] . '?action=compose&recipient_id=' . $data['sender_id'] . '&title=' . addslashes($title); $answer_url .= '"e&message_id=' . $message_id; echo '<input type="button" value="Svara" class="button" onclick="window.location=\'' . $answer_url . '\';" />'; } echo '<h2>Relaterade meddelanden</h2>'; $options = array('mode' => 'associated', 'user' => $data['sender_id'], 'discussion' => $data['discussion']); if ($data['sender_id'] == $user_id) { $options['user'] = $data['recipient_id']; } messages_list($user_id, $options); return true; }