Changeset 4669

Show
Ignore:
Timestamp:
11/11/07 22:34:27 (13 months ago)
Author:
coolengineer
Message:
Location:
trunk
Files:
3 added
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/blog/checkup/index.php

    r4660 r4669  
    945945} 
    946946 
     947if (!DBQuery::queryExistence("DESC {$database['prefix']}Links visible")) { 
     948    $changed = true; 
     949    echo '<li>', _text('Links 테이블에 보이기 여부 필드와 XFN 마이크로포맷을 위한 필드 추가합니다.'), ': '; 
     950    if (DBQuery::execute("ALTER TABLE {$database['prefix']}Links ADD visible int(1) NOT NULL DEFAULT 1") && 
     951       DBQuery::execute("ALTER TABLE {$database['prefix']}Links ADD xfn varchar(128) NOT NULL DEFAULT ''")) 
     952        echo '<span style="color:#33CC33;">', _text('성공'), '</span></li>'; 
     953    else 
     954        echo '<span style="color:#FF0066;">', _text('실패'), '</span></li>'; 
     955} 
     956 
    947957?> 
    948958</ul> 
  • trunk/blog/owner/link/index.php

    r3649 r4669  
    3434                                    request.send(); 
    3535                                } 
     36                                function toggleVisibility(id) { 
     37                                    var request = new HTTPRequest("GET", "<?php echo $blogURL;?>/owner/link/visible/" + id); 
     38                                    request.onSuccess = function () { 
     39                                        PM.removeRequest(this); 
     40                                        PM.showMessage("<?php echo _t('변경되었습니다.');?>", "center", "bottom"); 
     41                                        var node = document.getElementById("link-visible-" + id ); 
     42                                        var visible = parseInt(this.getText("/response/visible")); 
     43                                        node.className = ( visible ? "visible-link" : "invisible-link" ) + ' visible-button button'; 
     44                                    } 
     45                                    request.onError= function () { 
     46                                        PM.removeRequest(this); 
     47                                        switch(parseInt(this.getText("/response/error"))) 
     48                                        { 
     49                                            default: 
     50                                                alert("<?php echo _t('알 수 없는 에러가 발생했습니다.');?>"); 
     51                                        } 
     52                                    } 
     53                                    request.send(); 
     54                                } 
    3655                            //]]> 
    3756                        </script> 
     
    4564                                        <th class="homepage"><span class="text"><?php echo _t('홈페이지 이름');?></span></th> 
    4665                                        <th class="address"><span class="text"><?php echo _t('사이트 주소');?></span></th> 
     66                                        <th class="edit"><span class="text"><?php echo _t('보기');?></span></th> 
    4767                                        <th class="edit"><span class="text"><?php echo _t('수정');?></span></th> 
    4868                                        <th class="delete"><span class="text"><?php echo _t('삭제');?></span></th> 
     
    5373for ($i=0; $i<sizeof($links); $i++) { 
    5474    $link = $links[$i]; 
     75    $visible_class = ( $link['visible'] ? "visible-link" : "invisible-link" ) . " visible-button"; 
     76    $visible_class .= ' button'; 
    5577     
    5678    $className = ($i % 2) == 1 ? 'even-line' : 'odd-line'; 
     
    6082                                        <td class="homepage"><a href="<?php echo $blogURL;?>/owner/link/edit/<?php echo $link['id'];?>" title="<?php echo _t('이 링크 정보를 수정합니다.');?>"><?php echo htmlspecialchars($link['name']);?></a></td> 
    6183                                        <td class="address"><a href="<?php echo htmlspecialchars($link['url']);?>" onclick="window.open(this.href); return false;" title="<?php echo _t('이 링크에 연결합니다.');?>"><?php echo htmlspecialchars($link['url']);?></a></td> 
     84                                        <td class="edit"><a id="link-visible-<?php echo $link['id']?>" class="<?php echo $visible_class ?>" href="<?php echo $blogURL;?>/owner/link/visible/<?php echo $link['id'];?>" onclick="toggleVisibility(<?php echo $link['id'];?>); return false;" title="<?php echo _t('방문자에게 보일지 여부를 선택합니다.');?>"><span><?php echo _t('보기');?></span></a></td> 
    6285                                        <td class="edit"><a class="edit-button button" href="<?php echo $blogURL;?>/owner/link/edit/<?php echo $link['id'];?>" title="<?php echo _t('링크 정보를 수정합니다.');?>"><span><?php echo _t('수정');?></span></a></td> 
    6386                                        <td class="delete"><a class="delete-button button" href="<?php echo $blogURL;?>/owner/link/delete/<?php echo $link['id'];?>" onclick="deleteLink(<?php echo $link['id'];?>); return false;" title="<?php echo _t('링크 정보를 삭제합니다.');?>"><span class="text"><?php echo _t('삭제');?></span></a></td> 
  • trunk/lib/model/blog.link.php

    r4563 r4669  
    2323    $result = DBQuery::query("delete from {$database['prefix']}Links where blogid = $blogid and id = $id"); 
    2424    return ($result && (mysql_affected_rows() == 1)) ? true : false; 
     25} 
     26 
     27function toggleVisibility($blogid, $id) { 
     28    global $database; 
     29    if (DBQuery::queryCell("SELECT visible FROM {$database['prefix']}Links WHERE blogid = $blogid AND id = $id") == 1) { 
     30        $visible = 0; 
     31    } else { 
     32        $visible = 1; 
     33    } 
     34    $result = DBQuery::query("update {$database['prefix']}Links set visible = $visible where blogid = $blogid and id = $id"); 
     35    return array( ($result && (mysql_affected_rows() == 1)) ? true : false, $visible ); 
    2536} 
    2637 
     
    6172                    blogid = $blogid and id = {$link['id']}"); 
    6273} 
     74 
     75function updateXfn($blogid, $links) { 
     76    global $database; 
     77    $ids = Array(); 
     78    foreach( $links as $k => $v ) { 
     79        if( substr($k,0,3) == 'xfn' ) { 
     80            $id = substr( $k, 3 ); 
     81            $xfn = tc_escape_string($v); 
     82            DBQuery::execute("update {$database['prefix']}Links 
     83                set 
     84                    xfn = '$xfn', 
     85                    written = UNIX_TIMESTAMP() 
     86                where 
     87                    blogid = $blogid and id = $id"); 
     88        } 
     89    } 
     90} 
    6391?> 
  • trunk/lib/piece/blog/end.php

    r4555 r4669  
    7070dress('rctrp_rep', getRecentCommentsView(getRecentComments($blogid), $skin->recentComments), $view); 
    7171dress('rcttb_rep', getRecentTrackbacksView(getRecentTrackbacks($blogid), $skin->recentTrackback), $view); 
    72 dress('link_rep', getLinksView(getLinks($blogid), $skin->s_link_rep), $view); 
     72$links = getLinks( $blogid ); 
     73dress('link_rep', getLinksView($links, $skin->s_link_rep), $view); 
    7374dress('rss_url', "$blogURL/rss", $view); 
    7475dress('owner_url', "$blogURL/owner", $view); 
     
    109110} 
    110111$view = revertTempTags(removeAllTags($view)); 
     112 
     113$links = getLinks( $blogid ); 
     114foreach ($links as $link) { 
     115    if( !$link['visible'] || !$link['xfn'] ) { 
     116        continue; 
     117    } 
     118    addXfnAttrs( $link['url'], $link['xfn'], $view ); 
     119} 
     120 
    111121print $view; 
    112122 
  • trunk/lib/piece/owner/contentMenu.php

    r4596 r4669  
    3737            $blogContentMenuItem = array( 
    3838                array('menu'=>'add','title'=>_t('링크 추가'),'link'=>'/owner/link/add'), 
    39                 array('menu'=>'link','title'=>_t('링크 목록'),'link'=>'/owner/link') 
     39                array('menu'=>'link','title'=>_t('링크 목록'),'link'=>'/owner/link'), 
     40                array('menu'=>'xfn','title'=>_t('친구 링크 관리'),'link'=>'/owner/link/xfn') 
    4041            ); 
    4142        } 
  • trunk/lib/view/view.php

    r4651 r4669  
    912912} 
    913913 
     914function addXfnAttrs( $url, $xfn, & $view ) 
     915{ 
     916    $view = str_replace( "href=\"$url\"", "href=\"$url\" rel=\"$xfn\"", $view); 
     917    $view = str_replace( "href='$url'", "href='$url' rel=\"$xfn\"", $view); 
     918} 
     919 
    914920function getLinksView($links, $template) { 
    915921    global $blogURL, $skinSetting; 
    916922    ob_start(); 
    917923    foreach ($links as $link) { 
     924        if( !$link['visible'] ) { 
     925            continue; 
     926        } 
    918927        $view = "$template"; 
    919928        dress('link_url', htmlspecialchars($link['url']), $view); 
  • trunk/style/admin/default/link.css

    r2461 r4669  
    2222#part-link-list table.data-inbox tbody tr .address, 
    2323#part-link-list table.data-inbox tbody tr .edit, 
    24 #part-link-list table.data-inbox tbody tr .delete 
     24#part-link-list table.data-inbox tbody tr .delete, 
     25#part-link-list table.data-inbox tbody tr .xfn-edit 
    2526{ 
    2627    border-left                      : 1px solid #E3E3DE; 
     
    5960{ 
    6061    display                          : none; 
     62} 
     63 
     64#part-link-list table.data-inbox thead.xfn tr th.xfn-homepage 
     65{ 
     66    padding-left                     : 20px; 
     67    text-align                       : left; 
     68    width                            : 80px; 
     69} 
     70 
     71#part-link-list table.data-inbox thead.xfn tr th 
     72{ 
     73    padding-left                     : 5px; 
     74    text-align                       : center; 
     75} 
     76 
     77#part-link-list table.data-inbox thead.xfn tr th.xfn-me 
     78{ 
     79    width                            : 50px; 
     80} 
     81 
     82#part-link-list table.data-inbox thead.xfn tr th.xfn-friend 
     83{ 
     84    width                            : 80px; 
     85} 
     86 
     87#part-link-list table.data-inbox thead.xfn tr th.xfn-met, 
     88#part-link-list table.data-inbox thead.xfn tr th.xfn-professional 
     89{ 
     90    width                            : 50px; 
     91} 
     92 
     93#part-link-list table.data-inbox thead.xfn tr th.xfn-coresident, 
     94#part-link-list table.data-inbox thead.xfn tr th.xfn-family, 
     95#part-link-list table.data-inbox thead.xfn tr th.xfn-romantic 
     96{ 
     97    width                            : 100px; 
    6198} 
    6299 
     
    90127} 
    91128 
    92 #part-link-list table.data-inbox tbody tr td.edit .edit-button span 
     129#part-link-list table.data-inbox tbody tr td.edit .edit-button span, 
     130#part-link-list table.data-inbox tbody tr td.edit .visible-button span 
    93131{ 
    94132    display                          : none; 
     133} 
     134 
     135#part-link-list table.data-inbox tbody tr td.edit .visible-button 
     136{ 
     137    background-color                 : transparent; 
     138    display                          : block; 
     139    height                           : 15px; 
     140    margin                           : 0 auto; 
     141    padding                          : 0; 
     142    width                            : 15px; 
     143} 
     144 
     145#part-link-list table.data-inbox tbody tr td.edit .invisible-link 
     146{ 
     147    background-image                 : url("./image/icon_public.gif"); 
     148    background-position              : left top; 
     149} 
     150 
     151#part-link-list table.data-inbox tbody tr td.edit .visible-link 
     152{ 
     153    background-image                 : url("./image/icon_public.gif"); 
     154    background-position              : left bottom; 
     155} 
     156 
     157#part-link-list table.data-inbox tbody tr td.xfn-homepage 
     158{ 
     159    background-position              : right bottom; 
     160    padding-left                     : 25px; 
     161    text-align                       : left; 
     162} 
     163 
     164#part-link-list table.data-inbox tbody tr td.xfn-edit 
     165{ 
     166    background-position              : right bottom; 
     167    padding-left                     : 15px; 
     168    text-align                       : left; 
     169} 
     170 
     171#part-link-list table.data-inbox tbody tr td.xfn-edit label 
     172{ 
     173    display                          : block; 
     174    width                            : 8.5em; 
    95175} 
    96176 
     
    134214} 
    135215 
     216#part-link-list .button-box, 
    136217#part-link-add .button-box, 
    137218#part-link-edit .button-box 
     
    147228} 
    148229 
     230#part-link-list .button-box .input-button, 
    149231#part-link-add .button-box .input-button, 
    150232#part-link-edit .button-box .input-button 
     
    159241    vertical-align                   : middle; 
    160242} 
     243 
     244/* Xfn *******************************************************************************************/ 
     245 
     246#part-link-list .button-box 
     247{ 
     248    margin-top                    : -50px; 
     249} 
     250 
     251#part-link-list .button-box 
     252{ 
     253    margin                           : 0 auto 50px auto; 
     254}