How to unpin the pin in Empire CMS

藏色散人
Release: 2019-12-07 09:25:30
Original
2605 people have browsed it

How to unpin the pin in Empire CMS

How to cancel the pin in Empire CMS?

The example in this article describes the method of modifying the deduction of member points at the top of the Empire CMS. Share it with everyone for your reference. The specific implementation method is as follows:

It is recommended to study "Empire cms tutorial"

1. Add the int field top radio button 0, 1 ( 0 means no, 1 means yes)

2. Modify e/class/qinfofun.php and find it in the file

esetcookie("lastaddinfotime",time(),time() 3600*24 );

until //------------- Replace all

with:

The code is as follows:

//置顶扣分 $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);} }
Copy after login

3. Modify e/class/qinfofun.php and find the

code in the file as follows:

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; } }
Copy after login

to //--------------- Replace For:

The code is as follows:

//置顶扣分 $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);} }

Copy after login

Note that the 10 in the part is the deducted points that you can set yourself, and jifenbuzhu can provide the tips you need in e/data/language/gb/pub Added to /q_message.php (gb2312 version)

This field is added mainly to avoid conflicts with the boss’s firsttitle and to avoid trouble caused by future upgrades

If the member points are insufficient, the points will be prompted Insufficient but the information can still be submitted but cannot be pinned to the top.

Call the method in the list template:

The code is as follows:

[e:loop={"select * from phome_ecms_house where top=1 and checked=1 and classid='$GLOBALS[navclassid]' limit 3",3,24,0}]   [置顶]      [/e:loop]
Copy after login

01.23 Daily update function adds an expiration time field and the top function is invalid after the date expires.

Add the

code to the above list template sql as follows:

and (unix_timestamp(youxiaoqi)-UNIX_TIMESTAMP(NOW()))>0
Copy after login


You can modify the template by yourself, I believe it will not be difficult to solve.

Upload the following pictures:

The above is the detailed content of How to unpin the pin in Empire CMS. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!