$tool_content .= "<td>$image <a href='$topiclink'><b>" . q($topic_title) . "</b></a>$pagination</td>"; $tool_content .= "<td class='text-center'>$replies</td>"; $tool_content .= "<td class='text-center'>" . q(uid_to_name($myrow->poster_id)) . "</td>"; $tool_content .= "<td class='text-center'>$myrow->num_views</td>"; $tool_content .= "<td class='text-center'>" . q(uid_to_name($myrow->poster_id)) . "<br />$last_post_datetime</td>"; $sql = Database::get()->querySingle("SELECT notify_sent FROM forum_notify WHERE user_id = ?d AND topic_id = ?d AND course_id = ?d", $uid, $myrow->id, $course_id); if ($sql) { $topic_action_notify = $sql->notify_sent; } if (!isset($topic_action_notify)) { $topic_link_notify = FALSE; $topic_icon = '_off'; } else { $topic_link_notify = toggle_link($topic_action_notify); $topic_icon = toggle_icon($topic_action_notify); } $tool_content .= "<td class='text-center option-btn-cell'>"; $dyntools = (!$is_editor) ? array() : array( array('title' => $langModify, 'url' => "forum_admin.php?course=$course_code&forumtopicedit=yes&topic_id=$myrow->id", 'icon' => 'fa-edit' ), array('title' => $langDelete, 'url' => "$_SERVER[SCRIPT_NAME]?course=$course_code&forum=$forum_id&topic_id=$myrow->id&topicdel=yes", 'icon' => 'fa-times', 'class' => 'delete', 'confirm' => $langConfirmDelete) );
$tool_content .= "<td class='text-center'>"; if ($total_topics > 0 && $total_posts > 0) { $tool_content .= "<span class='smaller'>" . q($last_user_post) . " \n <a href='viewtopic.php?course={$course_code}&topic={$last_post_topic_id}&forum={$forum_id}'>\n\t\t\t\t\t\t" . icon('fa-comment-o', $langLastPost) . "\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t{$human_last_post_time}</span></td>"; } else { $tool_content .= "<div class='inactive'>{$langNoPosts}</div></td>"; } $forum_action_notify = Database::get()->querySingle("SELECT notify_sent FROM forum_notify\n\t\t\t\t\t\t\t\tWHERE user_id = ?d\n\t\t\t\t\t\t\t\tAND forum_id = ?d\n\t\t\t\t\t\t\t\tAND course_id = ?d", $uid, $forum_id, $course_id); if ($forum_action_notify) { $forum_action_notify = $forum_action_notify->notify_sent; } if (!isset($forum_action_notify)) { $forum_link_notify = false; $forum_icon = '_off'; } else { $forum_link_notify = toggle_link($forum_action_notify); $forum_icon = toggle_icon($forum_action_notify); } $tool_content .= "<td class='option-btn-cell'>"; $dyntools = !$is_editor ? array() : array(array('title' => $langModify, 'url' => "forum_admin.php?course={$course_code}&forumgoedit=yes&forum_id={$forum_id}&cat_id={$catNum}", 'icon' => 'fa-edit'), array('title' => $langDelete, 'url' => "forum_admin.php?course={$course_code}&forumgodel=yes&forum_id={$forum_id}&cat_id={$catNum}", 'icon' => 'fa-times', 'class' => 'delete', 'confirm' => $langConfirmDelete)); $dyntools[] = array('title' => $langNotify, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&forumnotify={$forum_link_notify}&forum_id={$forum_id}", 'icon' => 'fa-envelope'); $tool_content .= action_button($dyntools); } } else { $tool_content .= "<tr>"; $tool_content .= "<td colspan='6' class='alert2'>{$langNoForumsCat}</td>"; $tool_content .= "</tr>"; break; } } $tool_content .= "</table>"; }