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; }
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 }
/** *默认动作,获得主页信息 */ 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(); }
/** * 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; }
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.' ';} $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; }
/** * 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; }
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] . " <img src=\"images/edit.png\" alt=\"editar\" title=\"editar\" style=\"border:0;\"/></a> | <a target=\"_blank\" href=\"../" . $lang . "/" . $array[$i] . ".html\">Ver página <img src=\"images/view.png\" alt=\"ver\" title=\"ver\" style=\"border:0;\"/></a> </li>"; } }
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); }
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); }
/** * 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, ""); } }
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, ""); } }
* @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 '未找到首页!'; }
$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
$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)) {
/** */ 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, ""); } }
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()); } } } }
<?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;
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(); } }
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);
/** * 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); } } }
/** */ function fetchMovieCategoryItems($category, $title, $search = null) { $template = new MarocTemplate(); $template->setCategory($category); //Check for name ordered if (!strpos($category, "orderby")) { $category = $category . "&orderby=titleA"; } //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 . URL_AMP . "PHPSESID=" . session_id(), ""); } $template->generateView(MarocTemplate::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($category . "&start=" . ((int) $_GET["page"] - 1) * 10 . "/"); $newlines = array("\t", "\n", "\r", " ", "", "\v"); $content = str_replace($newlines, "", html_entity_decode($content, ENT_QUOTES, "UTF-8")); } //Get movies block $content = strstr($content, "<!-- Start link loop -->"); $content = substr($content, 0, strpos($content, "<!-- End link loop -->")); preg_match_all("/<div style=\"float: left; padding: 0 4px 4px 0;\">(.*)<a href=\"(.*)\" target=\"\"><img src=\"(.*)\"(.*)title=\"(.*)\"/siU", $content, $links, PREG_SET_ORDER); //var_dump($links); if ($links) { foreach ($links as $link) { $template->addItem($link[5], $movieDescription, SCRAPER_URL . "index.php?title=" . base64_encode($link[5]) . URL_AMP . "item=" . base64_encode($link[2]) . URL_AMP . "image=" . base64_encode($link[3]) . URL_AMP . "PHPSESID=" . session_id(), $link[3]); } } $template->generateView(MarocTemplate::VIEW_MOVIE, ""); } }
if (!$page) { $page = 1; } //$mydata = $myspace->getFavsByUser($uid,$page); $collectionService = L::loadClass('Collection', 'collection'); $myFavThreads = $collectionService->findByUidAndTypeInPage($winduid, 'postfavor', $page, $wap_perpage, 'all'); $mydata = array(); foreach ($myFavThreads as $key => $value) { $temp = array(); $temp['url'] = "index.php?a=read&tid=" . $value['typeid']; $temp['subject'] = $value['content']['postfavor']['subject']; $mydata[] = $temp; } } $url = "index.php?a=myfav&" . ($type ? "&type={$type}" : "") . "&" . ($uid ? "&uid={$uid}" : "") . "&"; $pages = getPages($page, count($mydata), $url); } else { $myArticles = $myspace->getArticlesByUser($uid); $myReplaies = $myspace->getReplaysByUser($uid); if ($winduid == $uid) { $collectionService = L::loadClass('Collection', 'collection'); $results = $collectionService->findByUidAndTypeInPage($winduid, 'postfavor', 1, 5, 'all'); //$myFavThreads = $myspace->getFavsByUser($uid); $myFavThreads = array(); foreach ($results as $key => $value) { $temp = array(); $temp['url'] = "index.php?a=read&tid=" . $value['typeid']; $temp['subject'] = $value['content']['postfavor']['subject']; $myFavThreads[] = $temp; } }
/** * Get category movies and pages. */ function fetchLetterItems($type, $letter, $title) { $template = new AnivideSeriesTemplate(); $template->setType($type); $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 . "series.php?letter=" . $letter . URL_AMP . "title=" . base64_encode($title) . URL_AMP . "page=" . $i . URL_AMP . "pages=" . $maxPages . URL_AMP . "PHPSESID=" . session_id(), ""); } $template->generateView(AnivideSeriesTemplate::VIEW_PAGE_NUMBERS); } else { if (!isset($_GET["page"])) { $pages = getPages($type, $letter); $template->setActualPage(1); $template->setMaxPages($pages[1]); $content = $pages[0]; } else { $page = $_GET["page"]; $template->setActualPage($_GET["page"]); $template->setMaxPages($_GET["pages"]); if ($letter == "all") { $url = "http://www.anivide.com/index.html?list=anime&type=series&page=" . $page; } else { if ($letter == "new") { $url = "http://www.anivide.com/index.html?list=anime&view=new&page=" . $page; } else { $url = "http://www.anivide.com/index.html?list=anime&type=series&letter=" . $letter . "&page=" . $page; } } $content = file_get_contents($url); } //Remove backslashes $content = html_entity_decode($content); preg_match_all("/<div class=\"animelist\"><a href=\"(.*)\"><img src=\"(.*)\" border=\"0\"><br><br><b>(.*)<\\/b><br>(.*)</U", $content, $links, PREG_SET_ORDER); if ($links) { foreach ($links as $value) { $title = html_entity_decode(utf8_decode($value[2])); $template->addItem($value[3], $value[4], SCRAPER_URL . "series.php?serie=" . base64_encode($value[1]) . URL_AMP . "title=" . base64_encode($value[3]) . URL_AMP . "PHPSESID=" . session_id(), $value[2]); } } $template->generateView(AnivideSeriesTemplate::VIEW_SERIE, ""); } }
/** * Get category movies and pages. */ function fetchCategoryItems($type, $letter, $title) { $template = new KinotoTemplate(); $template->setType($type); $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?type=" . base64_encode($type) . URL_AMP . "letter=" . $letter . URL_AMP . "title=" . base64_encode($title) . URL_AMP . "page=" . $i . URL_AMP . "pages=" . $maxPages . URL_AMP . "PHPSESID=" . session_id(), ""); } $template->generateView(KinotoTemplate::VIEW_PAGE_NUMBERS); } else { if (!isset($_GET["page"])) { $pages = getPages($type, $letter); $template->setActualPage(1); $template->setMaxPages($pages[1]); $content = $pages[0]; } else { $page = $_GET["page"]; $template->setActualPage($_GET["page"]); $template->setMaxPages($_GET["pages"]); $content = file_get_contents(getMovieListLink($type, $letter, $page), false, getExplorerContext(getSiteHash())); } //Remove backslashes $content = str_replace("\\", "", $content); //var_dump($content); preg_match_all("/(movie|documentation)\",\"<a href=\"\\/(.*)\" title=\"(.*)\" onclick=\"return false;\">(.*)<\\/a>/U", $content, $links, PREG_SET_ORDER); //var_dump($links); if ($links) { foreach ($links as $value) { $itemUrl = "/" . $value[2]; if (strpos($itemUrl, '"')) { $itemUrl = substr($itemUrl, 0, strpos($itemUrl, '"')); } $template->addItem(html_entity_decode($value[3], ENT_QUOTES, "UTF-8"), "", SCRAPER_URL . "movies.php?title=" . base64_encode($value[3]) . URL_AMP . "item=" . base64_encode($itemUrl) . URL_AMP . "PHPSESID=" . session_id(), ""); } $template->generateView(KinotoTemplate::VIEW_MOVIE, ""); } } }
<div class="bottom_block"> <div class="wide_container"> <div class="links text_center"> <ul style="padding: 0px!important; margin: 0px !important"> <?php getPages(); ?> </ul> </div> <div class="table"> <div class="social"> <div class="name">Follow Sport.net</div> <?php $linksSocial = getSocials(); $default = 'javascript:void(0)'; ?> <ul class="clear_fix" style="padding: 0px!important; margin: 0px !important"> <li class="fb"><a target="_blank" href="<?php echo isset($linksSocial->facebook) ? $linksSocial->facebook : $default; ?> "></a></li> <li class="gp"><a target="_blank" href="<?php echo isset($linksSocial->googleplug) ? $linksSocial->googleplug : $default; ?> "></a></li> <li class="inst"><a target="_blank" href="<?php echo isset($linksSocial->instagram) ? $linksSocial->instagram : $default; ?> "></a></li> <li class="pint"><a target="_blank" href="<?php echo isset($linksSocial->pinterest) ? $linksSocial->pinterest : $default;
/** * Get Link Menu Array * * get an array of menu links sorted by heirarchy and indented * * @uses $pagesSorted * * @since 3.3.0 * @param string $parent * @param array $array * @param int $level * @return array menuitems title,url,parent */ function get_link_menu_array($parent = '', $array = array(), $level = 0) { // pagesarray is sorted by file load, no specific or normalized sort order // pagesSorted attempts to sort by heirarchy parent children, in alphabetic order // @todo sort parent invalid filter $items = filterParent(getPages('sortParent'), $parent); if (count($items) > 0) { foreach ($items as $page) { $dash = ""; if ($page['parent'] != '') { $page['parent'] = $page['parent'] . "/"; } for ($i = 0; $i <= $level - 1; $i++) { if ($i != $level - 1) { $dash .= utf8_encode("��"); // outer level } else { $dash .= '- '; // inner level } } array_push($array, array($dash . $page['title'], find_url($page['url'], $page['parent']))); // recurse submenus $array = get_link_menu_array((string) $page['url'], $array, $level + 1); } } return $array; }
<?php include 'include.php'; isAllowed(); if (isset($_GET['page'])) { $content = getVote($_GET['page']); } else { $content = getVote(); } $content = $content->vote_feed; $pages = getPages(); getHeader(); ?> <article> <!-- Contenu de la page --> <div class="contenu"> <div class="contenu_static"> <h2>Les publications les mieux notées</h2> <section id="photos"> <ul id="inedit"> <?php foreach ($content as $k => $v) { ?> <li> <a href="afficherphoto.php?id=<?php echo $v->id; ?> "> <img src="http://api-rest-youcef-m.c9.io<?php echo implode("_200x200.", explode(".", $v->chemin));
function mod_view_board($boardName, $page_no = 1) { global $config, $mod; if (!openBoard($boardName)) { error($config['error']['noboard']); } 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; $page['config'] = $config; echo Element('index.html', $page); }
} wap_msg('消息发送失败', $basename); } } elseif ($action == 'all') { //$smsCount = $messageServer->countMessage($userId, $sms_type); //$smsList = $messageServer->getMessages($userId, $sms_type, $page, $wap_perpage); $smsCount = (int) $messageServer->countInBox($userId); $smsList = $messageServer->getInBox($userId, $page, $wap_perpage); //print_r($smsList);exit; !$smsCount && ($emptyListTip = "暂无任何站内信!"); $messageServer->resetStatistics(array($winduid), 'sms_num'); $pages = getPages($page, count($smsList), "{$basename}&a=ms_index&"); } elseif ($action == 'self') { $smsCount = $messageServer->countMessagesBySelf($userId, $sms_type); $smsList = $messageServer->getMessagesBySelf($userId, $sms_type, $page, $wap_perpage); $pages = getPages($page, count($smsList), "{$basename}&"); } elseif ($action == 'info') { InitGP(array('mid', 'rid', 'redirect', 'page')); empty($mid) && wap_msg("非法请求"); $_url = "index.php?a=ms_index&action={$redirect}&page={$page}"; if (!($relation = $messageServer->getRelation($userId, $rid))) { wap_msg("该条消息你无权查看", $_url); } if (!($message = $messageServer->getMessage($mid))) { wap_msg("该条消息不存在", $_url); } if ($relation['relation'] == 2) { $expand = isset($message['expand']) ? unserialize($message['expand']) : array(); $message = $messageServer->getMessage($expand['parentid']); !$message && wap_msg("该条消息不存在"); $mid = $message['mid'];
/** * @param $totalRecords how much of that shit you have? * @param $currentPage where is you now? * @param $perPage soo, how much do you want? * @param $maxPages now i reached limit of my imagination, derp * @return string */ function createLinks($totalRecords, $currentPage, $perPage, $maxPages = 4){ global $config; $pages = getPages($totalRecords, $perPage, $currentPage, $maxPages); $prevLiClass = 'prev'; $prevLinkHref = 'javascript:void(0)'; if ($currentPage == 1) { $prevLiClass = 'disabled'; } else { $prevLinkHref = buildQueryString($currentPage - 1); } $nextLiClass = 'next'; $nextLinkHref = 'javascript:void(0)'; if ($currentPage == $totalRecords) { $nextLiClass = 'disabled'; } else { $nextLinkHref = buildQueryString($currentPage + 1); } $output = '<ul class="pagination">'; $output .= '<li class="' . $prevLiClass . '"><a href="' . $prevLinkHref . '">«</a></li>'; foreach($pages as $page) { $currentClass = $page == $currentPage ? "active current " . $config['theme'] : ''; $output .= '<li class="' . $currentClass . '"><a href="' . buildQueryString($page) . '">' . $page . '</a></li>'; } $output .= '<li class="' . $nextLiClass . '"><a href="' . $nextLinkHref . '">»</a></li>'; $output .= '</ul>'; return $output; }