本文整理汇总了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');
}
示例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>";
//.........这里部分代码省略.........