if (isMobile() or $column == 3) { echo ",position: { my: 'center right', at: 'center left' }"; } elseif ($column == 2) { echo ",position: { my: 'bottom center', at: 'top center' }"; } ?> }); <?php if ($numComments > 0) { ?> $("#postline_comments<?php echo $post->id; ?> ").qtip({ content: '<?php echo "<span style=\"font-size: 0.75em;\"><strong style=\"border-bottom: 1px solid #{$last_comment->qd_author->color};\">" . ($last_comment->qd_author->username == $user->username ? translate("You", $user->you) : $last_comment->qd_author->name) . "</strong> " . translate("replied ", "trả lời ") . (date_diff_short($last_comment->last_touched) == "0" ? translate("just now...", "mới đây...") : (date_diff_short($last_comment->last_touched) === -1 ? translate("[unknown]", "[không biết]") : date_diff_short($last_comment->last_touched) . " " . translate("ago", "trước"))) . "</span>"; ?> ' <?php if (isMobile() or $column == 3) { echo ",position: { my: 'center right', at: 'center left' }"; } elseif ($column == 2) { echo ",position: { my: 'bottom center', at: 'top center' }"; } ?> }); <?php } ?> </script> <?php
?> </span> </fieldset> <fieldset> <legend><?php echo translate("Comment information", "Thông tin của bài trả lời"); ?> </legend> <div class="meta" id="comment<?php echo $comment->id; ?> meta" style="text-align: left; margin: 0; font-size: 0.8em; padding-left: 0px;"> <?php echo "<div id=\"comment{$comment->id}created\"><img src=\"files/site_images/layout/calendar-16.png\" style=\"vertical-align: middle;\"/><span style=\"vertical-align: middle;\"> " . translate("Posted ", "Được đăng ") . "<strong>" . (date_diff_short($comment->created) == "0" ? translate("just now", "mới đây") : (date_diff_short($comment->created) === -1 ? translate("[unknown]", "[không biết]") : date_diff_short($comment->created) . " " . translate("ago", "trước"))) . "</strong></span></div>"; if (!empty($comment->edited) and $comment->edited != "1970-01-01 00:00:00") { echo "<div id=\"comment{$comment->id}edited\"><img src=\"files/site_images/layout/calendar2-16.png\" style=\"vertical-align: middle;\"/>" . ($comment->author != $comment->editor ? "<span style=\"vertical-align: middle;\"> " . translate("Edited by ", "Soạn lại bởi ") . "<strong>{$comment->qd_editor->name}</strong>" . translate(" about ", " khoảng ") . "<strong>" . (date_diff_short($comment->edited) == "0" ? translate("just now", "mới đây") : (date_diff_short($comment->edited) === -1 ? translate("[unknown]", "[không biết]") : date_diff_short($comment->edited) . " " . translate("ago", "trước"))) . "</strong></span>" : "<span style=\"vertical-align: middle;\"> " . translate("Edited ", "Soạn lại ") . translate(" about ", " khoảng ") . "<strong>" . (date_diff_short($comment->edited) == "0" ? translate("just now", "mới đây") : (date_diff_short($comment->edited) === -1 ? translate("[unknown]", "[không biết]") : date_diff_short($comment->edited) . " " . translate("ago", "trước"))) . "</strong></span>") . "</div>"; } if ($comment->author == $user->username or $user->role > 0) { echo "<div id=\"comment{$comment->id}edit\"><img src=\"files/site_images/layout/pencil-16.png\" style=\"vertical-align: middle;\"/>"; echo "<span style=\"vertical-align: middle;\"> <a href='javascript:;' onClick=\"javascript: load_page('edit_discussion.php?id={$comment->id}&postid={$post->id}');\" target='_self'>" . translate("Edit this post", "Soạn lại bài này") . "</a></span>"; echo "</div>"; } echo "<div id=\"comment{$comment->id}delete\"><img src=\"files/site_images/layout/delete-16.png\" style=\"vertical-align: middle;\"/><span style=\"vertical-align: middle;\"> "; switch ($comment->can_delete()) { case "not_empty": echo translate("This post <strong>cannot</strong> be deleted because it contains replies.", "Bài này <strong>không thể</strong> xóa được vì nó đã có bài trả lời."); break; case "too_old": echo translate("This post <strong>cannot</strong> be deleted because it is too old.", "Bài này <strong>không thể</strong> xóa được vì nó quá thời hạn cho phép."); break; default:
echo translate("Recent comments", "Phản hồi mới"); ?> </span></div> <div style="margin-left: <?php echo isMobile() ? "10" : "38"; ?> px;"> <?php $q = mysql_query("SELECT * FROM `quick_discussions` WHERE `parent_id` > '0' ORDER BY `created` DESC, `id` DESC LIMIT {$num_items}"); while ($r = mysql_fetch_object($q)) { $item = new QuickDiscussion(); $item->load($r->id); echo "<div style=\"vertical-align: middle;\"><img src=\"files/site_images/layout/comment-16.png\" style=\"vertical-align: middle;\"/>"; echo "<span style=\"vertical-align: middle;\"> <a onClick=\"javascript: load_page('view_single_discussion.php?id={$item->parent_id}');\">" . (!empty($item->title) ? shorten_string($item->title, 5) : shorten_string(strip_tags($item->body), 5)) . "</a> </span>"; echo "<img src=\"files/site_images/layout/user-16.png\" style=\"vertical-align: middle;\"/> <span style=\"font-size: 0.9em; border-bottom: 1px solid #{$item->qd_author->color}; vertical-align: middle;\"><strong><em><a onClick=\"load_page('profile.php?who={$item->qd_author->username}');\">{$item->qd_author->name}</a></em></strong></span> "; echo "<span style=\"font-size: 0.9em; vertical-align: middle;\">(" . (date_diff_short($item->created) == "0" ? translate("just now", "mới đây") : (date_diff_short($item->created) === -1 ? translate("[unknown]", "[không biết]") : date_diff_short($item->created) . " " . translate("ago", "trước"))) . ")</span>"; echo "</div>"; } ?> </div> <?php if (!isMobile()) { ?> </td><td style="text-align: left; vertical-align: top;" valign="top"> <?php } else { ?> </div> <div style="text-align: left; vertical-align: middle;"> <?php }
</span></div> <div style="margin-left: <?php echo isMobile() ? "10" : "38"; ?> px;"> <?php $users_already_displayed = array(); $a = mysql_query("SELECT * FROM `users_activities` ORDER BY `when` DESC"); while ($b = mysql_fetch_object($a)) { if (in_array($b->username, $users_already_displayed)) { continue; } $c = new User($b->username); echo "<div style=\"vertical-align: middle;\"><img src=\"files/site_images/layout/activity_monitor-16.png\" style=\"vertical-align: middle;\"/>"; echo "<span style=\"vertical-align: middle; border-bottom: 1px solid #{$c->color};\"> <strong><a onClick=\"load_page('profile.php?who={$c->username}');\">{$c->name}</a></strong></span>"; echo "<span style=\"vertical-align: middle;\"> (" . (date_diff_short($b->when) == "0" ? translate("just now", "mới đây") : (date_diff_short($b->when) === -1 ? translate("[unknown]", "[không biết]") : date_diff_short($b->when) . " " . translate("ago", "trước"))) . ") - <em>"; echo get_defined_activity($b->what); echo "</em></span></div>"; $users_already_displayed[] = $c->username; } // $a = mysql_query("SELECT * FROM `users` WHERE `last_seen` > '0000-00-00 00:00:00' ORDER BY `last_seen` DESC"); // while ($b = mysql_fetch_object($a)){ // if (mysql_num_rows(mysql_query("SELECT 1 FROM `users_activities` WHERE `username` = '{$b->username}'")) > 0){ // $c = new User($b->username); // $activity = mysql_fetch_object(mysql_query("SELECT 1 FROM `users_activities` WHERE `username` = '{$c->username}' ORDER BY `when` DESC LIMIT 1")); // echo "<div style=\"vertical-align: middle;\"><img src=\"files/site_images/layout/activity_monitor-16.png\" style=\"vertical-align: middle;\"/>"; // echo "<span style=\"vertical-align: middle; border-bottom: 1px solid #{$c->color};\"> <strong><a onClick=\"load_page('profile.php?who={$c->username}');\">{$c->name}</a></strong></span>"; // echo "<span style=\"vertical-align: middle;\"> (".(date_diff_short($c->last_seen) == "0" ? translate("just now","mới đây") : (date_diff_short($c->last_seen) === -1 ? translate("[unknown]","[không biết]") : date_diff_short($c->last_seen)." ".translate("ago","trước"))).") - <em>"; // echo get_defined_activity($c->last_activity); // echo "</em></span></div>"; // }
$event_image = "/files/site_images/layout/calendar-16.png"; break; case "holiday_f": $event_image = "/files/site_images/layout/mistletoe-16.png"; break; case "holiday_v": $event_image = "/files/site_images/layout/shamrock-16.png"; break; case "get_together": $event_image = "/files/site_images/layout/get_together-16.png"; break; case "anniversary": $age = true; $event_image = "/files/site_images/layout/anniversary-16.png"; break; } echo "<div><img src='{$event_image}' style='vertical-align: middle;'/><span style='vertical-align: middle;'> <strong>{$theEvent->name}" . ($age ? " (" . (date_diff_short($theEvent->when, $theEventThisYear, true, true) > 1 ? date_diff_short($theEvent->when, $theEventThisYear, true, true) . " " . translate("years", "năm") : date_diff_short($theEvent->when, $theEventThisYear, true, true) . " " . translate("year", "năm")) . ")" : "") . "</strong> <span style='font-size: 0.9em;'>" . get_date($event[0] . " 00:00:00") . "</span></span></div>"; $age = false; } ?> </div> <?php if (!isMobile()) { ?> </td></tr></table> <?php } else { ?> </div> <?php }
} $status_q = mysql_query("SELECT * FROM `quick_discussions_read_status` WHERE `postid` = '{$post->id}' AND `{$u->username}` > '1970-01-01 00:00:00'"); if (mysql_num_rows($status_q) > 0) { $read_status = mysql_fetch_object($status_q); $read_status_array[] = array("user" => $u->username, "when" => $read_status->{$u->username}); $comments_count++; } } if ($comments_count > 0) { ?> <span style="display: inline-block; float: left; font-size: 0.8em;"> <?php usort($read_status_array, "single_discussion_usort_read_status"); foreach ($read_status_array as $a) { $b = new User($a["user"]); echo "<span style=\"display: inline-block; float: left;\"><span style=\"display: inline-block; border-bottom: 1px solid #{$b->color};margin: 0 2px;\"><strong>" . ($b->username == $user->username ? translate("You", $b->you) : $b->name) . "</strong></span><span style=\"display: inline-block; margin: 0 2px;\">— <em>" . (date_diff_short($a["when"]) == "0" ? translate("just now", "mới đây") : (date_diff_short($a["when"]) === -1 ? translate("[unknown]", "[không biết]") : date_diff_short($a["when"]) . " " . translate("ago", "trước"))) . "</em></span></span>"; } ?> </span> <?php } else { echo "<em>" . translate("No reader yet", "Chưa ai đọc hết") . "...</em>"; } ?> </fieldset> </div> <?php if ($post->parent_id == 0) { ?> <div class="wrap" style="text-align: center; margin: 5px auto; clear: both;">
</ul> </div> </fieldset> <?php $num_of_user_activities = mysql_num_rows(mysql_query("SELECT * FROM `users_activities` WHERE `username` = '{$a->username}'")); if ($num_of_user_activities > 0) { ?> <fieldset> <legend style="font-size: 1.1em;"><img src="files/site_images/layout/activity_monitor-32.png" style="vertical-align: middle;"/><span style="vertical-align: middle;"> <?php echo translate("User activities", "Hoạt động của thành viên"); ?> </span></legend> <ol style="text-align: left; font-size: 0.9em;"> <?php $result = mysql_query("SELECT * FROM `users_activities` WHERE `username` = '{$a->username}' ORDER BY `when` DESC, `id` DESC"); while ($row = mysql_fetch_object($result)) { if (get_defined_activity($row->what) !== false) { echo "<li>" . get_defined_activity($row->what) . ", " . (date_diff_short($row->when) == 0 ? translate("just now", "mới đây") : translate("about", "khoảng") . " " . date_diff_short($row->when) . " " . translate("ago", "trước")) . ".</li>"; } } ?> </ol> </fieldset> <?php } ?> </div> <?php require_once "{$_SESSION["root_path"]}/page_bottom.php";