Discuz投票自动回复插件
Discuz投票自动回复插件
<?php if(!defined('IN_DISCUZ')) { exit('Access Denied'); } $sql = <<<EOF CREATE TABLE `c_reply_poll` ( `tid` MEDIUMINT(8) UNSIGNED NULL DEFAULT '0', `dateline` INT(11) NOT NULL DEFAULT '0' ) COMMENT='投票自动生成回贴' COLLATE='utf8_general_ci' ENGINE=InnoDB; EOF; runquery($sql); $finish = TRUE; ?>
2. [文件] uninstall.php
<?php /** * [Discuz!] (C)2001-2099 Comsenz Inc. * This is NOT a freeware, use is subject to license terms * * $Id: uninstall.php 25889 2011-11-24 09:52:20Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } $sql = <<<EOF DROP TABLE IF EXISTS `c_reply_poll`; EOF; runquery($sql); $finish = TRUE; ?>
3. [文件] replypoll.class.php
<?php /** * 投票自动生成回贴插件 * * TODO:回贴格式可以在后台自定义 * 在post_newthread.php文件向c_reply_poll表记录用户选择自动回复功能 * @Author Ricky Feng */ require_once libfile('function/forum'); if(!defined('IN_DISCUZ')) { exit('Access Denied'); } class plugin_replypoll { protected $cookie_key = 'replypoll_plugin_autoreply'; function common(){ global $_G; if ($_GET['action'] == 'newthread' && $_GET['topicsubmit'] && $_GET['autoreply']) { dsetcookie($this->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 .= '<p class="mbn">'; $html .= '<input type="checkbox" tabindex="1" value="1" class="pc" id="overt" name="autoreply">'; $html .= '<label for="overt"> 投票结果自动生成回贴</label>'; $html .= '</p>'; 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
<?xml version="1.0" encoding="ISO-8859-1"?> <root> <item id="Title"><![CDATA[Discuz! Plugin]]></item> <item id="Version"><![CDATA[X2.5]]></item> <item id="Time"><![CDATA[2013-01-21 10:04]]></item> <item id="From"><![CDATA[39(http://xxx.net/)]]></item> <item id="Data"> <item id="plugin"> <item id="available"><![CDATA[1]]></item> <item id="adminid"><![CDATA[0]]></item> <item id="name"><![CDATA[replypoll]]></item> <item id="identifier"><![CDATA[replypoll]]></item> <item id="description"><![CDATA[]]></item> <item id="datatables"><![CDATA[]]></item> <item id="directory"><![CDATA[replypoll/]]></item> <item id="copyright"><![CDATA[xx]]></item> <item id="version"><![CDATA[ver 1.0]]></item> <item id="__modules"> <item id="0"> <item id="name"><![CDATA[replypoll]]></item> <item id="menu"><![CDATA[]]></item> <item id="url"><![CDATA[]]></item> <item id="type"><![CDATA[11]]></item> <item id="adminid"><![CDATA[0]]></item> <item id="displayorder"><![CDATA[0]]></item> <item id="navtitle"><![CDATA[]]></item> <item id="navicon"><![CDATA[]]></item> <item id="navsubname"><![CDATA[]]></item> <item id="navsuburl"><![CDATA[]]></item> </item> </item> </item> <item id="version"><![CDATA[X2.5]]></item> <item id="installfile"><![CDATA[install.php]]></item> <item id="uninstallfile"><![CDATA[uninstall.php]]></item> </item> </root>
5. [图片] QQ拼音截图未命名.jpg
以上就是Discuz投票自动回复插件的内容,更多相关内容请关注PHP中文网(www.php.cn)!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The solution to the Discuz background login problem is revealed. Specific code examples are needed. With the rapid development of the Internet, website construction has become more and more common, and Discuz, as a commonly used forum website building system, has been favored by many webmasters. However, precisely because of its powerful functions, sometimes we encounter some problems when using Discuz, such as background login problems. Today, we will reveal the solution to the Discuz background login problem and provide specific code examples. We hope to help those in need.

Xianyu can easily meet the needs of everyone. Everyone can buy the goods they need here, and they can also sell their idle items here, making money easily. It is very cost-effective. Friends in need can You can use it to sell all the idle items that you no longer need. You can not only free up space, but also get money. You can set the price freely and others can buy it directly. Sometimes if you are not satisfied with the price and want it, you can also We will talk to you about the price or get more detailed product information. If we don’t reply at this time, we may lose a customer, so we can set up some automatic replies, which can effectively help everyone retain customers for some time. Very useful. The editor here provides you with how to set up automatic replies.

"Detailed Explanation of Discuz Registration Process: Allowing you to easily modify personal information, specific code examples are required" Discuz is a powerful community forum program that is widely used in various websites. It provides a wealth of user registration and personal information modification. functions and interfaces. This article will introduce you to Discuz's registration process in detail and provide specific code examples to help you easily customize and modify your personal information. 1. User registration process In Discuz, user registration is one of the important functions of the site. The smoothness of the registration process and

QQ is a popular social networking software that not only supports multiple communication methods such as text, voice, and video, but also has rich personalized settings. Among them, the automatic reply function is a very practical setting. It can automatically send preset reply content to your friends when you are busy or unable to reply to messages in time, thus avoiding the embarrassment caused by failure to reply in time. In this way, when you are busy or temporarily away, QQ will automatically send preset replies to your friends, allowing you to enjoy social fun and easily cope with various scenarios. How to set up QQ automatic reply? QQ automatic reply setting steps 1. Unlock the phone, open the QQ application, on the homepage message page, lightly click the [Status] icon in the upper left corner, or long press your [avatar] to enter immediately

"Exploring Discuz: Definition, Functions and Code Examples" With the rapid development of the Internet, community forums have become an important platform for people to obtain information and exchange opinions. Among the many community forum systems, Discuz, as a well-known open source forum software in China, is favored by the majority of website developers and administrators. So, what is Discuz? What functions does it have, and how can it help our website? This article will introduce Discuz in detail and attach specific code examples to help readers learn more about it.

A must-have for Discuz users! Comprehensive analysis of renaming props! In the Discuz forum, the name change function has always received much attention and demand from users. For some users who need to change their name, name change props can easily modify the user name, and this is also an interesting way of interaction. Let’s take an in-depth look at the renaming props in Discuz, including how to obtain them, how to use them, and solutions to some common problems. 1. Obtain name-changing props in Discuz. Name-changing props are usually purchased through points or the administrator

What should I do if I encounter an incorrect Discuz password? Quick solution sharing! Discuz! It is a very popular forum program that provides users with a platform for convenient communication. Using Discuz! When accessing a forum, sometimes you may encounter an incorrect password, which may cause users to be unable to log in and use the forum normally. Well, meet Discuz! When the password is wrong, how should we quickly solve the problem? Some solutions will be shared below, with specific code examples provided for reference. 1. Check whether the password

Title: To solve the problem that Discuz WeChat shares cannot be displayed, specific code examples are needed. With the development of the mobile Internet, WeChat has become an indispensable part of people's daily lives. In website development, in order to improve user experience and expand website exposure, many websites will integrate WeChat sharing functions, allowing users to easily share website content to Moments or WeChat groups. However, sometimes when using open source forum systems such as Discuz, you will encounter the problem that WeChat shares cannot be displayed, which brings certain difficulties to the user experience.
