本文整理汇总了PHP中parse_url_tag函数的典型用法代码示例。如果您正苦于以下问题:PHP parse_url_tag函数的具体用法?PHP parse_url_tag怎么用?PHP parse_url_tag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parse_url_tag函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init_nav_list
function init_nav_list($nav_list)
{
$u_param = "";
foreach ($_GET as $k => $v) {
if (strtolower($k) != "ctl" && strtolower($k) != "act") {
$u_param .= $k . "=" . $v . "&";
}
}
if (substr($u_param, -1, 1) == '&') {
$u_param = substr($u_param, 0, -1);
}
foreach ($nav_list as $k => $v) {
if ($v['url'] == '') {
if ($v['u_module'] == "") {
$v['u_module'] = "index";
}
if ($v['u_action'] == "") {
$v['u_action'] = "index";
}
$route = $v['u_module'];
if ($v['u_action'] != '') {
$route .= "#" . $v['u_action'];
}
$str = "u:" . $route . "|" . $v['u_param'];
$nav_list[$k]['url'] = parse_url_tag($str);
if (ACTION_NAME == $v['u_action'] && MODULE_NAME == $v['u_module'] && $v['u_param'] == $u_param) {
$nav_list[$k]['current'] = 1;
}
}
}
return $nav_list;
}
示例2: index
public function index()
{
if (!$GLOBALS['user_info']) {
app_redirect(url("user#login"));
}
$all = intval($_REQUEST['all']);
$page_size = 20;
$page = intval($_REQUEST['p']);
if ($page == 0) {
$page = 1;
}
$limit = ($page - 1) * $page_size . "," . $page_size;
if ($all == 0) {
$cond = " and is_read = 0 ";
} else {
$cond = " and 1=1 ";
}
$GLOBALS['tmpl']->assign("all", $all);
$sql = "select * from " . DB_PREFIX . "user_notify where user_id = " . intval($GLOBALS['user_info']['id']) . " {$cond} order by log_time desc limit " . $limit;
$sql_count = "select count(*) from " . DB_PREFIX . "user_notify where user_id = " . intval($GLOBALS['user_info']['id']) . " {$cond} ";
$notify_list = $GLOBALS['db']->getAll($sql);
$notify_count = $GLOBALS['db']->getOne($sql_count);
foreach ($notify_list as $k => $v) {
$notify_list[$k]['url'] = parse_url_tag("u:" . $v['url_route'] . "|" . $v['url_param']);
}
$GLOBALS['tmpl']->assign("notify_list", $notify_list);
require APP_ROOT_PATH . 'app/Lib/page.php';
$page = new Page($notify_count, $page_size);
//初始化分页对象
$p = $page->show();
$GLOBALS['tmpl']->assign('pages', $p);
$GLOBALS['tmpl']->display("notify.html");
}
示例3: get_article_list
/**
* 获取文章列表
*/
function get_article_list($limit, $cate_id = 0, $where = '', $orderby = '', $cached = true)
{
$key = md5("ARTICLE" . $limit . $cate_id . $where . $orderby);
if ($cached) {
$res = $GLOBALS['cache']->get($key);
} else {
$res = false;
}
if ($res === false) {
$count_sql = "select count(*) from " . DB_PREFIX . "article as a left join " . DB_PREFIX . "article_cate as ac on a.cate_id = ac.id where a.is_effect = 1 and a.is_delete = 0 and ac.is_delete = 0 and ac.is_effect = 1 ";
$sql = "select a.*,ac.type_id,ac.title as ctitle from " . DB_PREFIX . "article as a left join " . DB_PREFIX . "article_cate as ac on a.cate_id = ac.id where a.is_effect = 1 and a.is_delete = 0 and ac.is_delete = 0 and ac.is_effect = 1 ";
if ($cate_id > 0) {
$ids = load_auto_cache("deal_shop_acate_belone_ids", array("cate_id" => $cate_id));
$sql .= " and a.cate_id in (" . implode(",", $ids) . ")";
$count_sql .= " and a.cate_id in (" . implode(",", $ids) . ")";
}
if ($where != '') {
$sql .= " and " . $where;
$count_sql .= " and " . $where;
}
if ($orderby == '') {
$sql .= " order by a.sort desc limit " . $limit;
} else {
$sql .= " order by " . $orderby . " limit " . $limit;
}
$articles = $GLOBALS['db']->getAll($sql);
foreach ($articles as $k => $v) {
if ($v['type_id'] == 1) {
$module = "help";
} elseif ($v['type_id'] == 2) {
$module = "notice";
} elseif ($v['type_id'] == 3) {
$module = "sys";
} else {
$module = 'article';
}
if ($v['rel_url'] != '') {
if (!preg_match("/http:\\/\\//i", $v['rel_url'])) {
if (substr($v['rel_url'], 0, 2) == 'u:') {
$aurl = parse_url_tag($v['rel_url']);
} else {
$aurl = APP_ROOT . "/" . $v['rel_url'];
}
} else {
$aurl = $v['rel_url'];
}
} else {
$aurl = url("index", $module . "#" . $v['id']);
}
$articles[$k]['url'] = $aurl;
}
$articles_count = $GLOBALS['db']->getOne($count_sql);
$res = array('list' => $articles, 'count' => $articles_count);
$GLOBALS['cache']->set($key, $res);
}
return $res;
}
示例4: index
public function index()
{
global_run();
init_app_page();
$GLOBALS['tmpl']->assign("no_nav", true);
//无分类下拉
$GLOBALS['tmpl']->caching = true;
$cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['act']));
if (!$GLOBALS['tmpl']->is_cached('notice_index.html', $cache_id)) {
$site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index", "index"));
$site_nav[] = array('name' => $GLOBALS['lang']['SITE_NOTICE_LIST'], 'url' => url("index", "news"));
$GLOBALS['tmpl']->assign("site_nav", $site_nav);
$id = intval($_REQUEST['act']);
if ($id == 0) {
app_redirect(url("index", "news"));
}
$article = $GLOBALS['db']->getRow("select a.*,ac.type_id from " . DB_PREFIX . "article as a left join " . DB_PREFIX . "article_cate as ac on a.cate_id = ac.id where a.id = " . $id . " and a.is_effect = 1 and a.is_delete = 0");
$cate_tree = get_acate_tree('', 2, "news");
$GLOBALS['tmpl']->assign("acate_tree", $cate_tree);
if (!$article || $article['type_id'] != 2) {
app_redirect(APP_ROOT . "/");
} else {
if ($article['rel_url'] != '') {
if (!preg_match("/http:\\/\\//i", $article['rel_url'])) {
if (substr($article['rel_url'], 0, 2) == 'u:') {
app_redirect(parse_url_tag($article['rel_url']));
} else {
app_redirect(APP_ROOT . "/" . $article['rel_url']);
}
} else {
app_redirect($article['rel_url']);
}
}
}
$GLOBALS['tmpl']->assign("article", $article);
$GLOBALS['tmpl']->assign("cur_id", $article['cate_id']);
$GLOBALS['tmpl']->assign("cur_title", $GLOBALS['lang']['SITE_NOTICE_LIST']);
$seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title'];
$GLOBALS['tmpl']->assign("page_title", $seo_title);
$seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title'];
$GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",");
$seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title'];
$GLOBALS['tmpl']->assign("page_description", $seo_description . ",");
}
$GLOBALS['tmpl']->display("notice_index.html", $cache_id);
}
示例5: load
public function load($param)
{
$param = array();
$key = $this->build_key(__CLASS__, $param);
$GLOBALS['cache']->set_dir(APP_ROOT_PATH . "public/runtime/data/" . __CLASS__ . "/");
$help_list = $GLOBALS['cache']->get($key);
if ($help_list === false) {
$ids_util = new ChildIds("article_cate");
$help_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "article_cate where type_id = 1 and is_delete = 0 and pid=0 order by sort desc limit " . intval(app_conf("HELP_CATE_LIMIT")));
foreach ($help_list as $k => $v) {
$ids = $GLOBALS['cache']->get("CACHE_HELP_ARTICLE_CATE_" . $v['id']);
if ($ids === false) {
$ids = $ids_util->getChildIds($v['id']);
$ids[] = $v['id'];
$GLOBALS['cache']->set("CACHE_HELP_ARTICLE_CATE_" . $v['id'], $ids);
}
$help_cate_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "article where cate_id in (" . implode(",", $ids) . ") and is_delete = 0 order by sort desc limit " . intval(app_conf("HELP_ITEM_LIMIT")));
foreach ($help_cate_list as $kk => $vv) {
if ($vv['rel_url'] != '') {
if (!preg_match("/http:\\/\\//i", $vv['rel_url'])) {
if (substr($vv['rel_url'], 0, 2) == 'u:') {
$help_cate_list[$kk]['url'] = parse_url_tag($vv['rel_url']);
} else {
$help_cate_list[$kk]['url'] = APP_ROOT . "/" . $vv['rel_url'];
}
} else {
$help_cate_list[$kk]['url'] = $vv['rel_url'];
}
$help_cate_list[$kk]['new'] = 1;
} else {
if ($vv['uname'] != '') {
$hurl = url("index", "help#" . $vv['uname']);
} else {
$hurl = url("index", "help#" . $vv['id']);
}
$help_cate_list[$kk]['url'] = $hurl;
}
}
$help_list[$k]['help_list'] = $help_cate_list;
}
$GLOBALS['cache']->set_dir(APP_ROOT_PATH . "public/runtime/data/" . __CLASS__ . "/");
$GLOBALS['cache']->set($key, $help_list);
}
return $help_list;
}
示例6: index
public function index()
{
$GLOBALS['tmpl']->caching = true;
$cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['id']) . $GLOBALS['deal_city']['id']);
if (!$GLOBALS['tmpl']->is_cached('page/help_index.html', $cache_id)) {
$id = intval($_REQUEST['id']);
$uname = addslashes(trim($_REQUEST['id']));
if ($id == 0 && $uname == '') {
$id = $GLOBALS['db']->getOne("select a.id from " . DB_PREFIX . "article as a left join " . DB_PREFIX . "article_cate as ac on a.cate_id = ac.id where ac.type_id = 1 order by a.sort desc");
} elseif ($id == 0 && $uname != '') {
$id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "article where uname = '" . $uname . "'");
}
$article = get_article($id);
if (!$article || $article['type_id'] != 1) {
app_redirect(APP_ROOT . "/");
} else {
if (check_ipop_limit(get_client_ip(), "article", 60, $article['id'])) {
//每一分钟访问更新一次点击数
$GLOBALS['db']->query("update " . DB_PREFIX . "article set click_count = click_count + 1 where id =" . $article['id']);
}
if ($article['rel_url'] != '') {
if (!preg_match("/http:\\/\\//i", $article['rel_url'])) {
if (substr($article['rel_url'], 0, 2) == 'u:') {
app_redirect(parse_url_tag($article['rel_url']));
} else {
app_redirect(APP_ROOT . "/" . $article['rel_url']);
}
} else {
app_redirect($article['rel_url']);
}
}
}
$article = get_article($id);
$GLOBALS['tmpl']->assign("article", $article);
$seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title'];
$GLOBALS['tmpl']->assign("page_title", $seo_title);
$seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title'];
$GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",");
$seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title'];
$GLOBALS['tmpl']->assign("page_description", $seo_description . ",");
$GLOBALS['tmpl']->assign("relate_help", $cate_list);
}
$GLOBALS['tmpl']->display("page/help_index.html", $cache_id);
}
示例7: init_nav_list
function init_nav_list($nav_list)
{
$u_param = "";
foreach ($_GET as $k => $v) {
if (strtolower($k) != "ctl" && strtolower($k) != "act" && strtolower($k) != "city") {
$u_param .= $k . "=" . $v . "&";
}
}
if (substr($u_param, -1, 1) == '&') {
$u_param = substr($u_param, 0, -1);
}
foreach ($nav_list as $k => $v) {
if (trim($v['url']) == '') {
$route = $v['u_module'];
if ($v['u_action'] != '') {
$route .= "#" . $v['u_action'];
}
$app_index = $v['app_index'];
if ($v['u_module'] == 'index') {
$route = "index";
$v['u_module'] = "index";
}
if ($v['u_action'] == '') {
$v["u_action"] = "index";
}
$str = "u:" . $app_index . "|" . $route . "|" . $v['u_param'];
$nav_list[$k]['url'] = parse_url_tag($str);
if (($v['u_module'] == 'deals' || $v['u_module'] == 'transfer' || $v['u_module'] == 'tool') && MODULE_NAME == $v['u_module']) {
$nav_list[$k]['current'] = 1;
} elseif ($v['u_module'] == 'borrow' && MODULE_NAME == $v['u_module']) {
$nav_list[$k]['current'] = 1;
} elseif (ACTION_NAME == $v['u_action'] && MODULE_NAME == $v['u_module'] && $v['u_param'] == $u_param) {
$nav_list[$k]['current'] = 1;
}
}
}
return $nav_list;
}
示例8: unset
?>
<div class="blank5"></div>
<?php
}
?>
<?php
}
}
unset($_from);
$this->pop_vars();
?>
</div>
</div>
<div class="tc pt10">
<a href="<?php
echo parse_url_tag("u:index|borrow#stepone|" . "typeid=" . $this->_var['type']['id'] . "" . "");
?>
"><img src="<?php
echo $this->_var['TMPL'];
?>
/images/toview.jpg" /></a>
</div>
<div class="blank10"></div>
</li>
<?php
}
}
unset($_from);
$this->pop_vars();
?>
</ul>
示例9: settype
$_from = $this->_var['store_list'];
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$this->push_vars('key', 'right_store_item');
if (count($_from)) {
foreach ($_from as $this->_var['key'] => $this->_var['right_store_item']) {
?>
<div class="right_store_item">
<span class="right_store_num num_<?php
echo intval($this->_var['key']) + 1;
?>
"></span>
<div class="right_store_info">
<a href="<?php
echo parse_url_tag("u:youhui|store#view|" . "id=" . $this->_var['right_store_item']['id'] . "" . "");
?>
" title="<?php
echo $this->_var['right_store_item']['name'];
?>
" target="_blank" class="title_link"><?php
$k = array('name' => 'msubstr', 'v' => $this->_var['right_store_item']['name'], 'b' => '0', 'e' => '8');
echo $k['name']($k['v'], $k['b'], $k['e']);
?>
</a>
<div class="blank5"></div>
<span class="index_start_bar f_l" title="<?php
echo $this->_var['LANG']['dp_point_' . ceil($this->_var['right_store_item']['avg_point'])];
?>
">
<i style="width:<?php
示例10: decode_weibo
public function decode_weibo($topic)
{
$data['content'] = $topic['content'];
$data['content'] = msubstr($data['content'], 0, 120);
$group_data = unserialize(base64_decode($topic['group_data']));
$url_tag = "u:" . $group_data['url']['app_index'] . "|" . $group_data['url']['route'] . "|" . $group_data['url']['param'];
$url = get_domain() . parse_url_tag($url_tag);
$data['content'] .= " " . $url;
//内容
//图片
$topic_image = $GLOBALS['db']->getRow("select o_path from " . DB_PREFIX . "topic_image where topic_id = " . $topic['id']);
if ($topic_image) {
$data['img'] = APP_ROOT_PATH . $topic_image['o_path'];
}
return $data;
}
示例11: index
public function index()
{
$id = intval($_REQUEST['id']);
$uname = addslashes(trim($_REQUEST['id']));
if ($uname == 'list') {
$this->list_notice();
exit;
}
$GLOBALS['tmpl']->caching = true;
$cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['id']) . $GLOBALS['deal_city']['id']);
if (!$GLOBALS['tmpl']->is_cached('sys_index.html', $cache_id)) {
if ($id == 0 && $uname == '') {
app_redirect(APP_ROOT . "/");
} elseif ($id == 0 && $uname != '') {
$id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "article where uname = '" . $uname . "'");
}
$article = get_article($id);
if (!$article || $article['type_id'] != 3) {
app_redirect(APP_ROOT . "/");
} else {
if (check_ipop_limit(get_client_ip(), "article", 60, $article['id'])) {
//每一分钟访问更新一次点击数
$GLOBALS['db']->query("update " . DB_PREFIX . "article set click_count = click_count + 1 where id =" . $article['id']);
}
if ($article['rel_url'] != '') {
if (!preg_match("/http:\\/\\//i", $article['rel_url'])) {
if (substr($article['rel_url'], 0, 2) == 'u:') {
app_redirect(parse_url_tag($article['rel_url']));
} else {
app_redirect(APP_ROOT . "/" . $article['rel_url']);
}
} else {
app_redirect($article['rel_url']);
}
}
}
$article = get_article($id);
$GLOBALS['tmpl']->assign("article", $article);
//开始输出当前的site_nav
$site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/");
$site_nav[] = array('name' => $GLOBALS['lang']['SHOP_SYSTEM'], 'url' => url("shop", "sys#list"));
if ($article['type_id'] == 1) {
$module = "help";
} elseif ($article['type_id'] == 2) {
$module = "notice";
} elseif ($article['type_id'] == 3) {
$module = "sys";
} else {
$module = 'article';
}
if ($article['uname'] != '') {
$aurl = url("index", $module, array("id" => $article['uname']));
} else {
$aurl = url("index", $module, array("id" => $article['id']));
}
$site_nav[] = array('name' => $article['title'], 'url' => $aurl);
$GLOBALS['tmpl']->assign("site_nav", $site_nav);
//输出当前的site_nav
$seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title'];
$GLOBALS['tmpl']->assign("page_title", $seo_title);
$seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title'];
$GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",");
$seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title'];
$GLOBALS['tmpl']->assign("page_description", $seo_description . ",");
}
$GLOBALS['tmpl']->display("sys_index.html", $cache_id);
}
示例12: parse_url_tag
echo $this->_var['LANG']['MY_ACCOUNT'];
?>
</a> |
<a href="<?php
echo parse_url_tag("u:shop|user#loginout|" . "" . "");
?>
"><?php
echo $this->_var['LANG']['LOGINOUT'];
?>
</a> |
<?php
} else {
?>
<?php
echo $this->_var['LANG']['PLEASE_FIRST'];
?>
[ <a href="javascript:void(0);" onclick="ajax_login();"><?php
echo $this->_var['LANG']['LOGIN'];
?>
</a> ] <?php
echo $this->_var['LANG']['OR'];
?>
[ <a href="<?php
echo parse_url_tag("u:shop|user#register|" . "" . "");
?>
"><?php
echo $this->_var['LANG']['REGISTER'];
?>
</a> ]
<?php
}
示例13: array
<?php
$k = array('name' => 'get_user_name', 'v' => $this->_var['dp_item']['user_id']);
echo $k['name']($k['v']);
?>
点评 <a href="<?php
echo parse_url_tag("u:youhui|store#view|" . "id=" . $this->_var['dp_item']['supplier_location_id'] . "" . "");
?>
" class="title_link" title="<?php
echo $this->_var['dp_item']['sp_name'];
?>
">[ <?php
$k = array('name' => 'msubstr', 'v' => $this->_var['dp_item']['sp_name'], 'b' => '0', 'e' => '10');
echo $k['name']($k['v'], $k['b'], $k['e']);
?>
]</a>:<a href="<?php
echo parse_url_tag("u:youhui|review#detail|" . "id=" . $this->_var['dp_item']['id'] . "" . "");
?>
" title="<?php
echo $this->_var['dp_item']['title'];
?>
" class="title_link"><?php
$k = array('name' => 'msubstr', 'v' => $this->_var['dp_item']['title'], 'b' => '0', 'e' => '8');
echo $k['name']($k['v'], $k['b'], $k['e']);
?>
- <?php
$k = array('name' => 'msubstr', 'v' => $this->_var['dp_item']['content'], 'b' => '0', 'e' => '30');
echo $k['name']($k['v'], $k['b'], $k['e']);
?>
</a>
</div>
<?php
示例14: unset
</p>
</dd>
<?php
}
}
unset($_from);
$this->pop_vars();
?>
<dd>
<p class="check-my-cart" id="<?php
echo $this->_var['row']['id'];
?>
">
<a href="<?php
echo parse_url_tag("u:index|cart|" . "" . "");
?>
" class="btn-small check_cart_btn " id="<?php
echo $this->_var['row']['id'];
?>
">查看我的购物车</a></p>
</dd>
<?php
} else {
?>
<div class="blank10"></div>
<p class="check-my-cart" id="<?php
echo $this->_var['row']['id'];
?>
">
示例15: parse_url_tag
</form>
</div>
</div>
<div class="blank"></div>
<div class="blank"></div>
</div>
<div class="list">
<div class="list_title clearfix">
<div class="list1 cur" >投资列表</div>
<div class="list2" onclick="window.location.href='<?php
echo parse_url_tag("u:index|transfer|" . "" . "");
?>
'">债权转让</div>
<a href="<?php
echo parse_url_tag("u:index|tool|" . "" . "");
?>
" class="calt">理财计算器</a>
</div>
<div class="list_cont">
<div class="i_deal_list clearfix">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr border="0" style="background-color:#00bef0; color:#fff; height:34px;">
<th style="width:30%">借款标题</th>
<th style="width:15%">借款金额</th>
<th style="width:10%">信用等级</th>
<th style="width:10%">年利率</th>
<th style="width:10%">借款进度</th>
<th style="width:10%">借款期限</th>
<th style="width:15%">借款状态</th>