当前位置: 首页>>代码示例>>PHP>>正文


PHP Archive::getArchive方法代码示例

本文整理汇总了PHP中Archive::getArchive方法的典型用法代码示例。如果您正苦于以下问题:PHP Archive::getArchive方法的具体用法?PHP Archive::getArchive怎么用?PHP Archive::getArchive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Archive的用法示例。


在下文中一共展示了Archive::getArchive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: LatestPages

                echo "データが存在しません。";
                return;
            }
            $latest = new LatestPages();
            $category = new Category();
            $archive = new Archive();
            foreach (array_reverse($data) as $page) {
                $main[] = array('title' => $page->title, 'date' => $page->date, 'text' => mb_substr($page->text, 0, mb_strpos($page->text, "<br />")), 'pagenum' => $page->pagenum);
            }
            $smarty->assign('title', 'アーカイブ:' . $_GET['archive']);
        } else {
            $blog = new ActiveRecord();
            $blog->connectPdo('blogdb', 'blog', 'readonly', 'readonly');
            $data = $blog->find($blog->size());
            if (!isset($data->pagenum)) {
                echo "データが存在しません。";
                return;
            }
            $latest = new LatestPages();
            $category = new Category();
            $archive = new Archive();
            $main[] = array('title' => $data->title, 'date' => $data->date, 'text' => $data->text);
            $smarty->assign('prev', $blog->find($blog->size() - 1));
        }
    }
}
$smarty->assign('main', $main);
$smarty->assign('latest', $latest->getPages());
$smarty->assign('category', $category->getCategory());
$smarty->assign('archive', $archive->getArchive());
$smarty->display('blog.tpl');
开发者ID:pakutoma,项目名称:pakutomablog,代码行数:31,代码来源:index.php

示例2: Smarty

 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
//----INCLUDE FILES----
include '../../digital-logsheets-res/smarty/libs/Smarty.class.php';
include "../../digital-logsheets-res/php/database/connectToDatabase.php";
require_once "../../digital-logsheets-res/php/objects/logsheetClasses.php";
require_once "../../digital-logsheets-res/php/select2-preparation.php";
// create object
$smarty = new Smarty();
//database interactions
try {
    //open database connection
    $db = connectToDatabase();
    $archive = new Archive($db);
    $episodesArchive = $archive->getArchive();
    $episodes = array();
    foreach ($episodesArchive as $episode) {
        $playlist = array();
        $segments = $episode->getPlaylist()->getSegments();
        //create the playlist for each episode
        foreach ($segments as $segment) {
            $playlist[$segment->getId()] = $segment->getObjectAsArray();
        }
        //create an array to store each episode's data
        $episodes[$episode->getId()] = $episode->getObjectAsArray();
    }
    $programs = getSelect2ProgramsList($db);
    //close database connection
    $db = NULL;
    $smarty->assign("episodes", $episodes);
开发者ID:radioCKUT,项目名称:digital-logsheets,代码行数:31,代码来源:index.php


注:本文中的Archive::getArchive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。