當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。