Esempio n. 1
0
            $item['file_type'] = stripslashes($item['file_type']);
            $item['file_name'] = stripslashes($item['file_name']);
            $item['file_size'] = $app->toMegaByte($item['file_size']);
            switch ($item['draft']) {
                case '1':
                    $item['draft_status_1'] = ' checked="checked"';
                    $item['draft_status_0'] = '';
                    break;
                default:
                    $item['draft_status_1'] = '';
                    $item['draft_status_0'] = ' checked="checked"';
                    break;
            }
            // Contents
            $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/edit.html';
            $contentsView = new Loggix_View($templateFile);
            $contentsVars = array('item' => $item, 'lang' => $lang, 'config' => $config);
            $contentsView->assign($contentsVars);
            $item = array('title' => $app->setTitle(array('Downloads', $lang['edit'], $item['title'])), 'contents' => $app->plugin->applyFilters('permalink-view', $contentsView->render()), 'pager' => '', 'result' => '');
            $app->display($item, $sessionState);
        }
    } else {
        header('Location: ../index.php');
    }
} else {
    header('Location: ../index.php');
}
Esempio n. 2
0
        header('Location : ' . $_SERVER['PHP_SELF']);
    }
    // Show Tag List
    $sql = 'SELECT ' . '* ' . 'FROM ' . DOWNLOADS_TAG_TABLE;
    $res = $app->db->query($sql);
    $tagList = '';
    if ($res) {
        $items = array();
        while ($item = $res->fetch()) {
            $sql2 = 'SELECT ' . 'COUNT(id) ' . 'FROM ' . DOWNLOADS_TAG_MAP_TABLE . ' ' . 'WHERE ' . "tag_id = '" . $item['id'] . "'";
            $res2 = $app->db->query($sql2);
            $item['number_of_tag'] = $res2->fetchColumn();
            $item['disabled_status'] = $item['id'] == '1' ? 'disabled="disabled" ' : '';
            $item['tag_name'] = htmlspecialchars($item['tag_name']);
            $items[] = $item;
        }
        $templateFile = $pathToIndex . LM_Downloads::THEME_PATH . 'admin/tags.html';
        $contentsView = new Loggix_View($templateFile);
        $templateVars = array('items' => $items, 'lang' => $lang);
        $contentsView->assign($templateVars);
        $item['contents'] = $app->plugin->applyFilters('permalink-view', $contentsView->render());
    }
    // Pager
    $item['pager'] = '';
    $item['result'] = '';
    // Title
    $item['title'] = $app->setTitle($lang['dl_tag']);
    $app->display($item, $sessionState);
} else {
    header('Location: ../index.php');
}
Esempio n. 3
0
         $countSql = $app->getSearchHitsSql($params);
     }
     // Count  the number of hit results
     $totalItemsCount = $app->getTotalItemsCount($countSql);
     if ($totalItemsCount !== 0) {
         // Archive By Date
         if (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}/', $date)) {
             $result = '';
         } else {
             $item = $app->setSearchItems($totalItemsCount, $previousItemNumber, $date);
             $resultView = new Loggix_View();
             $templateVars = array('item' => $item, 'lang' => $lang);
             $resultView->assign($templateVars);
             $result = $resultView->render($pathToIndex . '/theme/' . $resultTemplate);
         }
         $title = !empty($_GET['c']) ? $app->setTitle(array($item['keyword'], $lang['archive'])) : $app->setTitle(array('Downloads', $lang['archive']));
         // Title , Contents, Pager, and Results
         $item = array('title' => $title, 'contents' => $app->getArchives($sql), 'pager' => $app->getPager($totalItemsCount, $pageNumberToShow, $date, $expand), 'result' => $result);
     } else {
         $e = new Loggix_Exception();
         $item = $e->getArticleNotFoundMessage();
     }
     // (2) Permalink
 } elseif (!empty($_GET['id'])) {
     $id = intval($_GET['id']);
     $getPermalinkSql = 'SELECT ' . '* ' . 'FROM ' . DOWNLOADS_META_TABLE . ' ' . 'WHERE ' . '(id = :id) AND (draft = :draft)';
     $getPermalinkSql = $app->setDelimitedIdentifier($getPermalinkSql);
     $stmt = $app->db->prepare($getPermalinkSql);
     $stmt->execute(array(':id' => $id, ':draft' => 0));
     $itemArray = $stmt->fetch();
     if ($itemArray == true) {
Esempio n. 4
0
 *
 * @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'] = '';
    $item['result'] = '';
    $app->display($item, $sessionState);
} else {
    header('Location: ../index.php');
Esempio n. 5
0
        $res = $app->db->query($sql);
        if ($res) {
            $items = array();
            while ($item = $res->fetch()) {
                $item = $app->setEntryItems($item);
                $items[] = $item;
            }
            $templateFile = $pathToIndex . LM_Downloads::THEME_PATH . 'admin/drafts.html';
            $contentsView = new Loggix_View($templateFile);
            $contentsVars = array('items' => $items, 'lang' => $lang);
            $contentsView->assign($contentsVars);
            $item['contents'] = $contentsView->render();
        } else {
            $item['contents'] = '';
        }
        // Pager
        $countSql = 'SELECT COUNT(id) FROM ' . DOWNLOADS_META_TABLE . " WHERE draft = '1'";
        $countRes = $app->db->query($countSql);
        $hits = $countRes->fetchColumn();
        $item['pager'] = $app->getPager('', 'all', $hits, '', '1');
        /*
        $totalItemsCount = $countRes->fetchColumn();
        $item['pager'] = $app->getPager($totalItemsCount, 'all', '', '1');
        */
        $item['result'] = '';
        $item['title'] = $app->setTitle($lang['dl_draft']);
        $app->display($item, $sessionState);
    }
} else {
    header('Location: ../index.php');
}