Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post
Post Disallow New Users To Cast Vote In Polls 
 
This is a mod that prevents new users (users with less than $n posts) to vote polls:

SQL

Code: [Download] [Hide] [Select]
INSERT INTO `ip_config` ( `config_name` , `config_value` ) VALUES ('vote_min_posts', '10');


in posting.php


Code: [Download] [Hide] [Select]
#
#-----[ FIND ]------------------------------------------
#
    // Vote in a poll
    //
#
#-----[ BEFORE, ADD ]------------------------------------------
#

//-- mod : Minimum posts before Vote ------------------------------------------------------------
//-- add
// Check if user has enough posts
$vote_posts = $board_config['vote_min_posts'];
if ( $userdata['user_posts'] < $vote_posts && $userdata['user_level'] == USER )
{
    message_die(GENERAL_MESSAGE, sprintf($lang['Vote_min_posts_needed'], $vote_posts));
}
//-- fin mod : Minimum posts before Vote --------------------------------------------------------



in adm/admin_board.php

Code: [Download] [Hide] [Select]
#
#-----[ FIND ]------------------------------------------
#
    'L_SYSTEM_TIMEZONE' => $lang['System_timezone'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : Minimum posts before Vote ------------------------------------------------------------
//-- add
    'L_VOTE_MIN_POSTS' => $lang['Vote_min_posts'],
//-- fin mod : Minimum posts before Vote --------------------------------------------------------
#
#-----[ FIND ]------------------------------------------
#
    'TIMEZONE_SELECT' => $timezone_select,
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : Minimum posts before Vote ------------------------------------------------------------
//-- add
    'VOTE_MIN_POSTS' => $new['vote_min_posts'],
//-- fin mod : Minimum posts before Vote --------------------------------------------------------


in language/lang_english/lang_admin.php

Code: [Download] [Hide] [Select]
#
#-----[ FIND ]------------------------------------------
#

$lang['Session_length'] = 'Session length [ seconds ]';

#
#-----[ AFTER, ADD ]------------------------------------------
#

//-- mod : Minimum posts before Vote ------------------------------------------------------------
//-- add
$lang['Vote_min_posts'] = 'Minimum posts to Vote';
//-- fin mod : Minimum posts before Vote --------------------------------------------------------


in language/lang_english/lang_main.php

Code: [Download] [Hide] [Select]
#
#-----[ FIND ]------------------------------------------
#

//====================================================
// Do not insert anything below this line
//====================================================

?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#

//-- mod : Minimum posts before Vote ------------------------------------------------------------
//-- add
$lang['Vote_min_posts_needed'] = 'You need %s posts to vote.';
//-- fin mod : Minimum posts before Vote --------------------------------------------------------


in templates/common/ACP/board_config_body.tpl

Code: [Download] [Hide] [Select]
#
#-----[ FIND ]------------------------------------------
#
    <tr>
        <td class="row1">{L_ONLINE_TIME} <br /><span class="gensmall">{L_ONLINE_TIME_EXPLAIN}</span></td>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- mod : Minimum posts before Vote -->
    <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>
<!-- fin mod : Minimum posts before Vote -->









Edit: I forgot to add the credits. This is not mine, I just adapted it for Icy from here
 



 
VortexSend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron