作者:GRIROR格雷尔 | 来源:互联网 | 2018-03-23 09:41
Discuz投票自动回复插件
2. [文件] uninstall.php
3. [文件] replypoll.class.php
COOKIE_key ,1);
}
if ($_GET['action'] == 'votepoll' && $_GET['pollsubmit'] && isset($_GET['fid']) && $_GET['tid']) {
$_GET['fid'] = intval($_GET['fid']);
$_GET['tid'] = intval($_GET['tid']);
if (! $result = DB::result_first("SELECT COUNT(*) FROM c_reply_poll WHERE tid = " .$_GET['tid']) ) {
return;
}
$arr = C::t('forum_polloption')->fetch_all_by_tid($_GET['tid']);
$polloption = array();
foreach($arr as $k=>$v) {
$polloption[$v['polloptionid']] = $v;
}
$message = '我选择了{ ';
foreach ($_POST['pollanswers'] as $key => $val) {
$message .= $polloption[$val]['polloption'] . ',';
}
$message = trim($message,",") . ' }';
$data = array(
'fid' => $_GET['fid'],
'tid' => $_GET['tid'],
'first' => '0',
'author' => $_G['username'],
'authorid' => $_G['uid'],
'dateline' => time(),
'message' => $message,
'invisible' => 0,
'anonymous' => 0,
'usesig' => 0,
'htmlon' => 0,
'bbcodeoff' => '-1',
'smileyoff' => 0,
'parseurloff' => 0,
'attachment' => '0',
'replycredit' => 0,
'status' => 0,
'postid' => 0
);
insertpost($data);
C::t('forum_forum')->update_forum_counter($_GET['fid'], 0, 1, 0);
}
}
}
class plugin_replypoll_forum extends plugin_replypoll {
function post_poll_extra_output() {
$html .= '';
$html .= '';
$html .= '';
$html .= '
';
return $html;
}
function viewthread_poll_top_output() {
if ($autoreply = getCOOKIE($this->COOKIE_key) && isset($_GET['tid'])) {
$tid = intval($_GET['tid']);
DB::query("INSERT INTO c_reply_poll VALUE($tid, UNIX_TIMESTAMP())");
}
dsetCOOKIE($this->COOKIE_key , null, -1);
}
}
?>
4. [文件] discuz_plugin_replypoll.xml
-
-
-
-
5. [图片] QQ拼音截图未命名.jpg
以上就是Discuz投票自动回复插件的内容,更多相关内容请关注PHP中文网(www.php1.cn)!