99国产在线视频有精品视频_国产精品久久久久久亚洲影视 _国产三级日本三级韩国三级在线看_精精国产XXXX视频在线my_乱VODAFONEWIFI熟妇_超碰cao国产精品一区二区_91久久精品青青草原伊人_欧美,一区,日韩,精品

文章內容如何限制指定會員類型查閱,比如:只能vip會員查閱,代碼如何寫?

590次瀏覽 更新日期:2024-01-13 18:07:02 分類:問題求助 評論:1

我的代碼如下:



<div class="content">

{if $current_userid}

{$content}


{else}


<div id="ycfs3">

{$content}

<div class="gzback">

<div class="gzm"><img src="{$site[gongzhonghao]}" alt=""></div>

<p class="read-tips">

<span>●提示:</span>VIP會員方可查閱完整信息!<br>

</p>

</div>

</div>

{/if}

</div>


截圖:

image.png


解釋下以上代碼的意思:如果會員已經登錄,顯示{$content}內容,如果沒有的登錄,就顯示div id="ycfs3"等內容。



其實,我是想要實現,只有VIP會員才可以查看{$content}內容否則就只能查看div id="ycfs3"里面的內容。不知道如何判斷用戶是否為VIP會員???



還有就是頁面頂部是否需要添加“定義userid”??

{php $current_userid = intval(get_cookie('_userid'));}


我來說兩句
  • yzmcms
    yzmcms 官網認證 1年前
    {php $current_userid = intval(get_cookie('_userid'));}
    {if $current_userid}
    	{php $userinfo = get_memberinfo($current_userid);}
    	{if $userinfo['vip']&&$userinfo['overduedate']>SYS_TIME}
    			<p>你是VIP</p>
    	{else}
    			<p>你不是VIP</p>
    	{/if}
    {else}
    	<p>請先登錄</p>
    {/if}
    1
    回復
作者信息
發布見解
發內容 回頂部