회원의 서명과 프로필 이미지를 출력하는 것을 document.item/ comment.item 각각에 getProfileImage(), getSignature() method를 빼서 각 스킨에서 알아서 적용할 수 있도록 자유도 올림. member_extra_info 애드온에서 서명 부분은 제거

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3585 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-01-24 05:06:07 +00:00
parent 610df5a83f
commit b0639e383d
12 changed files with 138 additions and 86 deletions

View file

@ -53,6 +53,9 @@
</div>
</form>
<!--@else-->
<!--@if($comment->getProfileImage())-->
<img src="{$comment->getProfileImage()}" align="left" class="commentProfileImage"/>
<!--@end-->
{$comment->getContent(true)}
<!--@end-->
</td>

View file

@ -586,3 +586,9 @@ Jeong, Chan Myeong 070601~070630
.searchNextButton { border:1px solid #979797; border-left:1px solid #B1B1B1; border-top:1px solid #B1B1B1; color:#4F4F4F; height:21px; font-size:8pt; padding-left:5px; padding-right:5px; _padding-top:3px;}
*:first-child+html .searchNextButton { padding-top:3px; }
/* 회원 서명 및 프로필 이미지 출력 */
.memberSignature { border:1px solid #e0e1db; padding:10px; margin-top:20px;}
.memberSignature .profile { float:left; margin-right:20px; }
.memberSignature .signature { float:left; }
img.commentProfileImage { margin:5px 10px 5px 0; }

View file

@ -79,6 +79,19 @@
<!--@else-->
{$oDocument->getContent()}
<!--@end-->
<!-- 서명 / 프로필 이미지 출력 -->
<!--@if($oDocument->getProfileImage() || $oDocument->getSignature())-->
<div class="memberSignature">
<!--@if($oDocument->getProfileImage())-->
<div class="profile"><img src="{$oDocument->getProfileImage()}" alt="profile" /></div>
<!--@end-->
<!--@if($oDocument->getSignature())-->
<div class="signature">{$oDocument->getSignature()}</div>
<!--@end-->
<div class="clear"></div>
</div>
<!--@end-->
</div>
</div>

View file

@ -63,8 +63,12 @@
</form>
</div>
<!--@else-->
<!--@if($comment->getProfileImage())-->
<img src="{$comment->getProfileImage()}" align="left" class="commentProfileImage"/>
<!--@end-->
{$comment->getContent(true)}
<!--@end-->
<div class="clear"></div>
</div>
<!--@if($comment->hasUploadedFIles())-->

View file

@ -306,3 +306,9 @@ h5 { padding:2px; }
.tags .tagTypeD a { font-weight:bold; margin:0; background-color:#EFEFEF;}
.tags .tagTypeE a { font-weight:normal; margin:0;}
/* 회원 서명 및 프로필 이미지 출력 */
.memberSignature { border:1px solid #e0e1db; padding:10px; margin-top:20px;}
.memberSignature .profile { float:left; margin-right:20px; }
.memberSignature .signature { float:left; }
img.commentProfileImage { margin:5px 10px 5px 0; }

View file

@ -105,6 +105,19 @@
<!--@if($grant->is_admin)-->
<div class="ipaddress">ipaddress : {$oDocument->get('ipaddress')}</div>
<!--@end-->
<!-- 서명 / 프로필 이미지 출력 -->
<!--@if($oDocument->getProfileImage() || $oDocument->getSignature())-->
<div class="memberSignature">
<!--@if($oDocument->getProfileImage())-->
<div class="profile"><img src="{$oDocument->getProfileImage()}" alt="profile" /></div>
<!--@end-->
<!--@if($oDocument->getSignature())-->
<div class="signature">{$oDocument->getSignature()}</div>
<!--@end-->
<div class="clear"></div>
</div>
<!--@end-->
</div>
</div>

View file

@ -260,5 +260,26 @@
return $oEditorModel->getModuleEditor('comment', $module_srl, $this->comment_srl, 'comment_srl', 'content');
}
/**
* @brief 작성자의 프로필 이미지를 return
**/
function getProfileImage() {
if(!$this->isExists() || !$this->get('member_srl')) return;
$oMemberModel = &getModel('member');
$profile_info = $oMemberModel->getProfileImage($this->get('member_srl'));
if(!$profile_info) return;
return $profile_info->src;
}
/**
* @brief 작성자의 서명을 return
**/
function getSignature() {
if(!$this->isExists() || !$this->get('member_srl')) return;
$oMemberModel = &getModel('member');
$signature = $oMemberModel->getSignature($this->get('member_srl'));
return $signature;
}
}
?>

View file

@ -579,5 +579,27 @@
$oEditorModel = &getModel('editor');
return $oEditorModel->getModuleEditor('comment', $this->get('module_srl'), $comment_srl, 'comment_srl', 'content');
}
/**
* @brief 작성자의 프로필 이미지를 return
**/
function getProfileImage() {
if(!$this->isExists() || !$this->get('member_srl')) return;
$oMemberModel = &getModel('member');
$profile_info = $oMemberModel->getProfileImage($this->get('member_srl'));
if(!$profile_info) return;
return $profile_info->src;
}
/**
* @brief 작성자의 서명을 return
**/
function getSignature() {
if(!$this->isExists() || !$this->get('member_srl')) return;
$oMemberModel = &getModel('member');
$signature = $oMemberModel->getSignature($this->get('member_srl'));
return $signature;
}
}
?>

View file

@ -406,59 +406,75 @@
* @brief 프로필 이미지의 정보를 구함
**/
function getProfileImage($member_srl) {
$exts = array('gif','jpg','png');
for($i=0;$i<3;$i++) {
$image_name_file = sprintf('files/member_extra_info/profile_image/%s%d.%s', getNumberingPath($member_srl), $member_srl, $exts[$i]);
if(file_exists($image_name_file)) {
list($width, $height, $type, $attrs) = getimagesize($image_name_file);
$info->width = $width;
$info->height = $height;
$info->src = Context::getRequestUri().$image_name_file;
$info->file = './'.$image_name_file;
return $info;
if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl])) {
$GLOBALS['__member_info__']['profile_image'][$member_srl] = null;
$exts = array('gif','jpg','png');
for($i=0;$i<3;$i++) {
$image_name_file = sprintf('files/member_extra_info/profile_image/%s%d.%s', getNumberingPath($member_srl), $member_srl, $exts[$i]);
if(file_exists($image_name_file)) {
list($width, $height, $type, $attrs) = getimagesize($image_name_file);
$info->width = $width;
$info->height = $height;
$info->src = Context::getRequestUri().$image_name_file;
$info->file = './'.$image_name_file;
$GLOBALS['__member_info__']['profile_image'][$member_srl] = $info;
break;
}
}
}
return;
return $GLOBALS['__member_info__']['profile_image'][$member_srl];
}
/**
* @brief 이미지이름의 정보를 구함
**/
function getImageName($member_srl) {
$image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl);
if(!file_exists($image_name_file)) return;
list($width, $height, $type, $attrs) = getimagesize($image_name_file);
$info->width = $width;
$info->height = $height;
$info->src = Context::getRequestUri().$image_name_file;
$info->file = './'.$image_name_file;
return $info;
if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl])) {
$image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl);
if(file_exists($image_name_file)) {
list($width, $height, $type, $attrs) = getimagesize($image_name_file);
$info->width = $width;
$info->height = $height;
$info->src = Context::getRequestUri().$image_name_file;
$info->file = './'.$image_name_file;
$GLOBALS['__member_info__']['image_name'][$member_srl] = $info;
} else $GLOBALS['__member_info__']['image_name'][$member_srl] = null;
}
return $GLOBALS['__member_info__']['image_name'][$member_srl];
}
/**
* @brief 이미지마크의 정보를 구함
**/
function getImageMark($member_srl) {
$image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl);
if(!file_exists($image_mark_file)) return;
list($width, $height, $type, $attrs) = getimagesize($image_mark_file);
$info->width = $width;
$info->height = $height;
$info->src = Context::getRequestUri().$image_mark_file;
$info->file = './'.$image_mark_file;
return $info;
if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl])) {
$image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl);
if(file_exists($image_mark_file)) {
list($width, $height, $type, $attrs) = getimagesize($image_mark_file);
$info->width = $width;
$info->height = $height;
$info->src = Context::getRequestUri().$image_mark_file;
$info->file = './'.$image_mark_file;
$GLOBALS['__member_info__']['image_mark'][$member_srl] = $info;
} else $GLOBALS['__member_info__']['image_mark'][$member_srl] = null;
}
return $GLOBALS['__member_info__']['image_mark'][$member_srl];
}
/**
* @brief 사용자의 signature를 구함
**/
function getSignature($member_srl) {
$filename = sprintf('files/member_extra_info/signature/%s%d.signature.php', getNumberingPath($member_srl), $member_srl);
if(!file_exists($filename)) return '';
$buff = FileHandler::readFile($filename);
$signature = trim(substr($buff, 40));
return $signature;
if(!isset($GLOBALS['__member_info__']['signature'][$member_srl])) {
$filename = sprintf('files/member_extra_info/signature/%s%d.signature.php', getNumberingPath($member_srl), $member_srl);
if(file_exists($filename)) {
$buff = FileHandler::readFile($filename);
$signature = trim(substr($buff, 40));
$GLOBALS['__member_info__']['signature'][$member_srl] = $signature;
} else $GLOBALS['__member_info__']['signature'][$member_srl] = null;
}
return $GLOBALS['__member_info__']['signature'][$member_srl];
}
/**