当前位置: 首页>>代码示例>>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;未经允许,请勿转载。