• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getPages函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getPages函数的典型用法代码示例。如果您正苦于以下问题:PHP getPages函数的具体用法?PHP getPages怎么用?PHP getPages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: getIt

                function getIt($id) {
                    $page = "";
                    $lang = "";
                    $pagId = 0;
//                    if ($id > 100)
                    $page = "../";
                
                    if ($id <= 100) {
//                        echo "<br/> Admin <br/>";
                    } else if ($id < 200) { // 100 - 199
                        $lang = "es";
                        $pageId = $id%100;
                    } else if ($id < 300) { // 200 - 299
                        $lang = "fr";
                        $pageId = $id%100;
                    } else if ($id < 400) { // 300 - 399
                        $lang = "al";
                        $pageId = $id%100;
                    } else if ($id < 500) { // 400 - 499
                        $lang = "en";
                        $pageId = $id%100;
                    }
                    
                    if ($id == 0) {
                        $page .= "index.html";
                    } else {
                        $array = getPages($lang);
                        $page .= $lang . "/";
                        $page .= $array[$pageId - 1];
                        $page .= ".html";
                    }
	                return $page;
                }
开发者ID:nestoralvaro,项目名称:no_DDBB_web_editor,代码行数:33,代码来源:editor.php


示例2: getPageID

function getPageID()
{
    $aux = explode('/', $_SERVER['REQUEST_URI']);
    // Array separado por "/" pra pegar nome da página
    $aux2 = end($aux);
    // Pegando nome da página: "pagina.formato"
    $aux3 = explode('.', $aux2);
    // Array separado por ".": "pagina" e "formato"
    $pgClicada = reset($aux3);
    // Pegando o nome da página sem formato
    $itemMenuSup = getPages();
    // Buscando páginas no menu
    $itemMenuCon = count($itemMenuSup);
    // Quantidade de itens do menu
    for ($cont = 0; $cont < $itemMenuCon; $cont++) {
        // Percorrendo o array com as páginas do menu
        if ($pgClicada == $itemMenuSup[$cont]) {
            // Verificando se a página clicada tá menu
            return $cont;
        }
    }
    // Retornando posição da página clicada no menu
    return 0;
    // Se a página não existir, o padrão é o ID da Home
}
开发者ID:edantasn,项目名称:asi,代码行数:25,代码来源:funcoes.php


示例3: index

 /**
  *默认动作,获得主页信息
  */
 public function index()
 {
     @session_start();
     ///////取得page///////////
     if (isset($_GET['page']) && !empty($_GET['page'])) {
         $page = is_numeric($_GET['page']) ? $_GET['page'] : 1;
     } else {
         $page = 1;
     }
     /////////获得分页栏////////////////
     $model = $this->M('Index');
     $rowCount = $model->getRowCount('blog_category');
     $config = getConfig();
     $pagecount = intval($config['pagecount']);
     //注意int转换
     $totalPage = ceil($rowCount / $pagecount);
     $pagenum = intval($config['pagenum']);
     //注意int转换
     $pages = getPages($page, $totalPage, $pagenum);
     //////获得博文列表//////////
     $listOrderByTime = $model->getList(($page - 1) * $pagecount, $pagecount, 'time desc');
     $clickcount = intval($config['clickcount']);
     $listOrderByClick = $model->getList(0, $clickcount, 'click desc');
     //////获取用户信息/////////
     $model = $this->M('User');
     //
     //多用户功能已经测试完毕
     //此处我去掉多用户功能
     //改为只有我一个用户
     //真正展示一个自己的博客
     /*if(!isset($_SESSION['id'])){
     			header('Location:'.$this->strGroupUrl.'/user/login');
     			die;
     		}*/
     $userInfo = $model->getInfoById(13);
     if (!empty($error = $model->getError())) {
         p($error);
         die;
     }
     //////赋值并显示模板////////
     $this->assign('list1', $listOrderByTime);
     //右侧栏博文
     $this->assign('list2', $listOrderByClick);
     //阅读排行
     $this->assign('current', $page);
     //当前页
     $this->assign('total', $totalPage);
     //尾页
     $this->assign('pages', $pages);
     //分页栏
     $this->assign('username', $userInfo['username']);
     $this->assign('face', $userInfo['face']);
     $this->assign('email', $userInfo['email']);
     $this->assign('phone', $userInfo['phone']);
     $this->assign('count', $userInfo['count']);
     $this->display();
 }
开发者ID:huolong1992,项目名称:baixiu,代码行数:60,代码来源:IndexController.class.php


示例4: showFormCreate

/**
* Zeigt das Eingabeformular an
*/
function showFormCreate()
{
    $editor_tpl = dirname(__FILE__) . "/template/form.create.tpl";
    if (is_file($editor_tpl)) {
        $template = file_get_contents($editor_tpl);
    }
    $template = str_replace(array("%title%", "%tooltip%", "%sel_nz%", "%sel_i%", "%sel_e%", "%sel_c%", "%pagelist%", "%extern%"), array($_POST['title'], $_POST['tooltip'], !$_POST['type'] ? 'selected' : '', 1 == $_POST['type'] ? 'selected' : '', 2 == $_POST['type'] ? 'selected' : '', 3 == $_POST['type'] ? 'selected' : '', getPages($_POST['intern']), $_POST['extern']), $template);
    return $template;
}
开发者ID:nubix,项目名称:cms,代码行数:12,代码来源:function.create.php


示例5: getPages

 function getPages($page_id, $level = 0, $class = 'a', $current_page = '')
 {
   global $db, $class_ul;
   
   $level++;
 
   if($current_page == '') 
   { 
     $isfirst == 1;
   
     $current_page = getMainPage($page_id);
   
     $ul_class = ' class="page_menu"';
     
     $sql = "SELECT page_id FROM pages WHERE page_parent = '".$page_id."' AND page_ts_delete IS NULL;";
       
     $has_childs = $db->get_results($sql);
     
     
     if(count($has_childs)>0) $return.= '<span class="page_menu_title">'.utf8_encode(getDBData('page', 'title', $current_page)).':</span>';
   
   }
   $return.= '<ul'.$ul_class.'>';
   $level_spacer = '';
   
   for($l=1;$l<=$level;$l++)
   { $level_spacer = $level_spacer.'&nbsp;&nbsp;';}
   
   
   $sql = "SELECT * FROM pages WHERE page_parent = '".$current_page."' AND page_ts_delete IS NULL;";
   $pages = $db->get_results($sql);
   
   if(count($pages)>0)
   {
     
     foreach($pages as $page)
     {
       $return.= '<li '.(($level>1)? '':'class="menu-'.$class).' id="link_'.$page->page_title.'">'.$level_spacer.'<a href="?p='.$page->page_id.'">'.utf8_encode($page->page_title).'</a>';
       if($page->page_id != '' && $page->page_id == $page_id) $return.= '<div class="menu-'.$class.$liclass.'" id="selected"></div>';
       
       $sql = "SELECT page_id FROM pages WHERE page_parent = '".$page->page_id."' AND page_ts_delete IS NULL;";
       
       $has_childs = $db->get_results($sql);
       
       
       if(count($has_childs)>0) $return.= getPages($page_id, $level, $class, $page->page_id);
       
       $return.= '</li>';
       if($class == 'a') { $class = 'b'; } else { $class = 'a'; }
     }
     
     
     $return.= '</ul>';
   }
   
   return $return;
 }
开发者ID:4g3n7sm1th,项目名称:cms,代码行数:57,代码来源:function.menue.php


示例6: showFormEdit

/**
* Zeigt das Eingabeformular an
*/
function showFormEdit()
{
    global $mysql;
    $id = intval($_POST['id']);
    $oThisItem = mysql_fetch_object(@$mysql->query("SELECT * FROM " . _PREFIX_ . "menu WHERE id='" . $id . "'"));
    $tpl = dirname(__FILE__) . "/template/form.edit.tpl";
    if (is_file($tpl)) {
        $template = file_get_contents($tpl);
    }
    $template = str_replace(array("%id%", "%title%", "%tooltip%", "%sel_nz%", "%sel_i%", "%sel_e%", "%sel_c%", "%pagelist%", "%extern%"), array($id, $oThisItem->title, $oThisItem->tooltip, !$oThisItem->type ? 'selected' : '', 1 == $oThisItem->type ? 'selected' : '', 2 == $oThisItem->type ? 'selected' : '', 3 == $oThisItem->type ? 'selected' : '', getPages(1 == $oThisItem->type ? $oThisItem->target : 0), 2 == $oThisItem->type ? $oThisItem->target : ''), $template);
    return $template;
}
开发者ID:nubix,项目名称:cms,代码行数:15,代码来源:function.edit.php


示例7: generateLinks

 function generateLinks($lang) {
         $idCount = startLanguageCount($lang);
         $array = getPages($lang);
         $count = count($array);
         for ($i = 0; $i < $count; $i++) {
            $idCount++;
            echo "<li>
                 <a href=\"editor.php?url=" . $lang . "-" . $array[$i] . "&id=" . $idCount . "\">" . $lang . " - " . $array[$i] . "&nbsp;&nbsp;<img src=\"images/edit.png\" alt=\"editar\" title=\"editar\" style=\"border:0;\"/></a>
                 &nbsp;&nbsp;|&nbsp;&nbsp;
                 <a target=\"_blank\" href=\"../" . $lang . "/" . $array[$i] . ".html\">Ver p&aacute;gina&nbsp;&nbsp;<img src=\"images/view.png\" alt=\"ver\" title=\"ver\" style=\"border:0;\"/></a>
             </li>";
         }
     }
开发者ID:nestoralvaro,项目名称:no_DDBB_web_editor,代码行数:13,代码来源:admin.php


示例8: viewadminpages

function viewadminpages()
{
    global $context, $txt, $smcFunc, $scripturl;
    checkSession('get');
    //Load main trader template.
    $context['sub_template'] = 'viewadminpages';
    //Set the page title
    $context['page_title'] = $txt['adkmod_modules_pages'];
    $total = getTotal('adk_pages');
    $context['total'] = $total;
    $context['start'] = !empty($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0;
    $limit = 10;
    //Load adkportalPages
    $context['total_admin_pages'] = getPages($context['start'], $limit, '', 'titlepage ASC');
    $context['page_index'] = constructPageIndex($scripturl . '?action=admin;area=modules;sa=viewadminpages;' . $context['session_var'] . '=' . $context['session_id'], $context['start'], $total, $limit);
}
开发者ID:lucasruroken,项目名称:adkportal,代码行数:16,代码来源:Adk-AdminModules.php


示例9: LoadIndexPages

function LoadIndexPages()
{
    global $context, $txt, $adkportal, $user_info, $scripturl;
    if (empty($adkportal['enable_menu_pages'])) {
        fatal_lang_error('adkfatal_module_not_enable', false);
    }
    adktemplate('Adk-echomodules');
    adkLanguage('Adk-echomodules');
    $context['sub_template'] = 'page_system';
    $context['page_title'] = $txt['adkmodules_index_pages'];
    $total = getTotal('adk_pages', '(FIND_IN_SET(' . implode(', grupos_permitidos) != 0 OR FIND_IN_SET(', $user_info['groups']) . ', grupos_permitidos) != 0)');
    $show = 5;
    $start = !empty($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0;
    $context['pages'] = getPages($start, $show, '', 'id_page DESC', array(), true);
    if (empty($context['pages'])) {
        fatal_lang_error('adkfatal_module_not_enable', false);
    }
    $context['page_index'] = constructPageIndex($scripturl . '?action=pages', $start, $total, $show);
}
开发者ID:lucasruroken,项目名称:adkportal,代码行数:19,代码来源:Adk-echomodules.php


示例10: fetchCategoryItems

/**
 * Get category movies and pages.
 */
function fetchCategoryItems($title)
{
    $template = new Anime44MoviesTemplate();
    $template->setLetter($letter);
    //If page equal "x" goto page number list, in other case process actual category page
    if (isset($_GET["page"]) && $_GET["page"] == "x") {
        $maxPages = $_GET["pages"];
        for ($i = 1; $i <= $maxPages; ++$i) {
            $template->addItem($i, resourceString("goto_page") . $i, SCRAPER_URL . "movies.php?letter=" . $letter . URL_AMP . "title=" . base64_encode($title) . URL_AMP . "page=" . $i . URL_AMP . "pages=" . $maxPages . URL_AMP . "PHPSESID=" . session_id(), "");
        }
        $template->generateView(Anime44MoviesTemplate::VIEW_PAGE_NUMBERS);
    } else {
        if (!isset($_GET["page"])) {
            $pages = getPages();
            $template->setActualPage(1);
            $template->setMaxPages($pages[1]);
            $content = $pages[0];
            $showSearch = true;
        } else {
            $page = $_GET["page"];
            $template->setActualPage($_GET["page"]);
            $template->setMaxPages($_GET["pages"]);
            $content = file_get_contents("http://www.anime44.com/category/anime-movies/page/" . $page);
            $showSearch = false;
        }
        //Show search link on first page only
        if ($showSearch) {
            $template->setSearch(array(resourceString("search_by") . "...", resourceString("search_by") . "...", "rss_command://search", SCRAPER_URL . "movies.php?search=%s" . URL_AMP . "title=" . base64_encode(resourceString("search_by") . "...") . URL_AMP . "PHPSESID=" . session_id(), ""));
        }
        //
        $newlines = array("\t", "\n", "\r", "  ", "", "\v");
        $content = str_replace($newlines, "", html_entity_decode($content, ENT_QUOTES, "UTF-8"));
        preg_match_all("/<div class=\"postlist\"><a href=\"(.*)\" rel=\"bookmark\" title=\"(.*)\">(.*)<\\/a>/siU", $content, $links, PREG_SET_ORDER);
        if ($links) {
            foreach ($links as $value) {
                $template->addItem($value[3], "", SCRAPER_URL . "movies.php?title=" . base64_encode($value[3]) . URL_AMP . "item=" . base64_encode($value[1]) . URL_AMP . "PHPSESID=" . session_id(), "");
            }
        }
        $template->generateView(Anime44MoviesTemplate::VIEW_MOVIE, "");
    }
}
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:44,代码来源:movies.php


示例11: fetchCategoryItems

function fetchCategoryItems($type, $title)
{
    $template = new KinostreamingTemplate();
    //Start session
    if (isset($_GET["PHPSESID"])) {
        session_id($_GET["PHPSESID"]);
    }
    session_start();
    //If page equal "x" goto page number list, in other case process actual category page
    if (isset($_GET["page"]) && $_GET["page"] == "x") {
        $maxPages = $_GET["pages"];
        for ($i = 1; $i <= $maxPages; ++$i) {
            $template->addItem($i, resourceString("goto_page") . $i, SCRAPER_URL . "index.php?type=" . base64_encode($type) . URL_AMP . "page=" . $i . URL_AMP . "pages=" . $maxPages, "");
        }
        $template->generateView(KinostreamingTemplate::VIEW_PAGE_NUMBERS);
    } else {
        if (!isset($_GET["page"])) {
            $pages = getPages($type . "-1-3");
            $template->setActualPage(1);
            $template->setMaxPages($pages[1]);
            $content = $pages[0];
        } else {
            $template->setActualPage($_GET["page"]);
            $template->setMaxPages($_GET["pages"]);
            $content = file_get_contents($type . "-" . $_GET["page"] . "-3");
            $newlines = array("\t", "\n", "\r", "  ", "", "\v");
            $content = str_replace($newlines, "", html_entity_decode($content));
        }
        preg_match_all("/<div class\\=\"eTitle\"(.*)><a href\\=\"(.*)\">(.*)<\\/a>(.*)<img src\\=\"(.*)\"/U", $content, $links, PREG_SET_ORDER);
        if ($links) {
            foreach ($links as $value) {
                $image = $value[5];
                if (!$image) {
                    $image = XTREAMER_IMAGE_PATH . "background/nocover.jpg";
                }
                $template->addItem(utf8_decode($value[3]), "", SCRAPER_URL . "index.php?item=" . base64_encode($value[2]) . URL_AMP . "title=" . base64_encode($value[3]) . URL_AMP . "image=" . base64_encode($image) . URL_AMP . "PHPSESID=" . session_id(), $image);
            }
        }
        $template->generateView(KinostreamingTemplate::VIEW_MOVIE, "");
    }
}
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:41,代码来源:index.php


示例12: getPages

 * @param bool $isFull 是否全部内容
 * @return Array
 */
function getPages($db, $isFull = false)
{
    $target = $db->fetchAll($db->select($isFull ? 'slug, title, text' : 'slug, title')->from('table.contents')->where(' type = ?', "page")->where(' slug != ? ', "index")->order('order'));
    if ($isFull) {
        foreach ($target as $key => $value) {
            $resources = self::getResource($value['cid']);
            $target[$key] = array_merge($target[$key], $resources);
            $_temp_text = self::getDetail('page', $value['cid'], 'cid');
            if (!empty($_temp_text)) {
                $_temp_text = $_temp_text['text'];
            }
            $target[$key]['type'] = is_null(json_decode($_temp_text)) ? 'html' : 'json';
            $target[$key]['text'] = $_temp_text;
        }
    }
    return $target;
}
$_index = $this->db->fetchRow($this->db->select('text')->from('table.contents')->where('type = ?', 'page')->where('slug = ?', 'index'));
if (!empty($_index)) {
    $loader = new Twig_Loader_Array(array('index' => str_replace("<!--markdown-->", "", $_index['text'])));
    $twig = new Twig_Environment($loader);
    $_headers = getPages($this->db);
    $data = array('headers' => $_headers, 'theme' => array('url' => $this->options->themeUrl));
    echo $twig->render('index', $data);
    //$_text;
} else {
    echo '未找到首页!';
}
开发者ID:jiusanzhou,项目名称:spacms,代码行数:31,代码来源:index.php


示例13: array

    $stmt = $mysqli->prepare('SELECT pages.id, pages.title, is_live FROM pages ORDER BY pages.order');
    $stmt->execute();
    $stmt->bind_result($id, $title, $is_live);
    $results = array();
    $i = 0;
    while ($stmt->fetch()) {
        $results[$i]['id'] = $id;
        $results[$i]['title'] = $title;
        $results[$i]['is_live'] = $is_live;
        $i++;
    }
    $stmt->close();
    $mysqli->close();
    return $results;
}
$pages = getPages($DB_SERVER, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE);
?>
<html>
<head>
    <title>List Pages</title>
    <?php 
include 'includes/head.php';
?>
    <style>
        .list th, .list td {
            padding: 0.5rem 1rem 0.5rem 0
        }
    </style>
</head>
<body>
<?php 
开发者ID:Steadroy,项目名称:hcf-btw,代码行数:31,代码来源:page-list.php


示例14: form_newBoard

         $body .= form_newBoard();
         // TODO: Statistics, etc, in the dashboard.
         echo Element('page.html', array('config' => $config, 'title' => 'New board', 'body' => $body, 'mod' => true));
     }
 } elseif (preg_match('/^\\/' . $regex['board'] . '(' . $regex['index'] . '|' . $regex['page'] . ')?$/', $query, $matches)) {
     // Board index
     $boardName =& $matches[1];
     // Open board
     if (!openBoard($boardName)) {
         error($config['error']['noboard']);
     }
     $page_no = empty($matches[2]) || $matches[2] == $config['file_index'] ? 1 : $matches[2];
     if (!($page = index($page_no, $mod))) {
         error($config['error']['404']);
     }
     $page['pages'] = getPages(true);
     $page['pages'][$page_no - 1]['selected'] = true;
     $page['btn'] = getPageButtons($page['pages'], true);
     $page['mod'] = true;
     echo Element('index.html', $page);
 } elseif (preg_match('/^\\/' . $regex['board'] . $regex['res'] . $regex['page'] . '$/', $query, $matches)) {
     // View thread
     $boardName =& $matches[1];
     $thread =& $matches[2];
     // Open board
     if (!openBoard($boardName)) {
         error($config['error']['noboard']);
     }
     $page = buildThread($thread, true, $mod);
     echo $page;
 } elseif (preg_match('/^\\/' . $regex['board'] . 'edit\\/(\\d+)$/', $query, $matches)) {
开发者ID:niksfish,项目名称:Tinyboard,代码行数:31,代码来源:mod.php


示例15: fetchMovieCategoryItems

/**
 */
function fetchMovieCategoryItems($category, $title, $search = null)
{
    $template = new HdboxTemplate();
    $template->setCategory($category);
    //If page equal "x" goto page number list, in other case process actual category page
    if (isset($_GET["page"]) && $_GET["page"] == "x") {
        $maxPages = $_GET["pages"];
        for ($i = 1; $i <= $maxPages; ++$i) {
            $template->addItem($i, resourceString("goto_page") . $i, SCRAPER_URL . "index.php?cat=" . base64_encode($category) . URL_AMP . "page=" . $i . URL_AMP . "pages=" . $maxPages, "");
        }
        $template->generateView(HdboxTemplate::VIEW_PAGE_NUMBERS);
    } else {
        if (!isset($_GET["page"])) {
            $pages = getPages($category);
            $template->setActualPage(1);
            $template->setMaxPages($pages[1]);
            $content = $pages[0];
        } else {
            $template->setActualPage($_GET["page"]);
            $template->setMaxPages($_GET["pages"]);
            $content = file_get_contents("http://hd-box.org" . $category . "&page=" . $_GET["page"]);
            $newlines = array("\t", "\n", "\r", "  ", "", "\v");
            $content = str_replace($newlines, "", html_entity_decode($content, ENT_QUOTES, "UTF-8"));
        }
        preg_match_all("/<div class=\"pos-media media-center\"> <a href=\"(.*)\" title=\"(.*)\"><img src=\"(.*)\" title=\"(.*)\"/siU", $content, $links, PREG_SET_ORDER);
        if ($links) {
            foreach ($links as $link) {
                $template->addItem(utf8_decode($link[2]), "", SCRAPER_URL . "index.php?title=" . base64_encode($link[2]) . URL_AMP . "item=" . base64_encode($link[1]) . URL_AMP . "image=" . base64_encode($link[3]), $link[3]);
            }
        }
        $template->generateView(HdboxTemplate::VIEW_MOVIE, "");
    }
}
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:35,代码来源:index.php


示例16: getPages

function getPages($result)
{
    $pageUrl = $GLOBALS['service']->get($result);
    array_push($GLOBALS['pageUrls'], $pageUrl->get_href());
    if ($pageUrl->getLink()) {
        $links = $pageUrl->getLink();
        foreach ($links as $link) {
            if ($link->get_rel() == "nextPage") {
                getPages($link->get_href());
            }
        }
    }
}
开发者ID:arvindsharma16,项目名称:vghetto-scripts,代码行数:13,代码来源:vcloudVMChainLength.php


示例17: header

<?php

header("Access-Control-Allow-Origin: *");
include "../config.php";
include "../shopify_api.php";
include "shopify_function.php";
$product_list = array();
#$product_list = getAllProuctData($shop, $token);
$collection_list = array();
$All_coll_array = getCollection($shop, $token);
if (count($All_coll_array["result"]) > 0 && $All_coll_array["status"] == "1") {
    $collection_list = $All_coll_array["result"];
    $collection_list = array_values($collection_list);
}
$page_list = array();
$All_page_array = getPages($shop, $token);
if (count($All_page_array["result"]) > 0 && $All_page_array["status"] == "1") {
    $page_list = $All_page_array["result"];
    $page_list = array_values($page_list);
}
$b_id_val = "";
if (isset($_REQUEST['id']) && $_REQUEST['id'] != "") {
    $b_id_val = $_REQUEST["id"];
    $b_id_val = trim($b_id_val);
    $b_id_val = base64_decode($b_id_val);
}
$sel_sql = "select * from share_buttons where shop = '" . $shop . "' and bid= '" . $b_id_val . "'";
$result = mysql_query($sel_sql);
if (mysql_num_rows($result) == 0) {
    header('Location: buttons_ist.php?shop=' . $shop);
    exit;
开发者ID:borisnogindev,项目名称:Share-Viewer,代码行数:31,代码来源:edit_button.php


示例18: buildIndex

function buildIndex($global_api = "yes")
{
    global $board, $config, $build_pages;
    if (!$config['smart_build']) {
        $pages = getPages();
        if (!$config['try_smarter']) {
            $antibot = create_antibot($board['uri']);
        }
        if ($config['api']['enabled']) {
            $api = new Api();
            $catalog = array();
        }
    }
    for ($page = 1; $page <= $config['max_pages']; $page++) {
        $filename = $board['dir'] . ($page == 1 ? $config['file_index'] : sprintf($config['file_page'], $page));
        $jsonFilename = $board['dir'] . ($page - 1) . '.json';
        // pages should start from 0
        if ((!$config['api']['enabled'] || $global_api == "skip" || $config['smart_build']) && $config['try_smarter'] && isset($build_pages) && !empty($build_pages) && !in_array($page, $build_pages)) {
            continue;
        }
        if (!$config['smart_build']) {
            $content = index($page);
            if (!$content) {
                break;
            }
            // json api
            if ($config['api']['enabled']) {
                $threads = $content['threads'];
                $json = json_encode($api->translatePage($threads));
                file_write($jsonFilename, $json);
                $catalog[$page - 1] = $threads;
            }
            if ($config['api']['enabled'] && $global_api != "skip" && $config['try_smarter'] && isset($build_pages) && !empty($build_pages) && !in_array($page, $build_pages)) {
                continue;
            }
            if ($config['try_smarter']) {
                $antibot = create_antibot($board['uri'], 0 - $page);
                $content['current_page'] = $page;
            }
            $antibot->reset();
            $content['pages'] = $pages;
            $content['pages'][$page - 1]['selected'] = true;
            $content['btn'] = getPageButtons($content['pages']);
            $content['antibot'] = $antibot;
            file_write($filename, Element('index.html', $content));
        } else {
            file_unlink($filename);
            file_unlink($jsonFilename);
        }
    }
    if (!$config['smart_build'] && $page < $config['max_pages']) {
        for (; $page <= $config['max_pages']; $page++) {
            $filename = $board['dir'] . ($page == 1 ? $config['file_index'] : sprintf($config['file_page'], $page));
            file_unlink($filename);
            if ($config['api']['enabled']) {
                $jsonFilename = $board['dir'] . ($page - 1) . '.json';
                file_unlink($jsonFilename);
            }
        }
    }
    // json api catalog
    if ($config['api']['enabled'] && $global_api != "skip") {
        if ($config['smart_build']) {
            $jsonFilename = $board['dir'] . 'catalog.json';
            file_unlink($jsonFilename);
            $jsonFilename = $board['dir'] . 'threads.json';
            file_unlink($jsonFilename);
        } else {
            $json = json_encode($api->translateCatalog($catalog));
            $jsonFilename = $board['dir'] . 'catalog.json';
            file_write($jsonFilename, $json);
            $json = json_encode($api->translateCatalog($catalog, true));
            $jsonFilename = $board['dir'] . 'threads.json';
            file_write($jsonFilename, $json);
        }
    }
    if ($config['try_smarter']) {
        $build_pages = array();
    }
}
开发者ID:Cipherwraith,项目名称:infinity,代码行数:80,代码来源:functions.php


示例19: dress

dress('count_yesterday', $stats['yesterday'], $view);
if (preg_match("@\\[##_archive_rep_##\\]@iU", $view)) {
    dress('archive_rep', getArchivesView(getArchives($blogid), $skin->archive), $view, false, true);
}
if (preg_match("@\\[##_calendar_##\\]@iU", $view)) {
    dress('calendar', getCalendarView(getCalendar($blogid, isset($period) ? $period : true)), $view, false, true);
}
if (preg_match("@\\[##_random_tags_##\\]@iU", $view)) {
    dress('random_tags', getRandomTagsView(getRandomTags($blogid), $skin->randomTags), $view, false, true);
}
if (preg_match("@\\[##_rct_notice_##\\]@iU", $view)) {
    $noticeView = getRecentNoticesView(getRecentNotices($blogid), $skin->recentNotice, $skin->recentNoticeItem);
    dress('rct_notice', $noticeView, $view, false, true);
}
if (preg_match("@\\[##_rct_page_##\\]@iU", $view)) {
    $pageView = getRecentPagesView(getPages($blogid), $skin->recentPage, $skin->recentPageItem);
    dress('rct_page', $pageView, $view, false, true);
}
if (preg_match("@\\[##_author_rep_##\\]@iU", $view)) {
    dress('author_rep', getAuthorListView(User::getUserNamesOfBlog($blogid), $skin->authorList), $view, false, true);
}
// Recent items
if (preg_match("@\\[##_rctps_##\\]@iU", $view)) {
    dress('rctps', getRecentEntriesView(getRecentEntries($blogid), $skin->recentEntry, $skin->recentEntryItem), $view, false, true);
} else {
    if (preg_match("@\\[##_rctps_rep_##\\]@iU", $view)) {
        dress('rctps_rep', getRecentEntriesView(getRecentEntries($blogid), null, $skin->recentEntryItem), $view, false, true);
    }
}
if (preg_match("@\\[##_rctrp_##\\]@iU", $view)) {
    dress('rctrp', getRecentCommentsView(getRecentComments($blogid), $skin->recentComment, $skin->recentCommentItem), $view, false, true);
开发者ID:webhacking,项目名称:Textcube,代码行数:31,代码来源:end.php


示例20: fetchSerieCategoryItems

/**
 * Get given serie category pages, first page items or page number list.
 */
function fetchSerieCategoryItems($type, $category, $title)
{
    //Init template
    $template = new CinetubeTemplate();
    $template->setCategory($category);
    $template->setType($type);
    //If page equal "x" goto page number list, in other case process actual category page
    if (isset($_GET["page"]) && $_GET["page"] == "x") {
        $maxPages = $_GET["pages"];
        for ($i = 1; $i <= $maxPages; ++$i) {
            $template->addItem($i, resourceString("goto_page") . $i, SCRAPER_URL . "index.php?type=" . $type . URL_AMP . "cat=" . base64_encode($category) . URL_AMP . "page=" . $i . URL_AMP . "pages=" . $maxPages . URL_AMP . "PHPSESID=" . session_id(), "");
        }
        $template->generateView(CinetubeTemplate::VIEW_PAGE_NUMBERS);
    } else {
        if (!isset($_GET["page"])) {
            $pages = getPages($category);
            $template->setActualPage(1);
            $template->setMaxPages($pages[1]);
            $content = $pages[0];
        } else {
            $template->setActualPage($_GET["page"]);
            $template->setMaxPages($_GET["pages"]);
            $content = file_get_contents(CINETUBE_URL . $category . $_GET["page"] . ".html");
        }
        //Parse first page series
        $newlines = array("\t", "\n", "\r", "  ", "", "\v");
        $input = str_replace($newlines, "", $content);
        preg_match("/<ul class\\=\"ver_series_list( ver_series_list_puntos)?\">(.*)<\\/ul>/siU", $input, $divs);
        preg_match_all("/<li>(.*)<\\/li>/siU", $divs[0], $divs, PREG_SET_ORDER);
        //For new serie releases dont works
        if ($category != "series/") {
            if ($divs) {
                //$divs = $divs[0];
                foreach ($divs as $movie) {
                    $movie = $movie[1];
                    preg_match_all("/(<a href=\"(.*)\">)*\\s*<img\\s*src=\"(.*)\" alt=\"(.*)\"\\s(\\/)*>\\s*(<\\/a>)*|<p class\\=\"tit_ficha\">(.*)<\\/p>/siU", $movie, $info, PREG_SET_ORDER);
                    //Get info
                    $movieIcons = array();
                    foreach ($info as $key => $detail) {
                        if ($key == 0) {
                            if (strpos($detail[2], '"')) {
                                $movieLink = substr($detail[2], 0, strpos($detail[2], '"'));
                            } else {
                                $movieLink = $detail[2];
                            }
                            $movieThumbnail = html_entity_decode($detail[3]);
                        } else {
                            if (count($detail) == 8) {
                                $movieTitle = $detail[7];
                            } else {
                                if ($detail[4]) {
                                    if (!strpos($detail[4], "escarga")) {
                                        array_push($movieIcons, html_entity_decode($detail[4]));
                                    }
                                } else {
                                    //megavideo, veoh, tutv, google
                                    array_push($movieIcons, html_entity_decode(substr($detail[3], strrpos($detail[3], "/") + 1, strrpos($detail[3], "\\.") - 4)));
                                }
                            }
                        }
                    }
                    //Add video
                    $template->addItem($movieTitle, strtoupper(getArrayString($movieIcons) . ""), SCRAPER_URL . "index.php?type=ser" . URL_AMP . "item=" . base64_encode($movieLink) . URL_AMP . "title=" . base64_encode($title) . URL_AMP . "PHPSESID=" . session_id(), $movieThumbnail);
                }
            }
            $template->generateView(CinetubeTemplate::VIEW_SERIE, $title);
        } else {
            if ($divs) {
                //$divs = $divs[0];
                foreach ($divs as $movie) {
                    $movie = $movie[1];
                    preg_match_all("/<img src\\=\"(.*)\"(.*)<a class\\=\"tit_ficha\"(.*)href\\=\"(.*)\">(.*)<\\/a>(.*)<p class\\=\"tem_fich\">(.*)<\\/p>/siU", $movie, $info, PREG_SET_ORDER);
                    $info = $info[0];
                    if (strpos($info[7], "Cap")) {
                        $template->addItem(html_entity_decode($info[5]), $info[7], SCRAPER_URL . "index.php?type=" . $type . URL_AMP . "episodeName=" . base64_encode($info[7]) . URL_AMP . "episode=" . base64_encode($info[4]) . URL_AMP . "seasonNum=" . URL_AMP . "image=" . base64_encode($info[1]) . URL_AMP . "serieTitle=" . base64_encode($info[5]) . URL_AMP . "PHPSESID=" . session_id(), $info[1]);
                    } else {
                    }
                }
            }
            $template->generateView(CinetubeTemplate::VIEW_SERIE, $title);
        }
    }
}
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:86,代码来源:index.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getPagesXmlValues函数代码示例发布时间:2022-05-15
下一篇:
PHP getPageURL函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap