merge from 1.7.3.5(r13153:r13167)

git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2013-09-29 23:32:39 +00:00
parent cc47d2b247
commit 2d3f149b5a
2042 changed files with 129266 additions and 126243 deletions

View file

@ -26,9 +26,6 @@ RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$ ./index.php?mid=$1&documen
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$ ./index.php?vid=$1&document_srl=$2&key=$3&act=trackback [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$ ./index.php?vid=$1&mid=$2&document_srl=$3&key=$4&act=trackback [L]
# administrator page
RewriteRule ^admin/?$ ./index.php?module=admin [L]
# document permanent link
RewriteRule ^([0-9]+)$ ./index.php?document_srl=$1 [L,QSA]

View file

@ -1,17 +1,21 @@
<?php
if(!defined('__XE__')) exit();
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':'';
$act = Context::get('act');
$kind = strpos(strtolower($act), 'admin') !== false ? 'admin' : '';
if($called_position == 'before_module_proc' && $kind == 'admin' && $logged_info->is_admin == 'Y') {
$oAdminloggingController = &getController('adminlogging');
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

@ -1,12 +1,21 @@
<?php
if(!defined('__XE__')) exit();
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")
{
if(Mobile::isFromMobilePhone())
{
Context::addJsFile('./common/js/jquery.min.js', false, '', -1000000);
Context::addJsFile('./common/js/xe.min.js', false, '', -1000000);
}
Context::loadFile(array('./addons/autolink/autolink.js', 'body', '', null), true);
}
?>
/* End of file autolink.addon.php */
/* Location: ./addons/autolink/autolink.addon.php */

View file

@ -1,16 +1,16 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="ko" xml:lang="ko" xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html>
<html lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta charset="utf-8" />
<title>Autolink Addon Unit Test</title>
<link rel="stylesheet" type="text/css" href="../../common/js/unittest/css/JSSpec.css" />
<script type="text/javascript" src="../../common/js/jquery.js"></script>
<script type="text/javascript" src="../../common/js/common.js"></script>
<script type="text/javascript" src="../../common/js/js_app.js"></script>
<script type="text/javascript" src="autolink.js"></script>
<script type="text/javascript" src="../../common/js/unittest/JSSpec/diff_match_patch.js"></script>
<script type="text/javascript" src="../../common/js/unittest/JSSpec/JSSpec.js"></script>
<script type="text/javascript">// <![CDATA[
<link rel="stylesheet" href="../../common/js/unittest/css/JSSpec.css" />
<script src="../../common/js/jquery.js"></script>
<script src="../../common/js/common.js"></script>
<script src="../../common/js/js_app.js"></script>
<script src="autolink.js"></script>
<script src="../../common/js/unittest/JSSpec/diff_match_patch.js"></script>
<script src="../../common/js/unittest/JSSpec/JSSpec.js"></script>
<script>// <![CDATA[
var testParam = null;
var TestSuite = xe.createPlugin("TestSuite", {

View file

@ -1,5 +1,7 @@
<?php
if(!defined('__XE__')) exit();
if(!defined('__XE__'))
exit();
/**
* @file blogapicounter.addon.php
@ -8,417 +10,506 @@ if(!defined('__XE__')) exit();
*
* It enables to write a post by using an external tool such as ms live writer, firefox performancing, zoundry and so on.
* It should be called before executing the module(before_module_proc). If not, it is forced to shut down.
**/
* */
// Insert a rsd tag when called_position is after_module_proc
if($called_position == 'after_module_proc') {
if($called_position == 'after_module_proc')
{
// Create rsd address of the current module
$site_module_info = Context::get('site_module_info');
$rsd_url = getFullSiteUrl($site_module_info->domain, '', 'mid',$site_module_info->mid, 'act','api');
$rsd_url = getFullSiteUrl($site_module_info->domain, '', 'mid', $this->module_info->mid, 'act', 'api');
// Insert rsd tag into the header
Context::addHtmlHeader(" ".'<link rel="EditURI" type="application/rsd+xml" title="RSD" href="'.$rsd_url.'" />');
Context::addHtmlHeader(" " . '<link rel="EditURI" type="application/rsd+xml" title="RSD" href="' . $rsd_url . '" />');
}
// If act isnot api, just return
if($_REQUEST['act']!='api') return;
if($_REQUEST['act'] != 'api')
{
return;
}
// Read func file
require_once('./addons/blogapi/blogapi.func.php');
// xmlprc parsing
// Parse the requested xmlrpc
$oXmlParser = new XmlParser();
$xmlDoc = $oXmlParser->parse();
$xml = new SimpleXMLElement($GLOBALS['HTTP_RAW_POST_DATA']);
$method_name = (string)$xml->methodName;
$params = $xml->params->param;
$method_name = $xmlDoc->methodcall->methodname->body;
$params = $xmlDoc->methodcall->params->param;
if($params && !is_array($params)) $params = array($params);
// Compatible with some of methodname
if(in_array($method_name, array('metaWeblog.deletePost', 'metaWeblog.getUsersBlogs', 'metaWeblog.getUserInfo'))) {
if(in_array($method_name, array('metaWeblog.deletePost', 'metaWeblog.getUsersBlogs', 'metaWeblog.getUserInfo')))
{
$method_name = str_replace('metaWeblog.', 'blogger.', $method_name);
}
// Delete the first argument if it is blogger.deletePost
if($method_name == 'blogger.deletePost') array_shift($params);
// Get user_id, password and attempt log-in
$user_id = trim($params[1]->value->string->body);
$password = trim($params[2]->value->string->body);
$user_id = trim((string)$params[1]->value->string);
$password = trim((string)$params[2]->value->string);
// Before executing the module, authentication is processed.
if($called_position == 'before_module_init') {
if($called_position == 'before_module_init')
{
// Attempt log-in by using member controller
if($user_id && $password) {
$oMemberController = &getController('member');
if($user_id && $password)
{
$oMemberController = getController('member');
$output = $oMemberController->doLogin($user_id, $password);
// If login fails, an error message appears
if(!$output->toBool()) {
if(!$output->toBool())
{
$content = getXmlRpcFailure(1, $output->getMessage());
printContent($content);
}
} else {
}
else
{
$content = getXmlRpcFailure(1, 'not logged');
printContent($content);
}
}
// Before module processing, handle requests from blogapi tool and then terminate.
if($called_position == 'before_module_proc') {
if($called_position == 'before_module_proc')
{
// Check writing permission
if(!$this->grant->write_document) {
printContent( getXmlRpcFailure(1, 'no permission') );
if(!$this->grant->write_document)
{
printContent(getXmlRpcFailure(1, 'no permission'));
}
// Get information of the categories
$oDocumentModel = &getModel('document');
$oDocumentModel = getModel('document');
$category_list = $oDocumentModel->getCategoryList($this->module_srl);
// Specifies a temporary file storage
$tmp_uploaded_path = sprintf('./files/cache/blogapi/%s/%s/', $this->mid, $user_id);
$uploaded_target_path = sprintf('/files/cache/blogapi/%s/%s/', $this->mid, $user_id);
switch($method_name) {
switch($method_name)
{
// Blog information
case 'blogger.getUsersBlogs' :
$obj->url = getFullSiteUrl('');
$obj->blogid = $this->mid;
$obj->blogName = $this->module_info->browser_title;
$blog_list = array($obj);
$obj = new stdClass();
$obj->url = getFullSiteUrl('');
$obj->blogid = $this->mid;
$obj->blogName = $this->module_info->browser_title;
$blog_list = array($obj);
$content = getXmlRpcResponse($blog_list);
printContent($content);
$content = getXmlRpcResponse($blog_list);
printContent($content);
break;
// Return a list of categories
case 'metaWeblog.getCategories' :
$category_obj_list = array();
if($category_list) {
foreach($category_list as $category_srl => $category_info) {
unset($obj);
$obj->description = $category_info->title;
//$obj->htmlUrl = Context::getRequestUri().$this->mid.'/1';
//$obj->rssUrl= Context::getRequestUri().'rss/'.$this->mid.'/1';
$obj->title = $category_info->title;
$obj->categoryid = $category_srl;
$category_obj_list[] = $obj;
}
$category_obj_list = array();
if($category_list)
{
foreach($category_list as $category_srl => $category_info)
{
$obj = new stdClass();
$obj->description = $category_info->title;
//$obj->htmlUrl = Context::getRequestUri().$this->mid.'/1';
//$obj->rssUrl= Context::getRequestUri().'rss/'.$this->mid.'/1';
$obj->title = $category_info->title;
$obj->categoryid = $category_srl;
$category_obj_list[] = $obj;
}
}
$content = getXmlRpcResponse($category_obj_list);
printContent($content);
$content = getXmlRpcResponse($category_obj_list);
printContent($content);
break;
// Upload file
case 'metaWeblog.newMediaObject' :
// Check a file upload permission
$oFileModel = &getModel('file');
$file_module_config = $oFileModel->getFileModuleConfig($this->module_srl);
if(is_array($file_module_config->download_grant) && count($file_module_config->download_grant)>0) {
$logged_info = Context::get('logged_info');
if($logged_info->is_admin != 'Y') {
$is_permitted = false;
for($i=0;$i<count($file_module_config->download_grant);$i++) {
$group_srl = $file_module_config->download_grant[$i];
if($logged_info->group_list[$group_srl]) {
$is_permitted = true;
break;
}
// Check a file upload permission
$oFileModel = getModel('file');
$file_module_config = $oFileModel->getFileModuleConfig($this->module_srl);
if(is_array($file_module_config->download_grant) && count($file_module_config->download_grant) > 0)
{
$logged_info = Context::get('logged_info');
if($logged_info->is_admin != 'Y')
{
$is_permitted = false;
for($i = 0; $i < count($file_module_config->download_grant); $i++)
{
$group_srl = $file_module_config->download_grant[$i];
if($logged_info->group_list[$group_srl])
{
$is_permitted = true;
break;
}
if(!$is_permitted) printContent( getXmlRpcFailure(1, 'no permission') );
}
if(!$is_permitted){
printContent(getXmlRpcFailure(1, 'no permission'));
}
}
}
$fileinfo = $params[3]->value->struct->member;
foreach($fileinfo as $key => $val) {
$nodename = $val->name->body;
if($nodename == 'bits') $filedata = base64_decode($val->value->base64->body);
elseif($nodename == 'name') $filename = $val->value->string->body;
}
$fileinfo = $params[3]->value->struct->member;
foreach($fileinfo as $key => $val)
{
$nodename = (string)$val->name;
if($nodename == 'bits')
$filedata = base64_decode((string)$val->value->base64);
elseif($nodename == 'name')
$filename = (string)$val->value->string;
}
$tmp_arr = explode('/',$filename);
$filename = array_pop($tmp_arr);
$tmp_arr = explode('/', $filename);
$filename = array_pop($tmp_arr);
if(!is_dir($tmp_uploaded_path)) FileHandler::makeDir($tmp_uploaded_path);
if(!is_dir($tmp_uploaded_path))
{
FileHandler::makeDir($tmp_uploaded_path);
}
$target_filename = sprintf('%s%s', $tmp_uploaded_path, $filename);
FileHandler::writeFile($target_filename, $filedata);
$obj->url = Context::getRequestUri().$target_filename;
$target_filename = sprintf('%s%s', $tmp_uploaded_path, $filename);
FileHandler::writeFile($target_filename, $filedata);
$obj = new stdClass();
$obj->url = Context::getRequestUri() . $target_filename;
$content = getXmlRpcResponse($obj);
printContent($content);
$content = getXmlRpcResponse($obj);
printContent($content);
break;
// Get posts
case 'metaWeblog.getPost' :
$document_srl = $params[0]->value->string->body;
if(!$document_srl) {
printContent( getXmlRpcFailure(1, 'no permission') );
} else {
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
if(!$oDocument->isExists() || !$oDocument->isGranted()) {
printContent( getXmlRpcFailure(1, 'no permission') );
} else {
// Get a list of categories and set Context
$category = "";
if($oDocument->get('category_srl')) {
$oDocumentModel = &getModel('document');
$category_list = $oDocumentModel->getCategoryList($oDocument->get('module_srl'));
if($category_list[$oDocument->get('category_srl')]) {
$category = $category_list[$oDocument->get('category_srl')]->title;
}
}
$content = sprintf(
'<?xml version="1.0" encoding="utf-8"?>'.
'<methodResponse>'.
'<params>'.
'<param>'.
'<value>'.
'<struct>'.
'<member><name>categories</name><value><array><data><value><![CDATA[%s]]></value></data></array></value></member>'.
'<member><name>dateCreated</name><value><dateTime.iso8601>%s</dateTime.iso8601></value></member>'.
'<member><name>description</name><value><![CDATA[%s]]></value></member>'.
'<member><name>link</name><value>%s</value></member>'.
'<member><name>postid</name><value><string>%s</string></value></member>'.
'<member><name>title</name><value><![CDATA[%s]]></value></member>'.
'<member><name>publish</name><value><boolean>1</boolean></value></member>'.
'</struct>'.
'</value>'.
'</param>'.
'</params>'.
'</methodResponse>',
$category,
date("Ymd", $oDocument->getRegdateTime()).'T'.date("H:i:s", $oDocument->getRegdateTime()),
$oDocument->getContent(false, false, true,false),
getFullUrl('','document_srl', $oDocument->document_srl),
$oDocument->document_srl,
$oDocument->getTitleText()
);
printContent($content);
}
$document_srl = (string)$params[0]->value->string;
if(!$document_srl)
{
printContent(getXmlRpcFailure(1, 'no permission'));
}
else
{
$oDocumentModel = getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
if(!$oDocument->isExists() || !$oDocument->isGranted())
{
printContent(getXmlRpcFailure(1, 'no permission'));
}
else
{
// Get a list of categories and set Context
$category = "";
if($oDocument->get('category_srl'))
{
$oDocumentModel = &getModel('document');
$category_list = $oDocumentModel->getCategoryList($oDocument->get('module_srl'));
if($category_list[$oDocument->get('category_srl')])
{
$category = $category_list[$oDocument->get('category_srl')]->title;
}
}
$content = sprintf(
'<?xml version="1.0" encoding="utf-8"?>' .
'<methodResponse>' .
'<params>' .
'<param>' .
'<value>' .
'<struct>' .
'<member><name>categories</name><value><array><data><value><![CDATA[%s]]></value></data></array></value></member>' .
'<member><name>dateCreated</name><value><dateTime.iso8601>%s</dateTime.iso8601></value></member>' .
'<member><name>description</name><value><![CDATA[%s]]></value></member>' .
'<member><name>link</name><value>%s</value></member>' .
'<member><name>postid</name><value><string>%s</string></value></member>' .
'<member><name>title</name><value><![CDATA[%s]]></value></member>' .
'<member><name>publish</name><value><boolean>1</boolean></value></member>' .
'</struct>' .
'</value>' .
'</param>' .
'</params>' .
'</methodResponse>',
$category,
date("Ymd", $oDocument->getRegdateTime()) . 'T' . date("H:i:s", $oDocument->getRegdateTime()),
$oDocument->getContent(false, false, true, false),
getFullUrl('', 'document_srl', $oDocument->document_srl),
$oDocument->document_srl,
$oDocument->getTitleText()
);
printContent($content);
}
}
break;
// Write a new post
case 'metaWeblog.newPost' :
unset($obj);
$info = $params[3];
// Get information of post, title, and category
for($i=0;$i<count($info->value->struct->member);$i++) {
$val = $info->value->struct->member[$i];
switch($val->name->body) {
case 'title' :
$obj->title = $val->value->string->body;
break;
case 'description' :
$obj->content = $val->value->string->body;
break;
case 'categories' :
$categories = $val->value->array->data->value;
if(!is_array($categories)) $categories = array($categories);
$category = $categories[0]->string->body;
if($category && $category_list) {
foreach($category_list as $category_srl => $category_info) {
if($category_info->title == $category) $obj->category_srl = $category_srl;
}
}
break;
case 'tagwords' :
$tags = $val->value->array->data->value;
if(!is_array($tags)) $tags = array($tags);
for($j=0;$j<count($tags);$j++) {
$tag_list[] = $tags[$j]->string->body;
}
if(count($tag_list)) $obj->tags = implode(',',$tag_list);
break;
}
}
// Set document srl
$document_srl = getNextSequence();
$obj->document_srl = $document_srl;
$obj->module_srl = $this->module_srl;
// Attachment
if(is_dir($tmp_uploaded_path)) {
$file_list = FileHandler::readDir($tmp_uploaded_path);
$file_count = count($file_list);
if($file_count) {
$oFileController = &getController('file');
for($i=0;$i<$file_count;$i++) {
$file_info['tmp_name'] = sprintf('%s%s', $tmp_uploaded_path, $file_list[$i]);
$file_info['name'] = $file_list[$i];
$fileOutput = $oFileController->insertFile($file_info, $this->module_srl, $document_srl, 0, true);
$uploaded_filename = $fileOutput->get('uploaded_filename');
$source_filename = $fileOutput->get('source_filename');
$obj->content = str_replace($uploaded_target_path . $source_filename, sprintf('/files/attach/images/%s/%s%s', $this->module_srl, getNumberingPath($document_srl,3), $uploaded_filename), $obj->content);
$obj = new stdClass();
$info = $params[3];
// Get information of post, title, and category
foreach($info->value->struct->member as $val)
{
switch((string)$val->name)
{
case 'title' :
$obj->title = (string)$val->value->string;
break;
case 'description' :
$obj->content = (string)$val->value->string;
break;
case 'categories' :
$categories = $val->value->array->data->value;
$category = (string)$categories[0]->string;
if($category && $category_list)
{
foreach($category_list as $category_srl => $category_info)
{
if($category_info->title == $category)
$obj->category_srl = $category_srl;
}
}
$obj->uploaded_count = $file_count;
break;
case 'tagwords' :
$tags = $val->value->array->data->value;
foreach($tags as $tag)
{
$tag_list[] = (string)$tag->string;
}
if(count($tag_list))
$obj->tags = implode(',', $tag_list);
break;
}
}
// Set document srl
$document_srl = getNextSequence();
$obj->document_srl = $document_srl;
$obj->module_srl = $this->module_srl;
// Attachment
if(is_dir($tmp_uploaded_path))
{
$file_list = FileHandler::readDir($tmp_uploaded_path);
$file_count = count($file_list);
if($file_count)
{
$oFileController = &getController('file');
for($i = 0; $i < $file_count; $i++)
{
$file_info['tmp_name'] = sprintf('%s%s', $tmp_uploaded_path, $file_list[$i]);
$file_info['name'] = $file_list[$i];
$fileOutput = $oFileController->insertFile($file_info, $this->module_srl, $document_srl, 0, true);
$uploaded_filename = $fileOutput->get('uploaded_filename');
$source_filename = $fileOutput->get('source_filename');
$obj->content = str_replace($uploaded_target_path . $source_filename, sprintf('/files/attach/images/%s/%s%s', $this->module_srl, getNumberingPath($document_srl, 3), $uploaded_filename), $obj->content);
}
$obj->uploaded_count = $file_count;
}
}
$oDocumentController = getController('document');
$obj->commentStatus = 'ALLOW';
$obj->allow_trackback = 'Y';
$logged_info = Context::get('logged_info');
$obj->member_srl = $logged_info->member_srl;
$obj->user_id = $logged_info->user_id;
$obj->user_name = $logged_info->user_name;
$obj->nick_name = $logged_info->nick_name;
$obj->email_address = $logged_info->email_address;
$obj->homepage = $logged_info->homepage;
$output = $oDocumentController->insertDocument($obj, TRUE);
$oDocumentController = &getController('document');
$obj->commentStatus = 'ALLOW';
$obj->allow_trackback = 'Y';
$output = $oDocumentController->insertDocument($obj);
if(!$output->toBool())
{
$content = getXmlRpcFailure(1, $output->getMessage());
}
else
{
$content = getXmlRpcResponse(strval($document_srl));
}
FileHandler::removeDir($tmp_uploaded_path);
if(!$output->toBool()) {
$content = getXmlRpcFailure(1, $output->getMessage());
} else {
$content = getXmlRpcResponse(strval($document_srl));
}
FileHandler::removeDir($tmp_uploaded_path);
printContent($content);
printContent($content);
break;
// Edit post
case 'metaWeblog.editPost' :
$tmp_val = $params[0]->value->string->body;
if(!$tmp_val) $tmp_val = $params[0]->value->i4->body;
if(!$tmp_val) {
$content = getXmlRpcFailure(1, 'no permission');
break;
}
$tmp_arr = explode('/', $tmp_val);
$document_srl = array_pop($tmp_arr);
if(!$document_srl) {
$content = getXmlRpcFailure(1, 'no permission');
break;
}
$tmp_val = (string)$params[0]->value->string;
if(!$tmp_val)
$tmp_val = (string)$params[0]->value->i4;
if(!$tmp_val)
{
$content = getXmlRpcFailure(1, 'no permission');
break;
}
$tmp_arr = explode('/', $tmp_val);
$document_srl = array_pop($tmp_arr);
if(!$document_srl)
{
$content = getXmlRpcFailure(1, 'no permission');
break;
}
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
// Check if a permission to modify a document is granted
if(!$oDocument->isGranted()) {
$content = getXmlRpcFailure(1, 'no permission');
break;
}
$oDocumentModel = getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
// Check if a permission to modify a document is granted
if(!$oDocument->isGranted())
{
$content = getXmlRpcFailure(1, 'no permission');
break;
}
$obj = $oDocument->getObjectVars();
$obj = $oDocument->getObjectVars();
$info = $params[3];
// Get information of post, title, and category
for($i=0;$i<count($info->value->struct->member);$i++) {
$val = $info->value->struct->member[$i];
switch($val->name->body) {
case 'title' :
$obj->title = $val->value->string->body;
break;
case 'description' :
$obj->content = $val->value->string->body;
break;
case 'categories' :
$categories = $val->value->array->data->value;
if(!is_array($categories)) $categories = array($categories);
$category = $categories[0]->string->body;
if($category && $category_list) {
foreach($category_list as $category_srl => $category_info) {
if($category_info->title == $category) $obj->category_srl = $category_srl;
}
}
break;
case 'tagwords' :
$tags = $val->value->array->data->value;
if(!is_array($tags)) $tags = array($tags);
for($j=0;$j<count($tags);$j++) {
$tag_list[] = $tags[$j]->string->body;
}
if(count($tag_list)) $obj->tags = implode(',',$tag_list);
break;
}
}
// Document srl
$obj->document_srl = $document_srl;
$obj->module_srl = $this->module_srl;
// Attachment
if(is_dir($tmp_uploaded_path)) {
$file_list = FileHandler::readDir($tmp_uploaded_path);
$file_count = count($file_list);
if($file_count) {
$oFileController = &getController('file');
for($i=0;$i<$file_count;$i++) {
$file_info['tmp_name'] = sprintf('%s%s', $tmp_uploaded_path, $file_list[$i]);
$file_info['name'] = $file_list[$i];
$moved_filename = sprintf('./files/attach/images/%s/%s/%s', $this->module_srl, $document_srl, $file_info['name']);
if(file_exists($moved_filename)) continue;
$fileOutput = $oFileController->insertFile($file_info, $this->module_srl, $document_srl, 0, true);
$uploaded_filename = $fileOutput->get('uploaded_filename');
$source_filename = $fileOutput->get('source_filename');
$obj->content = str_replace($uploaded_target_path . $source_filename, sprintf('/files/attach/images/%s/%s%s', $this->module_srl, getNumberingPath($document_srl,3), $uploaded_filename), $obj->content);
$info = $params[3];
// Get information of post, title, and category
foreach($info->value->struct->member as $val)
{
switch((string)$val->name)
{
case 'title' :
$obj->title = (string)$val->value->string;
break;
case 'description' :
$obj->content = (string)$val->value->string;
break;
case 'categories' :
$categories = $val->value->array->data->value;
$category = (string)$categories[0]->string;
if($category && $category_list)
{
foreach($category_list as $category_srl => $category_info)
{
if($category_info->title == $category)
$obj->category_srl = $category_srl;
}
}
$obj->uploaded_count += $file_count;
break;
case 'tagwords' :
$tags = $val->value->array->data->value;
foreach($tags as $tag)
{
$tag_list[] = (string)$tag->string;
}
if(count($tag_list))
$obj->tags = implode(',', $tag_list);
break;
}
}
// Document srl
$obj->document_srl = $document_srl;
$obj->module_srl = $this->module_srl;
// Attachment
if(is_dir($tmp_uploaded_path))
{
$file_list = FileHandler::readDir($tmp_uploaded_path);
$file_count = count($file_list);
if($file_count)
{
$oFileController = &getController('file');
for($i = 0; $i < $file_count; $i++)
{
$file_info['tmp_name'] = sprintf('%s%s', $tmp_uploaded_path, $file_list[$i]);
$file_info['name'] = $file_list[$i];
$moved_filename = sprintf('./files/attach/images/%s/%s/%s', $this->module_srl, $document_srl, $file_info['name']);
if(file_exists($moved_filename))
continue;
$fileOutput = $oFileController->insertFile($file_info, $this->module_srl, $document_srl, 0, true);
$uploaded_filename = $fileOutput->get('uploaded_filename');
$source_filename = $fileOutput->get('source_filename');
$obj->content = str_replace($uploaded_target_path . $source_filename, sprintf('/files/attach/images/%s/%s%s', $this->module_srl, getNumberingPath($document_srl, 3), $uploaded_filename), $obj->content);
}
$obj->uploaded_count += $file_count;
}
}
$oDocumentController = &getController('document');
$output = $oDocumentController->updateDocument($oDocument,$obj);
$oDocumentController = &getController('document');
$output = $oDocumentController->updateDocument($oDocument, $obj, TRUE);
if(!$output->toBool()) {
$content = getXmlRpcFailure(1, $output->getMessage());
} else {
$content = getXmlRpcResponse(true);
FileHandler::removeDir($tmp_uploaded_path);
}
if(!$output->toBool())
{
$content = getXmlRpcFailure(1, $output->getMessage());
}
else
{
$content = getXmlRpcResponse(true);
FileHandler::removeDir($tmp_uploaded_path);
}
printContent($content);
printContent($content);
break;
// Delete the post
case 'blogger.deletePost' :
$tmp_val = $params[0]->value->string->body;
$tmp_arr = explode('/', $tmp_val);
$document_srl = array_pop($tmp_arr);
// Get a document
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
// If the document exists
if(!$oDocument->isExists()) {
$content = getXmlRpcFailure(1, 'not exists');
$tmp_val = (string)$params[1]->value->string;
$tmp_arr = explode('/', $tmp_val);
$document_srl = array_pop($tmp_arr);
// Get a document
$oDocumentModel = getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
// If the document exists
if(!$oDocument->isExists())
{
$content = getXmlRpcFailure(1, 'not exists');
// Check if a permission to delete a document is granted
} elseif(!$oDocument->isGranted()) {
$content = getXmlRpcFailure(1, 'no permission');
break;
}
elseif(!$oDocument->isGranted())
{
$content = getXmlRpcFailure(1, 'no permission');
break;
// Delete
} else {
$oDocumentController = &getController('document');
$output = $oDocumentController->deleteDocument($document_srl);
if(!$output->toBool()) $content = getXmlRpcFailure(1, $output->getMessage());
else $content = getXmlRpcResponse(true);
}
}
else
{
$oDocumentController = getController('document');
$output = $oDocumentController->deleteDocument($document_srl);
if(!$output->toBool())
$content = getXmlRpcFailure(1, $output->getMessage());
else
$content = getXmlRpcResponse(true);
}
printContent($content);
printContent($content);
break;
// Get recent posts
case 'metaWeblog.getRecentPosts' :
// Options to get a list
$args->module_srl = $this->module_srl; // /< module_srl of the current module
$args->page = 1;
$args->list_count = 20;
$args->sort_index = 'list_order'; // /< Sorting values
$logged_info = Context::get('logged_info');
$args->search_target = 'member_srl';
$args->search_keyword = $logged_info->member_srl;
$output = $oDocumentModel->getDocumentList($args);
if(!$output->toBool() || !$output->data) {
$content = getXmlRpcFailure(1, 'post not founded');
printContent($content);
} else {
$oEditorController = &getController('editor');
// Options to get a list
$args = new stdClass();
$args->module_srl = $this->module_srl; // /< module_srl of the current module
$args->page = 1;
$args->list_count = 20;
$args->sort_index = 'list_order'; // /< Sorting values
$logged_info = Context::get('logged_info');
$args->search_target = 'member_srl';
$args->search_keyword = $logged_info->member_srl;
$output = $oDocumentModel->getDocumentList($args);
if(!$output->toBool() || !$output->data)
{
$content = getXmlRpcFailure(1, 'post not founded');
}
else
{
$oEditorController = getController('editor');
$posts = array();
foreach($output->data as $key => $oDocument) {
$post = null;
$post->categories = array();
$post->dateCreated = date("Ymd", $oDocument->getRegdateTime()).'T'.date("H:i:s", $oDocument->getRegdateTime());
$post->description = htmlspecialchars($oEditorController->transComponent($oDocument->getContent(false,false,true,false)));
$post->link = $post->permaLink = getFullUrl('','document_srl',$oDocument->document_srl);
$post->postid = $oDocument->document_srl;
$post->title = htmlspecialchars($oDocument->get('title'));
$post->publish = 1;
$post->userid = $oDocument->get('user_id');
$post->mt_allow_pings = 0;
$post->mt_allow_comments = $oDocument->allowComment()?1:0;
$posts[] = $post;
}
$content = getXmlRpcResponse($posts);
printContent($content);
$posts = array();
foreach($output->data as $key => $oDocument)
{
$post = new stdClass();
$post->categories = array();
$post->dateCreated = date("Ymd", $oDocument->getRegdateTime()) . 'T' . date("H:i:s", $oDocument->getRegdateTime());
$post->description = htmlspecialchars($oEditorController->transComponent($oDocument->getContent(false, false, true, false)));
$post->link = $post->permaLink = getFullUrl('', 'document_srl', $oDocument->document_srl);
$post->postid = $oDocument->document_srl;
$post->title = htmlspecialchars($oDocument->get('title'));
$post->publish = 1;
$post->userid = $oDocument->get('user_id');
$post->mt_allow_pings = 0;
$post->mt_allow_comments = $oDocument->allowComment() ? 1 : 0;
$posts[] = $post;
}
$content = getXmlRpcResponse($posts);
printContent($content);
}
break;
// Display RSD if there is no request
default :
$homepagelink = getUrl('','mid',$this->mid);
$site_module_info = Context::get('site_module_info');
$api_url = getFullSiteUrl($site_module_info->domain, '', 'mid',$site_module_info->mid, 'act','api');
$content = <<<RSDContent
$homepagelink = getUrl('', 'mid', $this->mid);
$site_module_info = Context::get('site_module_info');
$api_url = getFullSiteUrl($site_module_info->domain, '', 'mid', $site_module_info->mid, 'act', 'api');
$content = <<<RSDContent
<?xml version="1.0" ?>
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd" >
<service>
@ -431,8 +522,9 @@ if($called_position == 'before_module_proc') {
</service>
</rsd>
RSDContent;
printContent($content);
printContent($content);
break;
}
}
?>
/* End of file blogapi.addon.php */
/* Location: ./addons/blogapi/blogapi.addon.php */

View file

@ -1,66 +1,96 @@
<?php
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";
if(!defined('__XE__'))
exit();
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();
}
?>
/**
* @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";
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

@ -11,9 +11,9 @@
<title xml:lang="zh-TW">部落格 API</title>
<description xml:lang="ko">
metaWeblog를 지원하는 blogApi애드온입니다.
사용으로 설정하면 각 모듈마다 RSD 태그를 노출합니다.
사용으로 설정하면 각 모듈마다 RSD 태그를 노출합니다.
api의 주소는 http://설치주소/모듈명/api 입니다.
사용으로 하셔야 RSD태그 및 api가 동작을 합니다.
사용으로 야 RSD태그 및 api가 동작을 합니다.
</description>
<description xml:lang="jp">
MetaWeblogをサポートするBlog APIアドオンです。

View file

@ -1,347 +1,405 @@
<?php
if(!defined("__ZBXE__")) exit();
if(!defined("__XE__")) exit();
/**
* @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'))
{
/**
* @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'))
{
// 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
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
{
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;
}
function before_module_proc()
{
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(!$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 type="text/javascript"> 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";
}
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;
}
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;
}
function before_module_init_captchaCompare()
$type = Context::get('captchaType');
$target_acts = array('procBoardInsertDocument', 'procBoardInsertComment', 'procIssuetrackerInsertIssue', 'procIssuetrackerInsertHistory', 'procTextyleInsertComment');
if($this->addon_info->apply_find_account == 'apply')
{
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>");
Context::close();
exit();
$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';
}
function inlineDisplay()
if(Context::getRequestMethod() != 'XMLRPC' && Context::getRequestMethod() !== 'JSON')
{
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);
}
}
// 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'))
{
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'));
$keyword = $_SESSION['captcha_keyword'];
$im = $this->createCaptchaImage($keyword);
global $lang;
header("Cache-Control: ");
header("Pragma: ");
header("Content-Type: image/png");
$tags=<<<EOD
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>");
Context::close();
exit();
}
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'));
global $lang;
$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__']);
}
$GLOBALS['__AddonCaptcha__'] = new AddonCaptcha;
$GLOBALS['__AddonCaptcha__']->setInfo($addon_info);
Context::set('oCaptcha', $GLOBALS['__AddonCaptcha__']);
}
$oAddonCaptcha = &$GLOBALS['__AddonCaptcha__'];
$oAddonCaptcha = &$GLOBALS['__AddonCaptcha__'];
if(method_exists($oAddonCaptcha, $called_position))
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

@ -89,7 +89,7 @@
<title xml:lang="en">How it works</title>
<title xml:lang="ru">How it works</title>
<title xml:lang="vi">Sử dụng</title>
<description xml:lang="ko">"1번만 동작"을 선택하면 1번만 동작후 상태를 저장해서 다음부터 물어보지 않고 그렇지 않으면 매번 물어보게 됩니다</description>
<description xml:lang="ko">"1번만 동작"을 선택하면 1번만 동작후 상태를 저장해서 다음부터 물어보지 않고 그렇지 않으면 매번 물어보게 됩니다</description>
<description xml:lang="zh-CN">"一次"就是每个IP只出现一次验证。</description>
<description xml:lang="jp">「1回だけ表示」を選択すると、最初だけ動作した後、その情報を記憶して次回からはCaptchaを見せないようにします。また、もう一つのオプションは毎回Captchaを表示します。</description>
<description xml:lang="zh-TW">選擇"單次",下次不會再顯示;選擇"每次"則會一直顯示。</description>
@ -123,9 +123,9 @@
<title xml:lang="en">applying to an action finding account</title>
<title xml:lang="ru">applying to an action finding account</title>
<title xml:lang="vi">Khi lấy lại mật khẩu</title>
<description xml:lang="ko">적용으로 하면 비밀번호 찾기 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="ko">적용으로 하면 비밀번호 찾기 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="zh-CN">启用此项功能可以有效地拦截以查找密码名义发送的垃圾邮件。</description>
<description xml:lang="jp">적용으로 하면 비밀번호찾기 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="jp">적용으로 하면 비밀번호찾기 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="zh-TW">開啟功能後在忘記密碼時會顯示驗證碼。</description>
<description xml:lang="en">If you set this option as apply, CAPTCHA will work for finding account action, too.</description>
<description xml:lang="ru">If you set this option as apply, CAPTCHA will work for finding account action, too.</description>
@ -157,9 +157,9 @@
<title xml:lang="en">apply to an action resending authmail</title>
<title xml:lang="ru">apply to an action resending authmail</title>
<title xml:lang="vi">Khi lấy lại mã kích hoạt</title>
<description xml:lang="ko">적용으로 하면 인증 메일 재발송 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="ko">적용으로 하면 인증 메일 재발송 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="zh-CN">启用此项功能可以有效地拦截以重新发送认证邮件名义发送的垃圾邮件。</description>
<description xml:lang="jp">적용으로 하면 인증 메일 재발송 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="jp">적용으로 하면 인증 메일 재발송 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="zh-TW">開啟功能後在重寄認證信時會顯示驗證碼。</description>
<description xml:lang="en">If you set this option as apply, CAPTCHA will work for resending authmail action, too.</description>
<description xml:lang="ru">If you set this option as apply, CAPTCHA will work for resending authmail action, too.</description>
@ -191,9 +191,9 @@
<title xml:lang="en">Apply to member signup</title>
<title xml:lang="ru">Apply to member signup</title>
<title xml:lang="vi">Apply to member signup</title>
<description xml:lang="ko">적용으로 하면 회원가입 기능에도 적용되어 악의적인 봇(또는 프로그램)의 회원가입을 막을 수 있습니다.</description>
<description xml:lang="ko">적용으로 하면 회원가입 기능에도 적용되어 악의적인 봇(또는 프로그램)의 회원가입을 막을 수 있습니다.</description>
<description xml:lang="zh-CN">启用此项功能可以有效地拦截自动注册软件的施虐。</description>
<description xml:lang="jp">적용으로 하면 회원가입 기능에도 적용되어 악의적인 봇(또는 프로그램)의 회원가입을 막을 수 있습니다.</description>
<description xml:lang="jp">적용으로 하면 회원가입 기능에도 적용되어 악의적인 봇(또는 프로그램)의 회원가입을 막을 수 있습니다.</description>
<description xml:lang="zh-TW">開啟功能後在註冊時會顯示驗證碼。</description>
<description xml:lang="en">If you set this option as apply, CAPTCHA will work for signup action, too.</description>
<description xml:lang="ru">If you set this option as apply, CAPTCHA will work for signup action, too.</description>

View file

@ -22,7 +22,7 @@
<value xml:lang="zh-TW"><![CDATA[播放]]></value>
</item>
<item name="captcha_denied">
<value xml:lang="ko"><![CDATA[잘못 입력하셨습니다]]></value>
<value xml:lang="ko"><![CDATA[잘못 입력습니다]]></value>
<value xml:lang="en"><![CDATA[The characters you entered didn't match the word verification.]]></value>
<value xml:lang="jp"><![CDATA[正しく入力してください。]]></value>
<value xml:lang="zh-CN"><![CDATA[验证码错误]]></value>

View file

@ -10,8 +10,8 @@
<title xml:lang="ru">Аддон счетчика</title>
<title xml:lang="zh-TW">網站訪問統計</title>
<description xml:lang="ko">
XE의 기본 카운터 모듈을 이용하여 접속 정보를 기록합니다.
이 애드온을 켜야 접속 정보 수집이 됩니다.
XE의 기본 카운터 이용하여 접속 정보를 기록합니다.
이 애드온을 켜야 접속 정보 수집이 됩니다.
</description>
<description xml:lang="jp">
XEのアクセスカウンターモジュールで接続アクセス情報を記録します。

View file

@ -1,14 +1,18 @@
<?php
if(!defined('__XE__')) exit();
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') {
$oCounterController = &getController('counter');
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

@ -10,8 +10,8 @@
<title xml:lang="ru">Общение</title>
<title xml:lang="zh-TW">交流</title>
<description xml:lang="ko">
커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다.
쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다.
커뮤니케이션 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다.
쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 설정하면 됩니다.
</description>
<description xml:lang="jp">
メッセージ・友達機能を使うにはこのアドオンを「使用」にして下さい。
@ -28,12 +28,12 @@
Hãy kích hoạt nếu bạn muốn sử dụng chức năng này.
</description>
<description xml:lang="ge">
커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다.
쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다.
커뮤니케이션 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다.
쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 설정하면 됩니다.
</description>
<description xml:lang="es">
커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다.
쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다.
커뮤니케이션 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다.
쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 설정하면 됩니다.
</description>
<description xml:lang="ru">
Активизирует модуль Общение, позволяет использование сообщений между друзьями.
@ -55,4 +55,40 @@
<name xml:lang="ru">NHN</name>
<name xml:lang="zh-TW">NHN</name>
</author>
<extra_vars>
<var name="use_alarm" type="select">
<title xml:lang="ko">알람기능 사용</title>
<title xml:lang="zh-CN">Using alarm</title>
<title xml:lang="jp">Using alarm</title>
<title xml:lang="zh-TW">Using alarm</title>
<title xml:lang="en">Using alarm</title>
<title xml:lang="ru">Using alarm</title>
<title xml:lang="vi">Using alarm</title>
<description xml:lang="ko">새로운 쪽지가 왔을때 팝업으로 알립니다.</description>
<description xml:lang="zh-CN">Pop-up alram when new message received.</description>
<description xml:lang="jp">Pop-up alram when new message received.</description>
<description xml:lang="zh-TW">Pop-up alram when new message received.</description>
<description xml:lang="en">Pop-up alram when new message received.</description>
<description xml:lang="ru">Pop-up alram when new message received.</description>
<description xml:lang="vi">Pop-up alram when new message received.</description>
<options value="">
<title xml:lang="ko">사용함</title>
<title xml:lang="zh-CN">Using</title>
<title xml:lang="jp">Using</title>
<title xml:lang="zh-TW">Using</title>
<title xml:lang="en">Using</title>
<title xml:lang="ru">Using</title>
<title xml:lang="vi">Using</title>
</options>
<options value="N">
<title xml:lang="ko">사용하지 않음</title>
<title xml:lang="zh-CN">Not using</title>
<title xml:lang="jp">Not using</title>
<title xml:lang="zh-TW">Not using</title>
<title xml:lang="en">Not using</title>
<title xml:lang="ru">Not using</title>
<title xml:lang="vi">Not using</title>
</options>
</var>
</extra_vars>
</addon>

View file

@ -1,5 +1,7 @@
<?php
if(!defined('__XE__')) exit();
if(!defined('__XE__'))
exit();
/**
* @file member_communication.addon.php
@ -9,63 +11,78 @@ 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;
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
$oMemberController = &getController('member');
$oMemberController = getController('member');
$oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend');
$oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box');
// Pop-up to display messages if a flag on new message is set
$flag_path = './files/member_extra_info/new_message_flags/'.getNumberingPath($logged_info->member_srl);
$flag_file = $flag_path.$logged_info->member_srl;
$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) && $addon_info->use_alarm != 'N')
{
$new_message_count = trim(FileHandler::readFile($flag_file));
FileHandler::removeFile($flag_file);
Context::loadLang('./addons/member_communication/lang');
Context::loadFile(array('./addons/member_communication/tpl/member_communication.js'), true);
$text = preg_replace('@\r?\n@', '\\n', addslashes(Context::getLang('alert_new_message_arrived')));
$link = Context::getRequestUri().'?module=communication&act=dispCommunicationNewMessage';
$text = preg_replace('@\r?\n@', '\\n', addslashes(Context::getLang('alert_new_message_arrived')));
$link = Context::getRequestUri() . '?module=communication&act=dispCommunicationNewMessage';
$script = "<script type=\"text/javascript\">jQuery(function(){ xeNotifyMessage('{$text}','{$new_message_count}'); });</script>";
Context::addHtmlFooter($script);
}
} elseif($called_position == 'before_module_proc' && $this->act == 'getMemberMenu') {
$oMemberController = &getController('member');
}
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');
$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');
$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 {
$oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationFriend'), 'cmd_view_friend', '', 'self');
// If not, Add menus to send message and to add friends
}
else
{
// Get member information
$oMemberModel = &getModel('member');
$oMemberModel = getModel('member');
$target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
if(!$target_member_info->member_srl) return;
if(!$target_member_info->member_srl)
{
return;
}
// Get logged-in user information
$logged_info = Context::get('logged_info');
// Add a menu for sending message
if( $logged_info->is_admin == 'Y' || $target_member_info->allow_message =='Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl)))
$oMemberController->addMemberPopupMenu(getUrl('','module','communication','act','dispCommunicationSendMessage','receiver_srl',$member_srl), 'cmd_send_message', '', 'popup');
if($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl)))
$oMemberController->addMemberPopupMenu(getUrl('', 'module', 'communication', 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup');
// Add a menu for listing friends (if a friend is new)
if(!$oCommunicationModel->isAddedFriend($member_srl))
$oMemberController->addMemberPopupMenu(getUrl('','module','communication','act','dispCommunicationAddFriend','target_srl',$member_srl), 'cmd_add_friend', '', 'popup');
$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

@ -1,5 +1,7 @@
<?php
if(!defined('__XE__')) exit();
if(!defined('__XE__'))
exit();
/**
* @file image_name.addon.php
@ -8,16 +10,23 @@ 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;
*/
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');
// 1. Find a part <div class="member_MemberSerialNumber"> content </div> in the output document, change it to image name/mark by using MemberController::transImageName()
$temp_output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'memberTransImageName', $output);
if($temp_output) $output = $temp_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,86 @@
<?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];
$oMemberModel = &getModel('member');
$nick_name = $matches[5];
/**
* @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];
}
// 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 = '';
$oMemberModel = getModel('member');
$nick_name = $matches[5];
$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];
// 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 = '';
}
// check member_config
$config = $oMemberModel->getMemberConfig();
$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];
}
if($config->image_name == 'Y' && $image_name_file) $nick_name = sprintf('<img src="%s%s" border="0" alt="id: %s" title="id: %s" style="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" border="0" alt="id: %s" title="id : %s" style="vertical-align:middle;margin-right:3px"/>%s', Context::getRequestUri(),$image_mark_file, strip_tags($nick_name), strip_tags($nick_name), $nick_name);
// check member_config
if($group_image) $nick_name = sprintf('<img src="%s" border="0" style="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);
$config = $oMemberModel->getMemberConfig();
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

@ -8,7 +8,7 @@
<title xml:lang="ru">Mobile XE</title>
<title xml:lang="zh-TW">XE行動上網</title>
<description xml:lang="ko">
모바일에서 접속시 헤더 정보를 분석하여 메뉴 - 모듈의 관계를 이용하여 WAP 태그로 출력하는 애드온입니다.
모바일에서 접속시 헤더 정보를 분석하여 WAP 태그로 출력하는 애드온입니다.
wml, hdml, mhtml를 지원하고 그 이외의 경우에는 동작하지 않습니다.
</description>
<description xml:lang="jp">
@ -72,41 +72,13 @@
<title xml:lang="vi">Charset</title>
<title xml:lang="ru">Charset</title>
<title xml:lang="zh-TW">編碼</title>
<description xml:lang="ko">
모바일 기기의 경우 UTF-8 문자셋을 인식하지 못할 수 있습니다.
문자셋에 원하시는 문자셋을 입력하면 자동으로 변환하여 출력하여 모바일에서 이상없이 출력하도록 합니다.
기본값은 UTF-8입니다.
(*SK Telecom 휴대전화의 경우 euc-kr인코딩만 지원하므로, 강제로 euc-kr인코딩만 지원합니다.)
</description>
<description xml:lang="jp">
ある特定のモバイル機器ではutf-8文字コードの認識が出来ない場合があります。
文字コードを設定すると、(日本語だけの場合)該当文字コードに自動変換して正常に表示出来るようになります。
本アドオンのデフォルト値はUTF-8で、日本の携帯はshift-jisが一般的です。
</description>
<description xml:lang="zh-CN">
手机有时无法识别utf-8编码这时输入相应的编码值即可自动转换。
默认编码为UTF-8。
</description>
<description xml:lang="en">
utf-8 may be read with mobile tools.
Mobile tools will display correct charset when you input charset you want.
Default charset is UTF-8.
</description>
<description xml:lang="vi">
UTF-8 không thể đọc được cho các công cụ di động.
Những công cụ di động sẽ trình bày Charset đúng khi bạn nhập vào Charset bạn muốn.
Charset mặc định là UTF-8.
</description>
<description xml:lang="ru">
utf-8 may be read with mobile tools.
Mobile tools will display correct charset when you input charset you want.
Default charset is UTF-8.
</description>
<description xml:lang="zh-TW">
行動工具無法讀取utf-8編碼。
當您輸入所想要的編碼時,行動工具將會正確的顯示。
預設編碼是UTF-8.
</description>
<description xml:lang="ko">모바일 기기의 경우 UTF-8 문자셋을 인식하지 못할 수 있습니다. 문자셋에 원하는 문자셋을 입력하면 자동으로 변환하여 출력하여 모바일에서 이상없이 출력하도록 합니다. 기본값은 UTF-8입니다. (*SK Telecom 휴대전화의 경우 euc-kr인코딩만 지원하므로, 강제로 euc-kr인코딩만 지원합니다.)</description>
<description xml:lang="jp">ある特定のモバイル機器ではutf-8文字コードの認識が出来ない場合があります。文字コードを設定すると、日本語だけの場合該当文字コードに自動変換して正常に表示出来るようになります。本アドオンのデフォルト値はUTF-8で、日本の携帯はshift-jisが一般的です。</description>
<description xml:lang="zh-CN">手机有时无法识别utf-8编码这时输入相应的编码值即可自动转换。默认编码为UTF-8。</description>
<description xml:lang="en">utf-8 may be read with mobile tools. Mobile tools will display correct charset when you input charset you want. Default charset is UTF-8.</description>
<description xml:lang="vi">UTF-8 không thể đọc được cho các công cụ di động. Những công cụ di động sẽ trình bày Charset đúng khi bạn nhập vào Charset bạn muốn. Charset mặc định là UTF-8.</description>
<description xml:lang="ru">utf-8 may be read with mobile tools. Mobile tools will display correct charset when you input charset you want. Default charset is UTF-8.</description>
<description xml:lang="zh-TW">行動工具無法讀取utf-8編碼。當您輸入所想要的編碼時行動工具將會正確的顯示。預設編碼是UTF-8.</description>
</var>
</extra_vars>
</addon>

View file

@ -1,5 +1,7 @@
<?php
if(!defined('__XE__')) exit();
if(!defined('__XE__'))
exit();
/**
* @file mobile.addon.php
@ -14,37 +16,61 @@ if(!defined('__XE__')) exit();
*
* after_module_proc > display mobile content
* Condition
**/
* */
// Ignore admin page
if(Context::get('module')=='admin') return;
if(Context::get('module') == 'admin')
{
return;
}
// Manage when to call it
if($called_position != 'before_module_proc' && $called_position != 'after_module_proc' ) return;
if($called_position != 'before_module_proc' && $called_position != 'after_module_proc')
{
return;
}
// Ignore if not mobile browser
require_once(_XE_PATH_.'addons/mobile/classes/mobile.class.php');
if(!mobileXE::getBrowserType()) return;
require_once(_XE_PATH_ . 'addons/mobile/classes/mobile.class.php');
if(!mobileXE::getBrowserType())
{
return;
}
// Generate mobile instance
$oMobile = &mobileXE::getInstance();
if(!$oMobile) return;
if(!$oMobile)
{
return;
}
// Specify charset on the add-on settings
$oMobile->setCharSet($addon_info->charset);
// Set module information
$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();
}
// On navigation mode, display navigation content
if($oMobile->isNavigationMode()) $oMobile->displayNavigationContent();
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') {
else
{
$oMobile->displayModuleContent();
}
// 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

@ -1,5 +1,7 @@
<?php
if(!defined('__XE__')) exit();
if(!defined('__XE__'))
exit();
/**
* @file openid_delegation_id.addon.php
@ -8,20 +10,28 @@ if(!defined('__XE__')) exit();
*
* This enables to use openID as user's homepage or blog url.
* Enter your open ID service information on the configuration.
**/
* */
// Execute only wen called_position is before_module_init
if($called_position != 'before_module_init') return;
if($called_position != 'before_module_init')
{
return;
}
// Get add-on settings(openid_delegation_id)
if(!$addon_info->server||!$addon_info->delegate||!$addon_info->xrds) 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

@ -11,7 +11,7 @@
<title xml:lang="zh-TW">點數等級圖案</title>
<description xml:lang="ko">
포인트 시스템을 사용중일 경우 사용자 이름 앞에 레벨 아이콘을 표시하도록 합니다.
레벨 아이콘은 모듈 &gt; 포인트시스템에서 선택 가능합니다.
레벨 아이콘은 설치된 모듈 &gt; 포인트시스템에서 선택 가능합니다.
</description>
<description xml:lang="zh-CN">
使用积分系统时,可以在用户名前显示级别图标。

View file

@ -1,5 +1,7 @@
<?php
if(!defined('__XE__')) exit();
if(!defined('__XE__'))
exit();
/**
* @file point.addon.php
@ -7,13 +9,21 @@ if(!defined('__XE__')) exit();
* @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;
if($called_position != "before_display_content" || Context::get('act') == 'dispPageAdminContentModify')
{
return;
}
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;
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,52 +1,78 @@
<?php
/**
* @brief Function to change point icon.
**/
function pointLevelIconTrans($matches) {
*/
function pointLevelIconTrans($matches)
{
$member_srl = $matches[3];
if($member_srl<1) return $matches[0];
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].'>';
$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']) {
$oModuleModel = &getModel('module');
if(!$GLOBALS['_pointConfig'])
{
$oModuleModel = getModel('module');
$GLOBALS['_pointConfig'] = $oModuleModel->getModuleConfig('point');
}
$config = $GLOBALS['_pointConfig'];
// Get point model
if(!$GLOBALS['_pointModel']) $GLOBALS['_pointModel'] = getModel('point');
if(!$GLOBALS['_pointModel'])
{
$GLOBALS['_pointModel'] = getModel('point');
}
$oPointModel = &$GLOBALS['_pointModel'];
// Get points
if(!$oPointModel->isExistsPoint($member_srl)) return $matches[0];
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];
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($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);
$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];
return $orig_text.$text.$matches[5].'</'.$matches[6].'>';
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 */

BIN
addons/resize_image/btn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -1 +1 @@
.xe_content img{max-width:100%;height:auto !important}
.xe_content img{max-width:100%;height:auto}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -9,76 +9,104 @@ var xScreen = null;
function getScreen() {
var body = $(document.body);
var controls, imgframe, closebtn, prevbtn, nextbtn;
// 스크린이 없으면 스크린을 만든다.
if (!xScreen) {
// 검은 스크린
xScreen = $("<div>")
.attr("id","xe_gallery_screen")
.css({
position:"absolute",
position:"fixed",
display:"none",
backgroundColor:"black",
zIndex:500,
opacity:0.5
opacity:0.7
});
// 이미지를 보여주고 컨트롤 버튼을 다룰 레이어
controls = $("<div>")
.attr("id","xe_gallery_controls")
.css({
position:"absolute",
position:"fixed",
display:"none",
overflow:"hidden",
zIndex:510
});
// 닫기 버튼
closebtn = $("<img>")
.attr("id", "xe_gallery_closebtn")
.attr("src", request_uri+"addons/resize_image/iconClose.png")
// 이전 버튼
prevbtn = $('<button type="button" id="xe_gallery_prevbtn" />')
.css({
top : "10px"
left: "10px",
backgroundPosition: "0 -64px"
})
.click(function(){xScreen.xePrev()})
.appendTo(controls);
// 닫기 버튼
closebtn = $('<button type="button" id="xe_gallery_closebtn" />')
.css({
top: "10px",
backgroundPosition: "0 0"
})
.click(function(){xScreen.xeHide()})
.appendTo(controls);
// 이전 버튼
prevbtn = $("<img>")
.attr("id", "xe_gallery_prevbtn")
.attr("src", request_uri+"addons/resize_image/iconLeft.png")
.css("left","10px")
.click(function(){xScreen.xePrev()})
.appendTo(controls);
// 다음 버튼
nextbtn = $("<img>")
nextbtn = $('<button type="button" id="xe_gallery_nextbtn" />')
.attr("id", "xe_gallery_nextbtn")
.attr("src", request_uri+"addons/resize_image/iconRight.png")
.css("right","10px")
.css({
right: "10px",
backgroundPosition: "0 -128px"
})
.click(function(){xScreen.xeNext()})
.appendTo(controls);
// 버튼 공통 속성
controls.find("img")
.attr({
width : 60,
height : 60,
className : "iePngFix"
})
controls.find(">button")
.css({
position : "absolute",
width : "60px",
height : "60px",
width : "64px",
height : "64px",
zIndex : 530,
cursor : "pointer"
});
cursor : "pointer",
border : 0,
margin : 0,
padding : 0,
backgroundColor: "transparent",
backgroundImage: "url(" + request_uri + "addons/resize_image/btn.png)",
backgroundRepeat: "no-repeat",
opacity: ".5",
filter: "alpha(opacity=50)"
})
.mouseover(function(){
$(this).css({
opacity: "1",
filter: "alpha(opacity=100)"
});
})
.mouseout(function(){
$(this).css({
opacity: ".5",
filter: "alpha(opacity=50)"
});
})
.focus(function(){
$(this).trigger('mouseover');
})
.blur(function(){
$(this).trigger('mouseout');
})
;
// 이미지 홀더
imgframe = $("<img>")
.attr("id", "xe_gallery_holder")
.css("border", "7px solid white")
.css("zIndex", 520)
.css({
border: '5px solid white',
zindex: 520,
maxWidth: 'none',
borderRadius: '5px',
boxShadow: '0 0 10px #000'
})
.appendTo(controls).draggable();
body.append(xScreen).append(controls);
@ -87,28 +115,18 @@ function getScreen() {
xScreen.xeShow = function() {
var clientWidth = $(window).width();
var clientHeight = $(window).height();
$("#xe_gallery_controls,#xe_gallery_screen").css({
display:"block",
width : $(document).width() + "px",
height : $(document).height() + "px",
left : 0,
top : 0
//width : clientWidth + "px",
//height : clientHeight + "px",
// left : $(document).scrollLeft(),
// top : $(document).scrollTop()
$("#xe_gallery_controls,#xe_gallery_screen").show().css({
top : 0,
right : 0,
bottom : 0,
left : 0
});
closebtn.css("left", Math.round((clientWidth-60)/2) + "px");
$("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top", Math.round( (clientHeight-60)/2 ) + "px");
$("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top", Math.round(clientHeight/2 - 32) + "px");
this.xeMove(0);
};
xScreen.xeHide = function(event) {
xScreen.css("display","none");
controls.css("display","none");
xScreen.hide();
controls.hide();
};
xScreen.xePrev = function() {
this.xeMove(-1);
@ -119,29 +137,31 @@ function getScreen() {
xScreen.xeMove = function(val) {
var clientWidth = $(window).width();
var clientHeight = $(window).height();
this.index += val;
prevbtn.css("visibility", (this.index>0)?"visible":"hidden");
nextbtn.css("visibility", (this.index<this.list.size()-1)?"visible":"hidden");
//textyle 이미지 리사이즈 처리
var src = this.list.eq(this.index).attr("rawsrc");
if(!src) src = this.list.eq(this.index).attr("src");
imgframe.attr("src", src).css({
left : Math.round( Math.max( parseInt($(document).scrollLeft()) + (clientWidth-imgframe.width()-14)/2, 0 ) ) + "px",
top : Math.round( Math.max( parseInt($(document).scrollTop()) + (clientHeight-imgframe.height()-14)/2, 0 ) ) + "px"
left : clientWidth/2 - imgframe.width()/2 + "px",
top : clientHeight/2 - imgframe.height()/2 + "px"
});
closebtn.css({
left : Math.round( Math.max( parseInt($(document).scrollLeft()) + (clientWidth-closebtn.width())/2, 0 ) ) + "px",
top : Math.round( Math.max( parseInt($(document).scrollTop()) + 10, 0 ) ) + "px"
});
left : clientWidth/2 - 32 + "px",
top : "10px"
}).focus();
};
// 스크린을 닫는 상황
$(document).keydown(xScreen.xeHide);
$(document).keydown(function(e){
if(e.which == 27){
xScreen.xeHide();
return false;
} else {
return true;
}
});
} else {
controls = $("#xe_gallery_controls");
imgframe = $("#xe_gallery_holder");
@ -149,7 +169,6 @@ function getScreen() {
prevbtn = $("#xe_gallery_prevbtn");
nextbtn = $("#xe_gallery_nextbtn");
}
return xScreen;
}
@ -166,15 +185,15 @@ function slideshow(event) {
xScreen.xeShow();
}
/* DOM READY */
$(function() {
/* Window Load */
$(window).load(function(){
var regx_skip = /(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i;
var regx_allow_i6pngfix = /(?:common\/tpl\/images\/blank\.gif$)/i;
/**
* 본문 구하기 위한 개체
* IE6에서 본문폭을 넘는 이미지가 있으면 크기로 구해지는 문제 우회용
**/
var dummy = $('<div style="height:1; overflow:hidden; opacity:0; display:block; clear:both;"></div>');
var dummy = $('<div style="height:1px;overflow:hidden;opacity:0;display:block;clear:both"></div>');
/**
* 리사이즈 실행 함수
@ -208,7 +227,7 @@ $(function() {
});
}
$('div.xe_content').each(function() {
$('.xe_content').each(function() {
var contentWidth = dummy.appendTo(this).width();
dummy.remove();
if(!contentWidth) return;
@ -217,9 +236,7 @@ $(function() {
var $img = $(this);
var imgSrc = $img.attr('src');
if(regx_skip.test(imgSrc) && !regx_allow_i6pngfix.test(imgSrc)) return;
$img.attr('rel', 'xe_gallery');
doResize.call($img, contentWidth);
});

View file

@ -1,7 +1 @@
/**
* @brief 화면내에서 상위 영역보다 이미지가 크면 리사이즈를 하고 클릭시 원본을 보여줄수 있도록 변경
**/
(function($){var xScreen=null
function getScreen(){var body=$(document.body),controls,imgframe,closebtn,prevbtn,nextbtn;if(!xScreen){xScreen=$("<div>").attr("id","xe_gallery_screen").css({position:"absolute",display:"none",backgroundColor:"black",zIndex:500,opacity:0.5});controls=$("<div>").attr("id","xe_gallery_controls").css({position:"absolute",display:"none",overflow:"hidden",zIndex:510});closebtn=$("<img>").attr("id","xe_gallery_closebtn").attr("src",request_uri+"addons/resize_image/iconClose.png").css({top:"10px"}).click(function(){xScreen.xeHide()}).appendTo(controls);prevbtn=$("<img>").attr("id","xe_gallery_prevbtn").attr("src",request_uri+"addons/resize_image/iconLeft.png").css("left","10px").click(function(){xScreen.xePrev()}).appendTo(controls);nextbtn=$("<img>").attr("id","xe_gallery_nextbtn").attr("src",request_uri+"addons/resize_image/iconRight.png").css("right","10px").click(function(){xScreen.xeNext()}).appendTo(controls);controls.find("img").attr({width:60,height:60,className:"iePngFix"}).css({position:"absolute",width:"60px",height:"60px",zIndex:530,cursor:"pointer"});imgframe=$("<img>").attr("id","xe_gallery_holder").css("border","7px solid white").css("zIndex",520).appendTo(controls).draggable();body.append(xScreen).append(controls);xScreen.xeShow=function(){var clientWidth=$(window).width(),clientHeight=$(window).height();$("#xe_gallery_controls,#xe_gallery_screen").css({display:"block",width:$(document).width()+"px",height:$(document).height()+"px",left:0,top:0});closebtn.css("left",Math.round((clientWidth-60)/2)+"px");$("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top",Math.round((clientHeight-60)/2)+"px");this.xeMove(0)};xScreen.xeHide=function(event){xScreen.css("display","none");controls.css("display","none")};xScreen.xePrev=function(){this.xeMove(-1)};xScreen.xeNext=function(){this.xeMove(1)};xScreen.xeMove=function(val){var clientWidth=$(window).width(),clientHeight=$(window).height();this.index+=val;prevbtn.css("visibility",(this.index>0)?"visible":"hidden");nextbtn.css("visibility",(this.index<this.list.size()-1)?"visible":"hidden");var src=this.list.eq(this.index).attr("rawsrc");if(!src)src=this.list.eq(this.index).attr("src");imgframe.attr("src",src).css({left:Math.round(Math.max(parseInt($(document).scrollLeft())+(clientWidth-imgframe.width()-14)/2,0))+"px",top:Math.round(Math.max(parseInt($(document).scrollTop())+(clientHeight-imgframe.height()-14)/2,0))+"px"});closebtn.css({left:Math.round(Math.max(parseInt($(document).scrollLeft())+(clientWidth-closebtn.width())/2,0))+"px",top:Math.round(Math.max(parseInt($(document).scrollTop())+10,0))+"px"})};$(document).keydown(xScreen.xeHide)}else{controls=$("#xe_gallery_controls");imgframe=$("#xe_gallery_holder");closebtn=$("#xe_gallery_closebtn");prevbtn=$("#xe_gallery_prevbtn");nextbtn=$("#xe_gallery_nextbtn")};return xScreen}
function slideshow(event){var container=$(this).closest('.xe_content'),imglist=container.find("img[rel=xe_gallery]"),currentIdx=$.inArray($(this).get(0),imglist.get()),xScreen=getScreen();xScreen.list=imglist;xScreen.index=currentIdx;xScreen.xeShow()};$(function(){var regx_skip=/(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i,regx_allow_i6pngfix=/(?:common\/tpl\/images\/blank\.gif$)/i,dummy=$('<div style="height:1; overflow:hidden; opacity:0; display:block; clear:both;"></div>')
function doResize(contentWidth,count){if(!count)count=0;if(count>=10)return;var $img=this,beforSize={width:$img.width(),height:$img.height()};if(!beforSize.width||!beforSize.height){setTimeout(function(){doResize.call($img,contentWidth,++count)},200);return};if(beforSize.width<=contentWidth)return;var resize_ratio=contentWidth/beforSize.width;$img.removeAttr('width').removeAttr('height').css({width:contentWidth,height:parseInt(beforSize.height*resize_ratio,10)})};$('div.xe_content').each(function(){var contentWidth=dummy.appendTo(this).width();dummy.remove();if(!contentWidth)return;$('img',this).each(function(){var $img=$(this),imgSrc=$img.attr('src');if(regx_skip.test(imgSrc)&&!regx_allow_i6pngfix.test(imgSrc))return;$img.attr('rel','xe_gallery');doResize.call($img,contentWidth)});$('img[rel=xe_gallery]',this).live('mouseover',function(){var $img=$(this);if(!$img.parent('a').length&&!$img.attr('onclick'))$img.css('cursor','pointer').click(slideshow)})})})})(jQuery)
(function(c){var d=null;function a(){var g=c(document.body);var h,f,e,j,i;if(!d){d=c("<div>").attr("id","xe_gallery_screen").css({position:"fixed",display:"none",backgroundColor:"black",zIndex:500,opacity:0.7});h=c("<div>").attr("id","xe_gallery_controls").css({position:"fixed",display:"none",overflow:"hidden",zIndex:510});j=c('<button type="button" id="xe_gallery_prevbtn" />').css({left:"10px",backgroundPosition:"0 -64px"}).click(function(){d.xePrev()}).appendTo(h);e=c('<button type="button" id="xe_gallery_closebtn" />').css({top:"10px",backgroundPosition:"0 0"}).click(function(){d.xeHide()}).appendTo(h);i=c('<button type="button" id="xe_gallery_nextbtn" />').attr("id","xe_gallery_nextbtn").css({right:"10px",backgroundPosition:"0 -128px"}).click(function(){d.xeNext()}).appendTo(h);h.find(">button").css({position:"absolute",width:"64px",height:"64px",zIndex:530,cursor:"pointer",border:0,margin:0,padding:0,backgroundColor:"transparent",backgroundImage:"url("+request_uri+"addons/resize_image/btn.png)",backgroundRepeat:"no-repeat",opacity:".5",filter:"alpha(opacity=50)"}).mouseover(function(){c(this).css({opacity:"1",filter:"alpha(opacity=100)"})}).mouseout(function(){c(this).css({opacity:".5",filter:"alpha(opacity=50)"})}).focus(function(){c(this).trigger("mouseover")}).blur(function(){c(this).trigger("mouseout")});f=c("<img>").attr("id","xe_gallery_holder").css({border:"5px solid white",zindex:520,maxWidth:"none",borderRadius:"5px",boxShadow:"0 0 10px #000"}).appendTo(h).draggable();g.append(d).append(h);d.xeShow=function(){var l=c(window).width();var k=c(window).height();c("#xe_gallery_controls,#xe_gallery_screen").show().css({top:0,right:0,bottom:0,left:0});c("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top",Math.round(k/2-32)+"px");this.xeMove(0)};d.xeHide=function(k){d.hide();h.hide()};d.xePrev=function(){this.xeMove(-1)};d.xeNext=function(){this.xeMove(1)};d.xeMove=function(n){var m=c(window).width();var k=c(window).height();this.index+=n;j.css("visibility",(this.index>0)?"visible":"hidden");i.css("visibility",(this.index<this.list.size()-1)?"visible":"hidden");var l=this.list.eq(this.index).attr("rawsrc");if(!l){l=this.list.eq(this.index).attr("src")}f.attr("src",l).css({left:m/2-f.width()/2+"px",top:k/2-f.height()/2+"px"});e.css({left:m/2-32+"px",top:"10px"}).focus()};c(document).keydown(function(k){if(k.which==27){d.xeHide();return false}else{return true}})}else{h=c("#xe_gallery_controls");f=c("#xe_gallery_holder");e=c("#xe_gallery_closebtn");j=c("#xe_gallery_prevbtn");i=c("#xe_gallery_nextbtn")}return d}function b(h){var f=c(this).closest(".xe_content");var e=f.find("img[rel=xe_gallery]");var g=c.inArray(c(this).get(0),e.get());var i=a();i.list=e;i.index=g;i.xeShow()}c(window).load(function(){var g=/(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i;var f=/(?:common\/tpl\/images\/blank\.gif$)/i;var h=c('<div style="height:1px;overflow:hidden;opacity:0;display:block;clear:both"></div>');function e(k,m){if(!m){m=0}if(m>=10){return}var l=this;var j={width:l.width(),height:l.height()};if(!j.width||!j.height){setTimeout(function(){e.call(l,k,++m)},200);return}if(j.width<=k){return}var i=k/j.width;l.removeAttr("width").removeAttr("height").css({width:k,height:parseInt(j.height*i,10)})}c(".xe_content").each(function(){var i=h.appendTo(this).width();h.remove();if(!i){return}c("img",this).each(function(){var j=c(this);var k=j.attr("src");if(g.test(k)&&!f.test(k)){return}j.attr("rel","xe_gallery");e.call(j,i)});c("img[rel=xe_gallery]",this).live("mouseover",function(){var j=c(this);if(!j.parent("a").length&&!j.attr("onclick")){j.css("cursor","pointer").click(b)}})})})})(jQuery);

View file

@ -1,18 +1,25 @@
<?php
if(!defined('__XE__')) exit();
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 */

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
admin/help/img/image001.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

BIN
admin/help/img/image002.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
admin/help/img/image003.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
admin/help/img/image004.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
admin/help/img/image005.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
admin/help/img/image006.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
admin/help/img/image007.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
admin/help/img/image008.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
admin/help/img/image009.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
admin/help/img/image010.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
admin/help/img/image011.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
admin/help/img/image012.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
admin/help/img/image013.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
admin/help/img/image014.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
admin/help/img/image015.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
admin/help/img/image016.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
admin/help/img/image017.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
admin/help/img/image018.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
admin/help/img/image019.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
admin/help/img/image020.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
admin/help/img/image021.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
admin/help/img/image022.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
admin/help/img/image023.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

BIN
admin/help/img/image024.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
admin/help/img/image025.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
admin/help/img/image026.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

BIN
admin/help/img/image027.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
admin/help/img/image028.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

BIN
admin/help/img/image029.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
admin/help/img/image030.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

BIN
admin/help/img/image031.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
admin/help/img/image032.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
admin/help/img/image033.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
admin/help/img/image034.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

BIN
admin/help/img/image035.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

BIN
admin/help/img/image036.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
admin/help/img/image037.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
admin/help/img/image038.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
admin/help/img/image039.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
admin/help/img/image040.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Some files were not shown because too many files have changed in this diff Show more