本文整理汇总了PHP中Context::getRequestUri方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::getRequestUri方法的具体用法?PHP Context::getRequestUri怎么用?PHP Context::getRequestUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Context
的用法示例。
在下文中一共展示了Context::getRequestUri方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLoginUrl
function getLoginUrl($provider)
{
$result = new Object();
// 제공하는 서비스인지 확인
if (!$this->providerManager->inProvider($provider)) {
$result->setError(-1);
$result->setMessage('msg_invalid_provider');
return $result;
}
// 요청 토큰을 얻는다.
$output = $this->getRequestToken();
if ($output->error) {
$result->setError($output->error);
$result->setMessage($output->message);
return $result;
}
$request_token = $output->request_token;
if (!$request_token) {
$result->setError(-1);
$result->setMessage('msg_request_error');
return $result;
}
// 요청 토큰을 세션에 저장한다.
$this->session->setSession('request_token', $request_token);
// 요청 URL 생성
$xe = preg_replace('@^https?://[^/]+/?@', '', Context::getRequestUri());
$data = array('provider' => $provider, 'request_token' => $request_token, 'xe' => $xe);
$url = $this->getURL('login', $data);
$result->add('url', $url);
return $result;
}
示例2: dispMessage
/**
* @brief Message output
**/
function dispMessage()
{
// Get configurations (using module model object)
$oModuleModel = getModel('module');
$config = $oModuleModel->getModuleConfig('message');
if (!$config->mskin) {
$config->mskin = 'default';
}
// Set the template path
$template_path = sprintf('%sm.skins/%s', $this->module_path, $config->mskin);
// Get the member configuration
$oModuleModel = getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
Context::set('member_config', $member_config);
// Set a flag to check if the https connection is made when using SSL and create https url
$ssl_mode = false;
if ($member_config->enable_ssl == 'Y') {
if (strncasecmp('https://', Context::getRequestUri(), 8) === 0) {
$ssl_mode = true;
}
}
Context::set('ssl_mode', $ssl_mode);
Context::set('system_message', nl2br($this->getMessage()));
Context::set('act', 'procMemberLogin');
Context::set('mid', '');
$this->setTemplatePath($template_path);
$this->setTemplateFile('system_message');
}
示例3: memberTransImageName
/**
* @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];
// Initialize global variable for cache
if (!isset($GLOBALS['_transImageNameList'][$member_srl])) {
$GLOBALS['_transImageNameList'][$member_srl] = new stdClass();
}
$_tmp =& $GLOBALS['_transImageNameList'][$member_srl];
// If pre-defined data in the global variables, return it
if (!$_tmp->cached) {
$_tmp->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(_XE_PATH_ . $image_name_file)) {
$_tmp->image_name_file = $image_name_file . '?' . date('YmdHis', filemtime(_XE_PATH_ . $image_name_file));
$image_name_file = $_tmp->image_name_file;
} else {
$image_name_file = '';
}
if (file_exists(_XE_PATH_ . $image_mark_file)) {
$_tmp->image_mark_file = $image_mark_file . '?' . date('YmdHis', filemtime(_XE_PATH_ . $image_mark_file));
$image_mark_file = $_tmp->image_mark_file;
} else {
$image_mark_file = '';
}
$site_module_info = Context::get('site_module_info');
$group_image = $oMemberModel->getGroupImageMark($member_srl, $site_module_info->site_srl);
$_tmp->group_image = $group_image;
} else {
$group_image = $_tmp->group_image;
$image_name_file = $_tmp->image_name_file;
$image_mark_file = $_tmp->image_mark_file;
}
// If image name and mark doesn't exist, set the original information
if (!$image_name_file && !$image_mark_file && !$group_image) {
return $matches[0];
}
// check member_config
$config = $oMemberModel->getMemberConfig();
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);
}
return preg_replace('/' . preg_quote($matches[5], '/') . '<\\/' . $matches[6] . '>$/', '', $matches[0]) . $nick_name . '</' . $matches[6] . '>';
}
示例4: proc
/**
* @brief Widget execution
* Get extra_vars declared in ./widgets/widget/conf/info.xml as arguments
* After generating the result, do not print but return it.
*/
function proc($args)
{
// Set a path of the template skin (values of skin, colorset settings)
$tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
Context::set('colorset', $args->colorset);
// Specify a template file
if (Context::get('is_logged')) {
$tpl_file = 'login_info';
} else {
$tpl_file = 'login_form';
}
// Get the member configuration
$oModuleModel = getModel('module');
$this->member_config = $oModuleModel->getModuleConfig('member');
Context::set('member_config', $this->member_config);
// Set a flag to check if the https connection is made when using SSL and create https url
$ssl_mode = false;
$useSsl = Context::getSslStatus();
if ($useSsl != 'none') {
if (strncasecmp('https://', Context::getRequestUri(), 8) === 0) {
$ssl_mode = true;
}
}
Context::set('ssl_mode', $ssl_mode);
// Compile a template
$oTemplate =& TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
示例5: dispMessage
/**
* @brief 메세지 출력
**/
function dispMessage()
{
// 설정 정보를 받아옴 (module model 객체를 이용)
$oModuleModel =& getModel('module');
$config = $oModuleModel->getModuleConfig('message');
if (!$config->skin) {
$config->skin = 'default';
}
// 템플릿 경로를 지정
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
// 회원 관리 정보를 받음
$oModuleModel =& getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
Context::set('member_config', $member_config);
// ssl 사용시 현재 https접속상태인지에 대한 flag및 https url 생성
$ssl_mode = false;
if ($member_config->enable_ssl == 'Y') {
if (preg_match('/^https:\\/\\//i', Context::getRequestUri())) {
$ssl_mode = true;
}
}
Context::set('ssl_mode', $ssl_mode);
Context::set('system_message', nl2br($this->getMessage()));
$this->setTemplatePath($template_path);
$this->setTemplateFile('system_message');
}
示例6: dispMessage
/**
* @brief Display messages
**/
function dispMessage()
{
// Get configurations (using module model object)
$oModuleModel =& getModel('module');
$this->module_config = $config = $oModuleModel->getModuleConfig('message', $this->module_info->site_srl);
if (!$config->skin) {
$config->skin = 'default';
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
} else {
//check theme
$config_parse = explode('|@|', $config->skin);
if (count($config_parse) > 1) {
$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
} else {
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
}
}
// Template path
$this->setTemplatePath($template_path);
// Get the member configuration
$member_config = $oModuleModel->getModuleConfig('member');
Context::set('member_config', $member_config);
// Set a flag to check if the https connection is made when using SSL and create https url
$ssl_mode = false;
if ($member_config->enable_ssl == 'Y') {
if (preg_match('/^https:\\/\\//i', Context::getRequestUri())) {
$ssl_mode = true;
}
}
Context::set('ssl_mode', $ssl_mode);
Context::set('system_message', nl2br($this->getMessage()));
$this->setTemplateFile('system_message');
}
示例7: dispMessage
/**
* @brief Display messages
*/
function dispMessage($detail = null)
{
// Get configurations (using module model object)
$oModuleModel = getModel('module');
$this->module_config = $config = $oModuleModel->getModuleConfig('message', $this->module_info->site_srl);
if (!$config) {
$config = new stdClass();
}
if (!$config->skin) {
$config->skin = 'xedition';
}
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
// Template path
$this->setTemplatePath($template_path);
// Get the member configuration
$member_config = $oModuleModel->getModuleConfig('member');
Context::set('member_config', $member_config);
// Set a flag to check if the https connection is made when using SSL and create https url
$ssl_mode = false;
if ($member_config->enable_ssl == 'Y') {
if (strncasecmp('https://', Context::getRequestUri(), 8) === 0) {
$ssl_mode = true;
}
}
Context::set('ssl_mode', $ssl_mode);
Context::set('system_message', nl2br($this->getMessage()));
Context::set('system_message_detail', nl2br($detail));
$this->setTemplateFile('system_message');
// Default 403 Error
if ($this->getHttpStatusCode() === 200) {
$this->setHttpStatusCode(403);
}
}
示例8: triggerRssUrlInsert
/**
* Check whether to use RSS rss url by adding
*
* @return Object
*/
function triggerRssUrlInsert()
{
$oModuleModel = getModel('module');
$total_config = $oModuleModel->getModuleConfig('rss');
$current_module_srl = Context::get('module_srl');
$site_module_info = Context::get('site_module_info');
if (is_array($current_module_srl)) {
unset($current_module_srl);
}
if (!$current_module_srl) {
$current_module_info = Context::get('current_module_info');
$current_module_srl = $current_module_info->module_srl;
}
if (!$current_module_srl) {
return new Object();
}
// Imported rss settings of the selected module
$oRssModel = getModel('rss');
$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
if ($rss_config->open_rss != 'N') {
Context::set('rss_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'rss'));
Context::set('atom_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'atom'));
}
if (Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N') {
if (Context::isAllowRewrite() && !Context::get('vid')) {
$request_uri = Context::getRequestUri();
Context::set('general_rss_url', $request_uri . 'rss');
Context::set('general_atom_url', $request_uri . 'atom');
} else {
Context::set('general_rss_url', getUrl('', 'module', 'rss', 'act', 'rss'));
Context::set('general_atom_url', getUrl('', 'module', 'rss', 'act', 'atom'));
}
}
return new Object();
}
示例9: proc
/**
* @brief 위젯의 실행 부분
* ./widgets/위젯/conf/info.xml에 선언한 extra_vars를 args로 받는다
* 결과를 만든후 print가 아니라 return 해주어야 한다
**/
function proc($args)
{
// 템플릿의 스킨 경로를 지정 (skin, colorset에 따른 값을 설정)
$tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
Context::set('colorset', $args->colorset);
// 템플릿 파일을 지정
if (Context::get('is_logged')) {
$tpl_file = 'login_info';
} else {
$tpl_file = 'login_form';
}
// 회원 관리 정보를 받음
$oModuleModel =& getModel('module');
$this->member_config = $oModuleModel->getModuleConfig('member');
Context::set('member_config', $this->member_config);
// ssl 사용시 현재 https접속상태인지에 대한 flag및 https url 생성
$ssl_mode = false;
if ($this->member_config->enable_ssl == 'Y') {
if (preg_match('/^https:\\/\\//i', Context::getRequestUri())) {
$ssl_mode = true;
}
}
Context::set('ssl_mode', $ssl_mode);
// 템플릿 컴파일
$oTemplate =& TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
示例10: procCommunicationSendMessage
/**
* @brief 쪽지 발송
**/
function procCommunicationSendMessage()
{
// 로그인 정보 체크
if (!Context::get('is_logged')) {
return new Object(-1, 'msg_not_logged');
}
$logged_info = Context::get('logged_info');
// 변수 검사
$receiver_srl = Context::get('receiver_srl');
if (!$receiver_srl) {
return new Object(-1, 'msg_not_exists_member');
}
$title = trim(Context::get('title'));
if (!$title) {
return new Object(-1, 'msg_title_is_null');
}
$content = trim(Context::get('content'));
if (!$content) {
return new Object(-1, 'msg_content_is_null');
}
$send_mail = Context::get('send_mail');
if ($send_mail != 'Y') {
$send_mail = 'N';
}
// 받을 회원이 있는지에 대한 검사
$oMemberModel =& getModel('member');
$oCommunicationModel =& getModel('communication');
$receiver_member_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl);
if ($receiver_member_info->member_srl != $receiver_srl) {
return new Object(-1, 'msg_not_exists_member');
}
// 받을 회원의 쪽지 수신여부 검사 (최고관리자이면 패스)
if ($logged_info->is_admin != 'Y') {
if ($receiver_member_info->allow_message == 'F') {
if (!$oCommunicationModel->isFriend($receiver_member_info->member_srl)) {
return new object(-1, 'msg_allow_message_to_friend');
}
} elseif ($receiver_member_info->allow_messge == 'N') {
return new object(-1, 'msg_disallow_message');
}
}
// 쪽지 발송
$output = $this->sendMessage($logged_info->member_srl, $receiver_srl, $title, $content);
// 메일로도 발송
if ($output->toBool() && $send_mail == 'Y') {
$view_url = Context::getRequestUri();
$content = sprintf("%s<br /><br />From : <a href=\"%s\" target=\"_blank\">%s</a>", $content, $view_url, $view_url);
$oMail = new Mail();
$oMail->setTitle($title);
$oMail->setContent($content);
$oMail->setSender($logged_info->user_name, $logged_info->email_address);
$oMail->setReceiptor($receiver_member_info->user_name, $receiver_member_info->email_address);
$oMail->send();
}
return $output;
}
示例11: dispHomepageIndex
/**
* @brief 카페 메인 출력
**/
function dispHomepageIndex()
{
$oHomepageAdminModel =& getAdminModel('homepage');
$oHomepageModel =& getModel('homepage');
$oModuleModel =& getModel('module');
$template_path = sprintf("%sskins/%s/", $this->module_path, $this->module_info->skin);
if (!is_dir($template_path) || !$this->module_info->skin) {
$this->module_info->skin = 'xe_default';
$template_path = sprintf("%sskins/%s/", $this->module_path, $this->module_info->skin);
}
$this->setTemplatePath($template_path);
// 카페 목록을 구함
$page = Context::get('page');
$output = $oHomepageAdminModel->getHomepageList($page);
if ($output->data && count($output->data)) {
foreach ($output->data as $key => $val) {
$banner_src = 'files/attach/cafe_banner/' . $val->site_srl . '.jpg';
if (file_exists(_XE_PATH_ . $banner_src)) {
$output->data[$key]->cafe_banner = $banner_src . '?rnd=' . filemtime(_XE_PATH_ . $banner_src);
}
$url = getSiteUrl($val->domain, '');
if (substr($url, 0, 1) == '/') {
$url = substr(Context::getRequestUri(), 0, -1) . $url;
}
$output->data[$key]->url = $url;
}
}
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('homepage_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
// 카페 생성 권한 세팅
if ($oHomepageModel->isCreationGranted()) {
Context::set('isEnableCreateCafe', true);
Context::addJsFilter($this->module_path . 'tpl/filter', 'cafe_creation.xml');
}
// 카페의 최신 글 추출
$output = executeQueryArray('homepage.getNewestDocuments');
Context::set('newest_documents', $output->data);
// 카페의 최신 댓글 추출
$output = executeQueryArray('homepage.getNewestComments');
Context::set('newest_comments', $output->data);
$logged_info = Context::get('logged_info');
if ($logged_info->member_srl) {
$myargs->member_srl = $logged_info->member_srl;
$output = executeQueryArray('homepage.getMyCafes', $myargs);
Context::set('my_cafes', $output->data);
}
$homepage_info = $oModuleModel->getModuleConfig('homepage');
if ($homepage_info->use_rss == 'Y') {
Context::set('rss_url', getUrl('', 'mid', $this->module_info->mid, 'act', 'rss'));
}
$this->setTemplateFile('index');
}
示例12: pointLevelIconTrans
/**
* @brief Function to change point icon.
*/
function pointLevelIconTrans($matches, $addon_info)
{
$member_srl = $matches[3];
// If anonymous or not member_srl go to Hide Point Icon
if ($member_srl < 1 || !$member_srl) {
return $matches[0];
}
if ($addon_info->icon_duplication != 'N') {
// Check Group Image Mark
$oMemberModel = getModel('member');
if ($oMemberModel->getGroupImageMark($member_srl)) {
return $matches[0];
}
}
$orig_text = preg_replace('/' . preg_quote($matches[5], '/') . '<\\/' . $matches[6] . '>$/', '', $matches[0]);
if (!isset($GLOBALS['_pointLevelIcon'][$member_srl])) {
// Get point configuration
if (!$GLOBALS['_pointConfig']) {
$oModuleModel = getModel('module');
$GLOBALS['_pointConfig'] = $oModuleModel->getModuleConfig('point');
}
$config = $GLOBALS['_pointConfig'];
// Get point model
if (!$GLOBALS['_pointModel']) {
$GLOBALS['_pointModel'] = getModel('point');
}
$oPointModel =& $GLOBALS['_pointModel'];
// Get points
if (!$oPointModel->isExistsPoint($member_srl)) {
return $matches[0];
}
$point = $oPointModel->getPoint($member_srl);
// Get level
$level = $oPointModel->getLevel($point, $config->level_step);
$text = $matches[5];
// Get a path where level icon is
$level_icon = sprintf('%smodules/point/icons/%s/%d.gif', Context::getRequestUri(), $config->level_icon, $level);
// Get per to go to the next level if not a top level
$per = NULL;
if ($level < $config->max_level) {
$next_point = $config->level_step[$level + 1];
$present_point = $config->level_step[$level];
if ($next_point > 0) {
$per = (int) (($point - $present_point) / ($next_point - $present_point) * 100);
$per = $per . '%';
}
}
$title = sprintf('%s:%s%s%s, %s:%s/%s', lang('point'), $point, $config->point_name, $per ? ' (' . $per . ')' : '', lang('level'), $level, $config->max_level);
$alt = sprintf('[%s:%s]', lang('level'), $level);
$GLOBALS['_pointLevelIcon'][$member_srl] = sprintf('<img src="%s" alt="%s" title="%s" class="xe_point_level_icon" style="vertical-align:middle;margin-right:3px;" />', $level_icon, $alt, $title);
}
$text = $GLOBALS['_pointLevelIcon'][$member_srl];
return $orig_text . $text . $matches[5] . '</' . $matches[6] . '>';
}
示例13: getThumbnailByUrl
function getThumbnailByUrl($image_url, $width = 80, $height = 0, $thumbnail_type = '')
{
if (!$height) {
$height = $width;
}
if (!in_array($thumbnail_type, array('crop', 'ratio'))) {
$config = $GLOBALS['__document_config__'];
if (!$config) {
$oDocumentModel = getModel('document');
$config = $oDocumentModel->getDocumentConfig();
$GLOBALS['__document_config__'] = $config;
}
$thumbnail_type = $config->thumbnail_type;
}
if (!is_dir('./files/thumbnails/magiccontent_thumbnail')) {
FileHandler::makeDir('./files/thumbnails/magiccontent_thumbnail');
}
$thumbnail_path = sprintf('files/thumbnails/magiccontent_thumbnail/%s', base64_encode($image_url));
$thumbnail_file = sprintf('%s%dx%d.%s.jpg', $thumbnail_path, $width, $height, $thumbnail_type);
$thumbnail_url = Context::getRequestUri() . $thumbnail_file;
if (file_exists($thumbnail_file)) {
if (filesize($thumbnail_file) < 1) {
return false;
} else {
return $thumbnail_url;
}
}
$tmp_file = sprintf('./files/cache/tmp/%s', md5(rand(111111, 999999) . $image_url));
if (!is_dir('./files/cache/tmp')) {
FileHandler::makeDir('./files/cache/tmp');
}
if (!preg_match('/^(http|https):\\/\\//i', $image_url)) {
$image_url = Context::getRequestUri() . $image_url;
}
FileHandler::getRemoteFile($image_url, $tmp_file);
if (!file_exists($tmp_file)) {
return false;
} else {
list($_w, $_h, $_t, $_a) = @getimagesize($tmp_file);
if (!in_array($_t, array(1, 2, 3, 6, 7, 8))) {
FileHandler::writeFile($thumbnail_file, '', 'w');
return false;
}
$source_file = $tmp_file;
}
$output = FileHandler::createImageFile($source_file, $thumbnail_file, $width, $height, 'jpg', $thumbnail_type);
FileHandler::removeFile($source_file);
if ($output) {
return $thumbnail_url;
} else {
FileHandler::writeFile($thumbnail_file, '', 'w');
}
return false;
}
示例14: proc
/**
* @brief Widget execution
* Get extra_vars declared in ./widgets/widget/conf/info.xml as arguments
* After generating the result, do not print but return it.
*/
function proc($args)
{
// Set a path of the template skin (values of skin, colorset settings)
$tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
Context::set('colorset', $args->colorset);
$is_logged = Context::get('is_logged');
$oMemberModel = getModel('member');
$memberConfig = $oMemberModel->getMemberConfig();
$oNcenterliteModel = getModel('ncenterlite');
$ncenter_config = $oNcenterliteModel->getConfig();
if ($is_logged) {
if (!empty($ncenter_config->use) && $args->ncenter_use == 'yes') {
$logged_info = Context::get('logged_info');
$ncenter_list = $oNcenterliteModel->getMyNotifyList($logged_info->member_srl);
$_latest_notify_id = array_slice($ncenter_list->data, 0, 1);
$_latest_notify_id = $_latest_notify_id[0]->notify;
if ($memberConfig->profile_image == 'Y') {
$profileImage = $oMemberModel->getProfileImage($logged_info->member_srl);
Context::set('profileImage', $profileImage);
}
Context::set('ncenterlite_latest_notify_id', $_latest_notify_id);
if ($_COOKIE['_ncenterlite_hide_id'] && $_COOKIE['_ncenterlite_hide_id'] == $_latest_notify_id) {
return;
}
setcookie('_ncenterlite_hide_id', '', 0, '/');
}
$tpl_file = 'login_info';
} else {
$tpl_file = 'login_form';
}
// Get the member configuration
$oModuleModel = getModel('module');
$this->member_config = $oModuleModel->getModuleConfig('member');
if ($ncenter_config->zindex) {
Context::set('ncenterlite_zindex', ' style="z-index:' . $ncenter_config->zindex . ';" ');
}
Context::set('useProfileImage', $memberConfig->profile_image == 'Y' ? true : false);
Context::set('ncenterlite_list', $ncenter_list->data);
Context::set('ncenterlite_page_navigation', $ncenter_list->page_navigation);
Context::set('_ncenterlite_num', $ncenter_list->page_navigation->total_count);
Context::set('member_config', $this->member_config);
// Set a flag to check if the https connection is made when using SSL and create https url
$ssl_mode = false;
$useSsl = Context::getSslStatus();
if ($useSsl != 'none') {
if (strncasecmp('https://', Context::getRequestUri(), 8) === 0) {
$ssl_mode = true;
}
}
Context::set('ssl_mode', $ssl_mode);
// Compile a template
$oTemplate =& TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
示例15: memberTransImageName
/**
* @brief div 또는 span에 member_번호 가 있을때 해당 회원 번호에 맞는 이미지이름이나 닉이미지를 대체
**/
function memberTransImageName($matches)
{
// 회원번호를 추출하여 0보다 찾으면 본문중 text만 return
$member_srl = $matches[3];
if ($member_srl < 0) {
return $matches[5];
}
$site_module_info = Context::get('site_module_info');
$oMemberModel =& getModel('member');
$group_image = $oMemberModel->getGroupImageMark($member_srl, $site_module_info->site_srl);
// 회원이 아닐경우(member_srl = 0) 본문 전체를 return
$nick_name = $matches[5];
if (!$member_srl) {
return $matches[0];
}
// 전역변수에 미리 설정한 데이터가 있다면 그걸 return
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 = '';
}
} else {
$image_name_file = $GLOBALS['_transImageNameList'][$member_srl]->image_name_file;
$image_mark_file = $GLOBALS['_transImageNameList'][$member_srl]->image_mark_file;
}
// 이미지이름이나 마크가 없으면 원본 정보를 세팅
if (!$image_name_file && !$image_mark_file && !$group_image) {
return $matches[0];
}
if ($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 ($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);
}
if ($group_image) {
$nick_name = sprintf('<img src="%s" border="0" style="vertical-align:middle;margin-right:3px"/>%s', $group_image->src, $nick_name);
}
$orig_text = preg_replace('/' . preg_quote($matches[5], '/') . '<\\/' . $matches[6] . '>$/', '', $matches[0]);
return $orig_text . $nick_name . '</' . $matches[6] . '>';
}