Changeset 1689:6a99bdc5ed01
- Timestamp:
- 09/01/13 20:56:28 (10 years ago)
- Branch:
- default
- Location:
- inc/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.blog.php
r1620 r1689 199 199 /** 200 200 Updates comments and trackbacks counters in post table. Should be called 201 every time comments or trackbacks are added, removed or changed the restatus.201 every time comments or trackbacks are added, removed or changed their status. 202 202 203 203 @param ids <b>mixed</b> Comment(s) ID(s) … … 1880 1880 - cat_id: (integer or array) Get comments belonging to entries of given category ID 1881 1881 - comment_id: (integer) Get comment with given ID 1882 - comment_site: (string) Get comments with given comment_site 1882 1883 - comment_status: (integer) Get comments with given comment_status 1883 1884 - comment_trackback: (integer) Get only comments (0) or trackbacks (1) … … 1969 1970 if (isset($params['comment_id']) && $params['comment_id'] !== '') { 1970 1971 $strReq .= 'AND comment_id = '.(integer) $params['comment_id'].' '; 1972 } 1973 1974 if (isset($params['comment_site'])) { 1975 $comment_site = $this->con->escape(str_replace('*','%',$params['comment_site'])); 1976 $strReq .= "AND comment_site LIKE '".$comment_site."' "; 1971 1977 } 1972 1978 -
inc/core/class.dc.trackback.php
r1684 r1689 147 147 //@} 148 148 149 private function pingAlreadyDone($post_id, $from_url) 150 { 151 $params = array( 152 'post_id' => $post_id, 153 'comment_site' => $from_url, 154 'comment_trackback' => 1, 155 ); 156 157 $rs = $this->core->blog->getComments($params, true); 158 if ($rs && !$rs->isEmpty()) { 159 return ($rs->f(0)); 160 } 161 162 return false; 163 } 164 149 165 private function addBacklink($post_id, $url, $blog_name, $title, $excerpt, &$comment) 150 166 { … … 206 222 $charset = ''; 207 223 $comment = ''; 208 224 209 225 $err = false; 210 226 $msg = ''; … … 238 254 $err = true; 239 255 $msg = 'Trackbacks are not allowed for this post or weblog.'; 256 } 257 258 $url = trim(html::clean($url)); 259 if ($this->pingAlreadyDone($post->post_id, $url)) { 260 $err = true; 261 $msg = 'The trackback has already been registered'; 240 262 } 241 263 } … … 270 292 $blog_name = html::escapeHTML($blog_name); 271 293 $blog_name = text::cutString($blog_name,60); 272 273 $url = trim(html::clean($url));274 294 275 295 try … … 361 381 } 362 382 383 if ($this->pingAlreadyDone($posts->post_id, $from_url)) { 384 throw new Exception(__('Don\'t repeat yourself, please.'), 48); 385 } 386 363 387 # OK. We've found our champion. Time to check the remote part. 364 388 try {
Note: See TracChangeset
for help on using the changeset viewer.