Exemple #1
0
 public function getTopicArticles()
 {
     if (!$this->mTopicId) {
         return NULL;
     }
     $sql = "SELECT `article_id` FROM `" . BIT_DB_PREFIX . "articles` WHERE `topic_id` = ?";
     $rs = $this->mDb->query($sql, array($this->mTopicId));
     $ret = array();
     while ($row = $rs->fetchRow()) {
         $tmpArticle = new BitArticle($row['article_id']);
         $tmpArticle->load();
         $ret[] = $tmpArticle;
     }
 }
<?php

/**
 * @version $Header$
 * @package articles
 * @subpackage functions
 */
/**
 * Initialization
 */
require_once ARTICLES_PKG_PATH . 'BitArticle.php';
require_once LIBERTY_PKG_PATH . 'lookup_content_inc.php';
// if we already have a gContent, we assume someone else created it for us, and has properly loaded everything up.
if (empty($gContent) || !is_object($gContent)) {
    if (@BitBase::verifyId($_REQUEST['article_id'])) {
        $gContent = new BitArticle($_REQUEST['article_id']);
    } elseif (@BitBase::verifyId($_REQUEST['content_id'])) {
        $gContent = new BitArticle(NULL, $_REQUEST['content_id']);
    } else {
        $gContent = new BitArticle();
        $gContent->mInfo['expire_date'] = strtotime("+1 year");
    }
    if (empty($gContent->mArticleId) && empty($gContent->mContentId)) {
        //handle legacy forms that use plain 'article' form variable name
    } else {
        $gContent->load();
    }
    $gBitSmarty->clear_assign('gContent');
    $gBitSmarty->assign('gContent', $gContent);
}
Exemple #3
0
 */
require_once '../kernel/setup_inc.php';
require_once ARTICLES_PKG_PATH . 'BitArticle.php';
include_once ARTICLES_PKG_PATH . 'article_filter_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage('articles');
// Now check permissions to access this page
$gBitSystem->verifyPermission('p_articles_read');
// get services set up
$gContent = new BitArticle();
$gContent->invokeServices('content_list_function', $_REQUEST);
// nuke articles if requested
if (!empty($_REQUEST['action'])) {
    if ($_REQUEST['action'] == 'remove' && !empty($_REQUEST['remove_article_id'])) {
        $tmpArt = new BitArticle($_REQUEST['remove_article_id']);
        $tmpArt->load();
        // depending on what the status of the article is, we need to check different permissions
        if ($tmpArt->mInfo['status_id'] == ARTICLE_STATUS_PENDING) {
            $gBitSystem->verifyPermission('p_articles_remove_submission');
        } else {
            $gBitSystem->verifyPermission('p_articles_remove');
        }
        if (isset($_REQUEST["confirm"])) {
            if ($tmpArt->expunge()) {
                bit_redirect(ARTICLES_PKG_URL . 'list.php?status_id=' . (!empty($_REQUEST['status_id']) ? $_REQUEST['status_id'] : ''));
            } else {
                $feedback['error'] = $tmpArt->mErrors;
            }
        }
        $gBitSystem->setBrowserTitle(tra('Confirm removal of') . ' ' . $tmpArt->mInfo['title']);
        $formHash['remove'] = TRUE;