本文整理汇总了PHP中Main::getcomment方法的典型用法代码示例。如果您正苦于以下问题:PHP Main::getcomment方法的具体用法?PHP Main::getcomment怎么用?PHP Main::getcomment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main::getcomment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validate
$cnr = $nr;
if (isset($_REQUEST['cnr'])) {
$cnr = $_REQUEST['cnr'];
}
$main->printcomments("-1", $role, $userid, $cstart, $cnr, $page, -1);
$_SESSION['lastid'] = "-1";
}
//}}}
//{{{ Edit comment
if ($page == "editcomment" and $role >= 1) {
print "<script type='text/javascript'>\n function validate(form)\n {\n error=\"\";\n if ( form.header.value == \"\" )\n {\n error=\"" . str_replace(":", ",", " " . $main->edit_array($text['header']) . " ") . "\";\n }\n\n if ( form.data.value == \"\" )\n {\n error=error+\"" . str_replace(":", "", " " . $main->edit_array($text['comment']) . " ") . "\";\n }\n if (error != '' )\n {\n error=error.replace(\":\", \",\");\n alert('" . $main->edit_array($text['missingfields']) . "'+' '+error);\n return;\n }\n else\n {\n form.submit();\n }\n }\n </script>";
$id = "";
if (isset($_REQUEST['id'])) {
$id = $_REQUEST['id'];
}
$comment = $main->edit_array($main->getcomment($userid, $role, $id));
print "<form enctype='multipart/form-data' action='?page=savecomment' method='post'><p><input type='hidden' name='rid' value='{$requestid}' /></p>\n";
print "<table summary='{$text['editcomment']}'><tr><td colspan='2'><hr></td></tr>\n";
if ($comment['records']['0']['role'] == 0) {
print "<tr><td>{$text['name']}</td><td><input name='name' type='text' id='name' value='" . $comment['records']['0']['anonname'] . "'/></td></tr>\n";
print "<tr><td>{$text['email']}</td><td><input name='email' type='text' id='email' value='" . $comment['records']['0']['anonemail'] . "'/></td></tr>\n";
print "<tr><td>{$text['homepageheader']}</td><td><input name='homepage' type='text' id='email' value='" . $comment['records']['0']['anonhomepage'] . "'/></td></tr>\n";
}
print "<tr><td>{$text['header']}</td><td><input name='header' type='text' id='header' value='" . $comment['records']['0']['headline'] . "'/></td></tr>\n";
print "<tr><td colspan='2'>{$text['comment']}</td></tr>\n";
print "<tr><td colspan='2'><input type='hidden' name='id' value='" . $comment['records']['0']['id'] . "'><textarea name='data' rows='5' cols='60'>" . $comment['records']['0']['data'] . "</textarea></td></tr>\n";
print "<tr><td colspan='2'><input type='button' value='{$text['savecomment']}' id='savecomment' onclick=\"validate(this.form)\" class='button'/> <input type='reset' value='{$text['reset']}' class='button' /></td></tr>\n";
print "</table></form>\n";
print "{$bbcode}";
}
//}}}