当前位置: 首页>>代码示例>>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;未经允许,请勿转载。