本文整理汇总了PHP中Wiki::get_article方法的典型用法代码示例。如果您正苦于以下问题:PHP Wiki::get_article方法的具体用法?PHP Wiki::get_article怎么用?PHP Wiki::get_article使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wiki
的用法示例。
在下文中一共展示了Wiki::get_article方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: authorize
authorize();
if (!isset($_POST['id']) || !is_number($_POST['id'])) {
error(0);
}
$ArticleID = (int) $_POST['id'];
include SERVER_ROOT . '/classes/validate.class.php';
$Val = new VALIDATE();
$Val->SetFields('title', '1', 'string', 'The title must be between 3 and 100 characters', array('maxlength' => 100, 'minlength' => 3));
$Err = $Val->ValidateForm($_POST);
if ($Err) {
error($Err);
}
$P = array();
$P = db_array($_POST);
$Article = Wiki::get_article($ArticleID);
list($OldRevision, $OldTitle, $OldBody, $CurRead, $CurEdit, $OldDate, $OldAuthor) = array_shift($Article);
if ($CurEdit > $LoggedUser['EffectiveClass']) {
error(403);
}
if (check_perms('admin_manage_wiki')) {
$Read = $_POST['minclassread'];
$Edit = $_POST['minclassedit'];
if (!is_number($Read)) {
error(0);
//int?
}
if (!is_number($Edit)) {
error(0);
}
if ($Edit > $LoggedUser['EffectiveClass']) {
示例2: error
<?php
if (!isset($_GET['id']) || !is_number($_GET['id'])) {
error(404);
}
$ArticleID = (int) $_GET['id'];
$Latest = Wiki::get_article($ArticleID);
list($Revision, $Title, $Body, $Read, $Edit, $Date, $AuthorID, $AuthorName) = array_shift($Latest);
if ($Read > $LoggedUser['EffectiveClass']) {
error(404);
}
if ($Edit > $LoggedUser['EffectiveClass']) {
error(403);
}
View::show_header("Revisions of " . $Title);
?>
<div class="thin">
<div class="header">
<h2>Revision history for <a href="wiki.php?action=article&id=<?php
echo $ArticleID;
?>
"><?php
echo $Title;
?>
</a></h2>
</div>
<form action="wiki.php" method="get">
<input type="hidden" name="action" id="action" value="compare" />
<input type="hidden" name="id" id="id" value="<?php
echo $ArticleID;
?>
示例3: elseif
<?php
if (!empty($_GET['id']) && is_number($_GET['id'])) {
//Visiting article via ID
$ArticleID = $_GET['id'];
} elseif ($_GET['name'] != '') {
//Retrieve article ID via alias.
$ArticleID = Wiki::alias_to_id($_GET['name']);
} else {
json_die("failure");
}
if (!$ArticleID) {
//No article found
json_die("failure", "article not found");
}
$Article = Wiki::get_article($ArticleID, false);
if (!$Article) {
json_die("failure", "article not found");
}
list($Revision, $Title, $Body, $Read, $Edit, $Date, $AuthorID, $AuthorName, $Aliases, $UserIDs) = array_shift($Article);
if ($Read > $LoggedUser['EffectiveClass']) {
json_die("failure", "higher user class required to view article");
}
Text::$TOC = true;
$TextBody = Text::full_format($Body, false);
json_die("success", array('title' => $Title, 'bbBody' => $Body, 'body' => $TextBody, 'aliases' => $Aliases, 'authorID' => (int) $AuthorID, 'authorName' => $AuthorName, 'date' => $Date, 'revision' => (int) $Revision));