帝國CMS置頂扣除積分機制_PHP教程

來源:互聯網
上載者:User
首先在所需的系統模型中添加int欄位 top,選項按鈕0,1(0為否,1為是)。主要修改e/class/qinfofun.php兩處 一處為增加,一處為編輯。

在檔案中找到esetcookie("lastaddinfotime",time(),time()+3600*24);下面到//-------------修改

全部替換為:

//置頂扣分$t=$empire->fetch1("select top from {$dbtbpre}ecms_".$tbname." where userid='$muserid' and id='$id' and classid='$classid' limit 1");if($t[top]){   $w=$empire->fetch1("select userfen from {$dbtbpre}enewsmember where userid='$muserid'");     if($w[userfen]>=10)      {       $sql3=$empire->query("update {$dbtbpre}enewsmember set userfen=userfen-10 where userid='$muserid'");          printerror("AddQinfoSuccess",$reurl,1);      }     else       {        $sql4=$empire->query("update {$dbtbpre}ecms_".$tbname." set top=0 where userid='$muserid' and id='$id' and classid='$classid' limit 1");       printerror("jifenbugou",$reurl,1);      }}                   else{printerror("AddQinfoSuccess",$reurl,1);}}else{printerror("DbError","history.go(-1)",1);}}

找到

if($sql){$reurl=DoingReturnUrl("ListInfo.php?mid=$mid",$add['ecmsfrom']); if($add['editgotoinfourl']&&$infor['checked'])//返回內容頁{    if($cr['showdt']==1)   {         $reurl=$public_r[newsurl]."e/action/ShowInfo/?classid=$classid&id=$id";     } elseif($cr['showdt']==2)      {          $reurl=$public_r[newsurl]."e/action/ShowInfo.php?classid=$classid&id=$id";       }     else   {          $reurl=$titleurl;    }}

在其下至//---------------刪除之間替換為:

//置頂扣分$t=$empire->fetch1("select top from {$dbtbpre}ecms_".$tbname." where userid='$muserid' and id='$id' and classid='$classid' limit 1");if($t[top]){$w=$empire->fetch1("select userfen from {$dbtbpre}enewsmember where userid='$muserid'");    if($w[userfen]>=10)     {         $sql3=$empire->query("update {$dbtbpre}enewsmember set userfen=userfen-10 where userid='$muserid'");          printerror("EditQinfoSuccess",$reurl,1);   }    else       {       $sql4=$empire->query("update {$dbtbpre}ecms_".$tbname." set top=0 where userid='$muserid' and id='$id' and classid='$classid' limit 1");       printerror("jifenbugou",$reurl,1);    }  } else{printerror("EditQinfoSuccess",$reurl,1);}        }else{printerror("DbError","history.go(-1)",1);}}

注意上面部分的10為扣除的積分自行設定,還有jifenbuzhu自己可以該為自己需要的提示在e/data/language/gb/pub/q_message.php中添加。

又添加這個欄位主要是避免與老大的那個firsttitle起衝突,避免以後升級帶來的麻煩,假如會員積分不足提示積分不足但資訊仍讓可以提交只是不能置頂。

在列表模板中調用方法:

[e:loop={"select * from phome_ecms_house where top=1 and checked=1 and classid='$GLOBALS[navclassid]'  limit 3",3,24,0}]                [置頂]" title="" target="_blank">        室廳        ㎡                    [/e:loop]

//01.23日更新功能添加到期時間欄位date 到期之後置頂功能無效,上面的列表模板sql中添加 and (unix_timestamp(youxiaoqi)-UNIX_TIMESTAMP(NOW()))>0

僅供參考。

http://www.bkjia.com/PHPjc/752499.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/752499.htmlTechArticle首先在所需的系統模型中添加int欄位 top,選項按鈕0,1(0為否,1為是)。主要修改e/class/qinfofun.php兩處 一處為增加,一處為編輯。 在檔案...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.