本文整理汇总了PHP中getPageInfo函数的典型用法代码示例。如果您正苦于以下问题:PHP getPageInfo函数的具体用法?PHP getPageInfo怎么用?PHP getPageInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getPageInfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: displayNews
/**
* @package pragyan
* @copyright (c) 2008 Pragyan Team
* @license http://www.gnu.org/licenses/ GNU Public License
* For more details, see README
*/
function displayNews()
{
$news = <<<NEWS
\t\t<style type="text/css">
\t\ta.tickl{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;line-height:12px;text-decoration:none;color:#fff;font-weight:bold;}
\t\t.tickls{color:#666;}
\t\t</style>
\t\t<div id="newsbox" style="font-size:0.9em;position:absolute;right:45px;width:375px;top:80px;color:#fff;z-index:2;">
\t\t<div class="ticki" >
\t\t<a class="tickl" href="/08/home/news/"><span class="tickls">UPDATES</span></a>
\t\t<a id="tickerAnchor" class="tickl" target="_top" href=""></a>
\t\t</div>
\t\t</div>
\t\t<script type="text/javascript" language="JavaScript">
\t\t <!--
\t\t var theCharacterTimeout = 50;
\t\t var theStoryTimeout = 5000;
\t\t var theWidgetOne = "_";
\t\t var theWidgetTwo = "-";
\t\t var theWidgetNone = "";
\t\t var theLeadString = ": ";
\t\t var theSummaries = new Array();
\t\t var theSiteLinks = new Array();
NEWS;
global $sourceFolder;
global $moduleFolder;
global $urlRequestRoot;
global $pageIdArray;
require_once "{$sourceFolder}/{$moduleFolder}/news.lib.php";
$tmpNewsObj = new news();
$pageFullPath = "/news/";
///<Replace with path of news page
$pageId = parseUrlReal($pageFullPath, $pageIdArray);
$pageInfo = getPageInfo($pageId);
$newsArray = $tmpNewsObj->getNewsArray($pageInfo['page_modulecomponentid']);
$news .= "var theItemCount =" . sizeof($newsArray) . ";";
for ($i = 0; $i < sizeof($newsArray); $i++) {
$newsFeed = $newsArray[$i]['news_title'];
$newsFeed .= " - " . $newsArray[$i]['news_feed'];
$newsLink = $newsArray[$i]['news_link'];
// displayerror()
if (strlen($newsFeed) >= 48) {
$newsFeed = substr($newsFeed, 0, 48);
$newsFeed = substr($newsFeed, 0, strrpos($newsFeed, " "));
$newsFeed .= "...";
}
$news .= "theSummaries[{$i}] = \"{$newsFeed}\";";
if ($newsLink == "") {
$newsLink = $urlRequestRoot . $pageFullPath . "&id=" . $newsArray[$i]['news_id'];
}
$news .= "theSiteLinks[{$i}] = \"{$newsLink}\";";
}
$news .= <<<NEWS
\t\t startTicker();
\t\t //-->
\t\t</script>
NEWS;
return $news;
}
开发者ID:ksb1712,项目名称:pragyan,代码行数:65,代码来源:news.php
示例2: getNodeHtmlforPagelist
function getNodeHtmlforPagelist($pageId, $userId, $module, $action, $parentPath, $depth)
{
global $cmsFolder, $urlRequestRoot, $templateFolder;
$tempFolder = "{$urlRequestRoot}/{$cmsFolder}/{$templateFolder}";
$imagesFolder = "{$tempFolder}/common/icons/32x32";
$imagesFolder2 = "{$tempFolder}/common/images/pagethumbs";
$goimage = "{$tempFolder}/common/icons/16x16/actions/media-skip-forward.png";
if ($depth != 0) {
$htmlOut = '';
if (getPermissions($userId, $pageId, $action, $module)) {
if (isset($_POST['hell'])) {
$pageId = escape($_POST['hell']);
unset($_POST['hell']);
$htmlOut .= $this->generatePagelist($pageId, $userId, $permId, $action = '', $depth);
} else {
$pageInfo = getPageInfo($pageId);
if (isset($_POST['hell2'])) {
$pagePath = escape($_POST['hell2']);
unset($_POST['hell2']);
} else {
$pagePath = $parentPath;
if ($pageInfo['page_name'] != '') {
$pagePath .= $pageInfo['page_name'] . '/';
}
}
$pagename = $pageInfo['page_name'];
$htmlOut .= "<li><form method ='POST' action='./'><input type='image' src=\"{$goimage}\" name='pagename' alt='Go' title='Click to list pages from here'><input type='hidden' name='hell' value='{$pageId}' /><input type='hidden' name='hell2' value='{$pagePath}' /><a href=\"{$pagePath}\">";
/** **************************************************************************************************************************************************************
The following lines are for thumb images of each page listed in the page of type pagelist :
By Default: the home icon is set as default thumb image for each page. This can be changed by doing following actions:
a) Create a folder called 'pagethumbs' in folder '/cms/templates/common'
b) put all the images (size preferably 32x32 ) with the name same as the name of the page.
e.g. for a page whose name is 'hello' in table _pages the name of the image in the above said folder should be 'hello.png'
c) Add comment symbol i.e. // in front of line saying : $thumbname="$imagesFolder/actions/go-home.png"; (currently it is line 159 if not changed)
THAT'S IT
************************************************************************************************************************************************************* */
$thumbname = "{$imagesFolder}/actions/go-home.png";
$htmlOut .= "<span class='list'><img src='{$thumbname}' alt=' !sorry! '>" . getPageTitle($pageId) . "</span></a>\n</form>";
$childrenQuery = 'SELECT `page_id`, `page_displayinmenu` FROM `' . MYSQL_DATABASE_PREFIX . 'pages` WHERE `page_parentid` <> `page_id` AND `page_parentid` = ' . $pageId;
$childrenResult = mysql_query($childrenQuery);
$childrenHtml = '';
while ($childrenRow = mysql_fetch_row($childrenResult)) {
if ($childrenRow[1] == 1 && $depth != 0) {
$childrenHtml .= $this->getNodeHtmlforPagelist($childrenRow[0], $userId, $module, $action, $pagePath, $depth - 1);
}
}
if ($childrenHtml != '') {
$htmlOut .= "<ul>{$childrenHtml}</ul>\n";
}
$htmlOut .= "</li>\n";
}
}
return $htmlOut;
}
}
开发者ID:ksb1712,项目名称:pragyan,代码行数:55,代码来源:pagelist.lib.php
示例3: displayNew
function displayNew()
{
global $sourceFolder;
global $moduleFolder;
global $urlRequestRoot;
global $pageIdArray;
require_once "{$sourceFolder}/{$moduleFolder}/news.lib.php";
$tmpNewsObj = new news();
$pageFullPath = "/whatsnew/";
///<Replace with path of news page
$pageId = parseUrlReal($pageFullPath, $pageIdArray);
$pageInfo = getPageInfo($pageId);
$newsArray = $tmpNewsObj->getNewsArray($pageInfo['page_modulecomponentid']);
$newsFeed = '';
for ($i = 0; $i < sizeof($newsArray); $i++) {
$newsTitle = str_replace("'", "'", $newsArray[$i]['news_title']);
$newsBody = str_replace("'", "'", $newsArray[$i]['news_feed']);
$newsTitle = rtrim($newsTitle);
$newsBody = rtrim($newsBody);
$days = 20;
// if(time()<(strtotime($newsArray[$i]['news_date'])+($days*24*60*60))) {
// $newsBody .= '<font color="#f9dc72"><strong> NEW!</strong></font>';
// }
if ($newsArray[$i]['news_link'] == '') {
$newsFeed .= '\'<a href=/09/home/whatsnew>' . $newsTitle . ' ' . $newsBody . '</a>\',';
} else {
$newsFeed .= '\'<a href=' . $newsArray[$i]['news_link'] . '>' . $newsTitle . ' ' . $newsBody . '</a>\',';
}
}
$newsFeed = rtrim($newsFeed, ',');
/**
if (strlen($newsFeed) >= 48) {
$newsFeed = substr($newsFeed, 0, 48);
$newsFeed = substr($newsFeed, 0, strrpos($newsFeed, " "));
$newsFeed .= "...";
}
*/
$news = <<<NEWS
<script>
var pausecontent2=new Array({$newsFeed})
</script>
NEWS;
return $news;
}
开发者ID:ksb1712,项目名称:pragyan,代码行数:44,代码来源:news.kid.php
示例4: displayNews2
/**
* @package pragyan
* @copyright (c) 2008 Pragyan Team
* @license http://www.gnu.org/licenses/ GNU Public License
* For more details, see README
*/
function displayNews2()
{
global $sourceFolder;
global $moduleFolder;
global $urlRequestRoot;
global $pageIdArray;
require_once "{$sourceFolder}/{$moduleFolder}/news.lib.php";
$tmpNewsObj = new news();
$pageFullPath = "/news/";
///<Replace with path of news page
$pageId = parseUrlReal($pageFullPath, $pageIdArray);
$pageInfo = getPageInfo($pageId);
$newsArray = $tmpNewsObj->getNewsArray(0);
for ($i = 0; $i < sizeof($newsArray); $i++) {
$divopen = "<div class=\"news_style\" rel=\"{$newsArray[$i]}[news_title]\" id=\"news{$i}\">";
$heading = "<h4>{$newsArray[$i]}[news_title]</h4>";
$content = "{$newsArray[$i]}[news_feed]";
$divclose = "</div>";
$fulldiv = $divopen . $heading . $content . $divclose;
echo $fulldiv;
}
return 1;
}
开发者ID:ksb1712,项目名称:pragyan,代码行数:29,代码来源:news.kulz.php
示例5: getNodeHtml
function getNodeHtml($pageId, $userId, $module, $action, $parentPath)
{
$htmlOut = '';
if (getPermissions($userId, $pageId, $action, $module)) {
$pageInfo = getPageInfo($pageId);
$pagePath = $parentPath;
if ($pageInfo['page_name'] != '') {
$pagePath .= $pageInfo['page_name'] . '/';
}
$htmlOut .= "<li><a href=\"{$pagePath}\">" . getPageTitle($pageId) . "</a>\n";
$childrenQuery = 'SELECT `page_id` FROM `' . MYSQL_DATABASE_PREFIX . 'pages` WHERE `page_parentid` <> `page_id` AND `page_parentid` = \'' . $pageId . '\' AND `page_displayinsitemap` = 1';
$childrenResult = mysql_query($childrenQuery);
$childrenHtml = '';
while ($childrenRow = mysql_fetch_row($childrenResult)) {
$childrenHtml .= $this->getNodeHtml($childrenRow[0], $userId, $module, $action, $pagePath);
}
if ($childrenHtml != '') {
$htmlOut .= "<ul>{$childrenHtml}</ul>\n";
}
$htmlOut .= "</li>\n";
}
return $htmlOut;
}
开发者ID:nobelium,项目名称:pragyan,代码行数:23,代码来源:sitemap.lib.php
示例6: getMenu
/**
* Function getMenu
* @param userId user Id of the current user logged in.
* @param pageIdArray generate menu for the request page.
* @return HTML element of the menu. An unordered list.
**/
function getMenu($userId, $pageIdArray)
{
///This hostURL is to replace all ".(dot)s" with the current address, making the link absolute.
///@functions hostURL() common.lib.php - http://pragyan.org/11
///@functions selfURI() common.lib.php - http://pragyan.org/11/home/how_to_use/mypage/mypage2
$hostURL = ".";
$pageId = $pageIdArray[count($pageIdArray) - 1];
$hostURL = hostURL();
/// A duplicate entry just a fix for changing $hostURL.
$MYHOST = hostURL();
/// Returns an array
$pageRow = getPageInfo($pageId);
$depth = $pageRow['page_menudepth'];
/// Default depth is 1 - Should always show atleast one level of sub menu to enable navigation within site.
if ($depth == 0) {
$depth = 1;
}
if ($pageRow['page_displaymenu'] == 0) {
return '';
}
$menutype = $pageRow['page_menutype'];
$menuHtml = "";
/// Classic Menu type - No branches are displayed in this type
if ($menutype == "classic") {
$pageId = $pageIdArray[count($pageIdArray) - 1];
$depth = 1;
$hostURL = strstr(selfURI(), '+', true);
/// Get parent page details
$parentPage = getParentPage($pageId);
$parentPageRow = getPageInfo($parentPage);
$childListGenerated = getChildList($pageId, $depth, hostURL(), $userId, 1);
/// Display the sibling menu of the same depth
if ($pageRow['page_displaysiblingmenu']) {
if ($pageId != 0) {
$imageTag = "";
if ($parentPageRow['page_displayicon'] == 1 && $parentPageRow['page_image'] != NULL) {
/// Icon for the menu if present
$imageTag = "<img width=32 height=32 src=\"{$MYHOST}/{$parentPageRow['page_image']}\" alt=\"{$parentPageRow['page_image']}\" />";
}
$menuHtml .= '<a href="' . $hostURL . '../"><div class="cms-menuhead">' . $imageTag . $parentPageRow["page_title"] . '</div></a>';
$siblingMenu = getChildList($parentPage, 1, hostURL(), $userId, 1);
$menuHtml .= $siblingMenu;
}
}
/// If nothing is generated, then display atleast one item - the current Menu
if ($pageRow['page_displaysiblingmenu'] == 0 && $childListGenerated == null) {
$imageTag = "";
$pageR = getPageInfo($pageId);
if ($pageR['page_displayicon'] == 1) {
if ($pageR['page_image'] != NULL) {
$imageTag = "<img width=32 height=32 src=\"{$MYHOST}/{$pageR['page_image']}\" alt=\"{$pageR['page_image']}\" />";
}
}
$menuHtml .= <<<MENU
\t\t\t\t<ul class="topnav">
\t\t\t\t<li>
\t\t\t\t\t<a href="./"><div class="cms-menuitem">{$imageTag} {$pageRow['page_title']}</div></a>
\t\t\t\t</li>
\t\t\t\t</ul>
MENU;
}
///If the childList is generated, then display the child items
if ($childListGenerated != "") {
$imageTag = "";
if ($pageRow['page_displayicon'] == 1 && $pageRow['page_image'] != NULL) {
$imageTag = "<img width=32 height=32 src=\"{$MYHOST}/{$pageRow['page_image']}\" alt=\"{$pageRow['page_image']}\" />";
}
$menuHtml .= '<a href="' . $hostURL . '"><div class="cms-menuhead">' . $imageTag . $pageRow["page_title"] . '</div></a>';
$menuHtml .= $childListGenerated;
}
} else {
///Multi Depth Menu Code starts from here
if ($menutype == "multidepth") {
$pageId = $pageIdArray[count($pageIdArray) - 1];
} else {
$pageId = 0;
}
$rootUri = hostURL();
///Get page information through pageId
$pageRow = getPageInfo($pageId);
///Get the Children of the page.
$childListGenerated = getChildList($pageId, $depth, $rootUri, $userId, 1);
if ($childListGenerated != "") {
$menuHtml .= $childListGenerated;
} else {
$imageTag = "";
$pageR = getPageInfo($pageId);
if ($pageR['page_displayicon'] == 1) {
if ($pageR['page_image'] != NULL) {
$imageTag = "<img width=32 height=32 src=\"{$rootUri}/{$pageR['page_image']}\" alt=\"{$pageR['page_image']}\" />";
}
}
$menuHtml .= <<<MENU
\t\t\t\t<ul class="topnav">
//.........这里部分代码省略.........
开发者ID:ksb1712,项目名称:pragyan,代码行数:101,代码来源:menu.lib.php
示例7: handleIconManagement
/**
* Function handleIconManagement
* @description Returns the Icon Admin page html and handles AJAX requests for page /+admin$subaction=i
*
* @return HTML of the FORM
*/
function handleIconManagement()
{
/*
* Upload a new icon
*/
if (isset($_POST['FileUploadForm'])) {
global $userId, $sourceFolder;
require_once "{$sourceFolder}/upload.lib.php";
$allowableTypes = array('jpeg', 'jpg', 'png', 'gif');
$result = submitFileUploadForm($userId, 'iconman', $userId, false, $allowableTypes, 'iconUpload');
}
/**
* If user is setting an icon to a page, then generate an ajax response
*/
if (isset($_GET['iconURL'])) {
$rootUri = hostURL();
global $cmsFolder, $templateFolder;
if (isset($_GET["iconURL"]) && isset($_GET['targetId'])) {
///Security checks
$iconURL = $_GET["iconURL"];
$iconURL = str_replace($rootUri, "", $iconURL);
$parse = strstr($iconURL, "{$cmsFolder}/{$templateFolder}/common/icons/");
if ($parse == "") {
$parse = strstr($iconURL, "{$cmsFolder}/uploads/iconman/");
}
$iconURL = $parse;
$iconURL = escape($iconURL);
$target = escape($_GET["targetId"]);
/**
* Save the Icon in Database - The following entries are saved
* icon URL - path relative to the website installation folder on the server
*/
mysql_query("UPDATE `" . MYSQL_DATABASE_PREFIX . "pages` SET `page_image`='{$iconURL}' WHERE `page_id`='{$target}'");
$pageDetails = getPageInfo($target);
if ($pageDetails['page_image'] != NULL) {
echo "<img src=\"{$rootUri}/{$cmsFolder}/{$templateFolder}/common/icons/16x16/status/weather-clear.png\" /> ";
} else {
echo "<img src=\"{$rootUri}/{$cmsFolder}/{$templateFolder}/common/icons/16x16/status/dialog-error.png\" width=12 height=12/> ";
}
echo $pageDetails["page_name"];
} else {
if (isset($_GET['iconAction'])) {
$action = $_GET['iconAction'];
} else {
die("Restricted access");
}
}
exit(0);
}
/**
* @description Icon Management Form Generation Code Starts here
*/
$iconForm = "";
$iconForm .= <<<ICONFORM
\t\t<style type="text/css">
\t\t.myIconForm div {
\t\t\tpadding: 5px;
\t\t}
\t\t.myIconForm div a{
\t\t\ttext-decoration: none!important;
\t\t}\t
\t\t</style>
\t\t
ICONFORM;
global $cmsFolder;
global $sourceFolder;
global $templateFolder;
global $userId;
$myhostURL = hostURL();
///Ajax handler functions, drag and drop handlers defined in icon.event.handler.js
$iconForm .= "<script type=\"text/javascript\" src=\"{$myhostURL}/{$cmsFolder}/{$templateFolder}/common/scripts/icon.event.handler.js\"></script>";
$iconForm .= <<<STYLES
\t\t<style type="text/css">
\t\t.myIconForm {
\t\t\tmargin:0;
\t\t\tpadding:0;
\t\t}
\t\t#iconTreeMenu {
\t\t\tposition:relative;
\t\t}
\t\t.myIconForm ul {
\t\t\tmargin: 5px;
\t\t\twidth: 100%;
\t\t\tmargin-left: 10px;
\t\t\tpadding: 0;
\t\t\tborder-left: solid 1px #333;
\t\t}
\t\t.myFormIcon ul li a {
\t\t\tpadding: 5px;
\t\t}
\t\t.myIconList {
\t\t\theight:500px;
\t\t\toverflow:scroll;
\t\t\tmax-width:100%;
//.........这里部分代码省略.........
开发者ID:ksb1712,项目名称:pragyan,代码行数:101,代码来源:iconmanagement.lib.php
示例8: getPageInfoVersion
function getPageInfoVersion($params)
{
return getPageInfo($params);
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:4,代码来源:XmlRpcServer.php
示例9: check_authorization
case 12:
// Copy tradeskill
check_authorization();
copy_tradeskill();
$nrec = get_new_id();
header("Location: index.php?editor=tradeskill&ts={$ts}&rec={$nrec}");
exit;
case 13:
// View Learned Recipes
check_authorization();
$breadcrumbs .= " >> Learned Recipes";
$curr_page = isset($_GET['page']) ? $_GET['page'] : $default_page;
$curr_size = isset($_GET['size']) ? $_GET['size'] : $default_size;
$curr_sort = isset($_GET['sort']) ? $columns[$_GET['sort']] : $columns[$default_sort];
$body = new Template("templates/tradeskill/learned.tmpl.php");
$page_stats = getPageInfo("char_recipe_list", $curr_page, $curr_size, $_GET['sort']);
if ($page_stats['page']) {
$recipes = getLearnedRecipes($page_stats['page'], $curr_size, $curr_sort);
}
if ($recipes) {
$body->set('recipes', $recipes);
foreach ($page_stats as $key => $value) {
$body->set($key, $value);
}
} else {
$body->set('page', 0);
$body->set('pages', 0);
}
break;
case 14:
// Delete Learned Recipe
开发者ID:Xackery,项目名称:EQEmuEOC,代码行数:31,代码来源:tradeskill.php
示例10: delete_bugs
delete_bugs();
header("Location: index.php?editor=server&action=4");
exit;
case 6:
// Preview Hackers
check_admin_authorization();
$breadcrumbs .= " >> Hackers";
$javascript = new Template("templates/server/js.tmpl.php");
$curr_page = isset($_GET['page']) ? $_GET['page'] : $default_page;
$curr_size = isset($_GET['size']) ? $_GET['size'] : $default_size;
$curr_sort = isset($_GET['sort']) ? $columns1[$_GET['sort']] : $columns1[$default_sort];
if ($_GET['filter'] == 'on') {
$filter = build_filter();
}
$body = new Template("templates/server/hackers.tmpl.php");
$page_stats = getPageInfo("hackers", $curr_page, $curr_size, $_GET['sort'], $filter['sql']);
if ($filter) {
$body->set('filter', $filter);
}
if ($page_stats['page']) {
$hackers = get_hackers($page_stats['page'], $curr_size, $curr_sort, $filter['sql']);
}
if ($hackers) {
foreach ($hackers as $key => $value) {
$body->set($key, $value);
}
foreach ($page_stats as $key => $value) {
$body->set($key, $value);
}
} else {
$body->set('page', 0);
开发者ID:Akkadius,项目名称:EQEmuEOC,代码行数:31,代码来源:server.php
示例11: file_get_contents
#echo "key_page_number: ".$key_page_number."<br/>";
$template = file_get_contents("tmpl_main_new.html");
}
#echo "url_for_cache: ".$url_for_cache."<br/>";
#echo "current_page: ".$current_page."<br/>";
$template = preg_replace("/\\[URL\\]/", $site_main_domain, $template);
$template = preg_replace("/\\[URLMAIN\\]/", $site_main_domain, $template);
$template = preg_replace("/\\[HEADER_KEYS\\]/", HEADER_KEYS, $template);
//fetch regions
$con = mysqli_connect(DB_HOST, DB_USER_NAME, DB_USER_PWD, DB_NAME);
#$con=mysqli_connect("192.240.96.222:3306","vtopax","lol200","vtopax");
mysqli_query($con, "set character_set_client='utf8'");
mysqli_query($con, "set character_set_results='utf8'");
mysqli_query($con, "set collation_connection='utf8_general_ci'");
//get page info
$page_info = getPageInfo($con, $url_for_request);
#var_dump($page_info);
if ($page_info) {
$is_cached = true;
$page_title = $page_info['title'];
$page_meta_keywords = $page_info['meta_keywords'];
$page_meta_description = $page_info['meta_description'];
#echo "Page $url is CACHED."."<br/>";
}
#TODO Get random title
$title_template = "Кредиты в России, Банки России, Области, Регионы и Округи";
if ($current_page_type == "MAIN_PAGE_PAGING") {
#echo "Main page processing...";
#$result = mysqli_query($con,"SELECT k.key_value, k.key_value_latin, unix_timestamp(p.post_dt) posted_time FROM pages p, door_keys k WHERE k.id = p.key_id AND p.post_dt < now() ORDER BY post_dt DESC LIMIT 50");
//getting city news count
$query_count = " SELECT count(t.key_value) row_count " . " FROM (SELECT DISTINCT k.key_value FROM door_keys k, pages p LEFT JOIN page_content pc ON p.id=pc.page_id " . " WHERE k.id = p.key_id AND pc.post_dt < now() AND k.key_value <> '/' AND pc.page_id IS NOT NULL) as t LIMIT " . $KEY_PER_PAGE * 10;
开发者ID:VarenKoks,项目名称:fdt-page-scrapper,代码行数:31,代码来源:index.php
示例12: preg_replace
$template = preg_replace("/\\[RANDKEY\\]/e", 'trim($keys[rand(0,$max_k)])', $template);
$template = preg_replace("/\\[RANDCITY\\]/e", 'trim($city[rand(0,$max_c)])', $template);
$template = preg_replace("/\\[URL\\]/", $_SERVER["HTTP_HOST"], $template);
$template = preg_replace("/\\[URLMAIN\\]/", $_SERVER["HTTP_HOST"], $template);
$template = preg_replace("/\\[HEADER_KEYS\\]/", HEADER_KEYS, $template);
//fetch regions
$con = mysqli_connect(DB_HOST, DB_USER_NAME, DB_USER_PWD, DB_NAME);
#echo "Connecting...";
if (mysqli_connect_errno()) {
#echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_query($con, "set character_set_client='utf8'");
mysqli_query($con, "set character_set_results='utf8'");
mysqli_query($con, "set collation_connection='utf8_general_ci'");
//get page info
$page_info = getPageInfo($con, $url_for_cache);
if ($page_info) {
$is_cached = true;
$page_title = $page_info['cached_page_title'];
$page_meta_keywords = $page_info['cached_page_meta_keywords'];
$page_meta_description = $page_info['cached_page_meta_description'];
#echo "Page $url is CACHED."."<br/>";
} else {
#echo "Page $url is NOT CACHED."."<br/>";
$is_cached = false;
}
if ($current_page == "MAIN_PAGE") {
#echo "Main page processing...";
if (!$is_cached) {
$page_title = $title_generator->getRegionRandomTitle();
}
开发者ID:VarenKoks,项目名称:fdt-page-scrapper,代码行数:31,代码来源:index.php
示例13: mysqli_connect
//fetch regions
$con = mysqli_connect(DB_HOST, DB_USER_NAME, DB_USER_PWD, DB_NAME);
#echo "Connecting...";
if (mysqli_connect_errno()) {
#echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_query($con, "set character_set_client='utf8'");
mysqli_query($con, "set character_set_results='utf8'");
mysqli_query($con, "set collation_connection='utf8_general_ci'");
//get page info
if ($current_page == "REGION_PAGE" || $current_page == "REGION_PAGE_PAGING") {
$page_info = getRegionPageInfo($con, $url_region);
} elseif ($current_page == "MAIN_PAGE") {
$page_info = getMainPageInfo($con);
} else {
$page_info = getPageInfo($con, $url_city, $url_region);
}
$page_title = $page_info['title'];
$page_meta_keywords = $page_info['meta_keywords'];
$page_meta_description = $page_info['meta_description'];
if ($current_page == "MAIN_PAGE") {
#echo "Main page processing...";
$result = mysqli_query($con, "SELECT COUNT(*) as row_count FROM region");
$row = mysqli_fetch_assoc($result);
$row_count = $row['row_count'];
$reg_section_count = 4;
$reg_per_section = ($row_count - $row_count % $reg_section_count) / $reg_section_count;
$result = mysqli_query($con, "SELECT region_name, region_name_latin, region_id FROM region ORDER BY region_name");
$regions = "";
$posted = 0;
$page = 1;
开发者ID:VarenKoks,项目名称:fdt-page-scrapper,代码行数:31,代码来源:index.php
示例14: news
* @package pragyan
* @copyright (c) 2010 Pragyan Team
* @license http://www.gnu.org/licenses/ GNU Public License
* For more details, see README
*/
$newsItems = "<div style=\"display: none;\" id=\"newscontainer\">";
global $sourceFolder;
global $moduleFolder;
global $urlRequestRoot;
global $pageIdArray;
require_once "{$sourceFolder}/{$moduleFolder}/news.lib.php";
$tmpNewsObj = new news();
$pageFullPath = "/news/";
///<Replace with path of news page
$pageId = parseUrlReal($pageFullPath, $pageIdArray);
$pageInfo = getPageInfo($pageId);
$newsArray = $tmpNewsObj->getNewsArray(0);
for ($i = 0; $i < count($newsArray); $i++) {
$newstitle = $newsArray[$i]['news_title'];
$newsfeed = $newsArray[$i]['news_feed'];
$newslink = $newsArray[$i]['news_link'];
$divopen = "<div class=\"news_style\" rel=\"{$newstitle}\" id=\"news{$i}\">";
$heading = "<h4><a href='" . $newslink . "'>" . $newstitle . "</a></h4>";
$content = "{$newsfeed}";
$divclose = "</div>";
$fulldiv = $divopen . $heading . $content . $divclose;
$newsItems .= $fulldiv;
}
$newsItems .= "</div>";
/*
$newsItems = <<<NEWSITEMS
开发者ID:ksb1712,项目名称:pragyan,代码行数:31,代码来源:updates.php
示例15: adminController
function adminController($action)
{
switch ($action) {
case 910:
$pageNum = isset($_REQUEST['pageNum']) ? $_REQUEST['pageNum'] : 1;
$memberPageInfo = getPageInfo($pageNum);
$memberList = selectMemberListWithPageInfo($memberPageInfo);
$_SESSION['memberPageInfo'] = $memberPageInfo;
$_SESSION['memberList'] = $memberList;
header("location:../view/MainView.php?action={$action}");
break;
case 914:
// 데이터 수정 처리
$data['num'] = isset($_REQUEST['num']) ? $_REQUEST['num'] : a;
$data['id'] = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
$data['password'] = isset($_REQUEST['password']) ? $_REQUEST['password'] : null;
$data['name'] = isset($_REQUEST['name']) ? $_REQUEST['name'] : null;
$data['tel'] = isset($_REQUEST['tel']) ? $_REQUEST['tel'] : null;
$data['level'] = isset($_REQUEST['level']) ? $_REQUEST['level'] : null;
$result = updateMemberByNum($data);
if (!$result) {
$action = 919;
}
$action = 910;
$memberPageInfo = $_SESSION['memberPageInfo'];
$pageNum = $memberPageInfo['currentPageNum'];
header("location:./MainCTL.php?action={$action}&pageNum={$pageNum}");
//콘트롤러 재호출
break;
case 916:
//수정요구 처리
$num = $_REQUEST['num'];
$member = selectMemberByNum($num);
if (!$member) {
$action = 919;
} else {
$_SESSION['member'] = $member;
$action = 911;
//수정처리 뷰로 리다이렉트
}
header("location:../view/MainView.php?action={$action}");
break;
case 917:
// 삭제요구 처리
$num = $_REQUEST['num'];
$result = deleteMemberByNum($num);
if (!$result) {
$action = 919;
} else {
$action = 910;
}
header("location:./MainCTL.php?action={$action}&pageNum={$_REQUEST['pageNum']}");
//콘트롤러 재호출
break;
case 920:
// 상품관리 처리 액션
header("location:../view/MainView.php?action={$action}");
break;
case 930:
// 결제관리 처리 액션
header("location:../view/MainView.php?action={$action}");
break;
case 940:
// 배송관리 처리 액션
header("location:../view/MainView.php?action={$action}");
break;
case 950:
// 매출관리 처리 액션
header("location:../view/MainView.php?action={$action}");
break;
case 960:
// 게시판관리 처리 액션
header("location:../view/MainView.php?action={$action}");
break;
default:
header("location:../view/MainView.php?action={$action}");
break;
}
}
开发者ID:Eolh,项目名称:php,代码行数:79,代码来源:AdminCTL.php
示例16: intval
include_once "../model/commonMD.php";
//천자리를 제외한 백자리수를 가지고 액션 처리.
$short_num = intval($action % 9000);
$_SESSION['search'] = isset($_REQUEST['search']) ? $_REQUEST['search'] : null;
$_SESSION['search_keyword'] = isset($_REQUEST['search_keyword']) ? $_REQUEST['search_keyword'] : null;
switch ($short_num) {
case 0:
//회원관리
//회원관리
case 100:
if (!isset($_SESSION['search_keyword'])) {
$all_record_num = getMemberCount();
} elseif (isset($_SESSION['search_keyword'])) {
$all_record_num = search_getMemberCount($_SESSION['search'], $_SESSION['search_keyword']);
}
$_SESSION['PageInfo'] = getPageInfo($pageNum, $all_record_num);
if (isset($_SESSION['search_keyword'])) {
$search_val['search'] = $_SESSION['search'];
$search_val['search_keyword'] = $_SESSION['search_keyword'];
$search_val['action'] = $action;
$_SESSION['memberList'] = search_MemberPageInfo($search_val, $pageNum);
// header("location:../controller/MainCTL.php?action=$action&pageNum=$pageNum");
} else {
$_SESSION['memberList'] = MemberPageInfo($pageNum);
}
break;
// 상품관리
// 상품관리
case 200:
$all_product_limit = array(3, 5);
$all_record_num = getAllProductCount();
开发者ID:superblr,项目名称:PHP_PCshoppingmall_MVC,代码行数:31,代码来源:adminCTL.php
示例17: check_authorization
// ToDo: Create faction copy
check_authorization();
$body = new Template("templates/faction/faction.default.tmpl.php");
break;
case 9:
// View Player Factions
check_authorization();
$breadcrumbs .= " >> Player Factions";
$curr_page = isset($_GET['page']) ? $_GET['page'] : $default_page;
$curr_size = isset($_GET['size']) ? $_GET['size'] : $default_size;
$curr_sort = isset($_GET['sort']) ? $columns[$_GET['sort']] : $columns[$default_sort];
if ($_GET['filter'] == 'on') {
$filter = build_filter();
}
$body = new Template("templates/faction/faction.players.view.tmpl.php");
$page_stats = getPageInfo("faction_values", $curr_page, $curr_size, $_GET['sort'], $filter['sql']);
if ($filter) {
$body->set('filter', $filter);
}
if ($page_stats['page']) {
$player_factions = get_player_factions($page_stats['page'], $curr_size, $curr_sort, $filter['sql']);
}
if ($player_factions) {
$body->set('player_factions', $player_factions);
foreach ($page_stats as $key => $value) {
$body->set($key, $value);
}
} else {
$body->set('page', 0);
$body->set('pages', 0);
}
开发者ID:Xackery,项目名称:EQEmuEOC,代码行数:31,代码来源:faction.php
示例18: check_authorization
$body->set($key, $value);
}
} else {
$body->set('page', 0);
$body->set('pages', 0);
}
break;
case 36:
// View Completed Tasks
check_authorization();
$breadcrumbs .= " >> Completed Tasks";
$curr_page = isset($_GET['page']) ? $_GET['page'] : $default_page;
$curr_size = isset($_GET['size']) ? $_GET['size'] : $default_size;
$curr_sort = isset($_GET['sort']) ? $columns[$_GET['sort']] : $columns[$default_sort];
$body = new Template("templates/tasks/tasks.completedtasks.tmpl.php");
$page_stats = getPageInfo("completed_tasks", $curr_page, $curr_size, $_GET['sort']);
if ($page_stats['page']) {
$completed_tasks = getCompletedTasks($page_stats['page'], $curr_size, $curr_sort);
}
if ($completed_tasks) {
$body->set('completed_tasks', $completed_tasks);
foreach ($page_stats as $key => $value) {
$body->set($key, $value);
}
} else {
$body->set('page', 0);
$body->set('pages', 0);
}
break;
case 37:
// Delete Active Task
开发者ID:Xackery,项目名称:EQEmuEOC,代码行数:31,代码来源:tasks.php
示例19: getSearchbar
/**
* @param $userId The user for whom the list of permitted actions must be computed.
* @param $pageId The page on which the permissible action for the user is computed
*
* @return $searchbar The search bar for tags.
*/
function getSearchbar($userId, $pageId)
{
if (isset($_GET['searchbar']) && isset($_GET['searchContents'])) {
$_GET['searchbar'] = escape($_GET['searchbar']);
$_GET['searchContents'] = escape($_GET['searchContents']);
$allPageQuery = "SELECT `page_id`, `page_module` FROM `" . MYSQL_DATABASE_PREFIX . "pages`";
$allPageResult = mysql_query($allPageQuery);
$pagesIdList = array();
//Contains all pages for which the user has view permission
while ($row = mysql_fetch_assoc($allPageResult)) {
if (getPermissions($userId, $row['page_id'], $action = "view", $module = $row['page_module'])) {
array_push($pagesIdList, intval($row['page_id']));
}
}
$searchQueryParams = "";
foreach ($pagesIdList as $key => $value) {
$searchQueryParams .= $value . ",";
}
$searchQueryParams = substr($searchQueryParams, 0, -1);
$searchQuery = "SELECT * FROM `" . MYSQL_DATABASE_PREFIX . "pagetags` WHERE `tag_text` LIKE '%{$_GET['searchContents']}%' AND `page_id` IN (" . $searchQueryParams . ");";
$tagsWithPermsResult = mysql_query($searchQuery);
$searchResult = mysql_query($searchQuery);
$suggestions = "";
while ($row = mysql_fetch_assoc($searchResult)) {
$suggestions .= "<a href=" . hostURL() . getPagePath($row['page_id']) . ">";
$pageInfo = getPageInfo($row['page_id']);
$suggestions .= $pageInfo['page_title'] . "</a><br/>";
}
echo $suggestions;
exit(0);
}
$searchbar = <<<SEARCHSCRIPT
<script>
function showResult(searchstr) {
if (searchstr.length==0) {
document.getElementById("tagSuggestions").innerHTML="";
|
请发表评论