ecshop当前会员等级距离下一等级差多少积分显示
2016-09-07 22:02 来源:www.chinab4c.com 作者:ecshop专家
在ecshop上显示ecshop当前会员等级距离下一等级差多少积分,这个功能很实用。chinab4c分享给大家:
if ($rank = get_rank_info())
{
$smarty->assign('rank_name', sprintf($_LANG['your_level'], $rank['rank_name']));
if (!empty($rank['next_rank_name']))
{
$smarty->assign('next_rank_name', sprintf($_LANG['next_level'], $rank['next_rank'] ,$rank['next_rank_name']));
}
}
再在语言库里增加相应的语言中文,插入到模板里next_rank_name 贴这个标签功能就实现了!(责任编辑:chinab4c)再增加get_rank_info 函数代码
function get_rank_info()
{
global $db,$ecs;
if (!empty($_SESSION['user_rank']))
{
$sql = "SELECT rank_name, special_rank FROM " . $ecs->table('user_rank') . " WHERE rank_id = '$_SESSION[user_rank]'";
$row = $db->getRow($sql);
if (empty($row))
{
return array();
}
$rank_name = $row['rank_name'];
if ($row['special_rank'])
{
return array('rank_name'=>$rank_name);
}
else
{
// zuimoban.com
$user_rank = $db->getOne("SELECT pay_points FROM " . $ecs->table('users') . " WHERE user_id = '$_SESSION[user_id]'");
$sql = "SELECT rank_name,min_points FROM " . $ecs->table('user_rank') . " WHERE min_points > '$user_rank' ORDER BY min_points ASC LIMIT 1";
$rt = $db->getRow($sql);
$next_rank_name = $rt['rank_name'];
$next_rank = $rt['min_points'] - $user_rank;
return array('rank_name'=>$rank_name,'next_rank_name'=>$next_rank_name,'next_rank'=>$next_rank);
}
}
else
{
return array();
}
}
|
最近更新
常用插件
- ecshop二次开发商品购买增
图片1香...
- ecshop最小购买数量控制插
ecshop最小购买数量控制插件,这个插件主要是为我们提供一个十分方便...
- ecshop2.7.2生成虚拟订单2.
以前我们开发过ecshop下的虚拟订单,就是客户在访问的时候,会自动生...
- ecshop没登陆情况下订单查
ecshop没登陆情况下订单查询插件,主要是针对ecshop在没有登陆的情况下...
- ecshop2.7.1邮件发送插件
ecshop2.7.1邮件发送插件:该插件主要的开发思想是源于ecshop短信发送系统...
ecshop热门问答
ecshop热门资料
ecshop360模板前台换颜色
ecshop框架
ecshop火星文
ecshop会员等级价格
ecshop边距
ecshop静态页面
ecshoprepeat
ecshop热心
ecshop幻灯片
ecshop措施
ecshop网卡
ecshop电子地图
ecshop插入
ecshop答对
ecshop打包下载
ecshop用户组
ecshopvars
ecshop栏目
ecshop专家
ecshop的正體中文模版
ecshopECSHOP
ecshop保持登陆
ecshop推荐
ecshop首页文章
ecshop程序包
ecshop最大的
ecshop搜索关键词
ecshopwinsock
ecshopBBS
ecshop淘宝销售