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


PHP Func::getCurrentURL方法代碼示例

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


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

示例1: header

    if (!$item) {
        header("Location: /html/404.html?005");
        exit;
    }
    $sku['iteminfo'] = $item;
    $sku_code = $sku['sku'];
    $pics = ProductsPic::getSkuPics($sku_code, 'path', 'sort DESC LIMIT 0,3');
    $sku['pics'] = $pics;
    $sku['order_num'] = OrdersProducts::getSkuAllNum($sku_code);
    $sku['stock'] = ProductsStock::getSkuStock($sku_code);
    $skus = ProductsSku::getItemSkus($item_code, "id,sku,sku_name");
    $skus = ProductsSku::getProductsPic($skus);
    $sku['skus'] = $skus;
    $userid = isset($_SESSION['userid']) ? (int) $_SESSION['userid'] : 0;
    $history = array();
    if ($userid) {
        $history = UsersHistory::getProductViewLog($userid, $id);
    }
    if (!$history) {
        $history = ProductsSku::getRand($item_code);
    }
    $history = ProductsSku::getProductsPic($history);
    $history = ProductsSku::getProductsItemTitle($history);
    ProductsSku::increase("id={$id}", 'view_num');
    $log = array('op' => 'view', 'id' => $id, 'url' => Func::getCurrentURL());
    $log = json_encode($log);
    UsersHistory::addLog($userid, ProductsSku::$module_id, $log);
    Templates::Assign('history', $history);
    Templates::Assign('sku', $sku);
    Templates::Display('product.html');
}
開發者ID:isonz,項目名稱:fxptpcn,代碼行數:31,代碼來源:product.php

示例2: pagedShow

 public static function pagedShow($shownum = 9, $is_arr = false)
 {
     $total = self::$_total;
     $page = self::$_page;
     $page_size = self::$_page_siez;
     $total_page = self::$_total_page;
     $pre_page = $page - 1;
     $next = $page + 1;
     if ($pre_page < 1) {
         $pre_page = 1;
     }
     if ($next > $total_page) {
         $next = $total_page;
     }
     $shownum = (int) $shownum;
     if ($total_page < 1) {
         $total_page = 1;
     }
     if ($page < 1) {
         $page = 1;
     }
     if ($page > $total_page) {
         $page = $total_page;
     }
     if ($page_size < 1) {
         $page_size = 1;
     }
     if ($shownum < 3) {
         $shownum = 3;
     }
     if ($shownum > $total_page) {
         $shownum = $total_page;
     }
     //-------url
     $cururl = Func::getCurrentURL();
     $pos = strpos($cururl, '?');
     if (!$pos) {
         $cururl = $cururl . '?';
     } else {
         $urlpas = explode('?', $cururl);
         if (isset($urlpas[1])) {
             $cururl = $urlpas[1];
         }
         $urlpara = Func::convertUrlQuery($cururl);
         if (isset($urlpara['page'])) {
             unset($urlpara['page']);
         }
         if (isset($urlpara['pagesize'])) {
             unset($urlpara['pagesize']);
         }
         if (count($urlpara) >= 1) {
             $cururl = Func::getUrlQuery($urlpara);
             if (isset($urlpas[1])) {
                 $cururl = $urlpas[0] . "?" . $cururl . '&';
             }
         } else {
             $cururl = '';
             if (isset($urlpas[1])) {
                 $cururl = $urlpas[0] . "?" . $cururl;
             }
         }
     }
     //------ end url
     $arr[] = array();
     $active = '';
     $paging = '<style>#paged{margin:30px 0; text-align:center;}#paged ul{margin:10px auto; text-align:center;}';
     $paging .= '#paged ul li{margin:10px; height:42px; width:42px; display:inline-block; float:none;}';
     $paging .= '#paged ul li a{display:block; line-height:40px; border: 1px #ccc solid;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}';
     $paging .= '#paged ul li a:hover,#paged ul li a.active{background:#4ba746; color:#FFF;}</style>';
     $paging .= '<ul class="clearfix">';
     if ($total_page <= $shownum) {
         for ($i = 1; $i <= $shownum; $i++) {
             $arr[] = $i;
             if ($page == $i) {
                 $active = ' class="active"';
             } else {
                 $active = '';
             }
             $paging .= "<li><a href='" . $cururl . "page={$i}&pagesize={$page_size}'{$active}>{$i}</a></li>";
         }
     } else {
         if ($page <= ceil($shownum / 2) && $total_page > $shownum) {
             for ($i = 1; $i <= $shownum; $i++) {
                 $arr[] = $i;
                 if ($page == $i) {
                     $active = ' class="active"';
                 } else {
                     $active = '';
                 }
                 $paging .= "<li><a href='" . $cururl . "page={$i}&pagesize={$page_size}'{$active}>{$i}</a></li>";
             }
             $arr[] = ">>";
             $paging .= "<li><a href='" . $cururl . "page=" . ($total_page - 1) . "&pagesize={$page_size}'>>></a></li>";
             $arr[] = $total_page;
             if ($page == $total_page) {
                 $active = ' class="active"';
             } else {
                 $active = '';
             }
             $paging .= "<li><a href='" . $cururl . "page={$total_page}&pagesize={$page_size}'{$active}>{$total_page}</a></li>";
//.........這裏部分代碼省略.........
開發者ID:isonz,項目名稱:fxptpcn,代碼行數:101,代碼來源:Paging.class.php


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