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


PHP Display::get方法代码示例

本文整理汇总了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();
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:34,代码来源:Update_display.php

示例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;
 }
开发者ID:reinfire,项目名称:arfooo,代码行数:47,代码来源:CategoryController.php

示例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;
 }
开发者ID:reinfire,项目名称:arfooo,代码行数:21,代码来源:MenuController.php

示例4: displayTime

 public static function displayTime($params, &$tpl)
 {
     $scriptEndTime = microtime(true);
     return "&nbsp; &nbsp; Generated in " . sprintf("%.3f", $scriptEndTime - $GLOBALS['scriptStartTime']) . " Queries: " . Display::get("queriesCount", 0);
 }
开发者ID:reinfire,项目名称:arfooo,代码行数:5,代码来源:AppTemplateLiteView.php


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