mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
플래닛, WAP class 추가, 리스트형에서 간단한 글 담을 수 있게 수정, + 간단한 코드 정리
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6399 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
1a4366aff8
commit
19e9580eb6
4 changed files with 111 additions and 1 deletions
|
|
@ -36,6 +36,7 @@
|
|||
foreach($this->getChilds() as $key => $val) {
|
||||
if(!$val['link']) continue;
|
||||
printf('<a href="%s" accesskey="%s">%s</a><br>%s', $val['href'], $this->getNo(), $val['text'], "\n");
|
||||
if($val['extra']) printf("<br>%s\n",str_replace('<br/>','<br>',$val['extra']));
|
||||
}
|
||||
} else {
|
||||
print(str_replace('<br/>','<br>',$this->getContent())."\n");
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
foreach($this->getChilds() as $key => $val) {
|
||||
if(!$val['link']) continue;
|
||||
printf('<do type="%s" label="%s"><go href="%s" /></do>%s', $this->getNo(), htmlspecialchars($val['text']), $val['href'], "\n");
|
||||
if($val['extra']) printf("%s\n",$val['extra']);
|
||||
}
|
||||
} else {
|
||||
printf('%s<br/>%s', str_replace("<br>","<br/>",$this->getContent()),"\n");
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@
|
|||
if($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']';
|
||||
$obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title;
|
||||
$childs[] = $obj;
|
||||
}
|
||||
}
|
||||
$oMobile->setChilds($childs);
|
||||
}
|
||||
|
||||
|
|
|
|||
108
modules/planet/planet.wap.php
Normal file
108
modules/planet/planet.wap.php
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
<?php
|
||||
/**
|
||||
* @class planetWAP
|
||||
* @author misol (misol@korea.ac.kr)
|
||||
* @brief planet 모듈의 WAP class
|
||||
* WML, mHTML 등 모바일 페이지 생성을 담당(스마트폰 제외^^)
|
||||
**/
|
||||
|
||||
class planetWAP extends planet {
|
||||
function procWAP(&$oMobile) {
|
||||
$content = '';
|
||||
|
||||
// 플래닛의 기본 단위인 날짜를 미리 계산 모듈에 있는 동작인데... 애드온이 모듈보다 일찍 실행된다;
|
||||
$last_date = $this->planet->getContentLastDay();
|
||||
$date = Context::get('date');
|
||||
if(!$date || $date > $last_date) $date = $last_date;
|
||||
Context::set('date', $date);
|
||||
Context::set('prev_date', $this->planet->getPrevDate($date));
|
||||
Context::set('next_date', $this->planet->getNextDate($date));
|
||||
|
||||
$type = Context::get('type');
|
||||
if(!$type) $type = 'all';
|
||||
Context::set('type',$type);
|
||||
$tagtab = null;
|
||||
|
||||
switch($type) {
|
||||
case 'wantyou':
|
||||
$sort_index = 'documents.voted_count';
|
||||
$order = 'desc';
|
||||
break;
|
||||
case 'best':
|
||||
$sort_index = 'documents.comment_count';
|
||||
$order = 'desc';
|
||||
break;
|
||||
|
||||
case 'all':
|
||||
$sort_index = 'documents.list_order';
|
||||
$order = 'asc';
|
||||
break;
|
||||
}
|
||||
|
||||
$page = Context::get('page');
|
||||
$oPlanetModel = &getModel('planet');
|
||||
|
||||
$output = $oPlanetModel->getNewestContentList(null, $date, $page, 9, $sort_index, $order,$tagtab );
|
||||
|
||||
$title = Context::getBrowserTitle().' ['.zdate($date,'Y').Context::getLang('unit_year').
|
||||
zdate($date,'m').Context::getLang('unit_month').
|
||||
zdate($date,'d').Context::getLang('unit_day').']';
|
||||
|
||||
// 댓글 보기 일 경우
|
||||
if($this->act == 'dispPlanetContentCommentList') {
|
||||
$page = Context::get('page');
|
||||
$document_srl = Context::get('document_srl');
|
||||
$oPlanetModel = &getModel('planet');
|
||||
$output = $oPlanetModel->getReplyList($document_srl,$page);
|
||||
$reply_list = $output->data;
|
||||
|
||||
$title .= ' - '.Context::getLang('comment');
|
||||
if(is_array($reply_list)) {
|
||||
foreach($reply_list as $key => $reply) {
|
||||
$content .= '[<strong>'.$reply->nick_name.'</strong>] ';
|
||||
$content .= $reply->content;
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 페이지를 목록으로 돌아가기로 지정
|
||||
$oMobile->setUpperUrl( getUrl('act',''), Context::getLang('cmd_go_upper') );
|
||||
|
||||
} else {
|
||||
if($output->page_navigation->total_page>1) {
|
||||
if($output->page_navigation->cur_page < $output->page_navigation->last_page) {
|
||||
// next/prevUrl 지정
|
||||
$oMobile->setPrevUrl(getUrl('page',$output->page_navigation->cur_page+1), sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $output->page_navigation->cur_page+1, $output->page_navigation->total_page));
|
||||
}
|
||||
if($output->page_navigation->cur_page > 1) $oMobile->setNextUrl(getUrl('page',$output->page_navigation->cur_page-1), sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $output->page_navigation->cur_page-1, $output->page_navigation->total_page));
|
||||
}
|
||||
|
||||
if(!$output->data || !count($output->data)) $content .= Context::getLang('no_documents');
|
||||
|
||||
|
||||
foreach($output->data as $no => $item) {
|
||||
$obj = null;
|
||||
$obj['href'] = getUrl('mid',$_GET['mid'],'document_srl',$item->get('document_srl'), 'act', 'dispPlanetContentCommentList');
|
||||
$obj['link'] = $item->get('document_srl').'['.htmlspecialchars($item->getNickName()).'] '."\n";
|
||||
$obj['link'] .= htmlspecialchars(strip_tags($item->getContent()));
|
||||
if($item->getPostScript()) $obj['extra'] = Context::getLang('planet_postscript').htmlspecialchars($item->getPostScript());
|
||||
if(is_array($item->getArrTags())) {
|
||||
$obj['extra'] .= '<br />TAG:';
|
||||
$obj['extra'] .= implode(', ',$item->getArrTags());
|
||||
}
|
||||
$obj['link'] = $obj['text'] = $obj['link'];
|
||||
$childs[] = $obj;
|
||||
}
|
||||
$oMobile->setChilds($childs);
|
||||
|
||||
|
||||
$prev_date = Context::get('prev_date');
|
||||
if($prev_date) $oMobile->setEtcBtn(getUrl('date',$prev_date, 'document_srl',''), '<');
|
||||
$next_date = Context::get('next_date');
|
||||
if($next_date) $oMobile->setEtcBtn(getUrl('date',$next_date, 'document_srl',''), '>');
|
||||
}
|
||||
$oMobile->setTitle($title);
|
||||
$oMobile->setContent($content);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue