function enable_disable_button($qtypename, $createable) { if ($createable) { return icon_html('disable', $qtypename, 'i/hide.gif', get_string('enabled', 'question'), get_string('disable')); } else { return icon_html('enable', $qtypename, 'i/show.gif', get_string('disabled', 'question'), get_string('enable')); } }
$comment->postedname = htmlspecialchars($comment->postedname, ENT_COMPAT, 'utf-8'); // turn commentor name into a link if they're a registered user // add rel="nofollow" to comment links if they're not if ($comment->owner > 0) { $commentownerusername = user_info('username', $comment->owner); $comment->postedname = '<a href="' . url . $commentownerusername . '/">' . $comment->postedname . '</a>'; $comment->icon = '<a href="' . url . $commentownerusername . '/">' . user_icon_html($comment->owner, 50) . "</a>"; $comment->body = run("weblogs:text:process", array($comment->body, false)); } else { $comment->icon = "<img src=\"" . user_icon_html(-1, 50) . "\" width=\"50\" height=\"50\" align=\"left\" alt=\"\" />"; $comment->body = run("weblogs:text:process", array($comment->body, true)); } $commentsbody .= templates_draw(array('context' => 'weblogcomment', 'postedname' => $comment->postedname, 'body' => '<a name="cmt' . $comment->ident . '" id="cmt' . $comment->ident . '"></a>' . $comment->body, 'posted' => strftime("%A, %d %B %Y, %H:%M %Z", $comment->posted), 'usericon' => $comment->icon, 'permalink' => $thispageurl . "#cmt" . $comment->ident, 'links' => $commentmenu)); } $commentsbody = templates_draw(array('context' => 'weblogcomments', 'paging' => $pagelinks, 'comments' => $commentsbody, 'comments_str' => $commentsStr)); } $run_result .= templates_draw(array('context' => 'weblogpost', 'date' => $date, 'username' => $username, 'usericon' => icon_html($usericon), 'body' => $body, 'fullname' => $fullname, 'title' => $postTitle, 'comments' => $commentsbody, 'links' => $links, 'postedby' => $postedby)); if (logged_on || !$CFG->disable_publiccomments && user_flag_get("publiccomments", $post->owner)) { $run_result .= run("weblogs:comments:add", $post); } else { $run_result .= "<p>" . __gettext("You must be logged in to post a comment.") . "</p>"; } $run_result .= run("weblogs:interesting:form", $post->ident); } else { // post is missing or prohibited $run_result .= templates_draw(array('context' => 'weblogpost', 'date' => "", 'username' => "", 'usericon' => user_icon_html(-1), 'body' => $body, 'fullname' => "", 'title' => $postTitle, 'comments' => "", 'links' => $links, 'postedby' => $postedby)); } } else { $run_result .= templates_draw(array('context' => 'weblogpost', 'date' => $date, 'username' => $username, 'usericon' => icon_html($usericon), 'body' => $body, 'fullname' => $fullname, 'title' => $postTitle, 'commentslink' => $comments, 'links' => $links, 'postedby' => $postedby)); } }