当前位置: 首页>>代码示例>>PHP>>正文


PHP Main::getcomment方法代码示例

本文整理汇总了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}";
}
//}}}
开发者ID:michaelprem,项目名称:phc,代码行数:31,代码来源:index.php


注:本文中的Main::getcomment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。