Tianguo CMS top-down credit deduction mechanism

Source: Internet
Author: User

First, add the int field top in the required system model, single choice button 0, 1 (0 is NO, 1 is yes ). Modify e/class/qinfofun. php to add and edit.

Find esetcookie ("lastaddinfotime", time (), time () + 3600*24) in the file. Modify the cookie // -----------.

Replace all:

// Top point deduction $ t = $ empire-> fettle ("select top from {$ dbtbpre} ecms _". $ tbname. "where userid = '$ muserid' and id =' $ id' and classid = '$ classid 'limit 1"); if ($ t [top]) {$ w = $ empire-> fettings ("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 );}}

Find

If ($ SQL) {$ reurl = DoingReturnUrl ("ListInfo. php? Mid = $ mid ", $ add ['ecmsfrom']); if ($ add ['editgotoinfourl'] & $ infor ['checked']) // return content page {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 ;}}

Replace it:

// Top point deduction $ t = $ empire-> fettle ("select top from {$ dbtbpre} ecms _". $ tbname. "where userid = '$ muserid' and id =' $ id' and classid = '$ classid 'limit 1"); if ($ t [top]) {$ w = $ empire-> fettings ("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 );}}

Note that the 10 in the above section is the deducted points, and the prompt that jifenbuzhu itself can be needed is added in e/data/language/gb/pub/q_message.php.

This field is also added to avoid conflicts with the boss's firsttitle, and to avoid the troubles caused by future upgrades. If the Member points are insufficient, the system prompts that the points are insufficient, but the information is still allowed to be submitted but cannot be placed on top.

Call the method in the list template:

[E: loop = {"select * from phome_ecms_house where top = 1 and checked = 1 and classid = '$ GLOBALS [navclassid] 'limit 3, 0}] <tr onmouseout = "this. style. backgroundColor = '# ffff' "onmouseover =" this. style. backgroundColor = '# F1F5FC' "> <td> <? = $ Bqr [myarea]?> </Td> <td class = "tx"> <font color = "red"> [stick] </font> <a href = "<? = $ Bqsr [titleurl]?> "Title =" <? = $ Bqr [title]?> "Target =" _ blank "> <? = $ Bqr [xiangxidizhi]?> </A> </td> <? = $ Bqr [shi]?> Room <? = $ Bqr [ting]?> Hall </td> <? = $ Bqr [size]?> <Span class = "m"> ㎡ </span> </td> <? = $ Bqr [money]?> </Td> <td align = "right"> <? = Date ('Y-m-d', $ bqr [newstime])?> </Td> </tr> [/e: loop]

// The 01.23-day update function adds the expiration time field. The pin function is invalid after the date expires. In the preceding list template, add and (unix_timestamp (youxiaoqi)-UNIX_TIMESTAMP (NOW ()> 0.

For reference only.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.