/** * @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; }
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; } }
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; }
/** * @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; }
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; }
/** * 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"> \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; } } // return the final generated HTML return $menuHtml; }
/** * 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%; \t\t} \t\t</style> STYLES; ///This contains file upload functions of CMS. Look into upload.lib.php documentation for more require_once "{$sourceFolder}/upload.lib.php"; ///Just a duplicate copy for sending it to the upload functions. $fakeid = $userId; ///get the html for upload - input tag $imageUploadField = getMultipleFileUploadField('iconUpload', 'iconman', 512 * 1024); //$iconForm .= $imageUploadField; $uploadForm = <<<FORM \t<form method="POST" action="./+admin&subaction=icon" enctype="multipart/form-data"> \t{$imageUploadField} \t<input type="submit" /> \t</form> \t FORM; ///Display Icons $iconForm .= "<table class=\"myIconForm\"><tr><td id=\"iconTreeMenu\">"; ///Fetch the site's complete tree structure of pages. ///The elements here are the ones on which icons are dropped. $iconForm .= getTreeView(0, -1, $myhostURL, $userId, 1); $iconForm .= "</td>"; $iconForm .= "<td>"; ///Fetch Icon file list and get as html $selectionList = getIconList(); ///Gather the html and append the iconform html $iconForm .= <<<SELECTION \t\t<div class="selection" id="targetIcon"> \t\t\t<h3>Upload new icons</h3> \t\t\t\t<p align="left"> \t\t\t\t\t{$uploadForm}<br/> \t\t\t\t\t- Select Multiple files \t\t\t\t</p> \t\t\t<h3>List of available icons</h3> \t\t\t<p align="left"> \t\t\t\tUsage : <br /> \t\t\t\t- Drag and drop<br /> \t\t\t\t- Select an icon and then choose the target. \t\t\t\t</p> \t\t\t<div class="selectlist"> \t\t\t\t{$selectionList} \t\t\t</div> \t\t</div> SELECTION; $iconForm .= "</td>"; $iconForm .= "</tr></table>"; return $iconForm; }
function getPageInfoVersion($params) { return getPageInfo($params); }
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
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);
#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;
$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(); }
//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;
* @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
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; } }
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();
// 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); }
$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
/** * @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=""; document.getElementById("tagSuggestions").style.border="0px"; return; } if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { if(xmlhttp.responseText != "") { console.log(xmlhttp.responseText); document.getElementById("tagSuggestions").innerHTML=xmlhttp.responseText; document.getElementById("tagSuggestions").style.border="1px solid #A5ACB2"; } else { document.getElementById("tagSuggestions").innerHTML=""; document.getElementById("tagSuggestions").style.border="0px"; } } } xmlhttp.open("GET","./&searchbar=1&searchContents="+searchstr,true); xmlhttp.send(); } </script> SEARCHSCRIPT; $searchbar .= "<div id='cms-searchbar'>"; $searchbar .= "<input type='text' size='30' onkeyup='showResult(this.value)'>"; $searchbar .= "<div id='tagSuggestions'></div>"; $searchbar .= "</div>"; return $searchbar; }
{ echo "Failed to connect to MySQL: " . mysqli_connect_error(); }*/ //получаем кол-во новостей на один регион //получаем необходимые параметры из базы list($region_count, $city_count, $extra_key_count) = getTablesRecordCount($con); echo "region_count: " . $region_count . "<br/>"; echo "city_count: " . $city_count . "<br/>"; echo "extra_key_count: " . $extra_key_count . "<br/>"; $news_count_for_posting = $region_count * $news_per_region; echo "news_count_for_posting: " . $news_count_for_posting . "<br/>"; //получаем список всех новостей, у которых время постинга больше текущего времени на 5 мин $news_for_posting_array = getNewsIdForPostingArray($con, $news_count_for_posting); echo var_dump($news_for_posting_array); $server_name = $argv[1]; for ($i = 0; $i < count($news_for_posting_array); $i++) { postNews($con, $news_for_posting_array[$i]); $result_array = getPageInfo($con, $news_for_posting_array[$i]); $href = "/" . str_replace(" ", "-", $result_array["region_name_latin"]) . "/" . str_replace(" ", "-", $result_array["city_page_key"]) . ".html"; $url = "http://" . $server_name . $href; $ch = curl_init(); curl_setopt($ch, CURLOPT_TIMEOUT, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_exec($ch); echo "curl_exec executed..." . "<br/>"; curl_close($ch); echo $url . "<br/>"; } //случайно выбараем mysqli_close($con); unset($con);
$body = new Template("templates/account/account.tmpl.php"); $body->set('acctid', $acctid); $body->set('yesno', $yesno); $body->set('acctname', getAccountName($acctid)); $vars = account_info(); if ($vars) { foreach ($vars as $key => $value) { $body->set($key, $value); } } } else { $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/account/account.default.tmpl.php"); $page_stats = getPageInfo("account", $curr_page, $curr_size, $_GET['sort']); if ($page_stats['page']) { $accounts = get_accounts($page_stats['page'], $curr_size, $curr_sort); } if ($accounts) { $body->set('accounts', $accounts); foreach ($page_stats as $key => $value) { $body->set($key, $value); } } else { $body->set('page', 0); $body->set('pages', 0); } } break; case 1:
function getYoukuUrl($id, $count, $movieid, $type_id, $pid) { global $db; if ($type_id === "3") { $count = "100&orderby=videoseq-desc"; } else { if ($type_id === "1") { $count = 1; } else { if ($count > 100) { $count = 100; } } } $url = replaceStr(VIDEOS, "{id}", $id); $url = replaceStr($url, "{count}", $count); $urlContent = getPageInfo($url); $webUrls = $urlContent->videos; foreach ($webUrls as $webUrlItem) { $contentObject = ContentProviderFactory::getContentProvider("youku"); $androidUrl = $contentObject->parseAndroidVideoUrl($webUrlItem->link, "", ""); $videoAddressUrl = $contentObject->parseIOSVideoUrl($webUrlItem->link, "", ""); if ($type_id === "3") { $name = $webUrlItem->stage . $webUrlItem->title; } else { $name = $webUrlItem->stage; } $sql = "SELECT {pre}cj_vod_url.u_id FROM ({pre}cj_vod_url INNER JOIN {pre}cj_vod ON {pre}cj_vod_url.u_movieid = {pre}cj_vod.m_id) where {pre}cj_vod_url.name='" . $name . "' and {pre}cj_vod.m_pid=" . $pid . " and {pre}cj_vod.m_id=" . $movieid; $rowurl = $db->getRow($sql); if (empty($rowurl)) { $db->query("insert into {pre}cj_vod_url(u_movieid,u_weburl,iso_video_url,name,android_vedio_url) values('" . $movieid . "','" . $webUrlItem->link . "','" . $videoAddressUrl . "','" . $name . "' ,'" . $androidUrl . "' )"); } } }
<?php //정말 관리자모드로 진입할 때 include_once "../model/ProductMD.php"; $short_num = intval($action % 9000); switch ($short_num) { case 0: //회원관리 //회원관리 case 100: $_SESSION['PageInfo'] = getPageInfo($pageNum); $_SESSION['memberList'] = selectMemberListWithPageInfo($pageNum); break; // 상품관리 // 상품관리 case 200: $all_product_limit = array(10, 5); $all_record_num = getAllProductCount(); $_SESSION['PageInfo'] = productPageInfo($pageNum, $all_record_num, $all_product_limit[0], $all_product_limit[1]); $_SESSION['productlist'] = all_product_selecting($_SESSION['PageInfo']); break; case 210: break; // 구매관리 // 구매관리 case 300: # code... break; // 결제관리 // 결제관리 case 400:
$body->set('langtypes', $langtypes); $body->set('player_name', getPlayerName($playerid)); $body->set('deities', $deities); $body->set('anonymity', $anonymity); $vars = player_info(); if ($vars) { foreach ($vars as $key => $value) { $body->set($key, $value); } } } else { $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/player/player.default.tmpl.php"); $page_stats = getPageInfo("character_data", $curr_page, $curr_size, $_GET['sort']); if ($page_stats['page']) { $players = get_players($page_stats['page'], $curr_size, $curr_sort); } if ($players) { $body->set('players', $players); $body->set('classes', $classes); foreach ($page_stats as $key => $value) { $body->set($key, $value); } } else { $body->set('page', 0); $body->set('pages', 0); } } break;
function copyPage($userId, $pageId, $parentId, $pagetitle, $pagename, $recursive) { if (!getPermissions($userId, $parentId, "settings")) { return false; } $parentInfo = getPageInfo($parentId); $parentmoduleType = $parentInfo['page_module']; if ($parentmoduleType == "link") { return false; } $pageInfo = getPageInfo($pageId); $moduleType = $pageInfo['page_module']; if ($moduleType == "link") { return false; } $newmodulecomponentid = 0; if ($moduleType != "menu" && $moduleType != "external") { global $sourceFolder; global $moduleFolder; require_once $sourceFolder . "/" . $moduleFolder . "/" . $moduleType . ".lib.php"; $page = new $moduleType(); $newmodulecomponentid = createInstance($moduleType); copyInstance($moduleType, $pageInfo['page_modulecomponentid'], $newmodulecomponentid); $page->copyModule($pageInfo['page_modulecomponentid'], $newId); } if ($moduleType == "external") { $extquery = "SELECT MAX( page_modulecomponentid ) AS MAX FROM " . MYSQL_DATABASE_PREFIX . "external"; $extqueryresult = mysql_query($extquery); $extqueryrow = mysql_fetch_array($extqueryresult); $extpageid = $extqueryrow[0] + 1; $linkquery = "SELECT page_extlink FROM " . MYSQL_DATABASE_PREFIX . "external WHERE page_modulecomponentid='" . $pageInfo['page_modulecomponentid'] . "'"; $linkqueryresult = mysql_query($linkquery); $linkqueryrow = mysql_fetch_array($linkqueryresult); $link = $linkqueryrow[0]; $query = "INSERT INTO `" . MYSQL_DATABASE_PREFIX . "external` (`page_modulecomponentid`,`page_extlink`) " . "VALUES('{$extpageid}','{$link}')"; if (!($result = mysql_query($query))) { displayerror("Unable to copy the page."); return false; } } $maxquery = "SELECT MAX( page_id ) AS MAX FROM " . MYSQL_DATABASE_PREFIX . "pages"; $maxqueryresult = mysql_query($maxquery); $maxqueryrow = mysql_fetch_array($maxqueryresult); $maxpageid = $maxqueryrow[0] + 1; $query = "INSERT INTO `" . MYSQL_DATABASE_PREFIX . "pages` (`page_id`,`page_name`,`page_title`,`page_parentid`,`page_module`,`page_modulecomponentid`,`page_displayinmenu`, `page_displaymenu`, `page_displaysiblingmenu`,`page_menurank`) " . "VALUES('{$maxpageid}','{$pagename}','{$pagetitle}','{$parentId}','{$pageInfo['page_module']}','{$newmodulecomponentid}','{$pageInfo['page_displayinmenu']}','{$pageInfo['page_displaymenu']}','{$pageInfo['page_displaysiblingmenu']}','{$maxpageid}')"; if (!($result = mysql_query($query))) { displayerror("Unable to copy the page."); return false; } if ($recursive) { $childrenquery = "SELECT `page_id`,`page_name`,`page_title` FROM `" . MYSQL_DATABASE_PREFIX . "pages` WHERE `page_parentid`='{$pageId}' "; $childrenresult = mysql_query($childrenquery); while ($temp = mysql_fetch_assoc($childrenresult)) { copyPage($userId, $temp['page_id'], $maxpageid, $temp['page_title'], $temp['page_name'], $recursive); } } return true; }
$member[6] = isset($_REQUEST['address']) ? $_REQUEST['address'] : false; $member[7] = isset($_REQUEST['movie']) ? 'O' : 'X'; $member[8] = isset($_REQUEST['book']) ? 'O' : 'X'; $member[9] = isset($_REQUEST['shop']) ? 'O' : 'X'; $member[10] = isset($_REQUEST['sport']) ? 'O' : 'X'; $member[11] = isset($_REQUEST['intro']) ? $_REQUEST['intro'] : 'null'; $result = joining($member); if ($result) { //성공뷰 $action = 920; header("location:../MainCTL.php?action={$action}"); } // else{$action=913;}//실패뷰 } elseif ($action == 912) { $action = 913; $_SESSION['login_id'] = $_REQUEST['login_id']; $_SESSION['login_passwd'] = $_REQUEST['login_passwd']; header("location:../MainCTL.php?action={$action}"); } elseif ($action == 913) { $login_id = isset($_REQUEST['login_id']) ? $_REQUEST['login_id'] : false; $login_passwd = isset($_REQUEST['login_passwd']) ? $_REQUEST['login_passwd'] : false; $_SESSION['user'] = logining($login_id, $login_passwd); } elseif ($action == 920 || $action == 900) { $_SESSION['memberPageInfo'] = getPageInfo($pageNum); $_SESSION['memberList'] = selectMemberListWithPageInfo($pageNum); } else { } header("location:../view/MainView.php?action={$action}"); ?>
check_authorization(); add_emote(); $emoteid = $_POST['emoteid']; header("Location: index.php?editor=npc&z={$z}&zoneid={$zoneid}&npcid={$npcid}&emoteid={$emoteid}&action=72"); exit; case 78: // View emote list $breadcrumbs .= " >> <a href='index.php?editor=npc&action=78'>Emotes</a>"; $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/npc/emotes.list.tmpl.php"); $page_stats = getPageInfo("npc_emotes", $curr_page, $curr_size, $_GET['sort'], $filter['sql']); if ($filter) { $body->set('filter', $filter); } if ($page_stats['page']) { $emotes = list_emotes($page_stats['page'], $curr_size, $curr_sort, $filter['sql']); } if ($emotes) { $body->set('emotes', $emotes); foreach ($page_stats as $key => $value) { $body->set($key, $value); } } else { $body->set('page', 0); $body->set('pages', 0); }
if (is_numeric($getUSSD->getMessage())) { if ($getUSSD->getMessage() == "000") { $responseExitMsg = "Exit Program!"; session_destroy(); } else { $num = (int) $getUSSD->getMessage(); $data = json_decode(getSessionInfo($sessionId, $address), true); showView($USSDSessionID, getLyrics($data[$num]['track_id'], $API), $INFO); //deleteSessionInfo($sessionId); } } else { if ($getUSSD->getMessage() == 'P') { showView($USSDSessionID, getTracks(getContentInfo($sessionId, $address), $sessionId, $address, getPageInfo($sessionId, $address) - 1, $API), $INFO); } else { if ($getUSSD->getMessage() == 'N') { showView($USSDSessionID, getTracks(getContentInfo($sessionId, $address), $sessionId, $address, getPageInfo($sessionId, $address) + 1, $API), $INFO); } else { showView($USSDSessionID, getTracks($content, $sessionId, $address, 1, $API), $INFO); } } } } function getTracks($content, $sessionId, $address, $pagenum = 1, $API) { $query = "http://api.musixmatch.com/ws/1.1/track.search?apikey={$API}&q=" . $content . "&page_size=10&f_has_lyrics=1&page=" . $pagenum; $jdata = file_get_contents($query); $data = json_decode($jdata, true); $result = ""; $i = 1; $tem = ""; foreach ($data["message"]["body"]["track_list"] as $t) {
$default_page = 1; $default_size = 50; $default_sort = 1; $columns = array(1 => 'name', 2 => 'charid', 3 => 'npcid', 4 => 'zoneid'); switch ($action) { case 0: // View QGlobals check_authorization(); $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/qglobal/qglobal.tmpl.php"); $page_stats = getPageInfo("quest_globals", $curr_page, $curr_size, $_GET['sort'], $filter['sql']); if ($filter) { $body->set('filter', $filter); } if ($page_stats['page']) { $qglobals = get_qglobals($page_stats['page'], $curr_size, $curr_sort, $filter['sql']); } if ($qglobals) { $body->set('qglobals', $qglobals); foreach ($page_stats as $key => $value) { $body->set($key, $value); } } else { $body->set('page', 0); $body->set('pages', 0); }