issue 2662 coding convention fix

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12143 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2012-11-07 05:20:06 +00:00
parent 26e08751b9
commit f9fbd4a307
18 changed files with 1474 additions and 1282 deletions

View file

@ -5,13 +5,15 @@ if(!defined('__XE__')) exit();
* @file adminlogging.addon.php
* @author NHN (developers@xpressengine.com)
* @brief Automatic link add-on
**/
*/
$logged_info = Context::get('logged_info');
$act = Context::get('act');
$kind = strpos(strtolower($act),'admin')!==false?'admin':'';
if($called_position == 'before_module_proc' && $kind == 'admin' && $logged_info->is_admin == 'Y') {
if($called_position == 'before_module_proc' && $kind == 'admin' && $logged_info->is_admin == 'Y')
{
$oAdminloggingController = &getController('adminlogging');
$oAdminloggingController->insertLog($this->module, $this->act);
}
?>
/* End of file adminlogging.php */
/* Location: ./addons/adminlogging */

View file

@ -5,8 +5,10 @@ if(!defined('__XE__')) exit();
* @file autolink.addon.php
* @author NHN (developers@xpressengine.com)
* @brief Automatic link add-on
**/
if($called_position == 'after_module_proc' && Context::getResponseMethod()!="XMLRPC") {
*/
if($called_position == 'after_module_proc' && Context::getResponseMethod()!="XMLRPC")
{
Context::loadFile(array('./addons/autolink/autolink.js', 'body', '', null), true);
}
?>
/* End of file autolink.addon.php */
/* Location: .//addons/autolink/autolink.addon.php */

View file

@ -435,4 +435,5 @@ RSDContent;
break;
}
}
?>
/* End of file blogapi.addon.php */
/* Location: ./addons/blogapi/blogapi.addon.php */

View file

@ -1,66 +1,79 @@
<?php
if(!defined('__XE__')) exit();
if(!defined('__XE__')) exit();
/**
* @file ./addons/blogapi/blogapi.func.php
* @author NHN (developers@xpressengine.com)
* @brief Function collections for the implementation of blogapi
**/
// Error messages
function getXmlRpcFailure($error, $message) {
return
sprintf(
"<methodResponse>\n<fault><value><struct>\n<member>\n<name>faultCode</name>\n<value><int>%d</int></value>\n</member>\n<member>\n<name>faultString</name>\n<value><string>%s</string></value>\n</member>\n</struct></value></fault>\n</methodResponse>\n",
$error,
htmlspecialchars($message)
);
}
// Display results
function getXmlRpcResponse($params) {
$buff = '<?xml version="1.0" encoding="utf-8"?>'."\n<methodResponse><params>";
$buff .= _getEncodedVal($params);
$buff .= "</params>\n</methodResponse>\n";
/**
* @file ./addons/blogapi/blogapi.func.php
* @author NHN (developers@xpressengine.com)
* @brief Function collections for the implementation of blogapi
**/
return $buff;
}
// Encoding
function _getEncodedVal($val, $is_sub_set = false) {
if(is_int($val)) $buff = sprintf("<value><i4>%d</i4></value>", $val);
elseif(is_string($val)&&preg_match('/^([0-9]+)T([0-9\:]+)$/', $val)) $buff = sprintf("<value><dateTime.iso8601>%s</dateTime.iso8601></value>\n", $val);
elseif(is_double($val)) $buff = sprintf("<value><double>%f</double></value>", $val);
elseif(is_bool($val)) $buff = sprintf("<value><boolean>%d</boolean></value>", $val?1:0);
elseif(is_object($val)) {
$values = get_object_vars($val);
$val_count = count($values);
$buff = "<value><struct>";
foreach($values as $k => $v) {
$buff .= sprintf("<member>\n<name>%s</name>\n%s</member>\n", htmlspecialchars($k), _getEncodedVal($v, true));
}
$buff .= "</struct></value>\n";
} elseif(is_array($val)) {
$val_count = count($val);
$buff = "<value><array>\n<data>";
for($i=0;$i<$val_count;$i++) {
$buff .= _getEncodedVal($val[$i], true);
}
$buff .= "</data>\n</array></value>";
} else {
$buff = sprintf("<value><string>%s</string></value>\n", $val);
}
if(!$is_sub_set) return sprintf("<param>\n%s</param>", $buff);
return $buff;
}
// Display the result
function printContent($content) {
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
print $content;
Context::close();
exit();
}
?>
// Error messages
function getXmlRpcFailure($error, $message)
{
return
sprintf(
"<methodResponse>\n<fault><value><struct>\n<member>\n<name>faultCode</name>\n<value><int>%d</int></value>\n</member>\n<member>\n<name>faultString</name>\n<value><string>%s</string></value>\n</member>\n</struct></value></fault>\n</methodResponse>\n",
$error,
htmlspecialchars($message)
);
}
// Display results
function getXmlRpcResponse($params)
{
$buff = '<?xml version="1.0" encoding="utf-8"?>'."\n<methodResponse><params>";
$buff .= _getEncodedVal($params);
$buff .= "</params>\n</methodResponse>\n";
return $buff;
}
// Encoding
function _getEncodedVal($val, $is_sub_set = false)
{
if(is_int($val)) $buff = sprintf("<value><i4>%d</i4></value>", $val);
elseif(is_string($val)&&preg_match('/^([0-9]+)T([0-9\:]+)$/', $val)) $buff = sprintf("<value><dateTime.iso8601>%s</dateTime.iso8601></value>\n", $val);
elseif(is_double($val)) $buff = sprintf("<value><double>%f</double></value>", $val);
elseif(is_bool($val)) $buff = sprintf("<value><boolean>%d</boolean></value>", $val?1:0);
elseif(is_object($val))
{
$values = get_object_vars($val);
$val_count = count($values);
$buff = "<value><struct>";
foreach($values as $k => $v) {
$buff .= sprintf("<member>\n<name>%s</name>\n%s</member>\n", htmlspecialchars($k), _getEncodedVal($v, true));
}
$buff .= "</struct></value>\n";
}
elseif(is_array($val))
{
$val_count = count($val);
$buff = "<value><array>\n<data>";
for($i=0;$i<$val_count;$i++) {
$buff .= _getEncodedVal($val[$i], true);
}
$buff .= "</data>\n</array></value>";
}
else
{
$buff = sprintf("<value><string>%s</string></value>\n", $val);
}
if(!$is_sub_set) return sprintf("<param>\n%s</param>", $buff);
return $buff;
}
// Display the result
function printContent($content)
{
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
print $content;
Context::close();
exit();
}
/* End of file blogapi.func.php */
/* Location: ./addons/blogapi/blogapi.func.php */

View file

@ -1,347 +1,353 @@
<?php
if(!defined("__ZBXE__")) exit();
if(!defined("__ZBXE__")) exit();
/**
* @file captcha.addon.php
* @author NHN (developers@xpressengine.com)
* @brief Captcha for a particular action
* English alphabets and voice verification added
**/
/**
* @file captcha.addon.php
* @author NHN (developers@xpressengine.com)
* @brief Captcha for a particular action
* English alphabets and voice verification added
**/
if(!class_exists('AddonCaptcha'))
{
if(!class_exists('AddonCaptcha'))
{
// On the mobile mode, XE Core does not load jquery and xe.js as normal.
Context::loadFile(array('./common/js/jquery.min.js','head', NULL,-100000),true);
Context::loadFile(array('./common/js/xe.min.js','head', NULL,-100000),true);
class AddonCaptcha
class AddonCaptcha
{
var $addon_info;
function setInfo(&$addon_info)
{
var $addon_info;
$this->addon_info = $addon_info;
}
function setInfo(&$addon_info)
function before_module_proc()
{
if($this->addon_info->act_type == 'everytime' && $_SESSION['captcha_authed'])
{
$this->addon_info = $addon_info;
unset($_SESSION['captcha_authed']);
}
}
function before_module_proc()
function before_module_init(&$ModuleHandler)
{
$logged_info = Context::get('logged_info');
if($logged_info->is_admin == 'Y' || $logged_info->is_site_admin) return false;
if($this->addon_info->target != 'all' && Context::get('is_logged')) return false;
if($_SESSION['XE_VALIDATOR_ERROR'] == -1) $_SESSION['captcha_authed'] = false;
if($_SESSION['captcha_authed']) return false;
$type = Context::get('captchaType');
$target_acts = array('procBoardInsertDocument','procBoardInsertComment','procIssuetrackerInsertIssue','procIssuetrackerInsertHistory','procTextyleInsertComment');
if($this->addon_info->apply_find_account=='apply') $target_acts[] = 'procMemberFindAccount';
if($this->addon_info->apply_resend_auth_mail=='apply') $target_acts[] = 'procMemberResendAuthMail';
if($this->addon_info->apply_signup=='apply') $target_acts[] = 'procMemberInsert';
if(Context::getRequestMethod()!='XMLRPC' && Context::getRequestMethod()!=='JSON')
{
if($this->addon_info->act_type == 'everytime' && $_SESSION['captcha_authed']) {
unset($_SESSION['captcha_authed']);
}
}
function before_module_init(&$ModuleHandler)
{
$logged_info = Context::get('logged_info');
if($logged_info->is_admin == 'Y' || $logged_info->is_site_admin) return false;
if($this->addon_info->target != 'all' && Context::get('is_logged')) return false;
if($_SESSION['XE_VALIDATOR_ERROR'] == -1) $_SESSION['captcha_authed'] = false;
if($_SESSION['captcha_authed']) return false;
$type = Context::get('captchaType');
$target_acts = array('procBoardInsertDocument','procBoardInsertComment','procIssuetrackerInsertIssue','procIssuetrackerInsertHistory','procTextyleInsertComment');
if($this->addon_info->apply_find_account=='apply') $target_acts[] = 'procMemberFindAccount';
if($this->addon_info->apply_resend_auth_mail=='apply') $target_acts[] = 'procMemberResendAuthMail';
if($this->addon_info->apply_signup=='apply') $target_acts[] = 'procMemberInsert';
if(Context::getRequestMethod()!='XMLRPC' && Context::getRequestMethod()!=='JSON')
if($type == 'inline')
{
if($type == 'inline') {
if(!$this->compareCaptcha())
{
Context::loadLang('./addons/captcha/lang');
$_SESSION['XE_VALIDATOR_ERROR'] = -1;
$_SESSION['XE_VALIDATOR_MESSAGE'] = Context::getLang('captcha_denied');;
$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error';
$_SESSION['XE_VALIDATOR_RETURN_URL'] = Context::get('error_return_url');
$ModuleHandler->_setInputValueToSession();
}
} else {
Context::addHtmlHeader('<script> var captchaTargetAct = new Array("'.implode('","',$target_acts).'"); </script>');
Context::loadFile(array('./addons/captcha/captcha.min.js', 'body', '', null), true);
if(!$this->compareCaptcha())
{
Context::loadLang('./addons/captcha/lang');
$_SESSION['XE_VALIDATOR_ERROR'] = -1;
$_SESSION['XE_VALIDATOR_MESSAGE'] = Context::getLang('captcha_denied');;
$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error';
$_SESSION['XE_VALIDATOR_RETURN_URL'] = Context::get('error_return_url');
$ModuleHandler->_setInputValueToSession();
}
}
else
{
Context::addHtmlHeader('<script> var captchaTargetAct = new Array("'.implode('","',$target_acts).'"); </script>');
Context::loadFile(array('./addons/captcha/captcha.min.js', 'body', '', null), true);
}
}
// compare session when calling actions such as writing a post or a comment on the board/issue tracker module
if(!$_SESSION['captcha_authed'] && in_array(Context::get('act'), $target_acts)) {
Context::loadLang('./addons/captcha/lang');
$ModuleHandler->error = "captcha_denied";
// compare session when calling actions such as writing a post or a comment on the board/issue tracker module
if(!$_SESSION['captcha_authed'] && in_array(Context::get('act'), $target_acts))
{
Context::loadLang('./addons/captcha/lang');
$ModuleHandler->error = "captcha_denied";
}
return true;
}
function createKeyword()
{
$type = Context::get('captchaType');
if ($type == 'inline' && $_SESSION['captcha_keyword']) return;
$arr = range('A','Y');
shuffle($arr);
$arr = array_slice($arr,0,6);
$_SESSION['captcha_keyword'] = join('', $arr);
}
function before_module_init_setCaptchaSession()
{
if($_SESSION['captcha_authed']) return false;
// Load language files
Context::loadLang(_XE_PATH_.'addons/captcha/lang');
// Generate keywords
$this->createKeyword();
$target = Context::getLang('target_captcha');
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
printf("<response>\r\n <error>0</error>\r\n <message>success</message>\r\n <about_captcha><![CDATA[%s]]></about_captcha>\r\n <captcha_reload><![CDATA[%s]]></captcha_reload>\r\n <captcha_play><![CDATA[%s]]></captcha_play>\r\n <cmd_input><![CDATA[%s]]></cmd_input>\r\n <cmd_cancel><![CDATA[%s]]></cmd_cancel>\r\n </response>"
,Context::getLang('about_captcha')
,Context::getLang('captcha_reload')
,Context::getLang('captcha_play')
,Context::getLang('cmd_input')
,Context::getLang('cmd_cancel')
);
Context::close();
exit();
}
function before_module_init_captchaImage()
{
if($_SESSION['captcha_authed']) return false;
if(Context::get('renew')) $this->createKeyword();
$keyword = $_SESSION['captcha_keyword'];
$im = $this->createCaptchaImage($keyword);
header("Cache-Control: ");
header("Pragma: ");
header("Content-Type: image/png");
imagepng($im);
imagedestroy($im);
Context::close();
exit();
}
function createCaptchaImage($string)
{
$arr = array();
for($i=0,$c=strlen($string);$i<$c;$i++) $arr[] = $string{$i};
// Font site
$w = 18;
$h = 25;
// Character length
$c = count($arr);
// Character image
$im = array();
// Create an image by total size
$im[] = imagecreate(($w+2)*count($arr), $h);
$deg = range(-30,30);
shuffle($deg);
// Create an image for each letter
foreach($arr as $i => $str)
{
$im[$i+1] = @imagecreate($w, $h);
$background_color = imagecolorallocate($im[$i+1], 255, 255, 255);
$text_color = imagecolorallocate($im[$i+1], 0, 0, 0);
// Control font size
$ran = range(1,20);
shuffle($ran);
if(function_exists('imagerotate'))
{
imagestring($im[$i+1], (array_pop($ran)%3)+3, 2, (array_pop($ran)%8), $str, $text_color);
$im[$i+1] = imagerotate($im[$i+1], array_pop($deg), 0);
$background_color = imagecolorallocate($im[$i+1], 255, 255, 255);
imagecolortransparent($im[$i+1], $background_color);
}
else
{
imagestring($im[$i+1], (array_pop($ran)%3)+3, 2, (array_pop($ran)%4), $str, $text_color);
}
}
// Combine images of each character
for($i=1;$i<count($im);$i++)
{
imagecopy($im[0],$im[$i],(($w+2)*($i-1)),0,0,0,$w,$h);
imagedestroy($im[$i]);
}
// Larger image
$big_count = 2;
$big = imagecreatetruecolor(($w+2)*$big_count*$c, $h*$big_count);
imagecopyresized($big, $im[0], 0, 0, 0, 0, ($w+2)*$big_count*$c, $h*$big_count, ($w+2)*$c, $h);
imagedestroy($im[0]);
if(function_exists('imageantialias')) imageantialias($big,true);
// Background line
$line_color = imagecolorallocate($big, 0, 0, 0);
$w = ($w+2)*$big_count*$c;
$h = $h*$big_count;
$d = array_pop($deg);
for($i=-abs($d);$i<$h+abs($d);$i=$i+7) imageline($big,0,$i+$d,$w,$i,$line_color);
$x = range(0,($w-10));
shuffle($x);
for($i=0;$i<200;$i++) imagesetpixel($big,$x[$i]%$w,$x[$i+1]%$h,$line_color);
return $big;
}
function before_module_init_captchaAudio()
{
if($_SESSION['captcha_authed']) return false;
$keyword = strtoupper($_SESSION['captcha_keyword']);
$data = $this->createCaptchaAudio($keyword);
header('Content-type: audio/mpeg');
header("Content-Disposition: attachment; filename=\"captcha_audio.mp3\"");
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Expires: Sun, 1 Jan 2000 12:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
header('Content-Length: ' . strlen($data));
echo $data;
Context::close();
exit();
}
function createCaptchaAudio($string)
{
$data = '';
$_audio = './addons/captcha/audio/F_%s.mp3';
for($i=0,$c=strlen($string);$i<$c;$i++)
{
$_data = FileHandler::readFile(sprintf($_audio, $string{$i}));
$start = rand(5, 68); // Random start in 4-byte header and 64 byte data
$datalen = strlen($_data) - $start - 256; // Last unchanged 256 bytes
for($j=$start;$j<$datalen;$j+=64)
{
$ch = ord($_data{$j});
if($ch<9 || $ch>119) continue;
$_data{$j} = chr($ch+rand(-8,8));
}
$data .= $_data;
}
return $data;
}
function compareCaptcha()
{
if($_SESSION['captcha_authed']) return true;
if(strtoupper($_SESSION['captcha_keyword']) == strtoupper(Context::get('secret_text')))
{
$_SESSION['captcha_authed'] = true;
return true;
}
function createKeyword()
unset($_SESSION['captcha_authed']);
return false;
}
function before_module_init_captchaCompare()
{
if(!$this->compareCaptcha())
{
$type = Context::get('captchaType');
if ($type == 'inline' && $_SESSION['captcha_keyword']) return;
$arr = range('A','Y');
shuffle($arr);
$arr = array_slice($arr,0,6);
$_SESSION['captcha_keyword'] = join('', $arr);
}
function before_module_init_setCaptchaSession()
{
if($_SESSION['captcha_authed']) return false;
// Load language files
Context::loadLang(_XE_PATH_.'addons/captcha/lang');
// Generate keywords
$this->createKeyword();
$target = Context::getLang('target_captcha');
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
printf("<response>\r\n <error>0</error>\r\n <message>success</message>\r\n <about_captcha><![CDATA[%s]]></about_captcha>\r\n <captcha_reload><![CDATA[%s]]></captcha_reload>\r\n <captcha_play><![CDATA[%s]]></captcha_play>\r\n <cmd_input><![CDATA[%s]]></cmd_input>\r\n <cmd_cancel><![CDATA[%s]]></cmd_cancel>\r\n </response>"
,Context::getLang('about_captcha')
,Context::getLang('captcha_reload')
,Context::getLang('captcha_play')
,Context::getLang('cmd_input')
,Context::getLang('cmd_cancel')
);
Context::close();
exit();
}
function before_module_init_captchaImage()
{
if($_SESSION['captcha_authed']) return false;
if(Context::get('renew')) $this->createKeyword();
$keyword = $_SESSION['captcha_keyword'];
$im = $this->createCaptchaImage($keyword);
header("Cache-Control: ");
header("Pragma: ");
header("Content-Type: image/png");
imagepng($im);
imagedestroy($im);
Context::close();
exit();
}
function createCaptchaImage($string)
{
$arr = array();
for($i=0,$c=strlen($string);$i<$c;$i++) $arr[] = $string{$i};
// Font site
$w = 18;
$h = 25;
// Character length
$c = count($arr);
// Character image
$im = array();
// Create an image by total size
$im[] = imagecreate(($w+2)*count($arr), $h);
$deg = range(-30,30);
shuffle($deg);
// Create an image for each letter
foreach($arr as $i => $str)
{
$im[$i+1] = @imagecreate($w, $h);
$background_color = imagecolorallocate($im[$i+1], 255, 255, 255);
$text_color = imagecolorallocate($im[$i+1], 0, 0, 0);
// Control font size
$ran = range(1,20);
shuffle($ran);
if(function_exists('imagerotate'))
{
imagestring($im[$i+1], (array_pop($ran)%3)+3, 2, (array_pop($ran)%8), $str, $text_color);
$im[$i+1] = imagerotate($im[$i+1], array_pop($deg), 0);
$background_color = imagecolorallocate($im[$i+1], 255, 255, 255);
imagecolortransparent($im[$i+1], $background_color);
}
else
{
imagestring($im[$i+1], (array_pop($ran)%3)+3, 2, (array_pop($ran)%4), $str, $text_color);
}
}
// Combine images of each character
for($i=1;$i<count($im);$i++)
{
imagecopy($im[0],$im[$i],(($w+2)*($i-1)),0,0,0,$w,$h);
imagedestroy($im[$i]);
}
// Larger image
$big_count = 2;
$big = imagecreatetruecolor(($w+2)*$big_count*$c, $h*$big_count);
imagecopyresized($big, $im[0], 0, 0, 0, 0, ($w+2)*$big_count*$c, $h*$big_count, ($w+2)*$c, $h);
imagedestroy($im[0]);
if(function_exists('imageantialias')) imageantialias($big,true);
// Background line
$line_color = imagecolorallocate($big, 0, 0, 0);
$w = ($w+2)*$big_count*$c;
$h = $h*$big_count;
$d = array_pop($deg);
for($i=-abs($d);$i<$h+abs($d);$i=$i+7) imageline($big,0,$i+$d,$w,$i,$line_color);
$x = range(0,($w-10));
shuffle($x);
for($i=0;$i<200;$i++) imagesetpixel($big,$x[$i]%$w,$x[$i+1]%$h,$line_color);
return $big;
}
function before_module_init_captchaAudio()
{
if($_SESSION['captcha_authed']) return false;
$keyword = strtoupper($_SESSION['captcha_keyword']);
$data = $this->createCaptchaAudio($keyword);
header('Content-type: audio/mpeg');
header("Content-Disposition: attachment; filename=\"captcha_audio.mp3\"");
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Expires: Sun, 1 Jan 2000 12:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
header('Content-Length: ' . strlen($data));
echo $data;
Context::close();
exit();
}
function createCaptchaAudio($string)
{
$data = '';
$_audio = './addons/captcha/audio/F_%s.mp3';
for($i=0,$c=strlen($string);$i<$c;$i++)
{
$_data = FileHandler::readFile(sprintf($_audio, $string{$i}));
$start = rand(5, 68); // Random start in 4-byte header and 64 byte data
$datalen = strlen($_data) - $start - 256; // Last unchanged 256 bytes
for($j=$start;$j<$datalen;$j+=64)
{
$ch = ord($_data{$j});
if($ch<9 || $ch>119) continue;
$_data{$j} = chr($ch+rand(-8,8));
}
$data .= $_data;
}
return $data;
}
function compareCaptcha()
{
if($_SESSION['captcha_authed']) return true;
if(strtoupper($_SESSION['captcha_keyword']) == strtoupper(Context::get('secret_text'))) {
$_SESSION['captcha_authed'] = true;
return true;
}
unset($_SESSION['captcha_authed']);
return false;
}
function before_module_init_captchaCompare()
{
if(!$this->compareCaptcha())
{
return false;
}
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
print("<response>\r\n<error>0</error>\r\n<message>success</message>\r\n</response>");
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
print("<response>\r\n<error>0</error>\r\n<message>success</message>\r\n</response>");
Context::close();
exit();
}
Context::close();
exit();
}
function inlineDisplay()
{
unset($_SESSION['captcha_authed']);
$this->createKeyword();
function inlineDisplay()
{
unset($_SESSION['captcha_authed']);
$this->createKeyword();
$swfURL = getUrl().'addons/captcha/swf/play.swf';
Context::unloadFile('./addons/captcha/captcha.min.js');
Context::loadFile(array('./addons/captcha/inline_captcha.js','body'));
$swfURL = getUrl().'addons/captcha/swf/play.swf';
Context::unloadFile('./addons/captcha/captcha.min.js');
Context::loadFile(array('./addons/captcha/inline_captcha.js','body'));
global $lang;
global $lang;
$tags=<<<EOD
$tags=<<<EOD
<img src="%s" id="captcha_image" alt="CAPTCHA" width="240" height="50" style="width:240px; height:50px; border:1px solid #b0b0b0" />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="0" height="0" id="captcha_audio" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="quality" value="high" />
<param name="movie" value="%s" />
<param name="wmode" value="window" />
<param name="allowFullScreen" value="false">
<param name="bgcolor" value="#fffff" />
<embed src="%s" quality="high" wmode="window" allowFullScreen="false" bgcolor="#ffffff" width="0" height="0" name="captcha_audio" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
<param name="allowScriptAccess" value="always" />
<param name="quality" value="high" />
<param name="movie" value="%s" />
<param name="wmode" value="window" />
<param name="allowFullScreen" value="false">
<param name="bgcolor" value="#fffff" />
<embed src="%s" quality="high" wmode="window" allowFullScreen="false" bgcolor="#ffffff" width="0" height="0" name="captcha_audio" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<button type="button" class="captchaReload text">%s</button>
<button type="button" class="captchaPlay text">%s</button><br />
<input type="hidden" name="captchaType" value="inline" />
<input name="secret_text" type="text" id="secret_text" />
EOD;
$tags = sprintf($tags, getUrl('captcha_action','captchaImage', 'rand', mt_rand(10000, 99999))
, $swfURL
, $swfURL
, $lang->reload
, $lang->play);
return $tags;
}
$tags = sprintf($tags, getUrl('captcha_action','captchaImage', 'rand', mt_rand(10000, 99999))
, $swfURL
, $swfURL
, $lang->reload
, $lang->play);
return $tags;
}
$GLOBALS['__AddonCaptcha__'] = new AddonCaptcha;
$GLOBALS['__AddonCaptcha__']->setInfo($addon_info);
Context::set('oCaptcha', &$GLOBALS['__AddonCaptcha__']);
}
$oAddonCaptcha = &$GLOBALS['__AddonCaptcha__'];
$GLOBALS['__AddonCaptcha__'] = new AddonCaptcha;
$GLOBALS['__AddonCaptcha__']->setInfo($addon_info);
Context::set('oCaptcha', $GLOBALS['__AddonCaptcha__']);
}
if(method_exists($oAddonCaptcha, $called_position))
$oAddonCaptcha = &$GLOBALS['__AddonCaptcha__'];
if(method_exists($oAddonCaptcha, $called_position))
{
if(!call_user_func_array(array(&$oAddonCaptcha, $called_position), array(&$this)))
{
if(!call_user_func_array(array(&$oAddonCaptcha, $called_position), array(&$this)))
{
return false;
}
return false;
}
}
$addon_act = Context::get('captcha_action');
if($addon_act && method_exists($oAddonCaptcha, $called_position.'_'.$addon_act))
$addon_act = Context::get('captcha_action');
if($addon_act && method_exists($oAddonCaptcha, $called_position.'_'.$addon_act))
{
if(!call_user_func_array(array(&$oAddonCaptcha, $called_position.'_'.$addon_act), array(&$this)))
{
if(!call_user_func_array(array(&$oAddonCaptcha, $called_position.'_'.$addon_act), array(&$this)))
{
return false;
}
return false;
}
?>
}
/* End of file captcha.addon.php */
/* Location: ./addons/captcha/captcha.addon.php */

View file

@ -5,10 +5,12 @@ if(!defined('__XE__')) exit();
* @file counter.addon.php
* @author NHN (developers@xpressengine.com)
* @brief Counter add-on
**/
*/
// Execute if called_position is before_display_content
if(Context::isInstalled() && $called_position == 'before_module_init' && Context::get('module')!='admin' && Context::getResponseMethod() == 'HTML') {
if(Context::isInstalled() && $called_position == 'before_module_init' && Context::get('module')!='admin' && Context::getResponseMethod() == 'HTML')
{
$oCounterController = &getController('counter');
$oCounterController->counterExecute();
}
?>
/* End of file counter.addon.php */
/* Location: ./addons/counter/counter.addon.php */

View file

@ -9,7 +9,7 @@ if(!defined('__XE__')) exit();
* - Pop-up the message if new message comes in
* - When calling MemberModel::getMemberMenu, feature to send a message is added
* - When caliing MemberModel::getMemberMenu, feature to add a friend is added
**/
*/
// Stop if non-logged-in user is
$logged_info = Context::get('logged_info');
if(!$logged_info) return;
@ -17,7 +17,8 @@ if(!$logged_info) return;
/**
* Message/Friend munus are added on the pop-up window and member profile. Check if a new message is received
**/
if($called_position == 'before_module_init' && $this->module != 'member') {
if($called_position == 'before_module_init' && $this->module != 'member')
{
// Load a language file from the communication module
Context::loadLang('./modules/communication/lang');
// Add menus on the member login information
@ -28,7 +29,8 @@ if($called_position == 'before_module_init' && $this->module != 'member') {
$flag_path = './files/member_extra_info/new_message_flags/'.getNumberingPath($logged_info->member_srl);
$flag_file = $flag_path.$logged_info->member_srl;
if(file_exists($flag_file)) {
if(file_exists($flag_file))
{
$new_message_count = trim(FileHandler::readFile($flag_file));
FileHandler::removeFile($flag_file);
Context::loadLang('./addons/member_communication/lang');
@ -40,20 +42,25 @@ if($called_position == 'before_module_init' && $this->module != 'member') {
Context::addHtmlFooter($script);
}
} elseif($called_position == 'before_module_proc' && $this->act == 'getMemberMenu') {
}
elseif($called_position == 'before_module_proc' && $this->act == 'getMemberMenu')
{
$oMemberController = &getController('member');
$member_srl = Context::get('target_srl');
$mid = Context::get('cur_mid');
// Creates communication model object
$oCommunicationModel = &getModel('communication');
// Add a feature to display own message box.
if($logged_info->member_srl == $member_srl) {
if($logged_info->member_srl == $member_srl)
{
// Add your own viewing Note Template
$oMemberController->addMemberPopupMenu(getUrl('','mid',$mid,'act','dispCommunicationMessages'), 'cmd_view_message_box', '', 'self');
// Display a list of friends
$oMemberController->addMemberPopupMenu(getUrl('','mid',$mid,'act','dispCommunicationFriend'), 'cmd_view_friend', '', 'self');
// If not, Add menus to send message and to add friends
} else {
// If not, Add menus to send message and to add friends
}
else
{
// Get member information
$oMemberModel = &getModel('member');
$target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
@ -68,4 +75,5 @@ if($called_position == 'before_module_init' && $this->module != 'member') {
$oMemberController->addMemberPopupMenu(getUrl('','module','communication','act','dispCommunicationAddFriend','target_srl',$member_srl), 'cmd_add_friend', '', 'popup');
}
}
?>
/* End of file member_communication.addon.php */
/* Location: ./addons/member_communication/member_communication.addon.php */

View file

@ -8,11 +8,11 @@ if(!defined('__XE__')) exit();
*
* Find member_srl in the part with <div class="member_MemberSerialNumber"> .... </div>
* Check if ther is image name and image mark. Then change it.
**/
*/
/**
* Just before displaying, change image name/ image mark
**/
*/
if($called_position != "before_display_content" || Context::get('act')=='dispPageAdminContentModify') return;
// Include a file having functions to replace member image name/mark
require_once('./addons/member_extra_info/member_extra_info.lib.php');
@ -20,4 +20,6 @@ require_once('./addons/member_extra_info/member_extra_info.lib.php');
$temp_output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'memberTransImageName', $output);
if($temp_output) $output = $temp_output;
unset($temp_output);
?>
/* End of file member_extra_info.addon.php */
/* Location: ./addons/member_extra_info/member_extra_info.addon.php */

View file

@ -1,49 +1,54 @@
<?php
/**
* @brief If member_srl exists in the div or span, replace to image name or nick image for each member_srl
**/
function memberTransImageName($matches) {
// If member_srl < 0, then return text only in the body
$member_srl = $matches[3];
if($member_srl<0) return $matches[5];
// If member_srl=o(not a member), return the entire body
if(!$member_srl) return $matches[0];
/**
* @brief If member_srl exists in the div or span, replace to image name or nick image for each member_srl
**/
function memberTransImageName($matches)
{
// If member_srl < 0, then return text only in the body
$member_srl = $matches[3];
if($member_srl<0) return $matches[5];
// If member_srl=o(not a member), return the entire body
if(!$member_srl) return $matches[0];
$oMemberModel = &getModel('member');
$nick_name = $matches[5];
$oMemberModel = &getModel('member');
$nick_name = $matches[5];
// If pre-defined data in the global variablesm return it
if(!$GLOBALS['_transImageNameList'][$member_srl]->cached) {
$GLOBALS['_transImageNameList'][$member_srl]->cached = true;
$image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl);
$image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl);
if(file_exists($image_name_file)) $GLOBALS['_transImageNameList'][$member_srl]->image_name_file = $image_name_file;
else $image_name_file = '';
if(file_exists($image_mark_file)) $GLOBALS['_transImageNameList'][$member_srl]->image_mark_file = $image_mark_file;
else $image_mark_file = '';
// If pre-defined data in the global variablesm return it
if(!$GLOBALS['_transImageNameList'][$member_srl]->cached)
{
$GLOBALS['_transImageNameList'][$member_srl]->cached = true;
$image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl);
$image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl);
if(file_exists($image_name_file)) $GLOBALS['_transImageNameList'][$member_srl]->image_name_file = $image_name_file;
else $image_name_file = '';
if(file_exists($image_mark_file)) $GLOBALS['_transImageNameList'][$member_srl]->image_mark_file = $image_mark_file;
else $image_mark_file = '';
$site_module_info = Context::get('site_module_info');
$group_image = $oMemberModel->getGroupImageMark($member_srl,$site_module_info->site_srl);
$GLOBALS['_transImageNameList'][$member_srl]->group_image = $group_image;
} else {
$group_image = $GLOBALS['_transImageNameList'][$member_srl]->group_image;
$image_name_file = $GLOBALS['_transImageNameList'][$member_srl]->image_name_file;
$image_mark_file = $GLOBALS['_transImageNameList'][$member_srl]->image_mark_file;
}
// If image name and mark doesn't exist, set the original information
if(!$image_name_file && !$image_mark_file && !$group_image) return $matches[0];
$site_module_info = Context::get('site_module_info');
$group_image = $oMemberModel->getGroupImageMark($member_srl,$site_module_info->site_srl);
$GLOBALS['_transImageNameList'][$member_srl]->group_image = $group_image;
}
else
{
$group_image = $GLOBALS['_transImageNameList'][$member_srl]->group_image;
$image_name_file = $GLOBALS['_transImageNameList'][$member_srl]->image_name_file;
$image_mark_file = $GLOBALS['_transImageNameList'][$member_srl]->image_mark_file;
}
// If image name and mark doesn't exist, set the original information
if(!$image_name_file && !$image_mark_file && !$group_image) return $matches[0];
// check member_config
$config = $oMemberModel->getMemberConfig();
// check member_config
if($config->image_name == 'Y' && $image_name_file) $nick_name = sprintf('<img src="%s%s" alt="id: %s" title="id: %s" style="border:0;vertical-align:middle;margin-right:3px" />', Context::getRequestUri(),$image_name_file, strip_tags($nick_name), strip_tags($nick_name));
if($config->image_mark == 'Y' && $image_mark_file) $nick_name = sprintf('<img src="%s%s" alt="id: %s" title="id : %s" style="border:0;vertical-align:middle;margin-right:3px"/>%s', Context::getRequestUri(),$image_mark_file, strip_tags($nick_name), strip_tags($nick_name), $nick_name);
$config = $oMemberModel->getMemberConfig();
if($group_image) $nick_name = sprintf('<img src="%s" style="border:0;max-height:16px;vertical-align:middle;margin-right:3px" alt="%s" title="%s" />%s', $group_image->src, $group_image->title, $group_image->description, $nick_name);
if($config->image_name == 'Y' && $image_name_file) $nick_name = sprintf('<img src="%s%s" alt="id: %s" title="id: %s" style="border:0;vertical-align:middle;margin-right:3px" />', Context::getRequestUri(),$image_name_file, strip_tags($nick_name), strip_tags($nick_name));
if($config->image_mark == 'Y' && $image_mark_file) $nick_name = sprintf('<img src="%s%s" alt="id: %s" title="id : %s" style="border:0;vertical-align:middle;margin-right:3px"/>%s', Context::getRequestUri(),$image_mark_file, strip_tags($nick_name), strip_tags($nick_name), $nick_name);
if($group_image) $nick_name = sprintf('<img src="%s" style="border:0;max-height:16px;vertical-align:middle;margin-right:3px" alt="%s" title="%s" />%s', $group_image->src, $group_image->title, $group_image->description, $nick_name);
$orig_text = preg_replace('/'.preg_quote($matches[5],'/').'<\/'.$matches[6].'>$/', '', $matches[0]);
return $orig_text.$nick_name.'</'.$matches[6].'>';
}
?>
$orig_text = preg_replace('/'.preg_quote($matches[5],'/').'<\/'.$matches[6].'>$/', '', $matches[0]);
return $orig_text.$nick_name.'</'.$matches[6].'>';
}
/* End of file member_extra_info.lib.php */
/* Location: ./addons/member_extra_info/member_extra_info.lib.php */

View file

@ -1,103 +1,124 @@
<?php
/**
* HDML Library ver 0.1
* @author NHN (developers@xpressengine.com)
**/
class wap extends mobileXE {
/**
* HDML Library ver 0.1
* @author NHN (developers@xpressengine.com)
*/
class wap extends mobileXE {
/**
* @brief constructor
**/
function wap() {
parent::mobileXE();
}
/**
* @brief constructor
**/
function wap()
{
parent::mobileXE();
}
/**
* @brief hdml header output
**/
function printHeader() {
header("Content-Type:text/x-hdml; charset=".$this->charset);
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
/**
* @brief hdml header output
**/
function printHeader()
{
header("Content-Type:text/x-hdml; charset=".$this->charset);
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
print '<hdml version=3.0 ttl=0 markable=true>';
print "\n";
print $this->hasChilds()?'<choice name=main>':'<display>';
print "\n";
print '<hdml version=3.0 ttl=0 markable=true>';
print "\n";
print $this->hasChilds()?'<choice name=main>':'<display>';
print "\n";
if($this->upperUrl) {
$url = $this->upperUrl;
printf('<action type=soft1 task=go dest="%s" label="%s">%s', $url->url, $url->text, "\n");
}
}
if($this->upperUrl)
{
$url = $this->upperUrl;
printf('<action type=soft1 task=go dest="%s" label="%s">%s', $url->url, $url->text, "\n");
}
}
/**
* @brief Output title
**/
function printTitle() {
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
printf('<b>&lt;%s%s&gt;%s', $this->title,$titlePageStr,"\n");
}
/**
* @brief Output title
**/
function printTitle()
{
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
printf('<b>&lt;%s%s&gt;%s', $this->title,$titlePageStr,"\n");
}
/**
* @brief Output information
* hasChilds() if there is a list of content types, otherwise output
**/
function printContent() {
if($this->hasChilds()) {
foreach($this->getChilds() as $key => $val) {
if(!$val['link']) continue;
printf('<ce task=go label="%s" dest="%s">%s%s',Context::getLang('cmd_select'), $val['href'], $val['text'], "\n");
}
} else {
printf('<wrap>%s<br>%s', $this->getContent(),"\n");
}
}
/**
* @brief Output information
* hasChilds() if there is a list of content types, otherwise output
**/
function printContent()
{
if($this->hasChilds())
{
foreach($this->getChilds() as $key => $val)
{
if(!$val['link']) continue;
printf('<ce task=go label="%s" dest="%s">%s%s',Context::getLang('cmd_select'), $val['href'], $val['text'], "\n");
}
}
else
{
printf('<wrap>%s<br>%s', $this->getContent(),"\n");
}
}
/**
* @brief Button to output
**/
function printBtn() {
// Menu Types
if($this->hasChilds()) {
if($this->nextUrl) {
$url = $this->nextUrl;
printf('<ce task=go label="%s" dest="%s">%s%s', $url->text, $url->url, $url->text, "\n");
}
if($this->prevUrl) {
$url = $this->prevUrl;
printf('<ce task=go label="%s" dest="%s">%s%s', $url->text, $url->url, $url->text, "\n");
}
if($this->homeUrl) {
$url = $this->homeUrl;
printf('<ce task=go label="%s" dest="%s">%s%s', $url->text, $url->url, $url->text, "\n");
}
// Content Types
} else {
if($this->nextUrl) {
$url = $this->nextUrl;
printf('<a task=gosub label="%s" dest="%s">%s</a>', $url->text, $url->url, $url->text);
}
if($this->prevUrl) {
$url = $this->prevUrl;
printf('<a task=gosub label="%s" dest="%s">%s</a>', $url->text, $url->url, $url->text);
}
if($this->homeUrl) {
$url = $this->homeUrl;
printf('<a task=gosub label="%s" dest="%s">%s</a>', $url->text, $url->url, $url->text);
}
}
}
/**
* @brief Button to output
**/
function printBtn()
{
// Menu Types
if($this->hasChilds())
{
if($this->nextUrl)
{
$url = $this->nextUrl;
printf('<ce task=go label="%s" dest="%s">%s%s', $url->text, $url->url, $url->text, "\n");
}
if($this->prevUrl)
{
$url = $this->prevUrl;
printf('<ce task=go label="%s" dest="%s">%s%s', $url->text, $url->url, $url->text, "\n");
}
if($this->homeUrl)
{
$url = $this->homeUrl;
printf('<ce task=go label="%s" dest="%s">%s%s', $url->text, $url->url, $url->text, "\n");
}
// Content Types
}
else
{
if($this->nextUrl)
{
$url = $this->nextUrl;
printf('<a task=gosub label="%s" dest="%s">%s</a>', $url->text, $url->url, $url->text);
}
if($this->prevUrl)
{
$url = $this->prevUrl;
printf('<a task=gosub label="%s" dest="%s">%s</a>', $url->text, $url->url, $url->text);
}
if($this->homeUrl)
{
$url = $this->homeUrl;
printf('<a task=gosub label="%s" dest="%s">%s</a>', $url->text, $url->url, $url->text);
}
}
}
/**
* @brief Footer information output
**/
function printFooter() {
print $this->hasChilds()?'</choice>':'</display>';
print "\n";
print("</hdml>");
}
/**
* @brief Footer information output
**/
function printFooter()
{
print $this->hasChilds()?'</choice>':'</display>';
print "\n";
print("</hdml>");
}
}
}
?>
/* End of file hdml.class.php */
/* Location: ./addons/mobile/classes/hdml.class.php */

View file

@ -1,80 +1,98 @@
<?php
/**
* mhtml Library ver 0.1
* @author NHN (developers@xpressengine.com) / lang_select : misol
**/
class wap extends mobileXE {
include './mobile.class.php';
/**
* mhtml Library ver 0.1
* @author NHN (developers@xpressengine.com) / lang_select : misol
*/
class wap extends mobileXE
{
/**
* @brief constructor
**/
function wap()
{
parent::mobileXE();
}
/**
* @brief constructor
**/
function wap() {
parent::mobileXE();
}
/**
* @brief hdml header output
**/
function printHeader()
{
print("<html><head>\n");
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
printf("<title>%s%s</title></head><body>\n", htmlspecialchars($this->title),htmlspecialchars($titlePageStr));
}
// Output title
function printTitle()
{
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
printf('&lt;%s%s&gt;<br>%s', htmlspecialchars($this->title),htmlspecialchars($titlePageStr),"\n");
}
/**
* @brief hdml header output
**/
function printHeader() {
print("<html><head>\n");
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
printf("<title>%s%s</title></head><body>\n", htmlspecialchars($this->title),htmlspecialchars($titlePageStr));
}
// Output title
function printTitle() {
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
printf('&lt;%s%s&gt;<br>%s', htmlspecialchars($this->title),htmlspecialchars($titlePageStr),"\n");
}
/**
* @brief Output information
* hasChilds() if there is a list of content types, otherwise output
**/
function printContent()
{
if($this->hasChilds())
{
foreach($this->getChilds() as $key => $val)
{
if(!$val['link']) continue;
printf('<a href="%s" accesskey="%s">%s</a><br>%s', $val['href'], $this->getNo(), $val['text'], "\n");
if($val['extra']) printf("<br>%s\n",str_replace('<br/>','<br>',$val['extra']));
}
}
else
{
print(str_replace('<br/>','<br>',$this->getContent())."\n");
}
print "<hr><br>";
}
/**
* @brief Output information
* hasChilds() if there is a list of content types, otherwise output
**/
function printContent() {
if($this->hasChilds()) {
foreach($this->getChilds() as $key => $val) {
if(!$val['link']) continue;
printf('<a href="%s" accesskey="%s">%s</a><br>%s', $val['href'], $this->getNo(), $val['text'], "\n");
if($val['extra']) printf("<br>%s\n",str_replace('<br/>','<br>',$val['extra']));
}
} else {
print(str_replace('<br/>','<br>',$this->getContent())."\n");
}
print "<hr><br>";
}
/**
* @brief Button to output
**/
function printBtn() {
if($this->nextUrl) {
$url = $this->nextUrl;
printf('<a href="%s">%s</a><br>%s', $url->url, $url->text, "\n");
}
if($this->prevUrl) {
$url = $this->prevUrl;
printf('<a href="%s">%s</a><br>%s', $url->url, $url->text, "\n");
}
// Select Language
if(!parent::isLangChange()){
$url = getUrl('','lcm','1','sel_lang',Context::getLangType(),'return_uri',Context::get('current_url'));
printf('<a href="%s">%s</a><br>%s', $url, 'Language : '.Context::getLang('select_lang'), "\n");
}
else {
printf('<a href="%s">%s</a><br>%s', Context::get('return_uri'), Context::getLang('lang_return'), "\n");
}
if($this->upperUrl) {
$url = $this->upperUrl;
printf('<btn href="%s" name="%s">%s', $url->url, $url->text, "\n");
}
if($this->homeUrl) {
$url = $this->homeUrl;
printf('<a btn="%s" href="%s">%s</a><br>%s', $url->text, $url->url, $url->text, "\n");
}
}
// Footer information output
function printFooter() {
print("</body></html>\n");
}
}
?>
/**
* @brief Button to output
**/
function printBtn()
{
if($this->nextUrl)
{
$url = $this->nextUrl;
printf('<a href="%s">%s</a><br>%s', $url->url, $url->text, "\n");
}
if($this->prevUrl)
{
$url = $this->prevUrl;
printf('<a href="%s">%s</a><br>%s', $url->url, $url->text, "\n");
}
// Select Language
if(!parent::isLangChange())
{
$url = getUrl('','lcm','1','sel_lang',Context::getLangType(),'return_uri',Context::get('current_url'));
printf('<a href="%s">%s</a><br>%s', $url, 'Language : '.Context::getLang('select_lang'), "\n");
}
else
{
printf('<a href="%s">%s</a><br>%s', Context::get('return_uri'), Context::getLang('lang_return'), "\n");
}
if($this->upperUrl)
{
$url = $this->upperUrl;
printf('<btn href="%s" name="%s">%s', $url->url, $url->text, "\n");
}
if($this->homeUrl)
{
$url = $this->homeUrl;
printf('<a btn="%s" href="%s">%s</a><br>%s', $url->text, $url->url, $url->text, "\n");
}
}
// Footer information output
function printFooter()
{
print("</body></html>\n");
}
}
/* End of file mhtml.class.php */
/* Location: ./addons/mobile/classes/mhtml.class.php */

File diff suppressed because it is too large Load diff

View file

@ -1,104 +1,127 @@
<?php
/**
* WML Library ver 0.1
* @author NHN (developers@xpressengine.com) / lang_select : misol
**/
class wap extends mobileXE {
/**
* WML Library ver 0.1
* @author NHN (developers@xpressengine.com) / lang_select : misol
*/
class wap extends mobileXE
{
/**
* @brief constructor
*/
function wap()
{
parent::mobileXE();
}
/**
* @brief constructor
**/
function wap() {
parent::mobileXE();
}
/**
* @brief wml header output
*/
function printHeader()
{
header("Content-Type: text/vnd.wap.wml");
header("charset: ".$this->charset);
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
print("<?xml version=\"1.0\" encoding=\"".$this->charset."\"?><!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n");
// Card Title
printf("<wml>\n<card title=\"%s%s\">\n<p>\n",htmlspecialchars($this->title),htmlspecialchars($titlePageStr));
}
/**
* @brief wml header output
**/
function printHeader() {
header("Content-Type: text/vnd.wap.wml");
header("charset: ".$this->charset);
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
print("<?xml version=\"1.0\" encoding=\"".$this->charset."\"?><!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n");
// Card Title
printf("<wml>\n<card title=\"%s%s\">\n<p>\n",htmlspecialchars($this->title),htmlspecialchars($titlePageStr));
}
/**
* @brief Output title
*/
function printTitle()
{
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
printf('&lt;%s%s&gt;<br/>%s', htmlspecialchars($this->title),htmlspecialchars($titlePageStr),"\n");
}
/**
* @brief Output title
**/
function printTitle() {
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
printf('&lt;%s%s&gt;<br/>%s', htmlspecialchars($this->title),htmlspecialchars($titlePageStr),"\n");
}
/**
* @brief Output information
* hasChilds() if there is a list of content types, otherwise output
*/
function printContent()
{
if($this->hasChilds())
{
foreach($this->getChilds() as $key => $val)
{
if(!$val['link']) continue;
printf('<do type="%s" label="%s"><go href="%s" /></do>%s', $this->getNo(), htmlspecialchars($val['text']), $val['href'], "\n");
if($val['extra']) printf("%s\n",$val['extra']);
}
}
else
{
printf('%s<br/>%s', str_replace("<br>","<br/>",$this->getContent()),"\n");
}
print('<br/>');
}
/**
* @brief Output information
* hasChilds() if there is a list of content types, otherwise output
**/
function printContent() {
if($this->hasChilds()) {
foreach($this->getChilds() as $key => $val) {
if(!$val['link']) continue;
printf('<do type="%s" label="%s"><go href="%s" /></do>%s', $this->getNo(), htmlspecialchars($val['text']), $val['href'], "\n");
if($val['extra']) printf("%s\n",$val['extra']);
}
} else {
printf('%s<br/>%s', str_replace("<br>","<br/>",$this->getContent()),"\n");
}
print('<br/>');
}
/**
* @brief Button to output
**/
function printBtn() {
if($this->nextUrl) {
$url = $this->nextUrl;
printf('<do type="vnd.next" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
}
if($this->prevUrl) {
$url = $this->prevUrl;
printf('<do type="vnd.prev" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
}
// Others are not applicable in charge of the button output (array passed) type??
if($this->etcBtn) {
if(is_array($this->etcBtn)) {
foreach($this->etcBtn as $key=>$val) {
printf('<do type="vnd.btn%s" label="%s"><go href="%s"/></do>%s', $key, $val['text'], $val['url'], "\n");
}
}
}
// Select Language
if(!parent::isLangChange()){
$url = getUrl('','lcm','1','sel_lang',Context::getLangType(),'return_uri',Context::get('current_url'));
printf('<do type="vnd.lang" label="%s"><go href="%s"/></do>%s', 'Language : '.Context::getLang('select_lang'), $url, "\n");
}
else {
printf('<do type="vnd.lang" label="%s"><go href="%s"/></do>%s', Context::getLang('lang_return'), Context::get('return_uri'), "\n");
}
if($this->homeUrl) {
$url = $this->homeUrl;
printf('<do type="access" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
}
if($this->upperUrl) {
$url = $this->upperUrl;
printf('<do type="vnd.up" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
}
}
// Footer information output
function printFooter() {
print("</p>\n</card>\n</wml>");
}
// And returns a list of serial numbers in
function getNo() {
if(Context::get('mobile_skt')==1) {
return "vnd.skmn".parent::getNo();
}
else {
return parent::getNo();
}
return $str;
}
}
?>
/**
* @brief Button to output
*/
function printBtn()
{
if($this->nextUrl)
{
$url = $this->nextUrl;
printf('<do type="vnd.next" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
}
if($this->prevUrl)
{
$url = $this->prevUrl;
printf('<do type="vnd.prev" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
}
// Others are not applicable in charge of the button output (array passed) type??
if($this->etcBtn)
{
if(is_array($this->etcBtn))
{
foreach($this->etcBtn as $key=>$val)
{
printf('<do type="vnd.btn%s" label="%s"><go href="%s"/></do>%s', $key, $val['text'], $val['url'], "\n");
}
}
}
// Select Language
if(!parent::isLangChange())
{
$url = getUrl('','lcm','1','sel_lang',Context::getLangType(),'return_uri',Context::get('current_url'));
printf('<do type="vnd.lang" label="%s"><go href="%s"/></do>%s', 'Language : '.Context::getLang('select_lang'), $url, "\n");
}
else
{
printf('<do type="vnd.lang" label="%s"><go href="%s"/></do>%s', Context::getLang('lang_return'), Context::get('return_uri'), "\n");
}
if($this->homeUrl)
{
$url = $this->homeUrl;
printf('<do type="access" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
}
if($this->upperUrl)
{
$url = $this->upperUrl;
printf('<do type="vnd.up" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n");
}
}
// Footer information output
function printFooter()
{
print("</p>\n</card>\n</wml>");
}
// And returns a list of serial numbers in
function getNo()
{
if(Context::get('mobile_skt')==1)
{
return "vnd.skmn".parent::getNo();
}
else
{
return parent::getNo();
}
return $str;
}
}
/* End of file wml.class.php */
/* Location: ./addons/mobile/classes/wml.class.php */

View file

@ -31,10 +31,12 @@ $oMobile->setCharSet($addon_info->charset);
$oMobile->setModuleInfo($this->module_info);
// Register the current module object
$oMobile->setModuleInstance($this);
// Extract content and display/exit if navigate mode is or if WAP class exists
if($called_position == 'before_module_proc') {
if($oMobile->isLangChange()) {
// Extract content and display/exit if navigate mode is or if WAP class exists
if($called_position == 'before_module_proc')
{
if($oMobile->isLangChange())
{
$oMobile->setLangType();
$oMobile->displayLangSelect();
}
@ -42,9 +44,13 @@ if($called_position == 'before_module_proc') {
if($oMobile->isNavigationMode()) $oMobile->displayNavigationContent();
// If you have a WAP class content output via WAP class
else $oMobile->displayModuleContent();
// If neither navigation mode nor WAP class is, display the module's result
} else if($called_position == 'after_module_proc') {
// If neither navigation mode nor WAP class is, display the module's result
}
else if($called_position == 'after_module_proc')
{
// Display
$oMobile->displayContent();
}
?>
/* End of file mobile.addon.php */
/* Location: ./addons/mobile/mobile.addon.php */

View file

@ -15,13 +15,15 @@ if($called_position != 'before_module_init') return;
if(!$addon_info->server||!$addon_info->delegate||!$addon_info->xrds) return;
$header_script = sprintf(
'<link rel="openid.server" href="%s" />'."\n".
'<link rel="openid.delegate" href="%s" />'."\n".
'<meta http-equiv="X-XRDS-Location" content="%s" />',
$addon_info->server,
$addon_info->delegate,
$addon_info->xrds
);
'<link rel="openid.server" href="%s" />'."\n".
'<link rel="openid.delegate" href="%s" />'."\n".
'<meta http-equiv="X-XRDS-Location" content="%s" />',
$addon_info->server,
$addon_info->delegate,
$addon_info->xrds
);
Context::addHtmlHeader($header_script);
?>
/* End of file openid_delegation_id.addon.php */
/* Location: ./addons/openid_delegation_id/openid_delegation_id.addon.php */

View file

@ -16,4 +16,6 @@ require_once('./addons/point_level_icon/point_level_icon.lib.php');
$temp_output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9\-]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'pointLevelIconTrans', $output);
if($temp_output) $output = $temp_output;
unset($temp_output);
?>
/* End of file point_level_icon.addon.php */
/* Location: ./addons/point_level_icon/point_level_icon.addon.php */

View file

@ -1,8 +1,9 @@
<?php
/**
* @brief Function to change point icon.
**/
function pointLevelIconTrans($matches) {
*/
function pointLevelIconTrans($matches)
{
$member_srl = $matches[3];
if($member_srl<1) return $matches[0];
@ -12,9 +13,11 @@ function pointLevelIconTrans($matches) {
$oMemberModel = &getModel('member');
if($oMemberModel->getGroupImageMark($member_srl)) return $orig_text.$matches[5].'</'.$matches[6].'>';
if(!isset($GLOBALS['_pointLevelIcon'][$member_srl])) {
if(!isset($GLOBALS['_pointLevelIcon'][$member_srl]))
{
// Get point configuration
if(!$GLOBALS['_pointConfig']) {
if(!$GLOBALS['_pointConfig'])
{
$oModuleModel = &getModel('module');
$GLOBALS['_pointConfig'] = $oModuleModel->getModuleConfig('point');
}
@ -31,7 +34,8 @@ function pointLevelIconTrans($matches) {
// 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) {
if($level < $config->max_level)
{
$next_point = $config->level_step[$level+1];
$present_point = $config->level_step[$level];
if($next_point > 0) {
@ -49,4 +53,6 @@ function pointLevelIconTrans($matches) {
return $orig_text.$text.$matches[5].'</'.$matches[6].'>';
}
?>
/* End of file point_level_icon.lib.php */
/* Location: ./addons/point_level_icon/point_level_icon.lib.php */

View file

@ -5,14 +5,20 @@ if(!defined('__XE__')) exit();
* @file resize_image.addon.php
* @author NHN (developers@xpressengine.com)
* @brief Add-on to resize images in the body
**/
*/
if($called_position == 'after_module_proc' && Context::getResponseMethod()=="HTML") {
if(Mobile::isFromMobilePhone()) {
if($called_position == 'after_module_proc' && Context::getResponseMethod()=="HTML")
{
if(Mobile::isFromMobilePhone())
{
Context::loadFile('./addons/resize_image/css/resize_image.mobile.css', true);
} else {
}
else
{
Context::loadJavascriptPlugin('ui');
Context::loadFile(array('./addons/resize_image/js/resize_image.min.js', 'body', '', null), true);
}
}
?>
/* End of file resize_image.addon.php */
/* Location: ./addons/resize_image/resize_image.addon.php */