Changeset 4669
- Timestamp:
- 11/11/07 22:34:27 (13 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 7 modified
-
blog/checkup/index.php (modified) (1 diff)
-
blog/owner/link/index.php (modified) (4 diffs)
-
blog/owner/link/visible (added)
-
blog/owner/link/visible/item.php (added)
-
lib/model/blog.link.php (modified) (2 diffs)
-
lib/piece/blog/end.php (modified) (2 diffs)
-
lib/piece/owner/contentMenu.php (modified) (1 diff)
-
lib/view/view.php (modified) (1 diff)
-
script/xfn.js (added)
-
style/admin/default/link.css (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/blog/checkup/index.php
r4660 r4669 945 945 } 946 946 947 if (!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 947 957 ?> 948 958 </ul> -
trunk/blog/owner/link/index.php
r3649 r4669 34 34 request.send(); 35 35 } 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 } 36 55 //]]> 37 56 </script> … … 45 64 <th class="homepage"><span class="text"><?php echo _t('홈페이지 이름');?></span></th> 46 65 <th class="address"><span class="text"><?php echo _t('사이트 주소');?></span></th> 66 <th class="edit"><span class="text"><?php echo _t('보기');?></span></th> 47 67 <th class="edit"><span class="text"><?php echo _t('수정');?></span></th> 48 68 <th class="delete"><span class="text"><?php echo _t('삭제');?></span></th> … … 53 73 for ($i=0; $i<sizeof($links); $i++) { 54 74 $link = $links[$i]; 75 $visible_class = ( $link['visible'] ? "visible-link" : "invisible-link" ) . " visible-button"; 76 $visible_class .= ' button'; 55 77 56 78 $className = ($i % 2) == 1 ? 'even-line' : 'odd-line'; … … 60 82 <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> 61 83 <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> 62 85 <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> 63 86 <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 23 23 $result = DBQuery::query("delete from {$database['prefix']}Links where blogid = $blogid and id = $id"); 24 24 return ($result && (mysql_affected_rows() == 1)) ? true : false; 25 } 26 27 function 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 ); 25 36 } 26 37 … … 61 72 blogid = $blogid and id = {$link['id']}"); 62 73 } 74 75 function 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 } 63 91 ?> -
trunk/lib/piece/blog/end.php
r4555 r4669 70 70 dress('rctrp_rep', getRecentCommentsView(getRecentComments($blogid), $skin->recentComments), $view); 71 71 dress('rcttb_rep', getRecentTrackbacksView(getRecentTrackbacks($blogid), $skin->recentTrackback), $view); 72 dress('link_rep', getLinksView(getLinks($blogid), $skin->s_link_rep), $view); 72 $links = getLinks( $blogid ); 73 dress('link_rep', getLinksView($links, $skin->s_link_rep), $view); 73 74 dress('rss_url', "$blogURL/rss", $view); 74 75 dress('owner_url', "$blogURL/owner", $view); … … 109 110 } 110 111 $view = revertTempTags(removeAllTags($view)); 112 113 $links = getLinks( $blogid ); 114 foreach ($links as $link) { 115 if( !$link['visible'] || !$link['xfn'] ) { 116 continue; 117 } 118 addXfnAttrs( $link['url'], $link['xfn'], $view ); 119 } 120 111 121 print $view; 112 122 -
trunk/lib/piece/owner/contentMenu.php
r4596 r4669 37 37 $blogContentMenuItem = array( 38 38 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') 40 41 ); 41 42 } -
trunk/lib/view/view.php
r4651 r4669 912 912 } 913 913 914 function 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 914 920 function getLinksView($links, $template) { 915 921 global $blogURL, $skinSetting; 916 922 ob_start(); 917 923 foreach ($links as $link) { 924 if( !$link['visible'] ) { 925 continue; 926 } 918 927 $view = "$template"; 919 928 dress('link_url', htmlspecialchars($link['url']), $view); -
trunk/style/admin/default/link.css
r2461 r4669 22 22 #part-link-list table.data-inbox tbody tr .address, 23 23 #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 25 26 { 26 27 border-left : 1px solid #E3E3DE; … … 59 60 { 60 61 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; 61 98 } 62 99 … … 90 127 } 91 128 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 93 131 { 94 132 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; 95 175 } 96 176 … … 134 214 } 135 215 216 #part-link-list .button-box, 136 217 #part-link-add .button-box, 137 218 #part-link-edit .button-box … … 147 228 } 148 229 230 #part-link-list .button-box .input-button, 149 231 #part-link-add .button-box .input-button, 150 232 #part-link-edit .button-box .input-button … … 159 241 vertical-align : middle; 160 242 } 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 }
