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


PHP getPages函数代码示例

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


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


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