Changeset 4898
- Timestamp:
- 12/28/07 03:26:02 (11 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 modified
-
components/Needlworks.Cache.PageCache.php (modified) (5 diffs)
-
interface/comment/rss (added)
-
interface/comment/rss/index.php (added)
-
interface/comment/rss/item.php (added)
-
lib/model/blog.comment.php (modified) (8 diffs)
-
lib/model/blog.rss.php (modified) (2 diffs)
-
lib/piece/blog/entries.php (modified) (1 diff)
-
lib/view/view.php (modified) (1 diff)
-
skin/coolant/skin.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/components/Needlworks.Cache.PageCache.php
r4799 r4898 5 5 6 6 class pageCache { 7 var $name;7 /* var $name; 8 8 var $realName; 9 9 var $realNameOwner; … … 18 18 var $absoluteFilePathOwner; 19 19 var $absoluteFilePathGuest; 20 var $error; 20 var $error;*/ 21 21 22 22 function reset() { … … 259 259 FROM {$database['prefix']}PageCacheLog 260 260 WHERE blogid = ".getBlogId()." 261 AND name like 'entry\\_".$entryId."%'");261 AND (name like 'entry\\_".$entryId."%' OR name = commentRSS_'.$entryId.')"); 262 262 foreach($Entries as $EntryName){ 263 263 $cache->reset(); … … 266 266 } 267 267 unset($cache); 268 return true; 269 } 270 271 function flushCommentRSS($entryId = null) { 272 global $database; 273 274 if(empty($entryId)) $entryId = ''; 275 $cache = new pageCache; 276 $cache->name = 'commentRSS_'.$entryId; 277 $cache->purge(); 268 278 return true; 269 279 } … … 306 316 307 317 class MMCache{ 308 var $variable;318 /*var $variable;*/ 309 319 310 320 //Variable must be the table form. (2-dimensional recursive structure) -
trunk/lib/model/blog.comment.php
r4820 r4898 402 402 if ($result) { 403 403 $id = $insertId; 404 CacheControl::flushCommentRSS($comment['entry']); 404 405 if ($parent != 'null' && $comment['secret'] < 1) { 405 406 $insertId = getCommentsNotifiedQueueMaxId() + 1; … … 493 494 WHERE blogid = $blogid 494 495 AND id = {$comment['id']} $wherePassword"); 495 return $result ? true : false; 496 if($result) { 497 CacheControl::flushCommentRSS($comment['entry']); // Assume blogid = current blogid. 498 return true; 499 } else return false; 496 500 } 497 501 … … 526 530 } 527 531 if(POD::query($sql . $wherePassword)) { 532 CacheControl::flushCommentRSS($entry); 528 533 updateCommentsOfEntry($blogid, $entry); 529 534 return true; … … 552 557 $affectedChildren = POD::queryCount($sql); 553 558 if ($affected + $affectedChildren > 0) { 559 CacheControl::flushCommentRSS($entry); 554 560 updateCommentsOfEntry($blogid, $entry); 555 561 return true; … … 573 579 AND entry = $entry"; 574 580 if(POD::query($sql)) { 581 CacheControl::flushCommentRSS($entry); 575 582 updateCommentsOfEntry($blogid, $entry); 576 583 return true; … … 676 683 if(POD::queryCount("DELETE FROM {$database['prefix']}Comments WHERE blogid = $blogid AND id = $id") == 1) { 677 684 if (POD::query("DELETE FROM {$database['prefix']}Comments WHERE blogid = $blogid AND parent = $id")) { 685 CacheControl::flushCommentRSS($entryId); 678 686 updateCommentsOfEntry($blogid, $entryId); 679 687 return true; … … 691 699 if(POD::query("UPDATE {$database['prefix']}Comments SET isFiltered = UNIX_TIMESTAMP() WHERE blogid = $blogid AND id = $id")) { 692 700 if (POD::query("UPDATE {$database['prefix']}Comments SET isFiltered = UNIX_TIMESTAMP() WHERE blogid = $blogid AND parent = $id")) { 701 CacheControl::flushCommentRSS($entryId); 693 702 updateCommentsOfEntry($blogid, $entryId); 694 703 return true; … … 705 714 if(POD::queryCount("UPDATE {$database['prefix']}Comments SET isFiltered = 0 WHERE blogid = $blogid AND id = $id") == 1) { 706 715 if (is_null($parent) || POD::query("UPDATE {$database['prefix']}Comments SET isFiltered = 0 WHERE blogid = $blogid AND id = $parent")) { 716 CacheControl::flushCommentRSS($entryId); 707 717 updateCommentsOfEntry($blogid, $entryId); 708 718 return true; -
trunk/lib/model/blog.rss.php
r4799 r4898 67 67 'author' => '('.$row['author'].')', 68 68 'pubDate' => Timestamp::getRFC1123($row['published']), 69 'comments' => $entryURL . '# entry' . $row['id'] . 'comment',69 'comments' => $entryURL . '#rp', 70 70 'guid' => "$defaultURL/" . $row['id'] 71 71 ); … … 115 115 fclose($fileHandle); 116 116 return false; 117 } 118 119 function getCommentRSSByEntryId($blogid, $entryId) { 120 global $database, $serviceURL, $defaultURL, $blogURL, $blog, $service; 121 122 if(empty($blogid)) $blogid = getBlogId(); 123 $entry = POD::queryRow("SELECT slogan, visibility, category FROM {$database['prefix']}Entries WHERE blogid = $blogid AND id = $entryId"); 124 if(empty($entry)) return false; 125 if($entry['visibility'] < 2) return false; 126 if(in_array($entry['category'], getCategoryVisibilityList($blogid, 'private'))) return false; 127 $channel = array(); 128 $channel['title'] = $blog['title']. ': '._f('%1 에 달린 댓글',$entry['slogan']); 129 if($blog['useSlogan']) { 130 $channel['link'] = $defaultURL."/entry/".URL::encode($entry['slogan'],true); 131 } else { 132 $channel['link'] = $defaultURL."/".$entryId; 133 } 134 $channel['description'] = $blog['description']; 135 $channel['language'] = $blog['language']; 136 $channel['pubDate'] = Timestamp::getRFC1123(); 137 $channel['generator'] = TEXTCUBE_NAME . ' ' . TEXTCUBE_VERSION; 138 139 if (!empty($blog['logo']) && file_exists(ROOT."/attach/$blogid/{$blog['logo']}")) { 140 $logoInfo = getimagesize(ROOT."/attach/$blogid/{$blog['logo']}"); 141 $channel['url'] = $serviceURL."/attach/".$blogid."/".$blog['logo']; 142 $channel['width'] = $logoInfo[0]; 143 $channel['height'] = $logoInfo[1]; 144 } 145 $result = POD::queryAll("SELECT * 146 FROM {$database['prefix']}Comments 147 WHERE blogid = ".$blogid." 148 AND entry = ".$entryId." 149 AND isFiltered = 0"); 150 if (!$result) 151 $result = array(); 152 153 $channel['items'] = array(); 154 foreach($result as $row) { 155 $commentURL = $channel['link']."#comment".$row['id']; 156 $content = $row['comment']; 157 $item = array( 158 'id' => $row['id'], 159 'title' => $row['title'], 160 'link' => $commentURL, 161 'categories' => array(), 'description' => $content, 162 'author' => '('.$row['name'].')', 163 'pubDate' => Timestamp::getRFC1123($row['written']), 164 'guid' => $commentURL 165 ); 166 if($row['secret']) $item['description'] = _t('비밀 댓글입니다'); 167 array_push($channel['items'], $item); 168 } 169 $rss = array('channel' => $channel); 170 return publishRSS($blogid, $rss); 117 171 } 118 172 -
trunk/lib/piece/blog/entries.php
r4679 r4898 89 89 dress('article_rep_id', $entry['id'], $entryView); 90 90 dress('article_rep_link', $permalink, $entryView); 91 dress('article_rep_rp_rssurl', $defaultURL.'/comment/rss/'.$entry['id'], $entryView); 91 92 dress('article_rep_title', htmlspecialchars(fireEvent('ViewPostTitle', $entry['title'], $entry['id'])), $entryView); 92 93 // 사용자가 작성한 본문은 lib/piece/blog/end.php의 removeAllTags() 다음에 처리하기 위한 조치. -
trunk/lib/view/view.php
r4894 r4898 1324 1324 return ''; 1325 1325 $file = "<script type=\"text/javascript\">//<![CDATA[" . CRLF 1326 . "var servicePath=\" $hostURL{$service['path']}\"; var blogURL=\"$hostURL$blogURL/\";$file";1326 . "var servicePath=\"".$hostURL.$service['path']."\"; var blogURL=\"".$hostURL.$blogURL."/\";".$file; 1327 1327 if ($obfuscate) { 1328 1328 } -
trunk/skin/coolant/skin.html
r4894 r4898 310 310 </s_rp_count> 311 311 </a> 312 </dd> 313 <dd> 314 Comment RSS : [##_article_rep_rp_rssurl_##] 312 315 </dd> 313 316 </dl>
