플래닛 위젯 디자인 추가. 플래닛 사진 이미지 받아올때 width/height지정할 수 있도록 변경

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5181 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-12-26 03:19:16 +00:00
parent ac70118473
commit a8b20c5df9
6 changed files with 45 additions and 74 deletions

View file

@ -67,10 +67,10 @@
return $this->get('planet_title'); return $this->get('planet_title');
} }
function getPhotoSrc() { function getPhotoSrc($width=96,$height=96) {
if(!$this->isExists()) return; if(!$this->isExists()) return;
$oPlanetModel = &getModel('planet'); $oPlanetModel = &getModel('planet');
return $oPlanetModel->getPlanetPhotoSrc($this->planet_srl); return $oPlanetModel->getPlanetPhotoSrc($this->planet_srl, $width, $height);
} }
function getMid() { function getMid() {

View file

@ -40,9 +40,9 @@
} }
} }
function getPlanetPhotoSrc() { function getPlanetPhotoSrc($width=96,$height=96) {
$oPlanetModel = &getModel('planet'); $oPlanetModel = &getModel('planet');
return $oPlanetModel->getPlanetPhotoSrc($this->get('module_srl')); return $oPlanetModel->getPlanetPhotoSrc($this->get('module_srl'), $width, $height);
} }
function getPlanetMid() { function getPlanetMid() {

View file

@ -502,13 +502,21 @@
/** /**
* @brief 플래닛 이미지 유무 체크후 경로 return * @brief 플래닛 이미지 유무 체크후 경로 return
**/ **/
function getPlanetPhotoSrc($module_srl) { function getPlanetPhotoSrc($module_srl, $width=96,$height=96) {
$path = $this->getPlanetPhotoPath($module_srl); $path = $this->getPlanetPhotoPath($module_srl);
if(!is_dir($path)) return sprintf("%s%s%s", Context::getRequestUri(), $this->module_path, 'tpl/images/blank_photo.gif'); $source_filename = sprintf('%s/%d.jpg', $path, $module_srl);
$filename = sprintf('%s/%d.jpg', $path, $module_srl);
if(!file_exists($filename)) return sprintf("%s%s%s", Context::getRequestUri(), $this->module_path, 'tpl/images/blank_photo.gif'); if(!is_dir($path) || !file_exists($source_filename)) return sprintf("%s%s%s", Context::getRequestUri(), $this->module_path, 'tpl/images/blank_photo.gif');
$src = Context::getRequestUri().$filename."?rnd=".filemtime($filename);
return $src; if($width!=96&&$height!=96) {
$filename = sprintf('%s%d.%d.%d.jpg', $path, $module_srl, $width, $height);
if(!file_exists($filename) && FileHandler::createImageFile($source_filename, $filename, $width, $height)) {
$source_filename = $filename;
}
} else {
$filename = $source_filename;
}
return Context::getRequestUri().$filename."?rnd=".filemtime($filename);
} }
/** /**

View file

@ -1,34 +1,18 @@
@charset "utf-8"; @charset "utf-8";
.commentBody.myPlanet .comment .tongue{ margin:0 !important;} .planetDocument { overflow:hidden; margin-bottom:5px; *zoom:1;}
.commentBody.myPlanet .comment .tongue .post, .planetDocument .identity { width:52px; height:52px; padding:0; float:left; margin:3px 10px 3px 3px; background:none; *zoom:1; overflow:hidden;}
.commentBody.myPlanet .comment .tongue .postScript, .planetDocument .identity a img{ display:block; border:1px solid #545554;}
.commentBody.myPlanet .comment .tongue .postExtra{ *zoom:1;}
/* Comment Body */ .planetDocument .article { position:relative; overflow:hidden; *zoom:1; margin-top:3px; }
.commentBody{ margin:0 0 10px 0; *zoom:1; clear:both; overflow:hidden; width:100%; } .planetDocument .article .tooltipLT,
.planetDocument .article .tooltipRT,
.commentBody .comment{ margin:0 1px 0 0; padding:0; clear:both; *zoom:1; overflow:hidden;} .planetDocument .article .tooltipLB,
.planetDocument .article .tooltipRB { position:absolute; background:url("../images/tooltip.gif") no-repeat; display:block; width:10px; height:10px; z-index:10; background-color:#FFFFFF; overflow:hidden; }
.commentBody .comment .identity{ width:98px; height:98px; padding:0; float:left; margin:0 -98px 0 0; background:none; *zoom:1;} .planetDocument .article .tooltipArrow { position:absolute; background:url("../images/tooltip.gif") no-repeat left -20px; width:7px; height:4px; left:0; top:10px; z-index:10;}
.commentBody .comment .identity a{ position:relative; font-size:12px; display:block; text-align:center; color:#fff !important; font-weight:bold; text-decoration:none; } .planetDocument .article .tooltipLT { left:4px; top:0px; background-position:0 0; }
.commentBody .comment .identity a img{ display:block; border:1px solid #000;} .planetDocument .article .tooltipRT { right:0px; _right:-1px; top:0px; background-position:-10px 0; }
.commentBody .comment .identity a em{ position:absolute; width:96px; text-align:center; left:1px; bottom:1px; display:block; padding:5px 0; font-style:normal; background:#000; opacity:.6; filter:alpha(opacity=60); line-height:normal;} .planetDocument .article .tooltipLB { left:4px; bottom:0px; background-position:left -10px; }
.planetDocument .article .tooltipRB { right:0px; _right:-1px; bottom:0px; background-position:-10px -10px; }
.commentBody .comment .tongue{ position:relative; margin-left:113px; *zoom:1;} .planetDocument .article .content { border:1px solid #545554; z-index:1; display:block; padding:10px; margin-left:4px; height:30px; }
.commentBody .comment .tongue .post{ margin:0 0 7px 0; } .planetDocument .article .content div { line-height:1.4; }
.commentBody .comment .tongue .post a { color:#06C;}
.commentBody .comment .tongue .post strong{ background:#f7b100; color:#000;}
.commentBody .comment .tongue .postScript{ margin:0 0 5px 0; color:#999;}
.commentBody .comment .tongue .postScript strong{ letter-spacing:-1px; margin-right:5px;}
.commentBody .comment .tongue .postExtra{ overflow:hidden; padding-top:5px; border-top:1px dotted #ccc; *zoom:1;}
.commentBody .comment .tongue .postExtra *{ margin:0; padding:0;}
.commentBody .comment .tongue .postExtra .tag { float:left;}
.commentBody .comment .tongue .postExtra .tag .time{ display:inline; margin-right:5px; color:#999; }
.commentBody .comment .tongue .postExtra .tag dl{ display:inline;}
.commentBody .comment .tongue .postExtra .tag dt{ text-align:center; padding:0 7px; margin-right:5px; display:inline; background:url(../images/bgTag.gif) no-repeat center; font:bold 8pt Tahoma; color:#fff;}
.commentBody .comment .tongue .postExtra .tag dd{ display:inline; position:relative;}
.commentBody .comment .tongue .postExtra .tag dd.tagRead a{ position:relative; margin-right:2px; color:#999; text-decoration:none;}
.commentBody .comment .tongue .postExtra .tag dd.tagRead a strong{ background:#f7b100; color:#fff;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

View file

@ -7,38 +7,17 @@
<!--@end--> <!--@end-->
<!--@foreach($planet_list as $no => $item)--> <!--@foreach($planet_list as $no => $item)-->
<div id="commentBody:{$item->get('document_srl')}" class="commentBody <!--@if($planet->getMid() == $item->getPlanetMid())-->myPlanet<!--@end-->"> <div class="planetDocument">
<!--// Original Text --> <!--@if($planet->getMid() != $item->getPlanetMid())-->
<div class="comment"> <h3 class="identity"><a href="{getUrl('','mid',$item->getPlanetMid())}"><img src="{$item->getPlanetPhotoSrc(50,50)}" width="50" height="50" alt="{htmlspecialchars($item->nick_name)}" /></a></h3>
<!--@if($planet->getMid() != $item->getPlanetMid())--> <!--@end-->
<h3 class="identity"> <a href="{getUrl('','mid',$item->getPlanetMid())}"><img src="{$item->getPlanetPhotoSrc()}" width="96" height="96" alt="{htmlspecialchars($item->nick_name)}" /><em>{htmlspecialchars($item->get('nick_name'))}</em></a> </h3> <div class="article">
<!--@end--> <span class="content">{$item->getContent()}</span>
<div class="tongue"> <span class="tooltipLT"></span>
<div class="post"> <span class="tooltipRT"></span>
{$item->getContent()} <span class="tooltipLB"></span>
</div> <span class="tooltipRB"></span>
<!--@if($item->getPostScript())--> <span class="tooltipArrow"></span>
<p class="postScript"><strong>{$lang->planet_postscript}</strong> {htmlspecialchars($item->getPostScript())}</p> </div>
<!--@end-->
<div class="postExtra">
<div class="tag">
<!--// class="tag" | class="tag edit" -->
{@ $regdate = $item->get('regdate') }
<p class="time">{getTimeGap($item->get('regdate'), sprintf('y/m/d a H%s i%s', $lang->unit_hour,$lang->unit_min))}</p>
<dl>
<dt>TAG</dt>
<dd class="tagRead">
<!--@for($i=0,$tag=$item->getArrTags(),$c=count($tag);$i<$c;$i++)-->
<a href="{getUrl('','mid',$item->getPlanetmid(), 'act','dispPlanetContentTagSearch','keyword',urlencode($tag[$i]))}" name="planet_content_tag:{$item->get('document_srl')}">{htmlspecialchars($tag[$i])}</a>
<!--@end-->
</dd>
</dl>
</div>
</div>
</div>
</div>
<!--// //Reply Text -->
<span class="tl"></span><span class="tr"></span><span class="bl"></span><span class="br"></span>
</div> </div>
<!--@end--> <!--@end-->