在ecshop首页有$position = assign_ur_here();其中assign_ur_here();是哪个地方传过来的
答案:1 悬赏:20 手机版
解决时间 2021-02-20 10:45
- 提问者网友:愿为果
- 2021-02-19 10:49
就是说这个函数是在哪里定义的!
最佳答案
- 五星知识达人网友:神的生死簿
- 2021-02-19 11:34
assign_ur_here在lib_main.php的129行,详细内函数容如下:
function assign_ur_here($cat = 0, $str = '')
{
$cur_url = basename(PHP_SELF);
if (intval($GLOBALS['_CFG']['rewrite']))
{
$filename = strpos($cur_url,'-') ? substr($cur_url, 0, strpos($cur_url,'-')) : substr($cur_url, 0, -4);
}
else
{
$filename = substr($cur_url, 0, -4);
}
$page_title = $GLOBALS['_CFG']['shop_title'] . ' - ' . 'Powered by ECShop';
$ur_here = '' . $GLOBALS['_LANG']['home'] . '';
if ($filename != 'index')
{
if (in_array($filename, array('category', 'goods', 'article_cat', 'article', 'brand')))
{
if ('category' == $filename || 'goods' == $filename || 'brand' == $filename)
{
if ($cat > 0)
{
$cat_arr = get_parent_cats($cat);
$key = 'cid';
$type = 'category';
}
else
{
$cat_arr = array();
}
}
elseif ('article_cat' == $filename || 'article' == $filename)
{
if ($cat > 0)
{
$cat_arr = get_article_parent_cats($cat);
$key = 'acid';
$type = 'article_cat';
}
else
{
$cat_arr = array();
}
}
if (!empty($cat_arr))
{
krsort($cat_arr);
foreach ($cat_arr AS $val)
{
$page_title = htmlspecialchars($val['cat_name']) . '_' . $page_title;
$args = array($key => $val['cat_id']);
$ur_here .= '
htmlspecialchars($val['cat_name']) . '';
}
}
}
else
{
if ('group_buy' == $filename)
{
$page_title = $GLOBALS['_LANG']['group_buy_goods'] . '_' . $page_title;
$args = array('gbid' => '0');
$ur_here .= '
$GLOBALS['_LANG']['group_buy_goods'] . '';
}
elseif ('auction' == $filename)
{
$page_title = $GLOBALS['_LANG']['auction'] . '_' . $page_title;
$args = array('auid' => '0');
$ur_here .= '
$GLOBALS['_LANG']['auction'] . '';
}
elseif ('snatch' == $filename)
{
$page_title = $GLOBALS['_LANG']['snatch'] . '_' . $page_title;
$args = array('id' => '0');
$ur_here .= '
}
elseif ('wholesale' == $filename)
{
$page_title = $GLOBALS['_LANG']['wholesale'] . '_' . $page_title;
$args = array('wsid' => '0');
$ur_here .= '
$GLOBALS['_LANG']['wholesale'] . '';
}
elseif ('exchange' == $filename)
{
$page_title = $GLOBALS['_LANG']['exchange'] . '_' . $page_title;
$args = array('wsid' => '0');
$ur_here .= '
$GLOBALS['_LANG']['exchange'] . '';
}
}
}
if (!empty($str))
{
$page_title = $str . '_' . $page_title;
$ur_here .= '
}
return array('title' => $page_title, 'ur_here' => $ur_here);
}
function assign_ur_here($cat = 0, $str = '')
{
$cur_url = basename(PHP_SELF);
if (intval($GLOBALS['_CFG']['rewrite']))
{
$filename = strpos($cur_url,'-') ? substr($cur_url, 0, strpos($cur_url,'-')) : substr($cur_url, 0, -4);
}
else
{
$filename = substr($cur_url, 0, -4);
}
$page_title = $GLOBALS['_CFG']['shop_title'] . ' - ' . 'Powered by ECShop';
$ur_here = '' . $GLOBALS['_LANG']['home'] . '';
if ($filename != 'index')
{
if (in_array($filename, array('category', 'goods', 'article_cat', 'article', 'brand')))
{
if ('category' == $filename || 'goods' == $filename || 'brand' == $filename)
{
if ($cat > 0)
{
$cat_arr = get_parent_cats($cat);
$key = 'cid';
$type = 'category';
}
else
{
$cat_arr = array();
}
}
elseif ('article_cat' == $filename || 'article' == $filename)
{
if ($cat > 0)
{
$cat_arr = get_article_parent_cats($cat);
$key = 'acid';
$type = 'article_cat';
}
else
{
$cat_arr = array();
}
}
if (!empty($cat_arr))
{
krsort($cat_arr);
foreach ($cat_arr AS $val)
{
$page_title = htmlspecialchars($val['cat_name']) . '_' . $page_title;
$args = array($key => $val['cat_id']);
$ur_here .= '
>
' .htmlspecialchars($val['cat_name']) . '';
}
}
}
else
{
if ('group_buy' == $filename)
{
$page_title = $GLOBALS['_LANG']['group_buy_goods'] . '_' . $page_title;
$args = array('gbid' => '0');
$ur_here .= '
>
' .$GLOBALS['_LANG']['group_buy_goods'] . '';
}
elseif ('auction' == $filename)
{
$page_title = $GLOBALS['_LANG']['auction'] . '_' . $page_title;
$args = array('auid' => '0');
$ur_here .= '
>
' .$GLOBALS['_LANG']['auction'] . '';
}
elseif ('snatch' == $filename)
{
$page_title = $GLOBALS['_LANG']['snatch'] . '_' . $page_title;
$args = array('id' => '0');
$ur_here .= '
>
' . $GLOBALS['_LANG']['snatch_list'] . '';}
elseif ('wholesale' == $filename)
{
$page_title = $GLOBALS['_LANG']['wholesale'] . '_' . $page_title;
$args = array('wsid' => '0');
$ur_here .= '
>
' .$GLOBALS['_LANG']['wholesale'] . '';
}
elseif ('exchange' == $filename)
{
$page_title = $GLOBALS['_LANG']['exchange'] . '_' . $page_title;
$args = array('wsid' => '0');
$ur_here .= '
>
' .$GLOBALS['_LANG']['exchange'] . '';
}
}
}
if (!empty($str))
{
$page_title = $str . '_' . $page_title;
$ur_here .= '
>
' . $str;}
return array('title' => $page_title, 'ur_here' => $ur_here);
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯