當前位置: 首頁>>代碼示例>>PHP>>正文


PHP gcms::sortby方法代碼示例

本文整理匯總了PHP中gcms::sortby方法的典型用法代碼示例。如果您正苦於以下問題:PHP gcms::sortby方法的具體用法?PHP gcms::sortby怎麽用?PHP gcms::sortby使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gcms的用法示例。


在下文中一共展示了gcms::sortby方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

     $search_result[$i]['category_id'] = gcms::getVars($item, 'category_id', 0);
     $search_result[$i]['topic'] = $item['topic'];
     $search_result[$i]['alias'] = $item['alias'];
     $search_result[$i]['index'] = $item['index'];
     if ($item['description'] == '') {
         $search_result[$i]['detail'] = gcms::cutstring(gcms::html2txt($item['detail']), 149);
     } else {
         $search_result[$i]['detail'] = $item['description'];
     }
     $search_result[$i]['module'] = $item['module'];
     $search_result[$i]['owner'] = $item['owner'];
     $search_result[$i]['value'] = $v * ($item['level'] + $item['index']);
 }
 if (sizeof($search_result) > 0) {
     // เรียงลำดับผลลัพท์ตาม score
     gcms::sortby($search_result, 'value', false);
     // จัดรูปแบบข้อความ
     $searchitem = gcms::loadtemplate('search', 'search', 'searchitem');
     $match = array('/{URL}/', '/{TOPIC}/', '/{DETAIL}/', '/{LINK}/');
     foreach ($search_result as $item) {
         unset($data);
         if ($item['owner'] == 'index' || $item['index'] == 1) {
             $url1 = gcms::getURL($item['module']);
             $url2 = gcms::getURL($item['module'], '', 0, 0, '', false);
         } elseif ($item['owner'] == 'board') {
             $url1 = gcms::getURL($item['module'], '', 0, 0, "wbid={$item['id']}");
             $url2 = $url1;
         } elseif ($item['owner'] == 'document') {
             if ($config['module_url'] == 1) {
                 $url1 = gcms::getURL($item['module'], $item['alias'], 0, 0, 'q=' . urlencode($search), true);
                 $url2 = gcms::getURL($item['module'], $item['alias'], 0, 0, '', false);
開發者ID:phannack,項目名稱:GCMS,代碼行數:31,代碼來源:main.php

示例2: empty

         } else {
             $datas[$k]['total'] = empty($datas[$k]['total']) ? 1 : $datas[$k]['total'] + 1;
         }
     }
 }
 if ($ip == '') {
     if ($type == 'ip') {
         // เรียงลำดับตาม ip
         gcms::sortby($datas, 'ip');
     } else {
         // เรียงลำดับตาม referer
         gcms::sortby($datas, 'referer');
     }
 } else {
     // เรียงลำดับตาม time
     gcms::sortby($datas, 'time');
 }
 $graphs['Google Search'] = 0;
 $graphs['Google Cached'] = 0;
 $graphs['Inbound'] = 0;
 $graphs['Direct'] = 0;
 $graphs['Direct'] = 0;
 $graphs['other'] = 0;
 $list = array();
 $total = 0;
 $i = 0;
 $bg = 'bg2';
 foreach ($datas as $item) {
     $i++;
     if (isset($item['total'])) {
         $total = $total + $item['total'];
開發者ID:goragod,項目名稱:php-framework-benchmark,代碼行數:31,代碼來源:report.php


注:本文中的gcms::sortby方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。