AGAMES 討論區
標題:
會員簽到1.0 for DZ 6.1F for utf8(修改為會員登入自動簽到)
[打印本頁]
作者:
dlalden
時間:
2008-11-9 13:08:18
標題:
會員簽到1.0 for DZ 6.1F for utf8(修改為會員登入自動簽到)
一.在後台運行sql語句:
CREATE TABLE IF NOT EXISTS `dev168_signin` (
`uid` int(11) NOT NULL,
`username` varchar(50) NOT NULL,
`dateline` int(11) NOT NULL,
`timeline` int(11) NOT NULL,
PRIMARY KEY (`uid`,`dateline`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
複製代碼
二. 把upload目錄下的文件覆蓋到discuz安裝目錄
三. 修改1個文件
修改”index.php”
找到
$discuz_action = 1;
複製代碼
之上加入
//Auto signin by Chienlin Start
//today timestamp
$timestamp = time();
$todaytimestamp = @strtotime(date("Y-m-d",$timestamp));
//check sign in info. if have not sign in,then add sign in record,else show a message
$count_rs = $db->query("SELECT COUNT(*) FROM dev168_signin where uid='$discuz_uid' and dateline='$todaytimestamp'");
$count = $db->result($count_rs, 0);
if($count==0&& $discuz_uid) {
$db->query("insert into dev168_signin(uid,username,dateline,timeline) values('$discuz_uid','$discuz_user','$todaytimestamp','$timestamp')");
showmessage('今天簽到成功',dreferer());
}
else{
//Auto signin by Chienlin End
複製代碼
找到
include template('discuz');
複製代碼
之上加上
//Auto signin by Chienlin Start
}
//Auto signin by Chienlin End
複製代碼
四. 在後臺的插件管理中,導入discuz_plugin_dev168_signin
到此,安裝結束。
=====若您的index.php的"今天簽到成功"會出現亂碼 有兩種解決方式如下=====
1.
先將index.php 改成utf-8格式 再將"今天簽到成功"貼進去,再將格式改為ANSI..
(檔案格式沒改回來ANSI版面字體會變)
2.
將"今天簽到成功"改為"Succuces sign , Today"
===========
歡迎光臨 AGAMES 討論區 (http://61.244.113.49/)
Powered by Discuz! X2