Show
Ignore:
Timestamp:
03/20/08 22:33:32 (10 months ago)
Author:
inureyes
Message:

#891

  • 방명록 리스팅 추가
  • 관련 메세지 추가
  • 댓글/방명록/댓글알리미/받은 트랙백/보낸 트랙백 인터페이스 통합
  • 새 컴 기념
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/interface/owner/entry/comment/index.php

    r5588 r5610  
    1212if (isset($_GET['search'])) $_POST['search'] = $_GET['search']; 
    1313if (isset($_GET['withSearch'])) $_POST['withSearch'] = $_GET['withSearch']; 
     14if (isset($_GET['status'])) $_POST['status'] = $_GET['status']; 
    1415 
    1516$IV = array( 
     
    2526        'perPage' => array('int', 1, 'mandatory' => false), 
    2627        'search' => array('string', 'default' => ''), 
    27         'withSearch' => array(array('on'), 'mandatory' => false) 
     28        'withSearch' => array(array('on'), 'mandatory' => false), 
     29        'status' => array('string', 'mandatory' => false) 
    2830    ) 
    2931);   
     
    4446    setBlogSetting('rowsPerPage', $_POST['perPage']); 
    4547} 
    46 list($comments, $paging) = getCommentsWithPagingForOwner($blogid, $categoryId, $name, $ip, $search, $suri['page'], $perPage); 
     48 
     49$tabsClass = array(); 
     50if (isset($_POST['status'])) { 
     51    if($_POST['status']=='comment') { 
     52        $tabsClass['comment'] = true; 
     53        $visibilityText = _t('댓글'); 
     54    } else if($_POST['status']=='guestbook') { 
     55        $tabsClass['guestbook'] = true; 
     56        $visibilityText = _t('방명록'); 
     57    } 
     58} else { 
     59    $tabsClass['comment'] = true; 
     60    $visibilityText = _t('댓글'); 
     61} 
     62if($tabsClass['comment'] == true) { 
     63    list($comments, $paging) = getCommentsWithPagingForOwner($blogid, $categoryId, $name, $ip, $search, $suri['page'], $perPage); 
     64} else { 
     65    list($comments, $paging) = getGuestbookWithPagingForOwner($blogid, $name, $ip, $search, $suri['page'], $perPage); 
     66} 
    4767require ROOT . '/lib/piece/owner/header.php'; 
    4868require ROOT . '/lib/piece/owner/contentMenu.php'; 
     
    162182                        <div id="part-post-comment" class="part"> 
    163183                            <h2 class="caption"> 
    164                                 <span class="main-text"><?php echo _t('등록된 댓글 목록입니다');?></span> 
     184                                <span class="main-text"><?php echo (isset($tabsClass['guestbook']) ? _t('등록된 방명록 목록입니다') : _t('등록된 댓글 목록입니다'));?></span> 
    165185<?php 
    166186if (strlen($name) > 0 || strlen($ip) > 0) { 
     
    179199?> 
    180200                            </h2> 
    181                              
     201                            <ul id="communication-tabs-box" class="tabs-box"> 
     202                                <!-- TODO : $tab['postfix'] 버그 --> 
     203                                <li<?php echo isset($tabsClass['comment']) ? ' class="selected"' : NULL;?>><a href="<?php echo $blogURL;?>/owner/entry/comment?page=1<?php echo $tab['postfix'];?>&amp;status=comment"><?php echo _t('댓글');?></a></li> 
     204                                <li<?php echo isset($tabsClass['guestbook']) ? ' class="selected"' : NULL;?>><a href="<?php echo $blogURL;?>/owner/entry/comment?page=1<?php echo $tab['postfix'];?>&amp;status=guestbook"><?php echo _t('방명록');?></a></li> 
     205                                <li<?php echo isset($tabsClass['notify']) ? ' class="selected"' : NULL;?>><a href="<?php echo $blogURL;?>/owner/entry/notify"><?php echo _t('댓글 알리미');?></a></li> 
     206                                <li<?php echo isset($tabsClass['received']) ? ' class="selected"' : NULL;?>><a href="<?php echo $blogURL;?>/owner/entry/trackback?page=1<?php echo $tab['postfix'];?>&amp;status=received"><?php echo _t('걸린 글');?></a></li> 
     207                                <li<?php echo isset($tabsClass['sent']) ? ' class="selected"' : NULL;?>><a href="<?php echo $blogURL;?>/owner/entry/trackback?page=1<?php echo $tab['postfix'];?>&amp;status=sent"><?php echo _t('건 글');?></a></li> 
     208                            </ul> 
     209<?php 
     210    if(isset($tabsClass['comment'])) { 
     211?> 
    182212                            <form id="category-form" class="category-box" method="post" action="<?php echo $blogURL;?>/owner/entry/comment"> 
    183213                                <div class="section"> 
     
    201231                                </div> 
    202232                            </form> 
    203                              
     233<?php 
     234    } 
     235?> 
    204236                            <form id="list-form" method="post" action="<?php echo $blogURL;?>/owner/entry/comment"> 
    205237<?php 
     
    272304    } 
    273305?> 
    274                                                 <a href="?name=<?php echo urlencode(escapeJSInAttribute($comment['name']));?>" title="<?php echo _t('이 이름으로 등록된 댓글 목록을 보여줍니다.');?>"><?php echo htmlspecialchars($comment['name']);?></a> 
     306                                                <a href="?name=<?php echo urlencode(escapeJSInAttribute($comment['name'])).'&status='.(isset($tabsClass['guestbook']) ? 'guestbook' : 'comment');?>" title="<?php echo (isset($tabsClass['guestbook']) ? _t('이 이름으로 등록된 방명록을 보여줍니다.') : _t('이 이름으로 등록된 댓글 목록을 보여줍니다.'));?>"><?php echo htmlspecialchars($comment['name']);?></a> 
    275307                                            </td> 
    276308                                            <td class="content"> 
    277309<?php 
    278     echo '<a class="entryURL" href="'.$blogURL.'/'.$comment['entry'].'#comment'.$comment['id'].'" title="'._t('댓글이 작성된 포스트로 직접 이동합니다.').'">'; 
     310    if(isset($tabsClass['guestbook'])) { 
     311        echo '<a class="entryURL" href="'.$blogURL.'/guestbook/'.$comment['id'].'#guestbook'.$comment['id'].'" title="'._t('방명록으로 직접 이동합니다.').'">'; 
     312    } else { 
     313        echo '<a class="entryURL" href="'.$blogURL.'/'.$comment['entry'].'#comment'.$comment['id'].'" title="'._t('댓글이 작성된 포스트로 직접 이동합니다.').'">'; 
     314    } 
    279315    echo '<span class="entry-title">'. htmlspecialchars($comment['title']) .'</span>'; 
    280316     
     
    283319    } 
    284320     
    285     echo empty($comment['parent']) ? '' : '<span class="explain">' . _f('%1 님의 댓글에 대한 댓글',$comment['parentName']) . '</span>'; 
     321    echo empty($comment['parent']) ? '' : '<span class="explain">' . (isset($tabsClass['guestbook']) ? _f('%1 님의 방명록에 대한 댓글',$comment['parentName']) : _f('%1 님의 댓글에 대한 댓글',$comment['parentName'])) . '</span>'; 
    286322    echo "</a>"; 
    287323?> 
     
    289325                                                <?php echo htmlspecialchars($comment['comment']);?> 
    290326<?php 
    291     if(empty($comment['parent'])) echo '<span class="reply"><a href="#" onclick="commentComment('.$comment['id'].');return false;">'._t('이 댓글에 댓글을 씁니다.').'</a></span>'; 
     327    if(empty($comment['parent'])) echo '<span class="reply"><a href="#" onclick="commentComment('.$comment['id'].');return false;">'.(isset($tabsClass['guestbook']) ? _t('이 방명록에 답글을 씁니다') : _t('이 댓글에 댓글을 씁니다.')).'</a></span>'; 
    292328?> 
    293329                                            </td>