mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-04 17:44:38 +09:00
1. Use __XE__ instead of __ZBXE__
2. Reformat indentations git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9722 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
477db7ed4f
commit
29f0d4a503
12 changed files with 648 additions and 650 deletions
|
|
@ -1,18 +1,18 @@
|
|||
<?php
|
||||
if(!defined("__ZBXE__")) exit();
|
||||
if(!defined('__XE__')) exit();
|
||||
|
||||
/**
|
||||
* @file point.addon.php
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief Icon-on-point level
|
||||
*
|
||||
* Display point level icon before user name when point system is enabled.
|
||||
**/
|
||||
// return unless before_display_content
|
||||
if($called_position != "before_display_content" || Context::get('act')=='dispPageAdminContentModify') return;
|
||||
/**
|
||||
* @file point.addon.php
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief Icon-on-point level
|
||||
*
|
||||
* Display point level icon before user name when point system is enabled.
|
||||
**/
|
||||
// return unless before_display_content
|
||||
if($called_position != "before_display_content" || Context::get('act')=='dispPageAdminContentModify') return;
|
||||
|
||||
require_once('./addons/point_level_icon/point_level_icon.lib.php');
|
||||
require_once('./addons/point_level_icon/point_level_icon.lib.php');
|
||||
|
||||
$oPointController = &getController('point');
|
||||
$output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9\-]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'pointLevelIconTrans', $output);
|
||||
$oPointController = &getController('point');
|
||||
$output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9\-]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'pointLevelIconTrans', $output);
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,52 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* @brief Function to change point icon.
|
||||
**/
|
||||
function pointLevelIconTrans($matches) {
|
||||
$member_srl = $matches[3];
|
||||
if($member_srl<1) return $matches[0];
|
||||
/**
|
||||
* @brief Function to change point icon.
|
||||
**/
|
||||
function pointLevelIconTrans($matches) {
|
||||
$member_srl = $matches[3];
|
||||
if($member_srl<1) return $matches[0];
|
||||
|
||||
$orig_text = preg_replace('/'.preg_quote($matches[5],'/').'<\/'.$matches[6].'>$/', '', $matches[0]);
|
||||
$orig_text = preg_replace('/'.preg_quote($matches[5],'/').'<\/'.$matches[6].'>$/', '', $matches[0]);
|
||||
|
||||
// Check Group Image Mark
|
||||
$oMemberModel = &getModel('member');
|
||||
if($oMemberModel->getGroupImageMark($member_srl)) return $orig_text.$matches[5].'</'.$matches[6].'>';
|
||||
// Check Group Image Mark
|
||||
$oMemberModel = &getModel('member');
|
||||
if($oMemberModel->getGroupImageMark($member_srl)) return $orig_text.$matches[5].'</'.$matches[6].'>';
|
||||
|
||||
if(!isset($GLOBALS['_pointLevelIcon'][$member_srl])) {
|
||||
// Get point configuration
|
||||
if(!$GLOBALS['_pointConfig']) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$GLOBALS['_pointConfig'] = $oModuleModel->getModuleConfig('point');
|
||||
}
|
||||
$config = $GLOBALS['_pointConfig'];
|
||||
// Get point model
|
||||
if(!$GLOBALS['_pointModel']) $GLOBALS['_pointModel'] = getModel('point');
|
||||
$oPointModel = &$GLOBALS['_pointModel'];
|
||||
// Get points
|
||||
if(!$oPointModel->isExistsPoint($member_srl)) return $matches[0];
|
||||
$point = $oPointModel->getPoint($member_srl);
|
||||
// Get level
|
||||
$level = $oPointModel->getLevel($point, $config->level_step);
|
||||
$text = $matches[5];
|
||||
// Get a path where level icon is
|
||||
$level_icon = sprintf('%smodules/point/icons/%s/%d.gif', Context::getRequestUri(), $config->level_icon, $level);
|
||||
// Get per to go to the next level if not a top level
|
||||
if($level < $config->max_level) {
|
||||
$next_point = $config->level_step[$level+1];
|
||||
$present_point = $config->level_step[$level];
|
||||
if($next_point > 0) {
|
||||
$per = (int)(($point - $present_point) / ($next_point - $present_point)*100);
|
||||
$per = $per.'%';
|
||||
}
|
||||
}
|
||||
if(!isset($GLOBALS['_pointLevelIcon'][$member_srl])) {
|
||||
// Get point configuration
|
||||
if(!$GLOBALS['_pointConfig']) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$GLOBALS['_pointConfig'] = $oModuleModel->getModuleConfig('point');
|
||||
}
|
||||
$config = $GLOBALS['_pointConfig'];
|
||||
// Get point model
|
||||
if(!$GLOBALS['_pointModel']) $GLOBALS['_pointModel'] = getModel('point');
|
||||
$oPointModel = &$GLOBALS['_pointModel'];
|
||||
// Get points
|
||||
if(!$oPointModel->isExistsPoint($member_srl)) return $matches[0];
|
||||
$point = $oPointModel->getPoint($member_srl);
|
||||
// Get level
|
||||
$level = $oPointModel->getLevel($point, $config->level_step);
|
||||
$text = $matches[5];
|
||||
// Get a path where level icon is
|
||||
$level_icon = sprintf('%smodules/point/icons/%s/%d.gif', Context::getRequestUri(), $config->level_icon, $level);
|
||||
// Get per to go to the next level if not a top level
|
||||
if($level < $config->max_level) {
|
||||
$next_point = $config->level_step[$level+1];
|
||||
$present_point = $config->level_step[$level];
|
||||
if($next_point > 0) {
|
||||
$per = (int)(($point - $present_point) / ($next_point - $present_point)*100);
|
||||
$per = $per.'%';
|
||||
}
|
||||
}
|
||||
|
||||
$title = sprintf('%s:%s%s%s, %s:%s/%s', Context::getLang('point'), $point, $config->point_name, $per?' ('.$per.')':'', Context::getLang('level'), $level, $config->max_level);
|
||||
$alt = sprintf('[%s:%s]', Context::getLang('level'), $level);
|
||||
$title = sprintf('%s:%s%s%s, %s:%s/%s', Context::getLang('point'), $point, $config->point_name, $per?' ('.$per.')':'', Context::getLang('level'), $level, $config->max_level);
|
||||
$alt = sprintf('[%s:%s]', Context::getLang('level'), $level);
|
||||
|
||||
$GLOBALS['_pointLevelIcon'][$member_srl] = sprintf('<img src="%s" alt="%s" title="%s" style="vertical-align:middle; margin-right:3px;" />', $level_icon, $alt, $title);
|
||||
}
|
||||
$text = $GLOBALS['_pointLevelIcon'][$member_srl];
|
||||
$GLOBALS['_pointLevelIcon'][$member_srl] = sprintf('<img src="%s" alt="%s" title="%s" style="vertical-align:middle; margin-right:3px;" />', $level_icon, $alt, $title);
|
||||
}
|
||||
$text = $GLOBALS['_pointLevelIcon'][$member_srl];
|
||||
|
||||
return $orig_text.$text.$matches[5].'</'.$matches[6].'>';
|
||||
}
|
||||
return $orig_text.$text.$matches[5].'</'.$matches[6].'>';
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue