示例#1
0
<?php

include "config.inc.php";
include "uploadedFile.php";
include "alias.php";
adminPage();
if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {
    $fileID = $_POST['fileID'];
    $key = $_POST['key'];
    $conn = getConnection();
    $file = new Uploadedfile($conn);
    $file = $file->load($fileID);
    if ($key == hash('md5', KEY . $file->getPath())) {
        menubar();
        $fileUpdate = new Uploadedfile();
        $fileUpdate->setCampus(issetOrBlank($_POST['file-campus']));
        $fileUpdate->setCategory(issetOrBlank($_POST['file-category']));
        $fileUpdate->setFaculty(issetOrBlank($_POST['file-faculty']));
        $fileUpdate->setExpiry(trim($_POST['file-expiry']) == "" ? "0000-00-00 00:00:00" : date('Y-m-d H:i:s', strtotime($_POST['file-expiry'])));
        ///0000-00-00 00:00:00
        $fileUpdate->setDescription($_POST['file-description']);
        if (issetOrBlank($_POST['file-tags']) != $file->getTags()) {
            //sort the tags
            $tags = array_filter(array_map('trim', explode(',', issetOrBlank($_POST['file-tags']))));
            asort($tags);
            $tags = implode(', ', $tags);
            $fileUpdate->setTags($tags);
            $query = "SELECT `option` FROM `options` WHERE `group_id` = 4 order by `sort`";
            $Otags = $conn->query($query);
            $Otags->execute();
            $Otags = $Otags->fetchAll(PDO::FETCH_COLUMN);
示例#2
0
<?php

include "config.inc.php";
include "uploadedFile.php";
include "alias.php";
adminPage();
$conn = getConnection();
$file = new Uploadedfile($conn);
if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {
    //echo '<pre>'.print_r($_POST,true).'</pre>';
    ?>
	<html>
		<head>
			<title>Upload File</title>
		</head>
		<body>
	<?php 
    menubar();
    //$file = new Uploadedfile($conn);
    $file->setCampus(issetOrBlank($_POST['file-campus']));
    $file->setCategory(issetOrBlank($_POST['file-category']));
    $file->setFaculty(issetOrBlank($_POST['file-faculty']));
    $file->setExpiry(trim($_POST['file-expiry']) == "" ? "0000-00-00 00:00:00" : date('Y-m-d H:i:s', strtotime($_POST['file-expiry'])));
    $file->setDescription($_POST['file-description']);
    //sort the tags
    $tags = array_filter(array_map('trim', explode(',', issetOrBlank($_POST['file-tags']))));
    asort($tags);
    $tags = implode(', ', $tags);
    $file->setTags($tags);
    //add tags to Global Tag list...
    //options - group_type = 4