本文整理汇总了PHP中Display::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Display::get方法的具体用法?PHP Display::get怎么用?PHP Display::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Display
的用法示例。
在下文中一共展示了Display::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
function get()
{
$profile_uid = intval($_GET['p']);
if (!$profile_uid) {
$profile_uid = -1;
}
$load = argc() > 1 && argv(1) == 'load' ? 1 : 0;
header("Content-type: text/html");
echo "<!DOCTYPE html><html><body>\r\n";
echo $_GET['msie'] == 1 ? '<div>' : '<section>';
$mod = new Display();
$text = $mod->get($profile_uid, $load);
$pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
$replace = "<img\${1} dst=\"\${2}\"";
// $text = preg_replace($pattern, $replace, $text);
/*
if(! $load) {
$replace = '<br />' . t('[Embedded content - reload page to view]') . '<br />';
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
$text = preg_replace($pattern, $replace, $text);
}
*/
echo str_replace("\t", ' ', $text);
echo $_GET['msie'] == 1 ? '</div>' : '</section>';
echo "</body></html>\r\n";
// logger('update_display: ' . $text);
killme();
}
示例2: listAction
function listAction()
{
//get category to display set by /site/category
$parentCategoryId = Display::get("currentCategoryId", 0);
$cache = Cacher::getInstance();
$cacheItemName = "categoryMiddleHtml" . $parentCategoryId . Config::get("language") . "Template" . Config::get("templateName");
//check that cached version exists
if (($categoriesMiddleHtml = $cache->load($cacheItemName, false)) === null) {
//retrieve all categories which have this $parentCategoryId alphabetically
$c = new Criteria();
$c->addOrder("position, name");
$c->add("parentCategoryId", $parentCategoryId);
//create assoctiation array with keys = categoryId and values category data
$categoriesList = $this->category->getArray($c, "parentCategoryId, name, urlName, imageSrc, validatedSitesCount", null, true);
//if exists some categories having this parent
if (!empty($categoriesList)) {
//get count of category subcategories
$maxSubcategoriesCount = Config::get("countOfSubcategoriesUnderCategory");
if ($maxSubcategoriesCount) {
//retrieve subcategories which have categories on this page
$c = new Criteria();
$c->addOrder("position, name");
$c->add("parentCategoryId", array_keys($categoriesList), "IN");
$subcategories = $this->category->findAll($c);
//foreach category create subcategories container
foreach ($categoriesList as $key => $category) {
$categoriesList[$key]['subcategories'] = array();
}
//foreach subcategories add it to parent category
foreach ($subcategories as $subcategory) {
$parentCategory =& $categoriesList[$subcategory['parentCategoryId']];
//check that $maxSubcategoriesCount isn't reached
if (count($parentCategory['subcategories']) < $maxSubcategoriesCount) {
$parentCategory['subcategories'][] = $subcategory;
}
}
}
//create standard array to be able create 2 columns table (much be indexed i, i+1)
$categoriesList = array_values($categoriesList);
}
$this->set("categoriesList", $categoriesList);
$categoriesMiddleHtml = $this->render();
//store categories with subcategories on this page to cache
$cache->save($categoriesMiddleHtml, $cacheItemName, false, array("category", "site"));
}
return $categoriesMiddleHtml;
}
示例3: displayCategoriesAction
/**
* Display left menu categories
*/
function displayCategoriesAction()
{
//get category to display set in /site/category
$parentId = Display::get("currentCategoryId", 0);
$cacheItemName = "categoryMenuHtml" . $parentId . Config::get("language") . "Template" . Config::get("templateName");
//check is this menu was cached before
$cache = Cacher::getInstance();
if (($categoriesHtml = $cache->load($cacheItemName, false)) === null) {
$c = new Criteria();
$c->addOrder('position, name');
$categories = $this->category->getChilds($parentId, false, $c);
$this->set("categories", $categories);
$this->viewFile = "menuleft/categories";
$categoriesHtml = $this->render();
$cache->save($categoriesHtml, $cacheItemName, false, array("category"));
}
return $categoriesHtml;
}
示例4: displayTime
public static function displayTime($params, &$tpl)
{
$scriptEndTime = microtime(true);
return " Generated in " . sprintf("%.3f", $scriptEndTime - $GLOBALS['scriptStartTime']) . " Queries: " . Display::get("queriesCount", 0);
}