Kod: Tümünü seç
##############################################################
## MOD Title: Minimum posts before voting
## MOD Author: eviL3 < evil@phpbbmodders.com > (Igor Wiedler) http://phpbbmodders.com/
## MOD Description: Users need to have enough posts before they can
## Vote in a poll. This is usefull if you don't want
## people registering accounts just for this.
##
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: posting.php
## admin/admin_board.php
## templates/subSilver/admin/board_config_body.tpl
## language/lang_english/lang_admin.php
## language/lang_english/lang_main.php
##
## Included Files: n/a
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## Author Notes:
## This MOD was requested by kber at phpBBModders.com
##
##############################################################
## MOD History:
##
## 2006-07-23 - Version 0.1.0
## - First Release
##
## 2006-07-24 - Version 0.1.1
## - Actually works now
## - Updated $lang usage
##
## 2006-07-24 - Version 0.1.2
## - Fixed the lang entry in the wrong file (thanks kber)
##
## 2006-09-06 - Version 0.1.3
## - Fixed SQL not being inserted
##
## 2006-09-08 - Version 0.1.3a
## - Viewtopic code removed and submitted
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]-------------------------------------------
#
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ('vote_min_posts', '10');
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
// Vote in a poll
//
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Minimum posts before Vote
// Check if user has enough posts
$vote_posts = $board_config['vote_min_posts'];
if ( $userdata['user_posts'] < $vote_posts && $userdata['user_level'] != (MOD || ADMIN) )
{
message_die(GENERAL_MESSAGE, sprintf($lang['Vote_min_posts_needed'], $vote_posts));
}
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
"L_SYSTEM_TIMEZONE" => $lang['System_timezone'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Minimum posts before Vote
"L_VOTE_MIN_POSTS" => $lang['Vote_min_posts'],
#
#-----[ FIND ]------------------------------------------
#
"TIMEZONE_SELECT" => $timezone_select,
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Minimum posts before Vote
"VOTE_MIN_POSTS" => $new['vote_min_posts'],
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_SYSTEM_TIMEZONE}</td>
<td class="row2">{TIMEZONE_SELECT}</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1">{L_VOTE_MIN_POSTS}</td>
<td class="row2"><input class="post" type="text" maxlength="255" size="3" name="vote_min_posts" value="{VOTE_MIN_POSTS}" /></td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Minimum posts before Vote
$lang['Vote_min_posts'] = 'Minimum posts to Vote';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all, Folks!
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Minimum posts before Vote
$lang['Vote_min_posts_needed'] = 'You need %s posts to vote.';
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM