[BETA] Advanced Points System v.0.9.2

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Scam Warning
Locked
TMorph
Registered User
Posts: 31
Joined: Mon May 30, 2005 7:23 am
Location: Silent Hill
Contact:

Re: [BETA] Advanced Points System v.0.9.1

Post by TMorph »

Works but the settings are not saved :shock:
I feel my English, Translation with translator
CiberMorph
CiberMorph-phpbb3
kmklr72
Registered User
Posts: 477
Joined: Sat Dec 29, 2007 9:37 pm
Location: St. Louis, USA
Name: Kevin

Re: [BETA] Advanced Points System v.0.9.1

Post by kmklr72 »

This should work (it does for me).

Open adm/style/acp_points.html
Replace all code with:

Code: Select all

<!-- INCLUDE overall_header.html -->  <a name="maincontent"></a>  <form id="cash" method="post" action="">  <fieldset>
	<legend>{L_ACP_POINTS_INDEX_TITLE}</legend> 	
	<dl>
		<dt><label>{L_POINTS_NAME}:</label><br />{L_POINTS_NAME_EXPLAIN}</dt>
		<dd><input name="POINTS_NAME" type="text" id="POINTS_NAME" size=30 value="{POINTS_NAME}" /></dd>
	</dl>
	
	<dl>
		<dt><label>{L_POINTS_ENABLE}:</label><br />{L_POINTS_ENABLE_EXPLAIN}</dt>
		<dd><label><input type="radio" class="radio" name="POINTS_ENABLE" value="1"<!-- IF POINTS_ENABLE --> id="POINTS_ENABLE" checked="checked" <!-- ENDIF --> /> Yes</label>
		<label><input type="radio" class="radio" name="POINTS_ENABLE" value="0"<!-- IF not POINTS_ENABLE --> id="POINTS_ENABLE" checked="checked" <!-- ENDIF --> /> No</label></dd>
	</dl>
	
	<dl>
		<dt><label>{L_POINTS_DISABLEMSG}:</label><br />{L_POINTS_DISABLEMSG_EXPLAIN}</dt>
		<dd><input name="POINTS_DISABLEMSG" type="text" id="POINTS_DISABLEMSG" size=120 value="{POINTS_DISABLEMSG}" /></dd>
	</dl>
	
	<dl>
		<dt><label>{L_POINTS_TRANSFER}:</label><br />{L_POINTS_TRANSFER_EXPLAIN}</dt>
		<dd><label><input type="radio" class="radio" name="POINTS_TRANSFER" value="1"<!-- IF POINTS_TRANSFER --> id="POINTS_TRANSFER" checked="checked" <!-- ENDIF --> /> Yes</label>
		<label><input type="radio" class="radio" name="POINTS_TRANSFER" value="0"<!-- IF not POINTS_TRANSFER --> id="POINTS_TRANSFER" checked="checked" <!-- ENDIF --> /> No</label></dd>
	</dl>
	
	<dl>
		<dt><label>{L_POINTS_STATS}:</label><br />{L_POINTS_STATS_EXPLAIN}</dt>
		<dd><label><input type="radio" class="radio" name="POINTS_STATS" value="1"<!-- IF POINTS_STATS --> id="POINTS_STATS" checked="checked" <!-- ENDIF --> /> Yes</label>
		<label><input type="radio" class="radio" name="POINTS_STATS" value="0"<!-- IF not POINTS_STATS --> id="POINTS_STATS" checked="checked" <!-- ENDIF --> /> No</label></dd>
	</dl>

	<dl>
		<dt><label>{L_POINTS_TRANSFER_PM}:</label><br />{L_POINTS_TRANSFER_PM_EXPLAIN}</dt>
		<dd><label><input type="radio" class="radio" name="POINTS_TRANSFER_PM" value="1"<!-- IF POINTS_TRANSFER_PM --> id="POINTS_TRANSFER_PM" checked="checked" <!-- ENDIF --> /> Yes</label>
		<label><input type="radio" class="radio" name="POINTS_TRANSFER_PM" value="0"<!-- IF not POINTS_TRANSFER_PM --> id="POINTS_TRANSFER_PM" checked="checked" <!-- ENDIF --> /> No</label></dd>
	</dl>
	
	<dl>
		<dt><label>{L_POINTS_COMMENTS}:</label><br />{L_POINTS_COMMENTS_EXPLAIN}</dt>
		<dd><label><input type="radio" class="radio" name="POINTS_COMMENTS" value="1"<!-- IF POINTS_COMMENTS --> id="POINTS_COMMENTS" checked="checked" <!-- ENDIF --> /> Yes</label>
		<label><input type="radio" class="radio" name="POINTS_COMMENTS" value="0"<!-- IF not POINTS_COMMENTS --> id="POINTS_COMMENTS" checked="checked" <!-- ENDIF --> /> No</label></dd>
	</dl>

	<dl>
		<dt><label>{L_POINTS_PERTOPIC}:</label><br />{L_POINTS_PERTOPIC_EXPLAIN}</dt>
		<dd><label><input type="radio" class="radio" name="POINTS_PERTOPIC" value="1"<!-- IF POINTS_PERTOPIC --> id="POINTS_PERTOPIC" checked="checked" <!-- ENDIF --> /> Yes</label>
		<label><input type="radio" class="radio" name="POINTS_PERTOPIC" value="0"<!-- IF not POINTS_PERTOPIC --> id="POINTS_PERTOPIC" checked="checked" <!-- ENDIF --> /> No</label></dd>
	</dl>

	<dl>
		<dt><label>{L_POINTS_PERPOST}:</label><br />{L_POINTS_PERPOST_EXPLAIN}</dt>
		<dd><label><input type="radio" class="radio" name="POINTS_PERPOST" value="1"<!-- IF POINTS_PERPOST --> id="POINTS_PERPOST" checked="checked" <!-- ENDIF --> /> Yes</label>
		<label><input type="radio" class="radio" name="POINTS_PERPOST" value="0"<!-- IF not POINTS_PERPOST --> id="POINTS_PERPOST" checked="checked" <!-- ENDIF --> /> No</label></dd>
	</dl>	

	<dl>
		<dt><label>{L_POINTS_PEREDIT}:</label><br />{L_POINTS_PEREDIT_EXPLAIN}</dt>
		<dd><label><input type="radio" class="radio" name="POINTS_PEREDIT" value="1"<!-- IF POINTS_PEREDIT --> id="POINTS_PEREDIT" checked="checked" <!-- ENDIF --> /> Yes</label>
		<label><input type="radio" class="radio" name="POINTS_PEREDIT" value="0"<!-- IF not POINTS_PEREDIT --> id="POINTS_PEREDIT" checked="checked" <!-- ENDIF --> /> No</label></dd>
	</dl>	
	
	<dl>
		<dt><label>{L_POINTS_LOGS}:</label><br />{L_POINTS_LOGS_EXPLAIN}</dt>
		<dd><label><input type="radio" class="radio" name="POINTS_LOGS" value="1"<!-- IF POINTS_LOGS --> id="POINTS_LOGS" checked="checked" <!-- ENDIF --> /> Yes</label>
		<label><input type="radio" class="radio" name="POINTS_LOGS" value="0"<!-- IF not POINTS_LOGS --> id="POINTS_LOGS" checked="checked" <!-- ENDIF --> /> No</label></dd>
	</dl>

	<dl>
		<dt><label>{L_LOTTERY_VIEW}:</label><br />{L_LOTTERY_VIEW_EXPLAIN}</dt>
		<dd><label><input type="radio" class="radio" name="LOTTERY_ENABLE" value="1"<!-- IF LOTTERY_ENABLE --> id="LOTTERY_ENABLE" checked="checked" <!-- ENDIF --> /> Yes</label>
		<label><input type="radio" class="radio" name="LOTTERY_ENABLE" value="0"<!-- IF not LOTTERY_ENABLE --> id="LOTTERY_ENABLE" checked="checked" <!-- ENDIF --> /> No</label></dd>
	</dl>

	<dl>
		<dt><label>{L_BANK_VIEW}:</label><br />{L_BANK_VIEW_EXPLAIN}</dt>
		<dd><label><input type="radio" class="radio" name="BANK_ENABLE" value="1"<!-- IF BANK_ENABLE --> id="BANK_ENABLE" checked="checked" <!-- ENDIF --> /> Yes</label>
		<label><input type="radio" class="radio" name="BANK_ENABLE" value="0"<!-- IF not BANK_ENABLE --> id="BANK_ENABLE" checked="checked" <!-- ENDIF --> /> No</label></dd>
	</dl>
	
	<dl>
		<dt><label>{L_POINTS_IMAGES_TOPIC}:</label><br />{L_POINTS_IMAGES_TOPIC_EXPLAIN}</dt>
		<dd><label><input type="radio" class="radio" name="POINTS_IMAGES_TOPIC" value="1"<!-- IF POINTS_IMAGES_TOPIC --> id="POINTS_IMAGES_TOPIC" checked="checked" <!-- ENDIF --> /> Yes</label>
		<label><input type="radio" class="radio" name="POINTS_IMAGES_TOPIC" value="0"<!-- IF not POINTS_IMAGES_TOPIC --> id="POINTS_IMAGES_TOPIC" checked="checked" <!-- ENDIF --> /> No</label></dd>
	</dl>
	
	<dl>
		<dt><label>{L_POINTS_IMAGES_MEMBERLIST}:</label><br />{L_POINTS_IMAGES_MEMBERLIST_EXPLAIN}</dt>
		<dd><label><input type="radio" class="radio" name="POINTS_IMAGES_MEMBERLIST" value="1"<!-- IF POINTS_IMAGES_MEMBERLIST --> id="POINTS_IMAGES_MEMBERLIST" checked="checked" <!-- ENDIF --> /> Yes</label>
		<label><input type="radio" class="radio" name="POINTS_IMAGES_MEMBERLIST" value="0"<!-- IF not POINTS_IMAGES_MEMBERLIST --> id="POINTS_IMAGES_MEMBERLIST" checked="checked" <!-- ENDIF --> /> No</label></dd>
	</dl>
	
	<dl>
		<dt><label>{L_POINTS_JAF_ENABLE}:</label><br />{L_POINTS_JAF_ENABLE_EXPLAIN}</dt>
		<dd><label><input type="radio" class="radio" name="POINTS_ROBBERY" value="1"<!-- IF POINTS_ROBBERY --> id="POINTS_ROBBERY" checked="checked" <!-- ENDIF --> /> Yes</label>
		<label><input type="radio" class="radio" name="POINTS_ROBBERY" value="0"<!-- IF not POINTS_ROBBERY --> id="POINTS_ROBBERY" checked="checked" <!-- ENDIF --> /> No</label></dd>
	</dl>

<p class="quick"> 	<input class="button1" type="submit" name="submit" value="Submit" /> </p>  </fieldset>  </form> 
<form id="acp_bank" method="post" action="{U_ACTION}">
	<fieldset>
		<legend>{L_POINTS_ADV_OPTIONS}</legend>
		<dl>
			<dt><label for="points_attachment">{L_POINTS_ATTACHMENT}:</label></dt>
			<dd><input type="text" id="points_attachment" name="points_attachment" value="{POINTS_ATTACHMENT}" size="5" /> {L_POINTS_NAME}</dd>
		</dl>
		<dl>
			<dt><label for="points_attachment_per_file">{L_POINTS_ATTACHMENT_PER_FILE}:</label></dt>
			<dd><input type="text" id="points_attachment_per_file" name="points_attachment_per_file" value="{POINTS_ATTACHMENT_PER_FILE}" size="5" /> {L_POINTS_NAME}</dd>
		</dl>
		<dl>
			<dt><label for="points_poll">{L_POINTS_POLL}:</label></dt>
			<dd><input type="text" id="points_poll" name="points_poll" value="{POINTS_POLL}" size="5" /> {L_POINTS_NAME}</dd>
		</dl>
		<dl>
			<dt><label for="points_poll_per_option">{L_POINTS_POLL_PER_OPTION}:</label></dt>
			<dd><input type="text" id="points_poll_per_option" name="points_poll_per_option" value="{POINTS_POLL_PER_OPTION}" size="5" /> {L_POINTS_NAME}</dd>
		</dl>
		<dl>
			<dt><label for="points_topic_per_word">{L_POINTS_TOPIC_PER_WORD}:</label></dt>
			<dd><input type="text" id="points_topic_per_word" name="points_topic_per_word" value="{POINTS_TOPIC_PER_WORD}" size="5" /> {L_POINTS_NAME}</dd>
		</dl>
		<dl>
			<dt><label for="points_topic_per_character">{L_POINTS_TOPIC_PER_CHARACTER}:</label></dt>
			<dd><input type="text" id="points_topic_per_character" name="points_topic_per_character" value="{POINTS_TOPIC_PER_CHARACTER}" size="5" /> {L_POINTS_NAME}</dd>
		</dl>
		<dl>
			<dt><label for="points_post_per_word">{L_POINTS_POST_PER_WORD}:</label></dt>
			<dd><input type="text" id="points_post_per_word" name="points_post_per_word" value="{POINTS_POST_PER_WORD}" size="5" /> {L_POINTS_NAME}</dd>
		</dl>
		<dl>
			<dt><label for="points_post_per_character">{L_POINTS_POST_PER_CHARACTER}:</label></dt>
			<dd><input type="text" id="points_post_per_character" name="points_post_per_character" value="{POINTS_POST_PER_CHARACTER}" size="5" /> {L_POINTS_NAME}</dd>
		</dl>
		<dl>
			<dt><label for="points_cost_attachment">{L_POINTS_COST_ATTACHMENT}:</label></dt>
			<dd><input type="text" id="points_cost_attachment" name="points_cost_attachment" value="{POINTS_COST_ATTACHMENT}" size="5" /> {L_POINTS_NAME}</dd>
		</dl>
		<dl>
			<dt><label for="reg_points_bonus">{L_REG_POINTS_BONUS}:</label></dt>
			<dd><input type="text" id="reg_points_bonus" name="reg_points_bonus" value="{REG_POINTS_BONUS}" size="5" /> {L_POINTS_NAME}</dd>
		</dl>
		<dl>
			<dt><label for="top_points">{L_TOP_POINTS}:</label></dt>
			<dd><input type="text" id="top_points" name="top_points" value="{TOP_POINTS}" size="5" /> </dd>
		</dl>
		<dl>
			<dt><label for="points_warn">{L_POINTS_WARN}:</label></dt>
			<dd><input type="text" id="points_warn" name="points_warn" value="{POINTS_WARN}" size="5" /> {L_POINTS_NAME}</dd>
		</dl>
		
       		<p class="quick">
			<input class="button1" type="submit" id="update_settings" name="update_settings" value="{L_SUBMIT}" />&nbsp;
		</p>
	</fieldset>
</form>

 <!-- INCLUDE overall_footer.html -->

Open includes/acp/acp_points.php
Replace all code with:

Code: Select all

<?php
/**
*
* @package acp
* @version $Id: acp_points.php v.1.9.7 2009-03-31 19:57:41Z doktorx $
* @copyright (c) 2008 McGod end doktorx
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

class acp_points
{
	var $u_action;
	var $new_config;
	
	function main($id, $mode)
	{
		global $db, $user, $auth, $template;
		global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $u_action;
		
		//Get config from Database
		$sql = 'SELECT * FROM ' . POINTS_CONFIG_TABLE;
		$result = $db->sql_query($sql);
		$Points = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);
		$template->assign_vars(array_change_key_case($Points, CASE_UPPER));
		
		//Grab some vars
		$Action = request_var('action', '');
		$Id		= request_var('id', 0);

		$template->assign_vars(array(
			'BASE'		=> $this->u_action,
		));
				
		switch ($mode) {
			
			case 'points':
				$this->page_title = 'ACP_POINTS_INDEX_TITLE';
				$this->tpl_name = 'acp_points';	
									
				if (isset($_POST['submit'])) {
					$sql_ary = array (
						'points_name'		=>	utf8_normalize_nfc(request_var('POINTS_NAME', '', true)),
						'points_enable'		=>	request_var('POINTS_ENABLE', 0),
						'points_disablemsg'		=>	utf8_normalize_nfc(request_var('POINTS_DISABLEMSG', '', true)),
						'points_transfer'	=>	request_var('POINTS_TRANSFER', 0),
						'points_transfer_pm'	=>	request_var('POINTS_TRANSFER_PM', 0),
						'points_comments'	=>	request_var('POINTS_COMMENTS', 0),
						'points_stats'	=>	request_var('POINTS_STATS', 0),
						'points_pertopic'	=>	request_var('POINTS_PERTOPIC', 0),
						'points_perpost'	=>	request_var('POINTS_PERPOST', 0),
						'points_peredit'	=>	request_var('POINTS_PEREDIT', 0),
						'points_logs'		=>	request_var('POINTS_LOGS', 0),
						'points_robbery'    => request_var('POINTS_ROBBERY', 0), 
                        'lottery_enable'		=>	request_var('LOTTERY_ENABLE', 0),
                        'bank_enable'		=>	request_var('BANK_ENABLE', 0),
						'points_images_topic' => request_var('POINTS_IMAGES_TOPIC', 0),
						'points_images_memberlist' => request_var('POINTS_IMAGES_MEMBERLIST', 0),
					);
					$sql = "UPDATE " . POINTS_CONFIG_TABLE . " SET " . $db->sql_build_array('UPDATE', $sql_ary);
					$db->sql_query($sql);
					
		   // Add logs
			add_log('admin', 'LOG_MOD_POINTS_SETTINGS');
			
					trigger_error($user->lang['POINTS_CONFIG_SUCCESS'] . adm_back_link($this->u_action));
				}
	else if (isset($_POST['update_settings']))
				{
			$points_attachment = request_var('points_attachment', 0);
			$points_attachment_per_file = request_var('points_attachment_per_file', 0);
			$points_poll = request_var('points_poll', 0);
			$points_poll_per_option = request_var('points_poll_per_option', 0);
			$points_topic_per_word = request_var('points_topic_per_word', 0);
			$points_topic_per_character = request_var('points_topic_per_character', 0);
			$points_post_per_word = request_var('points_post_per_word', 0);
			$points_post_per_character = request_var('points_post_per_character', 0);
			$points_cost_attachment = request_var('points_cost_attachment', 0);
			$reg_points_bonus = request_var('reg_points_bonus', 0);
			$top_points = request_var('top_points', 5);
			$points_warn = request_var('points_warn', 0);

			// Update variables if changed
			if($points_attachment != $config['points_attachment']) set_config('points_attachment', $points_attachment);
			if($points_attachment_per_file != $config['points_attachment_per_file']) set_config('points_attachment_per_file', $points_attachment_per_file);
			if($points_poll != $config['points_poll']) set_config('points_poll', $points_poll);
			if($points_poll_per_option != $config['points_poll_per_option']) set_config('points_poll_per_option', $points_poll_per_option);
            if($points_topic_per_word != $config['points_topic_per_word']) set_config('points_topic_per_word', $points_topic_per_word);
			if($points_topic_per_character != $config['points_topic_per_character']) set_config('points_topic_per_character', $points_topic_per_character);
			if($points_post_per_word != $config['points_post_per_word']) set_config('points_post_per_word', $points_post_per_word);
			if($points_post_per_character != $config['points_post_per_character']) set_config('points_post_per_character', $points_post_per_character);
			if($points_cost_attachment != $config['points_cost_attachment']) set_config('points_cost_attachment', $points_cost_attachment);
			if($reg_points_bonus != $config['reg_points_bonus']) set_config('reg_points_bonus', $reg_points_bonus);
			if($top_points != $config['top_points']) set_config('top_points', $top_points);
			if($points_warn != $config['points_warn']) set_config('points_warn', $points_warn);
			
			// Add logs
			add_log('admin', 'LOG_MOD_POINTS_SETTINGS');
			
			trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
				}
				else 
				{
			      $template->assign_vars(array(
					/*'points_attachment'		=> $config['points_attachment'],
						'points_attachment_per_file'		=> $config['points_attachment_per_file'],
						'points_poll'		=> $config['points_poll'],
						'points_poll_per_option'		=> $config['points_poll_per_option'],
						'points_topic_per_word'		=> $config['points_topic_per_word'],
						'points_topic_per_character'		=> $config['points_topic_per_character'],
						'points_post_per_word'		=> $config['points_post_per_word'],
						'points_post_per_character'		=> $config['points_post_per_character'],
						'points_cost_attachment'		=> $config['points_cost_attachment'],
						'reg_points_bonus'		=> $config['reg_points_bonus'],
						'top_points'		=> $config['top_points'],
						'points_warn'		=> $config['points_warn'],*/
						'POINTS_ATTACHMENT'		=> $config['points_attachment'],
						'POINTS_ATTACHMENT_PER_FILE'		=> $config['points_attachment_per_file'],
						'POINTS_POLL'		=> $config['points_poll'],
						'POINTS_POLL_PER_OPTION'		=> $config['points_poll_per_option'],
						'POINTS_TOPIC_PER_WORD'		=> $config['points_topic_per_word'],
						'POINTS_TOPIC_PER_CHARACTER'		=> $config['points_topic_per_character'],
						'POINTS_POST_PER_WORD'		=> $config['points_post_per_word'],
						'POINTS_POST_PER_CHARACTER'		=> $config['points_post_per_character'],
						'POINTS_COST_ATTACHMENT'		=> $config['points_cost_attachment'],
						'REG_POINTS_BONUS'		=> $config['reg_points_bonus'],
						'TOP_POINTS'		=> $config['top_points'],
						'POINTS_WARN'		=> $config['points_warn'],
				));

			}
			break;
			case 'lottery':
            		$this->page_title = 'ACP_POINTS_LOTTERY_TITLE';
				$this->tpl_name = 'acp_lottery';	

		$action = request_var('action', '');
		$submit = request_var('submit', '');

		$lottery_data = $errors = array();

		if($submit)
		{
			$lottery_name = request_var('lottery_name', '', true);
			$lottery_enabled = request_var('lottery_enabled', false);
			$lottery_base_amount = request_var('lottery_base_amount', 0);
			$lottery_draw_period = request_var('lottery_draw_period', 0) * 3600;
			$lottery_ticket_cost = request_var('lottery_ticket_cost', 0);
			$username_admin_lottery = utf8_normalize_nfc(request_var('username_admin_lottery', '', true));
			$lottery_sendpmadmin = request_var('lottery_sendpmadmin', false);
			$points_multiple_tickets = request_var('points_multiple_tickets', false);
			$display_lottery_stats = request_var('display_lottery_stats', false);

			if (empty($username_admin_lottery))
			{
			// Start transformation from username to user_id
			// Select user_id
			$sql = 'SELECT user_id
				FROM ' . USERS_TABLE . "
				WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username_admin_lottery)) . "'";
			$result = $db->sql_query($sql);
			$user_id_admin_lottery = (int) $db->sql_fetchfield('user_id');
			$db->sql_freeresult($result);

		   // If no match user id found	
			if (!$user_id_admin_lottery)
			{
				trigger_error($user->lang['NO_USER']);
			}
			// End transformation from username to user_id
			}
			
			//If base amount increases, increase jackpot
			if($lottery_base_amount > $config['lottery_base_amount'])
			{
				set_config('lottery_jackpot', $config['lottery_jackpot'] + $lottery_base_amount - $config['lottery_base_amount']);
			}

			// Update variables if changed
			if($lottery_name != $config['lottery_name']) set_config('lottery_name', $lottery_name);
			if($lottery_sendpmadmin != $config['lottery_sendpmadmin']) set_config('lottery_sendpmadmin', $lottery_sendpmadmin);
			if($lottery_enabled != $config['lottery_enabled']) set_config('lottery_enabled', $lottery_enabled);
			if($lottery_base_amount != $config['lottery_base_amount']) set_config('lottery_base_amount', $lottery_base_amount);
			if($user_id_admin_lottery != $config['user_id_admin_lottery']) set_config('user_id_admin_lottery', $user_id_admin_lottery);
			if($username_admin_lottery != $config['username_admin_lottery']) set_config('username_admin_lottery', $username_admin_lottery);
			if($lottery_draw_period != $config['lottery_draw_period']) set_config('lottery_draw_period', $lottery_draw_period);
			if($lottery_ticket_cost != $config['lottery_ticket_cost']) set_config('lottery_ticket_cost', $lottery_ticket_cost);
			if($points_multiple_tickets != $config['points_multiple_tickets']) set_config('points_multiple_tickets', $points_multiple_tickets);
			if($display_lottery_stats != $config['display_lottery_stats']) set_config('display_lottery_stats', $display_lottery_stats);

			// Set last draw time to current time if draw period activated
			if($config['lottery_last_draw_time'] == 0 && $config['lottery_draw_period'] != 0)
			{
				set_config('lottery_last_draw_time', time());
			}

			// Set last draw time to 0 if draw period deactivated
			if($config['lottery_draw_period'] == 0)
			{
				set_config('lottery_last_draw_time', 0);
			}
			
			// Add logs
			add_log('admin', 'LOG_MOD_POINTS_LOTTERY');
			
			trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
		}
		else
		{

			$template->assign_vars(array(
					'LOTTERY_BASE_AMOUNT'		=> $config['lottery_base_amount'],

					// Convert to hours
					'LOTTERY_DRAW_PERIOD'		=> ($config['lottery_draw_period'] == 0) ? $config['lottery_draw_period'] : $config['lottery_draw_period'] / 3600,
					'LOTTERY_TICKET_COST'		=> $config['lottery_ticket_cost'],
					'USERNAME_ADMIN_LOTTERY'    => $config['username_admin_lottery'],
					'LOTTERY_CASH_NAME'         => $Points['points_name'],
					
					'S_LOTTERY_ENABLED'			=> ($config['lottery_enabled']) ? true : false,
					'S_LOTTERY_SENDPMADMIN'			=> ($config['sendpmadmin']) ? true : false,
					'S_DISPLAY_LOTTERY_STATS'   => ($config['display_lottery_stats']) ? true : false,
					'S_MULTIPLE_TICKETS'		=> ($config['points_multiple_tickets']) ? true : false

				)
			);
     }
		        break;
			case 'bank':
            		$this->page_title = 'ACP_POINTS_BANK_TITLE';
				$this->tpl_name = 'acp_bank';	

		$action = request_var('action', '');
		$submit = request_var('submit', '');

		$lottery_data = $errors = array();

		if($submit)
		{
			$bank_enabled = request_var('bank_enabled', false);
			$bank_interest = request_var('bank_interest', 0);
			$bank_fees = request_var('bank_fees', 0);
			$bank_pay = request_var('bank_pay', 0);
			$bank_minwithdraw = request_var('bank_minwithdraw', 0);
			$bank_mindeposit = request_var('bank_mindeposit', 0);
 			$bank_interestcut = request_var('bank_interestcut', 0);  
            $bank_cost = request_var('bank_cost', 0);       			

			// Update variables if changed
			if($bank_enabled != $config['bank_enabled']) set_config('bank_enabled', $bank_enabled);
			if($bank_interest != $config['bank_interest']) set_config('bank_interest', $bank_interest);
			if($bank_fees != $config['bank_fees']) set_config('bank_fees', $bank_fees);
			if($bank_pay != $config['bank_pay']) set_config('bank_pay', $bank_pay);
			if($bank_minwithdraw != $config['bank_minwithdraw']) set_config('bank_minwithdraw', $bank_minwithdraw);
			if($bank_mindeposit != $config['bank_mindeposit']) set_config('bank_mindeposit', $bank_mindeposit);
			if($bank_interestcut != $config['bank_interestcut']) set_config('bank_interestcut', $bank_interestcut);
			if($bank_cost != $config['bank_cost']) set_config('bank_cost', $bank_cost);
			
			// Add logs
			add_log('admin', 'LOG_MOD_POINTS_BANK');
			
			trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
		}
		else
		{
			$template->assign_vars(array(
					'BANK_PAY'		=> $config['bank_pay'],
					'BANK_FEES'		=> $config['bank_fees'],
					'BANK_INTEREST'		=> $config['bank_interest'],
					'BANK_MINWITHDRAW'		=> $config['bank_minwithdraw'],
					'BANK_MINDEPOSIT'		=> $config['bank_mindeposit'],
					'BANK_INTERESTCUT'		=> $config['bank_interestcut'],
					'BANK_COST'		=> $config['bank_cost'],
                    'BANK_P'		=> $Points['points_name'],

					'S_BANK_ENABLED'			=> ($config['bank_enabled']) ? true : false,

				)
			);
     }
		        break;
				case 'jaf':
            		$this->page_title = 'ACP_POINTS_JAF_TITLE';
				$this->tpl_name = 'acp_jaf';	

		$action = request_var('action', '');
		$submit = request_var('submit', '');

		$lottery_data = $errors = array();

		if($submit)
		{
			$points_jaf_enable = request_var('points_jaf_enable', false);
			$points_jaf_sendpm = request_var('points_jaf_sendpm', false);
			$points_jaf_pos = request_var('points_jaf_pos', 1);
			$points_jaf_amountlose = request_var('points_jaf_amountlose', 0);
               
			//If the possibility is to small whe replace it wth the defalut value  
			if($points_jaf_pos  < 2)
			{
				$points_jaf_pos = 3;
			}
				  
			// Update variables if changed
			if($points_jaf_enable != $config['points_jaf_enable']) set_config('points_jaf_enable', $points_jaf_enable);
			if($points_jaf_sendpm != $config['points_jaf_sendpm']) set_config('points_jaf_sendpm', $points_jaf_sendpm);
			if($points_jaf_pos != $config['points_jaf_pos']) set_config('points_jaf_pos', $points_jaf_pos);
			if($points_jaf_amountlose != $config['points_jaf_amountlose']) set_config('points_jaf_amountlose', $points_jaf_amountlose);
				
			// Add logs
			add_log('admin', 'LOG_MOD_POINTS_ROBBERY');
			
			trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
		}
		else
		{
			$template->assign_vars(array(
					'POINTS_JAF_POS'		=> $config['points_jaf_pos'],
					'POINTS_JAF_AMOUNTLOSE'		=> $config['points_jaf_amountlose'],

					'S_POINTS_JAF_ENABLE'			=> ($config['points_jaf_enable']) ? true : false,
					'S_POINTS_JAF_SENDPM'			=> ($config['points_jaf_sendpm']) ? true : false,

			));
     }
		        break;
		}
   }
}
?>

Save and close all files. Don't forget to purge your cache.
User avatar
Ulenka
Registered User
Posts: 25
Joined: Sun May 31, 2009 2:47 pm

Re: [BETA] Advanced Points System v.0.9.1

Post by Ulenka »

kmklr72, I see it's working. Thank you!
TMorph
Registered User
Posts: 31
Joined: Mon May 30, 2005 7:23 am
Location: Silent Hill
Contact:

Re: [BETA] Advanced Points System v.0.9.1

Post by TMorph »

OK

Code: Select all

[phpBB Debug] PHP Notice: in file /adm/index.php on line 151: Cannot modify header information - headers already sent by (output started at /includes/acp/acp_points.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 153: Cannot modify header information - headers already sent by (output started at /includes/acp/acp_points.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 154: Cannot modify header information - headers already sent by (output started at /includes/acp/acp_points.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 155: Cannot modify header information - headers already sent by (output started at /includes/acp/acp_points.php:1)
I feel my English, Translation with translator
CiberMorph
CiberMorph-phpbb3
User avatar
Greight
Registered User
Posts: 163
Joined: Sun Jan 18, 2009 12:10 pm

Re: [BETA] Advanced Points System v.0.9.1

Post by Greight »

TMorph wrote:OK

Code: Select all

[phpBB Debug] PHP Notice: in file /adm/index.php on line 151: Cannot modify header information - headers already sent by (output started at /includes/acp/acp_points.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 153: Cannot modify header information - headers already sent by (output started at /includes/acp/acp_points.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 154: Cannot modify header information - headers already sent by (output started at /includes/acp/acp_points.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 155: Cannot modify header information - headers already sent by (output started at /includes/acp/acp_points.php:1)
The same for me
Also it seems that per forum post and topic points are not saved ! Have you tested this ?
User avatar
Ulenka
Registered User
Posts: 25
Joined: Sun May 31, 2009 2:47 pm

Re: [BETA] Advanced Points System v.0.9.1

Post by Ulenka »

I have problem with this changes.
I have established 1 'Points per word on new topics', but it is charged 10 points to the user.
User avatar
Greight
Registered User
Posts: 163
Joined: Sun Jan 18, 2009 12:10 pm

Re: [BETA] Advanced Points System v.0.9.1

Post by Greight »

As I said :
Also it seems that per forum post and topic points are not saved !
You can't change per forum points ! Somebody should sort this problem out !
kmklr72
Registered User
Posts: 477
Joined: Sat Dec 29, 2007 9:37 pm
Location: St. Louis, USA
Name: Kevin

Re: [BETA] Advanced Points System v.0.9.1

Post by kmklr72 »

Greight wrote:
TMorph wrote:OK

Code: Select all

[phpBB Debug] PHP Notice: in file /adm/index.php on line 151: Cannot modify header information - headers already sent by (output started at /includes/acp/acp_points.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 153: Cannot modify header information - headers already sent by (output started at /includes/acp/acp_points.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 154: Cannot modify header information - headers already sent by (output started at /includes/acp/acp_points.php:1)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 155: Cannot modify header information - headers already sent by (output started at /includes/acp/acp_points.php:1)
The same for me
Also it seems that per forum post and topic points are not saved ! Have you tested this ?
I tested it myself on my forum. I'll take a look at my edits again when I can look at the files.
User avatar
Greight
Registered User
Posts: 163
Joined: Sun Jan 18, 2009 12:10 pm

Re: [BETA] Advanced Points System v.0.9.1

Post by Greight »

per forum points problem was because of acp_forums.php. There was no edit in it. Seems setup has replaced it and I haven't noticed that.
I tested it myself on my forum. I'll take a look at my edits again when I can look at the files.
And can you make fractions possible ?
User avatar
Ashley.S.
Registered User
Posts: 469
Joined: Mon Aug 04, 2008 6:01 pm
Location: Falmouth, Cornwall, UK
Name: Ashley .S.
Contact:

Re: [BETA] Advanced Points System v.0.9.1

Post by Ashley.S. »

Greight wrote:per forum points problem was because of acp_forums.php. There was no edit in it. Seems setup has replaced it and I haven't noticed that.
I tested it myself on my forum. I'll take a look at my edits again when I can look at the files.
And can you make fractions possible ?
I reported the bug to Adrian a while back, I expect he will fix it in the next version
Regards,
-Ashley.S. [ PurephpBB Founder ]
kmklr72
Registered User
Posts: 477
Joined: Sat Dec 29, 2007 9:37 pm
Location: St. Louis, USA
Name: Kevin

Re: [BETA] Advanced Points System v.0.9.1

Post by kmklr72 »

Greight wrote:per forum points problem was because of acp_forums.php. There was no edit in it. Seems setup has replaced it and I haven't noticed that.
I tested it myself on my forum. I'll take a look at my edits again when I can look at the files.
And can you make fractions possible ?
I can try to make them possible. Even though I don't know anything about fractions in PHP, I'm always willing to learn. Also, are you still getting that error with acp_points.php.
User avatar
Ashley.S.
Registered User
Posts: 469
Joined: Mon Aug 04, 2008 6:01 pm
Location: Falmouth, Cornwall, UK
Name: Ashley .S.
Contact:

Re: [BETA] Advanced Points System v.0.9.1

Post by Ashley.S. »

kmklr72 wrote:
Greight wrote:per forum points problem was because of acp_forums.php. There was no edit in it. Seems setup has replaced it and I haven't noticed that.
I tested it myself on my forum. I'll take a look at my edits again when I can look at the files.
And can you make fractions possible ?
I can try to make them possible. Even though I don't know anything about fractions in PHP, I'm always willing to learn. Also, are you still getting that error with acp_points.php.
I have posted your bug fix at the phpbbgods.org website, and all seems to be well now, just noticed that your php code for the beginning & end has spaces in it when I copied it, so that might have caused a few errors to a few users using your code
Regards,
-Ashley.S. [ PurephpBB Founder ]
User avatar
Greight
Registered User
Posts: 163
Joined: Sun Jan 18, 2009 12:10 pm

Re: [BETA] Advanced Points System v.0.9.1

Post by Greight »

Thanx to both of you the problem was sorted out.
I'm still waiting for that fraction ;)
User avatar
Ashley.S.
Registered User
Posts: 469
Joined: Mon Aug 04, 2008 6:01 pm
Location: Falmouth, Cornwall, UK
Name: Ashley .S.
Contact:

Re: [BETA] Advanced Points System v.0.9.1

Post by Ashley.S. »

Greight wrote:Thanx to both of you the problem was sorted out.
I'm still waiting for that fraction ;)
That's something to speak to Adrian about, he said to me at phpbbgods when I reported it not working that he would fix it back up in the next version. He just needs time to finish the next release version of his Shop Mod Addon and then I'm sure he will be able to start work on the points system again
Regards,
-Ashley.S. [ PurephpBB Founder ]
kmklr72
Registered User
Posts: 477
Joined: Sat Dec 29, 2007 9:37 pm
Location: St. Louis, USA
Name: Kevin

Re: [BETA] Advanced Points System v.0.9.1

Post by kmklr72 »

Whitespaces is what I get for doing those edits in windows and forgetting to save with UNIX line endings lol. Thanks for giving that code to Adrian.
Locked

Return to “[3.0.x] MODs in Development”