Beispiel #1
0
<?php

/**
 * Display Edit Form for Downloads
 *
 * @package   LM_Downloads
 * @since     5.7.19
 * @version   10.5.20 
 */
/**
 * Include Download Module class
 */
$pathToIndex = '../../..';
require_once $pathToIndex . '/modules/downloads/lib/LM_Downloads.php';
$app = new LM_Downloads();
$app->getModuleLanguage('downloads');
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
if ($sessionState == 'on') {
    if (isset($_GET['id'])) {
        $id = $_GET['id'];
        $sql = 'SELECT * FROM ' . DOWNLOADS_META_TABLE . " WHERE id = {$id}";
        $res = $app->db->query($sql);
        if ($item = $res->fetch()) {
            $item['id'] = $item['id'];
            $item['time'] = $app->setDateArray($item['file_date']);
            $item['title'] = stripslashes(htmlspecialchars($item['file_title']));
            $item['comment'] = stripslashes(htmlspecialchars($item['file_comment']));
            $item['file_type'] = stripslashes($item['file_type']);
            $item['file_name'] = stripslashes($item['file_name']);
            $item['file_size'] = $app->toMegaByte($item['file_size']);
Beispiel #2
0
<?php

/**
 * @package   Downloads
 *
 * @since   5.5.26
 * @version 9.5.20
 */
/**
 * Include Download Module class
 */
$pathToIndex = '../../..';
require_once $pathToIndex . '/modules/downloads/lib/LM_Downloads.php';
$app = new LM_Downloads();
$app->getModuleLanguage('downloads');
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
if ($sessionState == 'on') {
    // Title & Content
    $item['title'] = $app->setTitle($lang['new_dl']);
    $item['time'] = $app->getDateArray();
    $item['attachments'] = $app->setAttachments();
    $item['tag_cloud'] = $app->getTagCloudArray('Downloads');
    $smileyButton = new Loggix_View($pathToIndex . '/theme/smiley-button.html');
    $item['smiley_button'] = $smileyButton->render();
    $templateFile = $pathToIndex . LM_Downloads::THEME_PATH . 'admin/write.html';
    $contentsView = new Loggix_View($templateFile);
    $templateVars = array('item' => $item, 'lang' => $lang);
    $contentsView->assign($templateVars);
    $item['contents'] = $app->plugin->applyFilters('permalink-view', $contentsView->render());
    $item['pager'] = '';
Beispiel #3
0
<?php

/**
 * Manage Downloads Tag
 *
 * @package  Downloads
 * @since    5.5.26
 * @version  10.4.11
 */
/**
 * Include Download Module class
 */
$pathToIndex = '../../..';
require_once $pathToIndex . '/modules/downloads/lib/LM_Downloads.php';
$app = new LM_Downloads();
$app->getModuleLanguage('downloads');
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
if ($sessionState == 'on') {
    $app->insertSafe();
    // Add New Tag
    if (isset($_POST['action']) == 'add' && isset($_POST['new_tag'])) {
        $aNewTag = $_POST['new_tag'];
        $checkSql = 'SELECT ' . 'COUNT(id) ' . 'FROM ' . DOWNLOADS_TAG_TABLE . ' ' . 'WHERE ' . 'tag_name = :tag_name';
        $stmt = $app->db->prepare($checkSql);
        $stmt->execute(array(':tag_name' => $aNewTag));
        $countId = $stmt->fetchColumn();
        if ($countId == '0') {
            $sql = 'INSERT INTO ' . DOWNLOADS_TAG_TABLE . '(tag_name) ' . 'VALUES' . '(:tag_name)';
            $stmt = $app->db->prepare($sql);
            $stmt->execute(array(':tag_name' => $aNewTag));
Beispiel #4
0
<?php

/**
 *
 * Loggix Downloads Controller
 *
 * @since     5.7.19
 * @version   9.8.29 
 */
/**
 * Include Download Module class
 */
$pathToIndex = '../..';
require_once $pathToIndex . '/modules/downloads/lib/LM_Downloads.php';
$app = new LM_Downloads();
$config = $app->getConfigArray();
$sessionState = $app->getSessionState();
$app->getModuleLanguage('downloads');
try {
    $_SERVER['QUERY_STRING'] = htmlentities($_SERVER['QUERY_STRING']);
    // Cleanup the request array.
    $app->insertSafe();
    // (1) Category, Keyword Search, or Archive By Date
    if (!empty($_GET['t']) || !empty($_GET['k']) || !empty($_GET['d'])) {
        $previousItemNumber = empty($_GET['p']) ? '0' : $_GET['p'];
        $date = empty($_GET['d']) ? '' : $_GET['d'];
        $expand = empty($_GET['ex']) ? '0' : $_GET['ex'];
        $pageNumberToShow = empty($_GET['pn']) ? '1' : $_GET['pn'];
        // Tag Search
        if (!empty($_GET['t'])) {
            $key = $_GET['t'];
Beispiel #5
0
<?php

/**
 * Upload Downloadble File into SQLite
 *
 * @package   Downloads
 * @since     5.7.18
 * @version   9.5.20
 */
/**
 * Include Download Module class
 */
$pathToIndex = '../../..';
require_once $pathToIndex . '/modules/downloads/lib/LM_Downloads.php';
$app = new LM_Downloads();
$sessionState = $app->getSessionState();
$app->insertTagSafe();
if ($sessionState == 'on') {
    if (isset($_POST['title'], $_POST['comment'], $_POST['draft'])) {
        $draft = $_POST['draft'];
        $app->sendAttachments();
        $app->sendDownloadableFile();
        // Get this entry's id
        $sql = 'SELECT MAX(id) FROM ' . DOWNLOADS_META_TABLE;
        $res = $app->db->query($sql);
        $id = $res->fetchColumn();
        $app->addTag(DOWNLOADS_TAG_MAP_TABLE, $id);
        if (isset($id)) {
            if ($draft == '1') {
                header('Location: ./drafts.php');
                exit;
Beispiel #6
0
<?php

/**
 * Modify Downloads Article 
 *
 * @package   LM_Downloads
 *
 * @since     5.5.27
 * @version   9.3.17
 */
/**
 * Include Download Module class
 */
$pathToIndex = '../../..';
require_once $pathToIndex . '/modules/downloads/lib/LM_Downloads.php';
$app = new LM_Downloads();
$sessionState = $app->getSessionState();
if ($sessionState == 'on') {
    $app->insertTagSafe();
    if (!empty($_POST['title']) && !empty($_POST['comment']) && !empty($_POST['id'])) {
        $id = $_POST['id'];
        $title = $_POST['title'];
        $comment = $_POST['comment'];
        $draft = $_POST['draft'];
        // Upload Attachments
        $app->sendAttachments();
        if (isset($_POST['y'], $_POST['m'], $_POST['d'], $_POST['h'], $_POST['i'], $_POST['s'])) {
            $Y = $_POST['y'];
            $m = $_POST['m'];
            $d = $_POST['d'];
            $H = $_POST['h'];
Beispiel #7
0
<?php

/**
 * Delete Downloads Entry Item
 *
 * @package   LM_Downloads
 * @since     5.7.20
 * @version   8.2.25
 */
/**
 * Include Download Module class
 */
$pathToIndex = '../../..';
require_once $pathToIndex . '/modules/downloads/lib/LM_Downloads.php';
$app = new LM_Downloads();
$sessionState = $app->getSessionState();
if ($sessionState == 'on') {
    if (!empty($_REQUEST['id'])) {
        $id = $_REQUEST['id'];
        $sql1 = 'DELETE FROM ' . DOWNLOADS_META_TABLE . " WHERE (draft = '1') AND (id = '{$id}')";
        $sql2 = 'DELETE FROM ' . DOWNLOADS_DATA_TABLE . " WHERE masterid = '{$id}'";
        $sql3 = 'DELETE FROM ' . DOWNLOADS_TAG_MAP_TABLE . " WHERE log_id = '{$id}'";
        $res1 = $app->db->query($sql1) or die('Error');
        $res2 = $app->db->query($sql2) or die('Error');
        $res3 = $app->db->query($sql3) or die('Error');
        if ($res1 && $res2 && $res3) {
            header('Location: ./drafts.php');
        }
    } else {
        header('Location: ' . $pathToIndex . '/index.php');
    }
Beispiel #8
0
<?php

/**
 * Show Drafts of Downloads
 *
 * @package   Downloads
 * @since     5.5.16
 * @version   9.2.6
 */
/**
 * Include Download Module class
 */
$pathToIndex = '../../..';
require_once $pathToIndex . '/modules/downloads/lib/LM_Downloads.php';
$app = new LM_Downloads();
$app->getModuleLanguage('downloads');
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
if ($sessionState == 'on') {
    if (!empty($_REQUEST['id'])) {
        // Publish or draft
        $id = $_REQUEST['id'];
        $app->db->query('BEGIN;');
        if (empty($_REQUEST['publish'])) {
            // Save as draft
            $sql = 'UPDATE ' . DOWNLOADS_META_TABLE . ' SET ' . "draft = '1' WHERE id = " . $id . '';
            $res = $app->db->query($sql);
            if ($res) {
                $app->db->query('COMMIT;');
                header('Location: ../index.php');
            }