Skip to content

Commit

Permalink
refs #1249
Browse files Browse the repository at this point in the history
  * 트랙백 출력 부분 추가
  • Loading branch information
inureyes committed Nov 28, 2009
1 parent 417116a commit 40221e5
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 12 deletions.
2 changes: 1 addition & 1 deletion interface/i/comment/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<?php

} else { // All comments
?>
?>
<div id="comment_<?php echo time();?>" title="<?php echo _text('최근 댓글');?>" selected="false">
<?php
printIphoneRecentCommentView($page);
Expand Down
3 changes: 3 additions & 0 deletions interface/i/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
<li><a href="#categories" class="link"><?php echo _text('분류');?></a></li>
<li><a href="#archives" class="link"><?php echo _text('보관목록');?></a></li>
<li><a href="#tags" class="link"><?php echo _text('태그');?></a></li>
<li><a href="<?php echo $blogURL;?>/comment" class="link"><?php echo _text('최근 댓글');?></a></li>
<li><a href="<?php echo $blogURL;?>/trackback" class="link"><?php echo _text('최근 트랙백');?></a></li>
<li><a href="<?php echo $blogURL;?>/guestbook" class="link"><?php echo _text('방명록');?></a></li>
<li><a href="<?php echo $blogURL;?>/link" class="link"><?php echo _text('링크');?></a></li>
<?php
if (doesHaveOwnership()) {
Expand Down
36 changes: 28 additions & 8 deletions interface/i/trackback/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,36 @@
define('__TEXTCUBE_IPHONE__', true);
require ROOT . '/library/preprocessor.php';
requireView('iphoneView');
list($entries, $paging) = getEntryWithPaging($blogid, $suri['id']);
$entry = $entries ? $entries[0] : null;
if(isset($_GET['page'])) $page = $_GET['page'];
else $page = 1;

if(!empty($suri['id'])) {
list($entries, $paging) = getEntryWithPaging($blogid, $suri['id']);
$entry = $entries ? $entries[0] : null;
?>
<div id="trackback_<?php echo $entry['id']."_".time();?>" title="<?php echo _text('트랙백');?> : <?php echo $entry['title'];?>" selected="false">
<?php
printIphoneTrackbackView($entry['id']);
?>
<?php
printIphoneTrackbackView($entry['id']);
?>
<fieldset class="navi margin-top10">
<?php
printIphoneNavigation($entry, true, false);
?>
</fieldset>
</div>
<?php
} else {
?>
<div id="trackback_<?php echo "_".time();?>" title="<?php echo _text('최근 트랙백');?> : <?php echo $entry['title'];?>" selected="false">
<?php
printIphoneRecentTrackbackView($page);
?>
<fieldset class="navi margin-top10">
<?php
printIphoneNavigation($entry, true, false);
?>
<?php
printIphoneNavigation($entry, false, false, $paging, 'trackback');
?>
</fieldset>
</div>
<?php
}
?>
19 changes: 19 additions & 0 deletions library/model/blog.response.remote.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ function getRemoteResponsesWithPagingForOwner($blogid, $category, $site, $ip, $s
return array($responses, $paging);
}

function getRemoteResponsesWithPaging($blogid, $entryId, $page, $count, $url = null, $prefix = '?page=',$postfix = '', $countItem = null, $type = 'trackback') {
global $database;
if (!is_null($type)) $typeFilter = " AND t.type = '".POD::escapeString($type)."'";
else $typeFilter = '';
if($entryId != -1) $typeFilter .= " AND t.entry = ".$entryId;
$postfix = '';
$authorized = doesHaveOwnership() ? '' : getPrivateCategoryExclusionQuery($blogid);

$sql = "SELECT t.*, c.name AS categoryName
FROM {$database['prefix']}RemoteResponses t
LEFT JOIN {$database['prefix']}Entries e ON t.blogid = e.blogid AND t.entry = e.id AND e.draft = 0
LEFT JOIN {$database['prefix']}Categories c ON t.blogid = c.blogid AND e.category = c.id
WHERE t.blogid = $blogid AND t.isfiltered = 0 $authorized $typeFilter";
$sql .= ' ORDER BY t.written DESC';
list($responses, $paging) = Paging::fetchWithPaging($sql, $page, $count, $url, $prefix, $countItem);
$paging['postfix'] .= $postfix;
return array($responses, $paging);
}

function getRemoteResponseLogsWithPagingForOwner($blogid, $category, $site, $ip, $search, $page, $count, $type = null) {
global $database;
if (!is_null($type)) $typeFilter = " AND t.type = '".POD::escapeString($type)."'";
Expand Down
15 changes: 12 additions & 3 deletions library/view/iphoneView.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,19 @@ function printIphoneNavigation($entry, $jumpToComment = true, $jumpToTrackback =
<?php
}

function printIphoneTrackbackView($entryId) {
$trackbacks = getTrackbacks($entryId);
function printIphoneTrackbackView($entryId, $page, $mode = null) {
global $paging, $blogid;
if($mode == 'recent') {
list($trackbacks,$paging) = getRemoteResponsesWithPaging($blogid, -1, $page, 10, null, '?page=');
} else {
$trackbacks = getTrackbacks($entryId);
}
if (count($trackbacks) == 0) {
?>
<p>&nbsp;<?php echo _text('트랙백이 없습니다');?></p>
<?php
} else {
foreach (getTrackbacks($entryId) as $trackback) {
foreach ($trackbacks as $trackback) {
?>
<ul id="trackback_<?php echo $commentItem['id'];?>" class="trackback">
<li class="group">
Expand Down Expand Up @@ -492,6 +497,10 @@ function printIphoneRecentCommentView($page) {
return printIphoneCommentView(1, $page, 'recent');
}

function printIphoneRecentTrackbackView($page) {
return printIphoneTrackbackView(1, $page, 'recent');
}

function printIphoneCommentFormView($entryId, $title, $actionURL) {
global $blogURL;
?>
Expand Down

0 comments on commit 40221e5

Please # to comment.