當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Article::getList方法代碼示例

本文整理匯總了PHP中Article::getList方法的典型用法代碼示例。如果您正苦於以下問題:PHP Article::getList方法的具體用法?PHP Article::getList怎麽用?PHP Article::getList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Article的用法示例。


在下文中一共展示了Article::getList方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: homepage

function homepage()
{
    $results = array();
    $data = Article::getList(HOMEPAGE_NUM_ARTICLES);
    $results['articles'] = $data['results'];
    $results['totalRows'] = $data['totalRows'];
    $results['pageTitle'] = "Widget News";
    require "templates/homepage.php";
}
開發者ID:gazeis77,項目名稱:hotfire_jamz,代碼行數:9,代碼來源:index.php

示例2: homepage

function homepage()
{
    $results = array();
    $data = Article::getList(HOMEPAGE_NUM_ARTICLES);
    $results['articles'] = $data['results'];
    $results['totalRows'] = $data['totalRows'];
    $results['pageTitle'] = "FusionCMS";
    require TEMPLATE_PATH . "/homepage.php";
}
開發者ID:DTMalfalfa,項目名稱:corsoDB,代碼行數:9,代碼來源:index.php

示例3: content

function content($nav)
{
    $results = array();
    //use getList from the Article class to collect all the articles relating to the users choice
    $data = Article::getList(1000, "menu_order ASC", $nav);
    //now put the results into our results array
    $results['articles'] = $data['results'];
    //record the total number of articles (not used, but may be needed in the future
    $results['totalRows'] = $data['totalRows'];
    //use the content template to output the required html
    require "templates/content.php";
}
開發者ID:rkrottner,項目名稱:jacobhooey.com,代碼行數:12,代碼來源:index.php

示例4: homepage

function homepage()
{
    $results = array();
    $data = Article::getList(HOMEPAGE_NUM_ARTICLES);
    $results['articles'] = $data['results'];
    $results['totalRows'] = $data['totalRows'];
    $data = Category::getList();
    $results['categories'] = array();
    foreach ($data['results'] as $category) {
        $results['categories'][$category->id] = $category;
    }
    $results['pageTitle'] = "SystemBolaget";
    require TEMPLATE_PATH . "/homepage.php";
}
開發者ID:sabrinamiao,項目名稱:Systembolaget,代碼行數:14,代碼來源:index.php

示例5: listArticles

function listArticles()
{
    $results = array();
    $data = Article::getList();
    $results['articles'] = $data['results'];
    $results['totalRows'] = $data['totalRows'];
    $results['pageTitle'] = "All Articles";
    if (isset($_GET['error'])) {
        if ($_GET['error'] == "articleNotFound") {
            $results['errorMessage'] = "Error: Article not found.";
        }
    }
    if (isset($_GET['status'])) {
        if ($_GET['status'] == "changesSaved") {
            $results['statusMessage'] = "Your changes have been saved.";
        }
        if ($_GET['status'] == "articleDeleted") {
            $results['statusMessage'] = "Article deleted.";
        }
    }
    require TEMPLATE_PATH . "/admin/listArticles.php";
}
開發者ID:aharish,項目名稱:FalconRanger,代碼行數:22,代碼來源:admin.php

示例6: count

    if (CheckForLogIn::isLogin()) {
        $user_info_array = GetMainUserInfo::GetInfo($regId);
        if ($user_info_array['is_admin'] == 1) {
            echo '<a id="article_edit" href="/edit-article/' . $singleArticleDescription['article_id'] . '"><i class="fa fa-pencil"></i> Редактировать статью</a>    |    ';
            echo '<a id="article_delete" href="/delete-article/' . $singleArticleDescription['article_id'] . '"><i class="fa fa-times"></i> Удалить статью (клик один раз на ссылку удалит статью)</a>';
            echo '<hr>';
        }
    }
    echo '</div>';
    echo '</div>';
    echo '</div>';
}
echo '<div class="container">';
echo '<div class="row">';
echo '<div class="col-md-12 artcicle_navigation">';
$all_articles = Article::getList();
$articlesCount = count($all_articles);
$get_id = ceil($articlesCount / 4);
// 4 - количество выводимых статей на одной странице
echo 'Страницы: ';
for ($i = 1; $i <= $get_id; $i++) {
    echo '  |  <a href="/article-navigation/' . $i . '">' . $i . '</a>  |  ';
}
echo '</div>';
echo '</div>';
echo '</div>';
?>

</div>

<div class="row">
開發者ID:artempronevskiy,項目名稱:shabashka_back-end_front_end,代碼行數:31,代碼來源:index.php

示例7: listArticles

function listArticles()
{
    $results = array();
    $data = Article::getList();
    $results['articles'] = $data['results'];
    $results['totalRows'] = $data['totalRows'];
    $results['pageTitle'] = "All Articles";
    if (isset($_GET['error'])) {
        if ($_GET['error'] == "articleNotFound") {
            $results['errorMessage'] = "Error: Article not found. Are you sure you know what you're doing here?";
        }
        /*the reason there is an if but not an else is that I only want to respond to errors. 
          To do that, I need to check if they exist (if). The else is not needed. This is kinda like a throw/catch kinda thing. Speaking of which, I should (once this version is live) look into implementing throw/catch. 
          It's the same thing as this, but it would make me look like less of a idiot */
    }
    if (isset($_GET['status'])) {
        #this isn't an error, so plain 'if' might be best. There is probably some alternative though.
        if ($_GET['status'] == "changesSaved") {
            $results['statusMessage'] = "Your changes have been saved, Captain.";
        }
        #I AM PICARD AND NO ONE CAN TELL ME OTHERWISE
        if ($_GET['status'] == "articleDeleted") {
            $results['statusMessage'] = "Article deleted. You monster.";
        }
    }
    require TEMPLATE_PATH . "/admin/listArticles.php";
    #note that there are no return;s. This is because I want the code to cycle through checking for errors and status messages. I don't want it to not find an article and then just die, and I /definitely/ don't want it to save changes and then crap out on me.
}
開發者ID:Dragonethan,項目名稱:The-Blag,代碼行數:28,代碼來源:admin.php

示例8:

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== TRUE) {
    die;
}
CModule::IncludeModule("iblock");
$article = Article::getList();
$arResult["ARTICLE"] = $article;
$this->IncludeComponentTemplate();
$APPLICATION->SetTitle("Список интересных статей от проекта MyTb.ru");
$APPLICATION->SetPageProperty("description", "Список статей от проекта MyTb.ru");
開發者ID:nProfessor,項目名稱:Mytb,代碼行數:11,代碼來源:component.php

示例9: deleteCategory

function deleteCategory()
{
    if (!($category = Category::getById((int) $_GET['categoryId']))) {
        header("Location: admin.php?action=listCategories&error=categoryNotFound");
        return;
    }
    $articles = Article::getList(1000000, $category->id);
    if ($articles['totalRows'] > 0) {
        header("Location: admin.php?action=listCategories&error=categoryContainsArticles");
        return;
    }
    $category->delete();
    header("Location: admin.php?action=listCategories&status=categoryDeleted");
}
開發者ID:sabrinamiao,項目名稱:projectSystembolaget,代碼行數:14,代碼來源:admin.php

示例10: homepage

function homepage()
{
    $results = array();
    $data = Article::getList(HOMEPAGE_NUM_ARTICLES);
    #this passes our value (defined in config.php) of the number of articles on the homepage, and the getList() function then stores those as articles (obligatory "as associative arrays") in $data.
    $results['articles'] = $data['results'];
    /*the getList() function 'return's its found articles (and totalRows). This is where 'return' is useful: passing the output of a function to something above it in a chain. 
      In this case, getList() passes the articles to its parent in the chain under the name 'results' (same for totalRows), and by setting $data equal to getList()'s output, we kind of "catch" that return and give it a container */
    $results['totalRows'] = $data['totalRows'];
    $results['pageTitle'] = "The Blag";
    /*I don't need to have any variables here because this is a static homepage. 
      The content changes, the type of page does not. This contrasts with individual article pages where the only content on them are the articles in question. 
      Here the main content is the homepage itself, therefore the name is the site's chosen name. (here it's "The Blag" because I like xkcd and it's simple.) */
    require TEMPLATE_PATH . "/homepage.php";
}
開發者ID:Dragonethan,項目名稱:The-Blag,代碼行數:15,代碼來源:index.php

示例11: Article

*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Add a special article
* 
* Settings
* 
* 01/10/2004 by Christian Ehret chris@uffbasse.de
*/
$smartyType = "www";
include_once "../includes/default.inc.php";
$auth->is_authenticated();
include_once "articleclass.inc.php";
$article = new Article();
$smarty->assign("tpl_title", "Sonderverkauf");
if ($request->GetVar('frm_description', 'post') !== $request->undefined) {
    include_once "barguestclass.inc.php";
    $barguest = new Barguest();
    $articleid = $article->addSpecial();
    $theguestid = $request->GetVar('frm_theguestid', 'post');
    $smarty->assign("tpl_theguestid", $theguestid);
    $num = $request->GetVar('frm_num', 'post');
    $barguest->buy($articleid, $theguestid, $num);
    $smarty->assign('tpl_added', 'true');
} else {
    $smarty->assign('tpl_articles', $article->getList());
    $smarty->assign("tpl_theguestid", $request->GetVar('guestid', get));
    $smarty->assign("tpl_catid", $request->GetVar('catid', get));
    $smarty->assign('tpl_added', 'false');
}
$smarty->display('addspecial.tpl');
開發者ID:BackupTheBerlios,項目名稱:zvs,代碼行數:31,代碼來源:addspecial.php

示例12: admin

function admin()
{
    if (!$GLOBALS['authentication']) {
        header("Location: index.php?admin=login");
    }
    $results = array();
    if (!$GLOBALS['authentication']) {
        header("Location: index.php?admin=login");
    }
    $data = Article::getList();
    $results['articles'] = $data['results'];
    $results['totalRows'] = $data['totalRows'];
    $results['pageTitle'] = "Здвинская ЦБС | Список новостей";
    $results['admin'] = true;
    //! @todo страница не тарифицируется роботами
    if (isset($_GET['error'])) {
        if ($_GET['error'] == "articleNotFound") {
            $results['errorMessage'] = "Error: Страница не найдена";
        }
    }
    if (!$results['articles']) {
        $results['statusMessage'] = 'Страниц не обнаруженно';
    }
    if (isset($_GET['status'])) {
        if ($_GET['status'] == "changesSaved") {
            $results['statusMessage'] = "Ваши изменение были сохранены";
        }
        if ($_GET['status'] == "articleDeleted") {
            $results['statusMessage'] = "Страница удаленна";
        }
    }
    $results['script'] = "/admin/listNews";
    require $setting["SCRIPT_PATH"] . $setting["TEMPLATE_PATH"] . "/include/page.php";
}
開發者ID:winorun,項目名稱:zdvlib.srv,代碼行數:34,代碼來源:article.php


注:本文中的Article::getList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。