当前位置:首页 > CMS教程 > 帝国cms > 列表

帝国CMS扣除会员积分置顶,到期后取消置顶

发布:smiling 来源: PHP粉丝网  添加日期:2014-11-24 13:52:02 浏览: 评论:0 

帝国CMS扣除会员积分置顶修改方法:

1、在所需的系统模型中添加int字段 top  单选按钮0,1(0为否,1为是)

2、​修改e/class/qinfofun.php ​在文件中找到

esetcookie("lastaddinfotime",time(),time()+3600*24);  到 //-------------    

全部替换为:

  1. //置顶扣分   
  2.                 $t=$empire->fetch1("select top from {$dbtbpre}ecms_".$tbname." where userid='$muserid' and id='$id' and classid='$classid' limit 1"); 
  3.                  
  4.                 if($t[top]) 
  5.                 { 
  6.                 $w=$empire->fetch1("select userfen from {$dbtbpre}enewsmember where userid='$muserid'"); 
  7.                 if($w[userfen]>=10) 
  8.                     { 
  9.                 $sql3=$empire->query("update {$dbtbpre}enewsmember set userfen=userfen-10 where userid='$muserid'"); 
  10.                 printerror("AddQinfoSuccess",$reurl,1); 
  11.                     } 
  12.                 else 
  13.                     { 
  14.                 $sql4=$empire->query("update {$dbtbpre}ecms_".$tbname." set top=0 where userid='$muserid' and id='$id' and classid='$classid' limit 1"); 
  15.                          
  16.                         printerror("jifenbugou",$reurl,1); 
  17.                   
  18.                     } 
  19.                 } 
  20.                          
  21.                         else{printerror("AddQinfoSuccess",$reurl,1);} 
  22.                          
  23.                          
  24.                 } 
  25.                 else 
  26.                 {printerror("DbError","history.go(-1)",1);} 
  27.         } 
  28. 3、修改e/class/qinfofun.php 在文件中找到 
  29. if($sql
  30.                 { 
  31.                         $reurl=DoingReturnUrl("ListInfo.php?mid=$mid",$add['ecmsfrom']); 
  32.                         if($add['editgotoinfourl']&&$infor['checked'])//返回内容页 
  33.                         { 
  34.                                 if($cr['showdt']==1) 
  35.                                 { 
  36.                                         $reurl=$public_r[newsurl]."e/action/ShowInfo/?classid=$classid&id=$id"
  37.                                 } 
  38.                                 elseif($cr['showdt']==2) 
  39.                                 { 
  40.                                         $reurl=$public_r[newsurl]."e/action/ShowInfo.php?classid=$classid&id=$id"
  41.                                 } 
  42.                                 else 
  43.                                 { 
  44.                                         $reurl=$titleurl
  45.                                 } 
  46.                         } 
  47. 到 //--------------- 替换为: 
  48. //置顶扣分 
  49.                  
  50.                 $t=$empire->fetch1("select top from {$dbtbpre}ecms_".$tbname." where userid='$muserid' and id='$id' and classid='$classid' limit 1"); 
  51.                  
  52.                 if($t[top]) 
  53.                 { 
  54.                 $w=$empire->fetch1("select userfen from {$dbtbpre}enewsmember where userid='$muserid'"); 
  55.                 if($w[userfen]>=10) 
  56.                     { 
  57.                 $sql3=$empire->query("update {$dbtbpre}enewsmember set userfen=userfen-10 where userid='$muserid'"); 
  58.                 printerror("EditQinfoSuccess",$reurl,1); 
  59.                     } 
  60.                 else 
  61.                     { 
  62.                 $sql4=$empire->query("update {$dbtbpre}ecms_".$tbname." set top=0 where userid='$muserid' and id='$id' and classid='$classid' limit 1"); 
  63.                          
  64.                         printerror("jifenbugou",$reurl,1); 
  65.  
  66.                   
  67.                     } 
  68.                 } 
  69.                 else{printerror("EditQinfoSuccess",$reurl,1);}         
  70.                         //开源软件:phpfensi.com 
  71.                 } 
  72.                 else 
  73.                 {printerror("DbError","history.go(-1)",1);} 
  74.         } 

注意部分的10为扣除的积分自行设置,还有jifenbuzhu自己可以该为自己需要的提示在e/data/language/gb/pub/q_message.php中添加(gb2312版)

又添加这个字段主要是避免与老大的那个firsttitle起冲突,避免以后升级带来的麻烦

假如会员积分不足提示积分不足但信息仍让可以提交只是不能置顶。。。。。。

在列表模板中调用方法:

  1. [e:loop={"select * from phome_ecms_house where top=1 and checked=1 and classid='$GLOBALS[navclassid]'  limit 3",3,24,0}] 
  2. <tr onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#F1F5FC'"
  3.         <td><?=$bqr[myarea]?></td> 
  4.         <td class="tx"><font color="red">[置顶]</font> 
  5. <a href="<?=$bqsr[titleurl]?>" title="<?=$bqr[title]?>" target="_blank"><?=$bqr[xiangxidizhi]?></a></td> 
  6.         <td><?=$bqr[shi]?>室<?=$bqr[ting]?>厅</td> 
  7.         <td><?=$bqr[size]?><span class="m">㎡</span></td> 
  8.         <td><?=$bqr[money]?></td> 
  9.         <td align="right"><?=date('Y-m-d',$bqr[newstime])?></td> 
  10.     </tr> 
  11. [/e:loop] 

01.23日更新功能添加到期时间字段date到期之后置顶功能无效.

上面的列表模板sql中添加 and (unix_timestamp(youxiaoqi)-UNIX_TIMESTAMP(NOW()))>0

模板大家自己修改,如有什么问题大家跟帖我会尽量解答.

上传以下图片:

帝国CMS扣除会员积分置顶,到期后取消置顶

Tags: 帝国CMS扣除积分 帝国CMS会员

分享到: