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

#891

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

Legend:

Unmodified
Added
Removed
  • trunk/lib/model/blog.comment.php

    r5604 r5610  
    4949} 
    5050 
    51 function getCommentsWithPagingForOwner($blogid, $category, $name, $ip, $search, $page, $count) { 
     51function getCommentsWithPagingForOwner($blogid, $category, $name, $ip, $search, $page, $count, $isGuestbook = false) { 
    5252    global $database; 
    5353     
     
    6666    } else 
    6767        $sql .= ' AND e.category >= 0'; 
     68    if (!empty($name)) { 
     69        $sql .= ' AND c.name = \'' . POD::escapeString($name) . '\''; 
     70        $postfix .= '&name=' . rawurlencode($name); 
     71    } 
     72    if (!empty($ip)) { 
     73        $sql .= ' AND c.ip = \'' . POD::escapeString($ip) . '\''; 
     74        $postfix .= '&ip=' . rawurlencode($ip); 
     75    } 
     76    if (!empty($search)) { 
     77        $search = escapeSearchString($search); 
     78        $sql .= " AND (c.name LIKE '%$search%' OR c.homepage LIKE '%$search%' OR c.comment LIKE '%$search%')"; 
     79        $postfix .= '&search=' . rawurlencode($search); 
     80    } 
     81     
     82    $sql .= ' ORDER BY c.written DESC'; 
     83    list($comments, $paging) = fetchWithPaging($sql, $page, $count); 
     84    if (strlen($postfix) > 0) { 
     85        $postfix .= '&withSearch=on'; 
     86        $paging['postfix'] .= $postfix; 
     87    } 
     88 
     89    return array($comments, $paging); 
     90} 
     91 
     92function getGuestbookWithPagingForOwner($blogid, $name, $ip, $search, $page, $count) { 
     93    global $database; 
     94     
     95    $postfix = ''; 
     96     
     97    $sql = "SELECT c.*, c2.name parentName  
     98        FROM {$database['prefix']}Comments c  
     99        LEFT JOIN {$database['prefix']}Comments c2 ON c.parent = c2.id AND c.blogid = c2.blogid  
     100        WHERE c.blogid = $blogid AND c.entry = 0 AND c.isFiltered = 0"; 
    68101    if (!empty($name)) { 
    69102        $sql .= ' AND c.name = \'' . POD::escapeString($name) . '\'';