本文整理汇总了PHP中content::getSingleDocument方法的典型用法代码示例。如果您正苦于以下问题:PHP content::getSingleDocument方法的具体用法?PHP content::getSingleDocument怎么用?PHP content::getSingleDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类content
的用法示例。
在下文中一共展示了content::getSingleDocument方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
if ($myApp['firewall'] == "on") {
if ($ObjFirewall->runIPcheck() != true) {
// Your IP address is not in the approved range or implicit speicification
require_once '../web/core/security/ipviolation.php';
exit;
}
}
if ($_SESSION['username'] != "") {
if ($_SESSION['utype'] >= '1') {
$urlVars = explode("/", $_SERVER['REQUEST_URI']);
$contentUUID = db::escapechars(trim($urlVars[3]));
require_once '../src/core/controller/content.php';
$ObjContent = new content();
$docID = $ObjContent->convertUUIDToDocumentID($contentUUID);
// Grab file information from the DB
$file_info = $ObjContent->getSingleDocument($docID);
$downloadFile = ".." . $file_info['document_location'];
$downloadFileNameArray = explode("/", $downloadFile);
$downloadFileName = $downloadFileNameArray[4];
if (file_exists($downloadFile)) {
// Get the file information from the file system
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime_type = finfo_file($finfo, $downloadFile);
// Set the headers for the download
header("Content-Disposition: attachment; filename=\"{$downloadFileName}\";");
header("Content-Type: {$mime_type}");
header('Content-Length: ' . filesize($downloadFile));
// Now send the file as a data stream
$fp = fopen($downloadFile, 'rb');
fpassthru($fp);
} else {
示例2: elseif
if ($d) {
$documentID = $d;
} elseif ($_POST['docid']) {
$documentID = $_POST['docid'];
} else {
$documentID = "";
}
if ($documentID) {
if ($_POST['action'] == "confirm") {
// Remove the document
$deleteDoc = $ObjContent->deleteDoc($documentID);
if ($deleteDoc) {
$responseMsg = "Your document has been marked for removal";
} else {
$responseMsg = "I couldn't mark this for removal right now, please try again.";
}
}
$document = $ObjContent->getSingleDocument($ObjContent->convertUUIDToDocumentID($documentID));
$classid = $document['class_id'];
$classes = $ObjClass->getClassInformation($classid);
require_once 'web/core/content/delete.php';
} else {
$classes = $ObjClass->getClassList();
require_once 'web/core/class/view.php';
}
} else {
require_once 'web/core/security/insufficient.php';
}
} else {
require_once 'web/core/login/index.php';
}