플래닛 위젯 디자인 추가. 플래닛 사진 이미지 받아올때 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');
}
function getPhotoSrc() {
function getPhotoSrc($width=96,$height=96) {
if(!$this->isExists()) return;
$oPlanetModel = &getModel('planet');
return $oPlanetModel->getPlanetPhotoSrc($this->planet_srl);
return $oPlanetModel->getPlanetPhotoSrc($this->planet_srl, $width, $height);
}
function getMid() {

View file

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

View file

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