존재하지 않는 게시글일때 썸네일 추출시 썸네일 여부를 체크하지 않도록 코드 수정. (웹진형 위젯의 무한루프 방지)

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3422 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-12-27 03:04:07 +00:00
parent e94547969a
commit c8bc698b93

View file

@ -101,6 +101,7 @@
} }
function doCart() { function doCart() {
if(!$this->document_srl) return false;
if($this->isCarted()) $this->removeCart(); if($this->isCarted()) $this->removeCart();
else $this->addCart(); else $this->addCart();
} }
@ -118,6 +119,8 @@
} }
function notify($type, $content) { function notify($type, $content) {
if(!$this->document_srl) return;
// useNotify가 아니면 return // useNotify가 아니면 return
if(!$this->useNotify()) return; if(!$this->useNotify()) return;
@ -180,6 +183,8 @@
} }
function getTitle($cut_size = 0, $tail='...') { function getTitle($cut_size = 0, $tail='...') {
if(!$this->document_srl) return;
$title = $this->getTitleText($cut_size, $tail); $title = $this->getTitleText($cut_size, $tail);
$attrs = array(); $attrs = array();
@ -191,6 +196,8 @@
} }
function getContentText($strlen = 0) { function getContentText($strlen = 0) {
if(!$this->document_srl) return;
if($this->isSecret() && !$this->isGranted()) return Context::getLang('msg_is_secret'); if($this->isSecret() && !$this->isGranted()) return Context::getLang('msg_is_secret');
$_SESSION['accessible'][$this->document_srl] = true; $_SESSION['accessible'][$this->document_srl] = true;
@ -203,6 +210,8 @@
} }
function getContent($add_document_info = true) { function getContent($add_document_info = true) {
if(!$this->document_srl) return;
if($this->isSecret() && !$this->isGranted()) return Context::getLang('msg_is_secret'); if($this->isSecret() && !$this->isGranted()) return Context::getLang('msg_is_secret');
$_SESSION['accessible'][$this->document_srl] = true; $_SESSION['accessible'][$this->document_srl] = true;
@ -242,6 +251,8 @@
} }
function getSummary($str_size = 50) { function getSummary($str_size = 50) {
if(!$this->document_srl) return;
$content = htmlspecialchars(strip_tags(str_replace(" "," ",$this->getContent(false)))); $content = htmlspecialchars(strip_tags(str_replace(" "," ",$this->getContent(false))));
return cut_str($content, $str_size, '...'); return cut_str($content, $str_size, '...');
} }
@ -288,6 +299,8 @@
} }
function getTrackbackUrl() { function getTrackbackUrl() {
if(!$this->document_srl) return;
// 스팸을 막기 위한 key 생성 // 스팸을 막기 위한 key 생성
$oTrackbackModel = &getModel('trackback'); $oTrackbackModel = &getModel('trackback');
return $oTrackbackModel->getTrackbackUrl($this->document_srl); return $oTrackbackModel->getTrackbackUrl($this->document_srl);
@ -340,6 +353,8 @@
} }
function getTrackbacks() { function getTrackbacks() {
if(!$this->document_srl) return;
if(!$this->allowTrackback() || !$this->get('trackback_count')) return; if(!$this->allowTrackback() || !$this->get('trackback_count')) return;
$oTrackbackModel = &getModel('trackback'); $oTrackbackModel = &getModel('trackback');
@ -347,11 +362,14 @@
} }
function thumbnailExists($width = 80, $height = 0, $type = '') { function thumbnailExists($width = 80, $height = 0, $type = '') {
if(!$this->document_srl) return false;
if(!$this->getThumbnail($width, $height, $type)) return false; if(!$this->getThumbnail($width, $height, $type)) return false;
return true; return true;
} }
function getThumbnail($width = 80, $height = 0, $thumbnail_type = '') { function getThumbnail($width = 80, $height = 0, $thumbnail_type = '') {
if(!$this->document_srl) return;
if(!$height) $height = $width; if(!$height) $height = $width;
$thumbnail_type = ''; $thumbnail_type = '';
@ -436,6 +454,7 @@
* $time_interval 지정된 시간() 새글/최신 업데이트글의 판별 * $time_interval 지정된 시간() 새글/최신 업데이트글의 판별
**/ **/
function getExtraImages($time_interval = 43200) { function getExtraImages($time_interval = 43200) {
if(!$this->document_srl) return;
// 아이콘 목록을 담을 변수 미리 설정 // 아이콘 목록을 담을 변수 미리 설정
$buffs = array(); $buffs = array();
@ -481,6 +500,8 @@
* @brief getExtraImages로 구한 값을 이미지 태그를 씌워서 리턴 * @brief getExtraImages로 구한 값을 이미지 태그를 씌워서 리턴
**/ **/
function printExtraImages($time_check = 43200) { function printExtraImages($time_check = 43200) {
if(!$this->document_srl) return;
// 아이콘 디렉토리 구함 // 아이콘 디렉토리 구함
$path = sprintf('%s%s',getUrl(), 'modules/document/tpl/icons/'); $path = sprintf('%s%s',getUrl(), 'modules/document/tpl/icons/');
@ -495,11 +516,15 @@
} }
function hasUploadedFiles() { function hasUploadedFiles() {
if(!$this->document_srl) return;
if($this->isSecret() && !$this->isGranted()) return false; if($this->isSecret() && !$this->isGranted()) return false;
return $this->get('uploaded_count')? true : false; return $this->get('uploaded_count')? true : false;
} }
function getUploadedFiles() { function getUploadedFiles() {
if(!$this->document_srl) return;
if($this->isSecret() && !$this->isGranted()) return; if($this->isSecret() && !$this->isGranted()) return;
if(!$this->get('uploaded_count')) return; if(!$this->get('uploaded_count')) return;