52 if(!$this->comment_srl)
57 $args =
new stdClass();
70 if(!$attribute->comment_srl)
72 $this->comment_srl = NULL;
76 $this->comment_srl = $attribute->comment_srl;
77 $this->
adds($attribute);
82 foreach($attribute as $key => $val)
91 return $this->comment_srl ? TRUE : FALSE;
96 if($_SESSION[
'own_comment'][$this->comment_srl])
118 if($this->
get(
'member_srl') && ($this->
get(
'member_srl') ==
$logged_info->member_srl || $this->get(
'member_srl') * -1 ==
$logged_info->member_srl))
129 $this->is_granted = TRUE;
139 if($this->
isGranted() || !$this->
get(
'member_srl'))
148 return $this->
get(
'is_secret') ==
'Y' ? TRUE : FALSE;
153 if($_SESSION[
'accessibled_comment'][$this->comment_srl])
166 if($oDocument->isGranted())
177 return $this->
get(
'notify_message') ==
'Y' ? TRUE : FALSE;
193 if(!$this->
get(
'member_srl'))
200 if(
$logged_info->member_srl == $this->get(
'member_srl'))
212 $title =
"[" . $type .
"] ";
215 $title .=
cut_str(strip_tags($content), 30,
'...');
216 $content = sprintf(
'%s<br /><br />from : <a href="%s#comment_%s" target="_blank">%s</a>', $content,
getFullUrl(
'',
'document_srl', $this->
get(
'document_srl')), $this->
get(
'comment_srl'),
getFullUrl(
'',
'document_srl', $this->
get(
'document_srl')));
217 $receiver_srl = $this->
get(
'member_srl');
222 $oCommunicationController->sendMessage($sender_member_srl, $receiver_srl, $title, $content, FALSE);
229 return $this->
get(
'ipaddress');
232 return '*' . strstr($this->
get(
'ipaddress'),
'.');
237 if(trim($this->
get(
'homepage')))
247 $url = trim($this->
get(
'homepage'));
253 if(strncasecmp(
'http://', $url, 7) !== 0)
255 $url =
"http://" . $url;
258 return htmlspecialchars($url, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
263 return $this->
get(
'member_srl');
268 return htmlspecialchars($this->
get(
'user_id'), ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
273 return htmlspecialchars($this->
get(
'user_name'), ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
278 return htmlspecialchars($this->
get(
'nick_name'), ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
292 $content = $this->
get(
'content');
296 return cut_str(strip_tags($content), $strlen,
'...');
299 return htmlspecialchars($content, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
306 function getContent($add_popup_menu = TRUE, $add_content_info = TRUE, $add_xe_content_class = TRUE)
313 $content = $this->
get(
'content');
320 '%s<div class="comment_popup_menu"><a href="#popup_menu_area" class="comment_%d" onclick="return false">%s</a></div>', $content, $this->comment_srl,
Context::getLang(
'cmd_comment_do')
325 if($add_content_info)
327 $memberSrl = $this->
get(
'member_srl');
333 '<!--BeforeComment(%d,%d)--><div class="comment_%d_%d xe_content">%s</div><!--AfterComment(%d,%d)-->', $this->comment_srl, $memberSrl, $this->comment_srl, $memberSrl, $content, $this->comment_srl, $memberSrl
339 if($add_xe_content_class)
341 $content = sprintf(
'<div class="xe_content">%s</div>', $content);
357 $content = preg_replace(
'!(<br[\s]*/{0,1}>[\s]*)+!is',
' ', $content);
360 $content = str_replace(array(
'</p>',
'</div>',
'</li>',
'-->'),
' ', $content);
363 $content = preg_replace(
'!<([^>]*?)>!is',
'', $content);
366 $content = str_replace(array(
'<',
'>',
'"',
' '), array(
'<',
'>',
'"',
' '), $content);
369 $content = preg_replace(
'/ ( +)/is',
' ', $content);
372 $content = trim(
cut_str($content, $str_size, $tail));
382 return zdate($this->
get(
'regdate'), $format);
387 $regdate = $this->
get(
'regdate');
388 $year = substr($regdate, 0, 4);
389 $month = substr($regdate, 4, 2);
390 $day = substr($regdate, 6, 2);
391 $hour = substr($regdate, 8, 2);
392 $min = substr($regdate, 10, 2);
393 $sec = substr($regdate, 12, 2);
394 return mktime($hour, $min, $sec, $month, $day, $year);
404 return zdate($this->
get(
'last_update'), $format);
409 return getFullUrl(
'',
'mid', $this->
getCommentMid(),
'document_srl', $this->
get(
'document_srl')) .
'#comment_' . $this->
get(
'comment_srl');
414 $year = substr($this->
get(
'last_update'), 0, 4);
415 $month = substr($this->
get(
'last_update'), 4, 2);
416 $day = substr($this->
get(
'last_update'), 6, 2);
417 $hour = substr($this->
get(
'last_update'), 8, 2);
418 $min = substr($this->
get(
'last_update'), 10, 2);
419 $sec = substr($this->
get(
'last_update'), 12, 2);
420 return mktime($hour, $min, $sec, $month, $day, $year);
434 return $this->
get(
'uploaded_count') ? TRUE : FALSE;
444 if(!$this->
get(
'uploaded_count'))
450 $file_list = $oFileModel->getFiles($this->comment_srl, array(),
'file_srl', TRUE);
466 return $oEditorModel->getModuleEditor(
'comment',
$module_srl, $this->comment_srl,
'comment_srl',
'content');
475 if(!$this->
isExists() || !$this->
get(
'member_srl'))
480 $profile_info = $oMemberModel->getProfileImage($this->
get(
'member_srl'));
486 return $profile_info->src;
496 if(!$this->
isExists() || !$this->
get(
'member_srl'))
503 $signature = $oMemberModel->getSignature($this->
get(
'member_srl'));
506 if(!isset(
$GLOBALS[
'__member_signature_max_height']))
510 $GLOBALS[
'__member_signature_max_height'] = $member_config->signature_max_height;
513 $max_signature_height =
$GLOBALS[
'__member_signature_max_height'];
515 if($max_signature_height)
517 $signature = sprintf(
'<div style="max-height:%dpx;overflow:auto;overflow-x:hidden;height:expression(this.scrollHeight > %d ? \'%dpx\': \'auto\')">%s</div>', $max_signature_height, $max_signature_height, $max_signature_height, $signature);
525 if(!$this->comment_srl)
541 if(!$this->comment_srl)
557 $content = $this->
get(
'content');
562 $args =
new stdClass();
567 $content =
$output->data->content;
568 $this->
add(
'content', $content);
572 if(!preg_match(
"!<img!is", $content))
return;
576 if(!in_array($thumbnail_type, array(
'crop',
'ratio')))
578 $thumbnail_type =
'crop';
582 $thumbnail_path = sprintf(
'files/thumbnails/%s',
getNumberingPath($this->comment_srl, 3));
583 $thumbnail_file = sprintf(
'%s%dx%d.%s.jpg', $thumbnail_path, $width, $height, $thumbnail_type);
584 $thumbnail_lockfile = sprintf(
'%s%dx%d.%s.lock', $thumbnail_path, $width, $height, $thumbnail_type);
588 if(file_exists($thumbnail_file) || file_exists($thumbnail_lockfile))
590 if(filesize($thumbnail_file) < 1)
596 return $thumbnail_url .
'?' . date(
'YmdHis', filemtime($thumbnail_file));
605 $is_tmp_file = FALSE;
613 foreach($file_list as $file)
615 if($file->direct_download !==
'Y')
continue;
617 if($file->cover_image ===
'Y' && file_exists($file->uploaded_filename))
619 $source_file = $file->uploaded_filename;
623 if($first_image)
continue;
625 if(preg_match(
"/\.(jpe?g|png|gif|bmp)$/i", $file->source_filename))
627 if(file_exists($file->uploaded_filename))
629 $first_image = $file->uploaded_filename;
634 if(!$source_file && $first_image)
636 $source_file = $first_image;
641 $is_tmp_file =
false;
646 preg_match_all(
"!<img[^>]*src=(?:\"|\')([^\"\']*?)(?:\"|\')!is", $content, $matches, PREG_SET_ORDER);
648 foreach($matches as $target_image)
650 $target_src = trim($target_image[1]);
651 if(preg_match(
'/\/(common|modules|widgets|addons|layouts|m\.layouts)\//i', $target_src))
continue;
653 if(!preg_match(
'/^(http|https):\/\//i',$target_src))
658 $target_src = htmlspecialchars_decode($target_src);
660 $tmp_file =
_XE_PATH_ .
'files/cache/tmp/' . $random->createSecureSalt(32,
'hex');
662 if(!file_exists($tmp_file))
continue;
664 $imageinfo = getimagesize($tmp_file);
665 list($_w, $_h) = $imageinfo;
666 if($imageinfo ===
false || ($_w < ($width * 0.3) && $_h < ($height * 0.3))) {
671 $source_file = $tmp_file;
694 return $thumbnail_url .
'?' . date(
'YmdHis', filemtime($thumbnail_file));
709 $module = $model->getModuleInfoByModuleSrl($this->
get(
'module_srl'));
getController($module_name)
getNumberingPath($no, $size=3)
zdate($str, $format= 'Y-m-d H:i:s', $conversion=TRUE)
stripEmbedTagForAdmin(&$content, $writer_member_srl)
if(file_exists(_XE_PATH_. 'config/config.user.inc.php')) if(!defined('__DEBUG__')) if(!defined('__DEBUG_OUTPUT__')) if(!defined('__DEBUG_PROTECT__')) if(!defined('__DEBUG_PROTECT_IP__')) if(!defined('__DEBUG_DB_OUTPUT__')) if(!defined('__LOG_SLOW_QUERY__')) if(!defined('__LOG_SLOW_TRIGGER__')) if(!defined('__LOG_SLOW_ADDON__')) if(!defined('__LOG_SLOW_WIDGET__')) if(!defined('__DEBUG_QUERY__')) if(!defined('__OB_GZHANDLER_ENABLE__')) if(!defined('__ENABLE_PHPUNIT_TEST__')) if(!defined('__PROXY_SERVER__')) if(!defined('__ERROR_LOG__')) if(!defined('__DISABLE_DEFAULT_CSS__')) if(!defined('__AUTO_OPCACHE_INVALIDATE__')) if((__DEBUG_OUTPUT__==2)&&version_compare(PHP_VERSION, '6.0.0')===-1) if(version_compare(PHP_VERSION, '5.3.0') >=0) $GLOBALS['__xe_autoload_file_map']
writeFile($filename, $buff, $mode="w")
getRemoteFile($url, $target_filename, $body=null, $timeout=3, $method= 'GET', $content_type=null, $headers=array(), $cookies=array(), $post_data=array(), $request_config=array())
createImageFile($source_file, $target_file, $resize_width=0, $resize_height=0, $target_type= '', $thumbnail_type= 'crop', $thumbnail_transparent=FALSE)
getRequestUri($ssl_mode=FOLLOW_REQUEST_SSL, $domain=null)
cut_str($string, $cut_size=0, $tail= '...')
executeQuery($query_id, $args=NULL, $arg_columns=NULL)