mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Remove trailing whitespace
This commit is contained in:
parent
c5267b42fd
commit
37b0d3a1e6
71 changed files with 806 additions and 806 deletions
|
|
@ -173,7 +173,7 @@ class pointAdminController extends point
|
|||
|
||||
// A function to calculate per-level points
|
||||
$config->expression = $args->expression;
|
||||
|
||||
|
||||
// Save
|
||||
$oModuleController->insertModuleConfig('point', $config);
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ class pointAdminController extends point
|
|||
'voter', 'blamer', 'voter_comment', 'blamer_comment',
|
||||
'download_file_author', 'read_document_author', 'voted', 'blamed', 'voted_comment', 'blamed_comment',
|
||||
);
|
||||
|
||||
|
||||
foreach($configTypeList AS $config)
|
||||
{
|
||||
if(is_array($args->{$config}))
|
||||
|
|
@ -385,7 +385,7 @@ class pointAdminController extends point
|
|||
$output = executeQuery("point.initMemberPoint");
|
||||
if(!$output->toBool()) return $output;
|
||||
// Save the file temporarily
|
||||
|
||||
|
||||
$str = '';
|
||||
foreach($member as $key => $val)
|
||||
{
|
||||
|
|
@ -432,7 +432,7 @@ class pointAdminController extends point
|
|||
{
|
||||
FileHandler::removeFile('./files/cache/pointRecal.txt');
|
||||
$idx = $total;
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::clearGroup('member');
|
||||
FileHandler::rename('./files/member_extra_info/point','./files/member_extra_info/point.old');
|
||||
FileHandler::removeDir('./files/member_extra_info/point.old');
|
||||
|
|
|
|||
|
|
@ -47,11 +47,11 @@ class pointAdminView extends point
|
|||
}
|
||||
}
|
||||
Context::set('group_list', $selected_group_list);
|
||||
|
||||
|
||||
// Get max level allowed by system
|
||||
$system_max_level = min(1000, ini_get('max_input_vars') - 100);
|
||||
Context::set('system_max_level', $system_max_level);
|
||||
|
||||
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('group_list..title','group_list..description');
|
||||
|
|
@ -116,7 +116,7 @@ class pointAdminView extends point
|
|||
|
||||
$columnList = array('member.member_srl', 'member.user_id', 'member.email_address', 'member.nick_name', 'point.point');
|
||||
$output = $oPointModel->getMemberList($args, $columnList);
|
||||
// context::set for writing into a template
|
||||
// context::set for writing into a template
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
|
|
|
|||
|
|
@ -11,17 +11,17 @@ class point extends ModuleObject
|
|||
* Cache for the point module's own configuration.
|
||||
*/
|
||||
protected static $_config = null;
|
||||
|
||||
|
||||
/**
|
||||
* Cache for other modules' point configuration.
|
||||
*/
|
||||
protected static $_module_config_cache = array();
|
||||
|
||||
|
||||
/**
|
||||
* Cache for member points.
|
||||
*/
|
||||
protected static $_member_point_cache = array();
|
||||
|
||||
|
||||
/**
|
||||
* Triggers to insert.
|
||||
*/
|
||||
|
|
@ -49,7 +49,7 @@ class point extends ModuleObject
|
|||
array('module.procModuleAdminCopyModule', 'after', 'controller', 'triggerCopyModule'),
|
||||
array('module.dispAdditionSetup', 'after', 'view', 'triggerDispPointAdditionSetup'),
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Triggers to delete.
|
||||
*/
|
||||
|
|
@ -58,7 +58,7 @@ class point extends ModuleObject
|
|||
array('document.deleteDocument', 'before', 'controller', 'triggerBeforeDeleteDocument'),
|
||||
array('file.insertFile', 'after', 'controller', 'triggerInsertFile'),
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Shortcut to getting module configuration
|
||||
*/
|
||||
|
|
@ -70,10 +70,10 @@ class point extends ModuleObject
|
|||
}
|
||||
return self::$_config;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check triggers.
|
||||
*
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function checkTriggers()
|
||||
|
|
@ -95,10 +95,10 @@ class point extends ModuleObject
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register triggers.
|
||||
*
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function registerTriggers()
|
||||
|
|
@ -120,7 +120,7 @@ class point extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Additional tasks required to accomplish during the installation
|
||||
*/
|
||||
|
|
@ -140,7 +140,7 @@ class point extends ModuleObject
|
|||
{
|
||||
$config->level_step[$i] = pow($i, 2) * 90;
|
||||
}
|
||||
|
||||
|
||||
// Define default points.
|
||||
$config->signup_point = 10;
|
||||
$config->login_point = 5;
|
||||
|
|
@ -153,10 +153,10 @@ class point extends ModuleObject
|
|||
$config->blamed = 0;
|
||||
$config->voted_comment = 0;
|
||||
$config->blamed_comment = 0;
|
||||
|
||||
|
||||
// Save module config.
|
||||
getController('module')->insertModuleConfig('point', $config);
|
||||
|
||||
|
||||
// Create a directory to store points information.
|
||||
FileHandler::makeDir('./files/member_extra_info/point');
|
||||
}
|
||||
|
|
@ -186,7 +186,7 @@ class point extends ModuleObject
|
|||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
/* End of file point.class.php */
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class pointController extends point
|
|||
* Variables for internal reference.
|
||||
*/
|
||||
protected $_original;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
*/
|
||||
|
|
@ -29,7 +29,7 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$config = $this->getConfig();
|
||||
$diff = intval($config->signup_point);
|
||||
if ($diff != 0)
|
||||
|
|
@ -49,13 +49,13 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Points are given only once a day.
|
||||
if (substr($obj->last_login, 0, 8) === date('Ymd'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$config = $this->getConfig();
|
||||
$diff = intval($config->login_point);
|
||||
if ($diff != 0)
|
||||
|
|
@ -72,7 +72,7 @@ class pointController extends point
|
|||
{
|
||||
$group_srl = $obj->group_srl;
|
||||
$config = $this->getConfig();
|
||||
|
||||
|
||||
// Exclude deleted group from point/level/group integration
|
||||
if($config->point_group && isset($config->point_group[$group_srl]))
|
||||
{
|
||||
|
|
@ -80,7 +80,7 @@ class pointController extends point
|
|||
getController('module')->insertModuleConfig('point', $config);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief A trigger to add points to the member for creating a post
|
||||
*/
|
||||
|
|
@ -92,7 +92,7 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// The fix to disable giving points for saving the document temporarily
|
||||
if ($module_srl == $member_srl)
|
||||
{
|
||||
|
|
@ -102,19 +102,19 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$diff = 0;
|
||||
|
||||
// Add points for the document.
|
||||
$diff += $this->_getModulePointConfig($module_srl, 'insert_document');
|
||||
|
||||
|
||||
// Add points for attached files.
|
||||
if ($obj->updated_file_count > 0)
|
||||
{
|
||||
$upload_point = $this->_getModulePointConfig($module_srl, 'upload_file');
|
||||
$diff += $upload_point * $obj->updated_file_count;
|
||||
}
|
||||
|
||||
|
||||
// Increase the point.
|
||||
if ($diff != 0)
|
||||
{
|
||||
|
|
@ -137,7 +137,7 @@ class pointController extends point
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief The trigger to give points for normal saving the temporarily saved document
|
||||
* Temporary storage at the point in 1.2.3 changed to avoid payment
|
||||
|
|
@ -154,15 +154,15 @@ class pointController extends point
|
|||
$module_srl = $obj->module_srl;
|
||||
$member_srl = $obj->member_srl;
|
||||
}
|
||||
|
||||
|
||||
if (!$module_srl || !$member_srl)
|
||||
{
|
||||
$this->_original = null;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$diff = 0;
|
||||
|
||||
|
||||
// Add points for the document, only if the document is being updated from TEMP to another status such as PUBLIC.
|
||||
if ($obj->status !== DocumentModel::getConfigStatus('temp') && $this->_original->get('status') === DocumentModel::getConfigStatus('temp'))
|
||||
{
|
||||
|
|
@ -175,14 +175,14 @@ class pointController extends point
|
|||
$upload_point = $this->_getModulePointConfig($module_srl, 'upload_file');
|
||||
$diff += $upload_point * $obj->updated_file_count;
|
||||
}
|
||||
|
||||
|
||||
// Increase the point.
|
||||
if ($diff != 0)
|
||||
{
|
||||
$cur_point = PointModel::getPoint($member_srl);
|
||||
$this->setPoint($member_srl, $cur_point + $diff);
|
||||
}
|
||||
|
||||
|
||||
// Remove the reference to the original document.
|
||||
$this->_original = null;
|
||||
}
|
||||
|
|
@ -192,7 +192,7 @@ class pointController extends point
|
|||
*/
|
||||
public function triggerBeforeDeleteDocument($obj)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -210,14 +210,14 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Return if disabled
|
||||
$config = $this->getConfig();
|
||||
if ($config->insert_document_revert_on_delete === false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// The fix to disable giving points for saving the document temporarily
|
||||
if ($module_srl == $member_srl)
|
||||
{
|
||||
|
|
@ -227,10 +227,10 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Subtract points for the document.
|
||||
$diff = $this->_getModulePointConfig($module_srl, 'insert_document');
|
||||
|
||||
|
||||
// Increase the point.
|
||||
if ($diff != 0)
|
||||
{
|
||||
|
|
@ -258,14 +258,14 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Abort if the comment and the document have the same author.
|
||||
$oDocument = DocumentModel::getDocument($obj->document_srl);
|
||||
if (!$oDocument->isExists() || abs($oDocument->get('member_srl')) == $member_srl)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Abort if the document is older than a configured limit.
|
||||
$config = $this->getConfig();
|
||||
$time_limit = $config->insert_comment_limit ?: $config->no_point_date;
|
||||
|
|
@ -273,22 +273,22 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$diff = 0;
|
||||
|
||||
|
||||
// Add points for the comment.
|
||||
if ($mode === 'insert')
|
||||
{
|
||||
$diff += $this->_getModulePointConfig($module_srl, 'insert_comment');
|
||||
}
|
||||
|
||||
|
||||
// Add points for attached files.
|
||||
if ($obj->updated_file_count > 0)
|
||||
{
|
||||
$upload_point = $this->_getModulePointConfig($module_srl, 'upload_file');
|
||||
$diff += $upload_point * $obj->updated_file_count;
|
||||
}
|
||||
|
||||
|
||||
// Increase the point.
|
||||
if ($diff != 0)
|
||||
{
|
||||
|
|
@ -304,7 +304,7 @@ class pointController extends point
|
|||
{
|
||||
$this->triggerInsertComment($obj, 'update');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief A trigger which gives points for deleting a comment
|
||||
*/
|
||||
|
|
@ -320,32 +320,32 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Return if disabled
|
||||
$config = $this->getConfig();
|
||||
if ($config->insert_comment_revert_on_delete === false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Abort if the comment and the document have the same author.
|
||||
$oDocument = DocumentModel::getDocument($obj->document_srl);
|
||||
if (!$oDocument->isExists() || abs($oDocument->get('member_srl')) == $member_srl)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Abort if the document is older than a configured limit.
|
||||
$time_limit = $config->insert_comment_limit ?: $config->no_point_date;
|
||||
if ($time_limit > 0 && ztime($oDocument->get('regdate')) < RX_TIME - ($time_limit * 86400))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Calculate points based on the module_srl of the document to which this comment belongs
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
$diff = $this->_getModulePointConfig($module_srl, 'insert_comment');
|
||||
|
||||
|
||||
// Decrease the point.
|
||||
if ($diff != 0)
|
||||
{
|
||||
|
|
@ -368,7 +368,7 @@ class pointController extends point
|
|||
*/
|
||||
public function triggerInsertFile($obj)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -383,19 +383,19 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Return if disabled
|
||||
$config = $this->getConfig();
|
||||
if ($config->upload_file_revert_on_delete === false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Get the points of the member
|
||||
|
||||
// Subtract points for the file.
|
||||
$diff = $this->_getModulePointConfig($module_srl, 'upload_file');
|
||||
|
||||
|
||||
// Update the point.
|
||||
if ($diff != 0)
|
||||
{
|
||||
|
|
@ -417,23 +417,23 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$point = $this->_getModulePointConfig($module_srl, 'download_file');
|
||||
if (!$point)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Get current points.
|
||||
$cur_point = $logged_member_srl ? PointModel::getPoint($logged_member_srl) : 0;
|
||||
|
||||
|
||||
// If the user (member or guest) does not have enough points, deny access.
|
||||
$config = $this->getConfig();
|
||||
if ($config->disable_download == 'Y' && $cur_point + $point < 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_cannot_download');
|
||||
}
|
||||
|
||||
|
||||
// Points will be adjusted after downloading (triggerDownloadFile).
|
||||
}
|
||||
|
||||
|
|
@ -450,7 +450,7 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Adjust points of the downloader.
|
||||
if ($logged_member_srl)
|
||||
{
|
||||
|
|
@ -461,7 +461,7 @@ class pointController extends point
|
|||
$this->setPoint($logged_member_srl, $cur_point + $point);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Adjust points of the uploader.
|
||||
if ($author_member_srl)
|
||||
{
|
||||
|
|
@ -488,7 +488,7 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Load configuration for reader and author points.
|
||||
$reader_point = $this->_getModulePointConfig($module_srl, 'read_document');
|
||||
$author_point = $this->_getModulePointConfig($module_srl, 'read_document_author');
|
||||
|
|
@ -496,7 +496,7 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// If the reader has already read this document, do not adjust points again.
|
||||
if ($logged_member_srl)
|
||||
{
|
||||
|
|
@ -509,7 +509,7 @@ class pointController extends point
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Give no points if the document is older than a configured limit.
|
||||
$regdate = ztime($obj->get('regdate'));
|
||||
$config = $this->getConfig();
|
||||
|
|
@ -521,7 +521,7 @@ class pointController extends point
|
|||
{
|
||||
$author_point = 0;
|
||||
}
|
||||
|
||||
|
||||
// Give no points if the document is a notice and an exception has been configured.
|
||||
if ($obj->get('is_notice') === 'Y')
|
||||
{
|
||||
|
|
@ -534,13 +534,13 @@ class pointController extends point
|
|||
$author_point = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Adjust points of the reader.
|
||||
if ($reader_point)
|
||||
{
|
||||
// Get current points.
|
||||
$cur_point = $logged_member_srl ? PointModel::getPoint($logged_member_srl) : 0;
|
||||
|
||||
|
||||
// If the reader does not have enough points, deny access.
|
||||
if ($cur_point + $reader_point < 0 && $config->disable_read_document == 'Y')
|
||||
{
|
||||
|
|
@ -556,7 +556,7 @@ class pointController extends point
|
|||
return new BaseObject(-1, $message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Record the fact that this member has already read this document.
|
||||
if ($logged_member_srl)
|
||||
{
|
||||
|
|
@ -567,7 +567,7 @@ class pointController extends point
|
|||
$this->setPoint($logged_member_srl, $cur_point + $reader_point);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Adjust points of the person who wrote the document.
|
||||
if ($author_point && $author_member_srl)
|
||||
{
|
||||
|
|
@ -588,10 +588,10 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Document or comment?
|
||||
$is_comment = isset($obj->comment_srl) && $obj->comment_srl;
|
||||
|
||||
|
||||
// Give no points if the document or comment is older than a configured limit.
|
||||
$config = $this->getConfig();
|
||||
if ($is_comment)
|
||||
|
|
@ -608,7 +608,7 @@ class pointController extends point
|
|||
}
|
||||
$logged_enabled = !($config->$logged_config_key > 0 && $regdate < RX_TIME - ($config->$logged_config_key * 86400));
|
||||
$target_enabled = !($config->$target_config_key > 0 && $regdate < RX_TIME - ($config->$target_config_key * 86400));
|
||||
|
||||
|
||||
// Adjust points of the voter.
|
||||
if ($logged_member_srl && $logged_enabled)
|
||||
{
|
||||
|
|
@ -624,7 +624,7 @@ class pointController extends point
|
|||
$this->setPoint($logged_member_srl, $cur_point + $point);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Adjust points of the person who wrote the document or comment.
|
||||
if ($target_member_srl && $target_enabled)
|
||||
{
|
||||
|
|
@ -752,7 +752,7 @@ class pointController extends point
|
|||
{
|
||||
$change_group = ($level != $current_level);
|
||||
}
|
||||
|
||||
|
||||
if ($change_group)
|
||||
{
|
||||
// Check if the level, for which the current points are prepared, is calculate and set the correct group
|
||||
|
|
@ -763,7 +763,7 @@ class pointController extends point
|
|||
// Get the default group
|
||||
$default_group = MemberModel::getDefaultGroup();
|
||||
asort($point_group);
|
||||
|
||||
|
||||
// Reset group after initialization
|
||||
if($config->group_reset != 'N')
|
||||
{
|
||||
|
|
@ -862,10 +862,10 @@ class pointController extends point
|
|||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get point configuration for module, falling back to defaults if not set.
|
||||
*
|
||||
*
|
||||
* @param int $module_srl
|
||||
* @param string $config_key
|
||||
* @return int
|
||||
|
|
@ -878,7 +878,7 @@ class pointController extends point
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if ($module_srl)
|
||||
{
|
||||
if (!isset(self::$_module_config_cache[$module_srl]))
|
||||
|
|
@ -895,7 +895,7 @@ class pointController extends point
|
|||
{
|
||||
$module_config = array();
|
||||
}
|
||||
|
||||
|
||||
if (isset($module_config[$config_key]) && $module_config[$config_key] !== '')
|
||||
{
|
||||
$point = $module_config[$config_key];
|
||||
|
|
@ -905,7 +905,7 @@ class pointController extends point
|
|||
$default_config = $this->getConfig();
|
||||
$point = $default_config->{$config_key};
|
||||
}
|
||||
|
||||
|
||||
return intval($point);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class pointModel extends point
|
|||
$args = new stdClass;
|
||||
$args->member_srl = abs($member_srl);
|
||||
$output = executeQuery('point.getPoint', $args, array('member_srl'));
|
||||
|
||||
|
||||
return isset($output->data->member_srl);
|
||||
}
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ class pointModel extends point
|
|||
return parent::$_member_point_cache[$member_srl] = $point;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Get from file cache
|
||||
$cache_path = sprintf(RX_BASEDIR . 'files/member_extra_info/point/%s', getNumberingPath($member_srl));
|
||||
$cache_filename = sprintf('%s/%d.cache.txt', $cache_path, $member_srl);
|
||||
|
|
@ -79,7 +79,7 @@ class pointModel extends point
|
|||
$exists = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Save to cache
|
||||
parent::$_member_point_cache[$member_srl] = $point;
|
||||
if (Rhymix\Framework\Cache::getDriverName() !== 'dummy')
|
||||
|
|
@ -121,7 +121,7 @@ class pointModel extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if (!$logged_info->member_srl)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue