Changeset 3321

Show
Ignore:
Timestamp:
05/24/07 16:21:52 (18 months ago)
Author:
inureyes
Message:

#413

  • 페이징 출력하도록 함.
  • 관련한 쿼리들이 비만이라서 다이어트좀 시켰음.

#408

  • 목록에서의 팀블로그 유저 이름을 list_rep_name 으로 변경.
  • 관련하여 수정 예제 올릴 예정.
Location:
sandbox
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • sandbox/blog/search/index.php

    r3106 r3321  
    1717    if ($suri['page'] === true || $suri['page'] === '1') 
    1818        $commentList = getCommentList($owner, $search); 
     19    $paging = $listWithPaging[1]; 
    1920} 
    2021 
  • sandbox/lib/model/blog.entry.php

    r3300 r3321  
    100100    $tag = mysql_tt_escape_string($tag); 
    101101    $visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 0 AND (c.visibility > 1 OR e.category = 0)'; 
    102     $sql = "SELECT e.*  
     102    $sql = "SELECT e.owner, e.id, e.title, e.comments, e.slogan, e.published 
    103103        FROM {$database['prefix']}Entries e  
    104104        LEFT JOIN {$database['prefix']}TagRelations t ON e.id = t.entry AND e.owner = t.owner  
     
    113113    $cond = "AND e.published >= " . getTimeFromPeriod($period) . " AND e.published < " . getTimeFromPeriod(addPeriod($period)); 
    114114    $visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 0 AND (c.visibility > 1 OR e.category = 0)'; 
    115     $sql = "SELECT e.*  
     115    $sql = "SELECT e.owner, e.id, e.title, e.comments, e.slogan, e.published 
    116116        FROM {$database['prefix']}Entries e 
    117117        LEFT JOIN {$database['prefix']}Categories c ON e.category = c.id AND e.owner = c.owner  
     
    126126    $cond = empty($search) ? '' : "AND (title LIKE '%$search%' OR content LIKE '%$search%')"; 
    127127    $visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 1 AND (c.visibility > 1 OR e.category = 0)'; 
    128     $sql = "SELECT e.*  
     128    $sql = "SELECT e.owner, e.id, e.title, e.comments, e.slogan, e.published 
    129129        FROM {$database['prefix']}Entries e 
    130130        LEFT JOIN {$database['prefix']}Categories c ON e.category = c.id AND e.owner = c.owner  
     
    182182} 
    183183 
    184 function getEntriesWithPagingByNotice($owner, $page, $count) { 
     184function getEntriesWithPagingByNotice($owner, $page, $count, $countItem = null) { 
    185185    global $database, $folderURL, $suri; 
    186186    $visibility = doesHaveOwnership() ? '' : 'AND visibility = 2'; 
    187     $sql = "SELECT *, '" . _text('공지') . "' categoryLabel FROM {$database['prefix']}Entries WHERE owner = $owner $visibility AND category = -2 ORDER BY published DESC"; 
    188     return fetchWithPaging($sql, $page, $count, "$folderURL/{$suri['value']}"); 
     187    $sql = "SELECT *  
     188        FROM {$database['prefix']}Entries  
     189        WHERE owner = $owner $visibility AND category = -2  
     190        ORDER BY published DESC"; 
     191    return fetchWithPaging($sql, $page, $count, "$folderURL/{$suri['value']}","?page=", $countItem); 
    189192} 
    190193 
  • sandbox/lib/piece/blog/end.php

    r3294 r3321  
    5656dress('textcube_name', TEXTCUBE_NAME, $view); 
    5757dress('textcube_version', TEXTCUBE_VERSION, $view); 
     58dress('tattertools_name', TEXTCUBE_NAME, $view); 
     59dress('tattertools_version', TEXTCUBE_VERSION, $view); 
    5860if (isset($paging)) 
    5961    dress('paging', getPagingView($paging, $skin->paging, $skin->pagingItem), $view); 
  • sandbox/lib/piece/blog/list.php

    r3300 r3321  
    1010        $teamblog_name = DBQuery::queryCell("SELECT b.name  
    1111            FROM {$database['prefix']}TeamEntryRelations a, {$database['prefix']}Users b   
    12             WHERE a.Owner=".$item['owner']." AND a.Id=".$item['id']." AND a.Team=b.userid"); 
     12            WHERE a.owner=".$item['owner']." AND a.id=".$item['id']." AND a.team=b.userid"); 
    1313        $itemsView .= str_replace( 
    1414            array( 
    1515                '[##_list_rep_regdate_##]', 
     16                '[##_list_rep_name_##]', 
    1617                '[##_list_rep_link_##]', 
    1718                '[##_list_rep_title_##]', 
     
    2021            array( 
    2122                fireEvent('ViewListDate', Timestamp::format3($item['published'])), 
     23                fireEvent('ViewListName', htmlspecialchars($teamblog_name)), 
    2224                "$blogURL/" . ($blog['useSlogan'] ? 'entry/' . encodeURL($item['slogan']) : $item['id']), 
    23                 htmlspecialchars('['.$teamblog_name.'] '. fireEvent('ViewListTitle', $item['title'])), 
     25                fireEvent('ViewListTitle', $item['title']), 
    2426                ($item['comments'] > 0) ? "({$item['comments']})" : '' 
    2527            ),