虚位以待(AD)
虚位以待(AD)
首页 > CMS教程 > Ecshop > ecshop调用user_info没有登陆状态

ecshop调用user_info没有登陆状态
类别:Ecshop   作者:码皇   来源:互联网   点击:

ecshop用户登陆注册,然后如果用户登陆以后显示的应该是退出于是我在首页index dwt文件里写上 {if $user_info} {$lang hello},{$user_info username}, {$lang welcome_return}! {$lang user_c ,魔客吧

ecshop用户登陆注册,然后如果用户登陆以后显示的应该是退出于是我在首页index.dwt文件里写上

{if $user_info}				{$lang.hello},{$user_info.username}, {$lang.welcome_return}!		{$lang.user_center}|		 {$lang.user_logout}				{else}		  注册
登陆 {/if}

发现登陆了,首页也无法显示登陆状态。

有个说法是必须调用

需要把你的代码搜索放在member_info.lbi里,然后
在你的页面进用{insert name=’member_info’}来调用,不然是没有显示的,无显示的原因是:
直接调用$user_info的值是空的,只有通过{insert name=’member_info’}来调用php才会给$user_info赋值

我做了一个文件叫member_info_mc.lbi 然后

{insert name='member_info_mc'}
报错

Fatal error: Call to undefined function insert_member_info_mc() in /Users/mc2/WEB/php/ecshop/includes/cls_template.php on line 1152

说明ecshop底层直接调用了文件的名字作为函数名字来调用的。还不能随便乱改名字

老实改回来就叫member_info.lbi 文件好了。

{insert name='member_info'}
然后就好了。

相关热词搜索: ecshop调用user_info没有登陆状态