Changeset 1468:3132a0aca046 for inc
- Timestamp:
- 08/19/13 09:55:29 (12 years ago)
- Branch:
- default
- Parents:
- 1466:e67efe636ce1 (diff), 1467:917fc08f3a59 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- inc
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/lib.dc.page.php
r1461 r1468 164 164 if ($core->error->flag()) { 165 165 echo 166 '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</ p></strong>'.166 '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</strong></p>'. 167 167 $core->error->toHTML(). 168 168 '</div>'; … … 508 508 self::jsVar('dotclear.msg.confirm_delete_theme', 509 509 __('Are you sure you want to delete "%s" theme?')). 510 self::jsVar('dotclear.msg.confirm_delete_backup', 511 __('Are you sure you want to delete this backup?')). 510 512 self::jsVar('dotclear.msg.zip_file_content', 511 513 __('Zip file content')). -
inc/admin/lib.dc.page.php
r1462 r1468 49 49 50 50 # Top of admin page 51 public static function open($title='', $head='')51 public static function open($title='',$head='',$breadcrumb='') 52 52 { 53 53 global $core; … … 73 73 } 74 74 $blog_box = 75 '<p><label for="switchblog" class="classic ">'.76 __('Blogs:').' '.75 '<p><label for="switchblog" class="classic nomobile">'. 76 __('Blogs:').'</label> '. 77 77 $core->formNonce(). 78 78 form::combo('switchblog',$blogs,$core->blog->id). 79 '</ label></p>'.79 '</p>'. 80 80 '<noscript><p><input type="submit" value="'.__('ok').'" /></p></noscript>'; 81 81 } … … 93 93 "<head>\n". 94 94 ' <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'."\n". 95 ' <title>'.$title.' - '.html::escapeHTML($core->blog->name).' - '.html::escapeHTML(DC_VENDOR_NAME).' - '.DC_VERSION.'</title>'."\n".96 97 95 ' <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />'."\n". 98 96 ' <meta name="GOOGLEBOT" content="NOSNIPPET" />'."\n". 97 ' <meta name="viewport" content="width=device-width, initial-scale=1.0" />'."\n". 98 ' <title>'.$title.' - '.html::escapeHTML($core->blog->name).' - '.html::escapeHTML(DC_VENDOR_NAME).' - '.DC_VERSION.'</title>'."\n". 99 99 100 100 101 self::jsLoadIE7(). … … 133 134 '<form action="index.php" method="post">'. 134 135 $blog_box. 135 '<p ><a href="'.$core->blog->url.'" onclick="window.open(this.href);return false;" title="'.__('Go to site').' ('.__('new window').')'.'">'.__('Go to site').' <img src="images/outgoing.png" alt="" /></a>'.136 '<p class="nomobile"><a href="'.$core->blog->url.'" onclick="window.open(this.href);return false;" title="'.__('Go to site').' ('.__('new window').')'.'">'.__('Go to site').' <img src="images/outgoing.png" alt="" /></a>'. 136 137 '</p></form>'. 137 138 '</div>'. 138 139 '<div id="info-box2">'. 139 '<a '.(preg_match('/index.php$/',$_SERVER['REQUEST_URI']) ? ' class="active"' : '').'href="index.php">'.__('My dashboard').'</a>'.140 '<span > | </span><a'.(preg_match('/preferences.php(\?.*)?$/',$_SERVER['REQUEST_URI']) ? ' class="active"' : '').'href="preferences.php">'.__('My preferences').'</a>'.141 '<span > | </span><a href="index.php?logout=1" class="logout">'.sprintf(__('Logout %s'),$core->auth->userID()).' <img src="images/logout.png" alt="" /></a>'.140 '<a class="smallscreen'.(preg_match('/index.php$/',$_SERVER['REQUEST_URI']) ? ' active' : '').'" href="index.php">'.__('My dashboard').'</a>'. 141 '<span class="smallscreen"> | </span><a class="smallscreen'.(preg_match('/preferences.php(\?.*)?$/',$_SERVER['REQUEST_URI']) ? ' active' : '').'" href="preferences.php">'.__('My preferences').'</a>'. 142 '<span class="smallscreen"> | </span><a href="index.php?logout=1" class="logout">'.sprintf(__('Logout %s'),$core->auth->userID()).' <img src="images/logout.png" alt="" /></a>'. 142 143 '</div>'. 143 144 '</div>'. … … 158 159 } 159 160 161 // Display breadcrumb (if given) before any error message 162 echo $breadcrumb; 163 160 164 if ($core->error->flag()) { 161 165 echo … … 176 180 "</div>\n". // End of #main 177 181 178 '<div id="main-menu">'."\n"; 182 '<div id="main-menu">'."\n". 183 184 '<form id="search-menu" action="search.php" method="get">'. 185 '<p><label for="q" class="hidden">'.__('Search:').' </label>'.form::field('q',30,255,''). 186 '<input type="submit" value="'.__('OK').'" /></p>'. 187 '</form>'; 179 188 180 189 foreach ($menu as $k => $v) { … … 193 202 echo 194 203 '</div>'."\n". // End of #main-menu 195 '<div id="footer"><a href="http://dotclear.org/" title="'.$text.'"><img src="style/dc_logo _footer.png" alt="'.$text.'" /></a></div>'."\n".204 '<div id="footer"><a href="http://dotclear.org/" title="'.$text.'"><img src="style/dc_logos/w-dotclear90.png" alt="'.$text.'" /></a></div>'."\n". 196 205 "</div>\n"; // End of #wrapper 197 206 … … 204 213 } 205 214 206 public static function openPopup($title='', $head='')215 public static function openPopup($title='',$head='',$breadcrumb='') 207 216 { 208 217 global $core; … … 216 225 'xml:lang="'.$core->auth->getInfo('user_lang').'" '. 217 226 'lang="'.$core->auth->getInfo('user_lang').'">'."\n". 227 '<meta name="viewport" content="width=device-width, initial-scale=1.0" />'."\n". 218 228 "<head>\n". 219 229 ' <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'."\n". … … 241 251 '<body id="dotclear-admin" class="popup">'."\n". 242 252 243 '<div id="top "><h1>'.DC_VENDOR_NAME.'</h1></div>'."\n";253 '<div id="top hidden"><h1>'.DC_VENDOR_NAME.'</h1></div>'."\n"; 244 254 245 255 echo … … 247 257 '<div id="main">'."\n". 248 258 '<div id="content">'."\n"; 259 260 // display breadcrumb if given 261 echo $breadcrumb; 249 262 250 263 if ($core->error->flag()) { … … 264 277 "</div>\n". // End of #wrapper 265 278 '</body></html>'; 279 } 280 281 public static function breadcrumb($elements=null,$with_home_link=true,$echo=false) 282 { 283 // First item of array elements should be blog's name, System or Plugins 284 $res = '<h2>'.($with_home_link ? 285 '<a class="go_home" href="index.php"><img src="style/dashboard.png" alt="'.__('Go to dashboard').'" /></a>' : 286 '<img src="style/dashboard-alt.png" alt="" />'); 287 $index = 0; 288 foreach ($elements as $element => $url) { 289 $res .= ($with_home_link ? ($index == 1 ? ' : ' : ' › ') : ($index == 0 ? ' ' : ' › ')). 290 ($url ? '<a href="'.$url.'">' : '').$element.($url ? '</a>' : ''); 291 $index++; 292 } 293 $res .= '</h2>'; 294 if ($echo) { 295 echo $res; 296 } 297 return $res; 266 298 } 267 299 … … 333 365 { 334 366 $args = func_get_args(); 367 368 $args = new ArrayObject($args); 369 370 # --BEHAVIOR-- adminPageHelpBlock 371 $GLOBALS['core']->callBehavior('adminPageHelpBlock',$args); 372 335 373 if (empty($args)) { 336 374 return; … … 411 449 412 450 self::jsVar('dotclear.msg.help', 413 __('help')). 451 __('Help about this page')). 452 self::jsVar('dotclear.msg.help_hide', 453 __('Hide')). 414 454 self::jsVar('dotclear.msg.no_selection', 415 455 __('no selection')). … … 436 476 self::jsVar('dotclear.msg.confirm_delete_post', 437 477 __("Are you sure you want to delete this entry?")). 478 self::jsVar('dotclear.msg.click_to_unlock', 479 __("Click here to unlock the field")). 438 480 self::jsVar('dotclear.msg.confirm_spam_delete', 439 481 __('Are you sure you want to delete all spams?')). … … 478 520 self::jsVar('dotclear.msg.confirm_change_post_format', 479 521 __('You have unsaved changes. Switch post format will loose these changes. Proceed anyway?')). 480 self::jsVar('dotclear.msg.confirm_change_post_format_noconvert',481 __("Warning: post format change will not convert existing content. You will need to apply new format by yourself. Proceed anyway?")).482 522 self::jsVar('dotclear.msg.load_enhanced_uploader', 483 523 __('Loading enhanced uploader, please wait.')). … … 489 529 { 490 530 return 491 '<!--[if lt IE 8]>'."\n".492 self::jsLoad('js/ie7/IE 8.js').531 '<!--[if lt IE 9]>'."\n". 532 self::jsLoad('js/ie7/IE9.js'). 493 533 '<link rel="stylesheet" type="text/css" href="style/iesucks.css" />'."\n". 494 534 '<![endif]-->'."\n"; … … 692 732 '<link rel="stylesheet" type="text/css" href="style/jsUpload/style.css" />'."\n". 693 733 694 '<script id="template-upload" type="text/x-tmpl">695 {% for (var i=0, file; file=o.files[i]; i++) { %}696 <div class="template-upload fade">697 <div class="upload-file">698 <div class="upload-fileinfo">699 <span class="upload-filename">{%=file.name%}</span>700 <span class="upload-filesize">({%=o.formatFileSize(file.size)%})</span>701 <span class="upload-filecancel cancel">'.__('Cancel').'</span>702 {% if (!o.files.error && !i && !o.options.autoUpload) { %}703 <input type="submit" class="button start" value="'.__('Send').'"/>704 {% } %}705 <span class="upload-filemsg"></span>706 </div>707 {% if (!o.files.error) { %}708 <div class="upload-progress progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>709 {% } %}710 </div>711 {% } %}712 </script>713 <!-- The template to display files available for download -->714 <script id="template-download" type="text/x-tmpl">715 {% for (var i=0, file; file=o.files[i]; i++) { %}716 <div class="template-download fade">717 <div class="upload-file">718 <div class="upload-fileinfo">719 <span class="upload-filename">{%=file.name%}</span>720 <span class="upload-filesize">({%=o.formatFileSize(file.size)%})</span>721 <span class="upload-filemsg{% if (file.error) { %} upload-error{% } %}">722 {% if (file.error) { %}723 '.__('Error:').' {%=file.error%}724 {% } else { %}725 '.__('File successfully uploaded.').'726 {% } %}727 </span>728 </div>729 <div class="upload-progress">730 {% if (!file.error) { %}731 <div class="bar" style="width:100%;">100%</div>732 {% } %}733 </div>734 </div>735 {% } %}736 </script>'.737 738 self::jsLoad('js/jsUpload/vendor/jquery.ui.widget.js').739 self::jsLoad('js/jsUpload/tmpl.js').740 self::jsLoad('js/jsUpload/load-image.js').741 self::jsLoad('js/jsUpload/jquery.iframe-transport.js').742 self::jsLoad('js/jsUpload/jquery.fileupload.js').743 self::jsLoad('js/jsUpload/jquery.fileupload-process.js').744 self::jsLoad('js/jsUpload/jquery.fileupload-resize.js').745 self::jsLoad('js/jsUpload/jquery.fileupload-ui.js').746 747 734 '<script type="text/javascript">'."\n". 748 735 "//<![CDATA[\n". … … 761 748 self::jsVar('dotclear.jsUpload.msg.clean',__('Clean')). 762 749 self::jsVar('dotclear.jsUpload.msg.upload',__('Upload')). 750 self::jsVar('dotclear.jsUpload.msg.send',__('Send')). 751 self::jsVar('dotclear.jsUpload.msg.file_successfully_uploaded',__('File successfully uploaded.')). 763 752 self::jsVar('dotclear.jsUpload.msg.no_file_in_queue',__('No file in queue.')). 764 753 self::jsVar('dotclear.jsUpload.msg.file_in_queue',__('1 file in queue.')). … … 767 756 self::jsVar('dotclear.jsUpload.base_url',$base_url). 768 757 "\n//]]>\n". 769 "</script>\n"; 758 "</script>\n". 759 760 self::jsLoad('js/jsUpload/vendor/jquery.ui.widget.js'). 761 self::jsLoad('js/jsUpload/tmpl.js'). 762 self::jsLoad('js/jsUpload/template-upload.js'). 763 self::jsLoad('js/jsUpload/template-download.js'). 764 self::jsLoad('js/jsUpload/load-image.js'). 765 self::jsLoad('js/jsUpload/jquery.iframe-transport.js'). 766 self::jsLoad('js/jsUpload/jquery.fileupload.js'). 767 self::jsLoad('js/jsUpload/jquery.fileupload-process.js'). 768 self::jsLoad('js/jsUpload/jquery.fileupload-resize.js'). 769 self::jsLoad('js/jsUpload/jquery.fileupload-ui.js'); 770 770 } 771 771 -
inc/admin/lib.pager.php
r1415 r1468 87 87 html::escapeHTML($this->rs->cat_title)); 88 88 } else { 89 $cat_title = __(' None');89 $cat_title = __('(No cat)'); 90 90 } 91 91 -
inc/admin/lib.pager.php
r1364 r1468 58 58 } 59 59 60 echo '<p >'.__('Page(s)').' : '.$pager->getLinks().'</p>';60 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 61 61 62 62 $blocks = explode('%s',$html_block); … … 71 71 echo $blocks[1]; 72 72 73 echo '<p >'.__('Page(s)').' : '.$pager->getLinks().'</p>';73 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 74 74 } 75 75 } … … 93 93 switch ($this->rs->post_status) { 94 94 case 1: 95 $img_status = sprintf($img,__(' published'),'check-on.png');95 $img_status = sprintf($img,__('Published'),'check-on.png'); 96 96 break; 97 97 case 0: 98 $img_status = sprintf($img,__(' unpublished'),'check-off.png');98 $img_status = sprintf($img,__('Unpublished'),'check-off.png'); 99 99 break; 100 100 case -1: 101 $img_status = sprintf($img,__(' scheduled'),'scheduled.png');101 $img_status = sprintf($img,__('Scheduled'),'scheduled.png'); 102 102 break; 103 103 case -2: 104 $img_status = sprintf($img,__(' pending'),'check-wrn.png');104 $img_status = sprintf($img,__('Pending'),'check-wrn.png'); 105 105 break; 106 106 } … … 108 108 $protected = ''; 109 109 if ($this->rs->post_password) { 110 $protected = sprintf($img,__(' protected'),'locker.png');110 $protected = sprintf($img,__('Protected'),'locker.png'); 111 111 } 112 112 113 113 $selected = ''; 114 114 if ($this->rs->post_selected) { 115 $selected = sprintf($img,__(' selected'),'selected.png');115 $selected = sprintf($img,__('Selected'),'selected.png'); 116 116 } 117 117 … … 170 170 } 171 171 172 echo '<p >'.__('Page(s)').' : '.$pager->getLinks().'</p>';172 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 173 173 174 174 $blocks = explode('%s',$html_block); … … 183 183 echo $blocks[1]; 184 184 185 echo '<p >'.__('Page(s)').' : '.$pager->getLinks().'</p>';185 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 186 186 } 187 187 } … … 192 192 switch ($this->rs->post_status) { 193 193 case 1: 194 $img_status = sprintf($img,__(' published'),'check-on.png');194 $img_status = sprintf($img,__('Published'),'check-on.png'); 195 195 break; 196 196 case 0: 197 $img_status = sprintf($img,__(' unpublished'),'check-off.png');197 $img_status = sprintf($img,__('Unpublished'),'check-off.png'); 198 198 break; 199 199 case -1: 200 $img_status = sprintf($img,__(' scheduled'),'scheduled.png');200 $img_status = sprintf($img,__('Scheduled'),'scheduled.png'); 201 201 break; 202 202 case -2: 203 $img_status = sprintf($img,__(' pending'),'check-wrn.png');203 $img_status = sprintf($img,__('Pending'),'check-wrn.png'); 204 204 break; 205 205 } … … 207 207 $protected = ''; 208 208 if ($this->rs->post_password) { 209 $protected = sprintf($img,__(' protected'),'locker.png');209 $protected = sprintf($img,__('Protected'),'locker.png'); 210 210 } 211 211 212 212 $selected = ''; 213 213 if ($this->rs->post_selected) { 214 $selected = sprintf($img,__(' selected'),'selected.png');214 $selected = sprintf($img,__('Selected'),'selected.png'); 215 215 } 216 216 … … 267 267 } 268 268 269 echo '<p >'.__('Page(s)').' : '.$pager->getLinks().'</p>';269 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 270 270 271 271 $blocks = explode('%s',$html_block); … … 280 280 echo $blocks[1]; 281 281 282 echo '<p >'.__('Page(s)').' : '.$pager->getLinks().'</p>';282 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 283 283 } 284 284 } … … 306 306 switch ($this->rs->comment_status) { 307 307 case 1: 308 $img_status = sprintf($img,__(' published'),'check-on.png');308 $img_status = sprintf($img,__('Published'),'check-on.png'); 309 309 break; 310 310 case 0: 311 $img_status = sprintf($img,__(' unpublished'),'check-off.png');311 $img_status = sprintf($img,__('Unpublished'),'check-off.png'); 312 312 break; 313 313 case -1: 314 $img_status = sprintf($img,__(' pending'),'check-wrn.png');314 $img_status = sprintf($img,__('Pending'),'check-wrn.png'); 315 315 break; 316 316 case -2: 317 $img_status = sprintf($img,__(' junk'),'junk.png');317 $img_status = sprintf($img,__('Junk'),'junk.png'); 318 318 break; 319 319 } … … 374 374 } 375 375 376 echo '<p >'.__('Page(s)').' : '.$pager->getLinks().'</p>';376 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 377 377 378 378 $blocks = explode('%s',$html_block); … … 387 387 echo $blocks[1]; 388 388 389 echo '<p >'.__('Page(s)').' : '.$pager->getLinks().'</p>';389 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 390 390 } 391 391 } -
inc/core/class.dc.blog.php
r1353 r1468 634 634 private function checkCategory($title,$url,$id=null) 635 635 { 636 $strReq = 'SELECT cat_id '. 637 'FROM '.$this->prefix.'category '. 638 "WHERE cat_url = '".$this->con->escape($url)."' ". 639 "AND blog_id = '".$this->con->escape($this->id)."' "; 640 641 if ($id !== null) { 642 $strReq .= 'AND cat_id <> '.(integer) $id.' '; 643 } 636 # Let's check if URL is taken... 637 $strReq = 638 'SELECT cat_url FROM '.$this->prefix.'category '. 639 "WHERE cat_url = '".$this->con->escape($url)."' ". 640 ($id ? 'AND cat_id <> '.(integer) $id. ' ' : ''). 641 "AND blog_id = '".$this->con->escape($this->id)."' ". 642 'ORDER BY cat_url DESC'; 644 643 645 644 $rs = $this->con->select($strReq); 646 645 647 if (!$rs->isEmpty()) { 648 throw new Exception(__('Category URL must be unique.')); 649 } 646 if (!$rs->isEmpty()) 647 { 648 if ($this->con->driver() == 'mysql') { 649 $clause = "REGEXP '^".$this->con->escape($url)."[0-9]+$'"; 650 } elseif ($this->con->driver() == 'pgsql') { 651 $clause = "~ '^".$this->con->escape($url)."[0-9]+$'"; 652 } else { 653 $clause = "LIKE '".$this->con->escape($url)."%'"; 654 } 655 $strReq = 656 'SELECT cat_url FROM '.$this->prefix.'category '. 657 "WHERE cat_url ".$clause.' '. 658 ($id ? 'AND cat_id <> '.(integer) $id. ' ' : ''). 659 "AND blog_id = '".$this->con->escape($this->id)."' ". 660 'ORDER BY cat_url DESC '; 661 662 $rs = $this->con->select($strReq); 663 $a = array(); 664 while ($rs->fetch()) { 665 $a[] = $rs->cat_url; 666 } 667 668 natsort($a); 669 $t_url = end($a); 670 671 if (preg_match('/(.*?)([0-9]+)$/',$t_url,$m)) { 672 $i = (integer) $m[2]; 673 $url = $m[1]; 674 } else { 675 $i = 1; 676 } 677 678 return $url.($i+1); 679 } 680 681 # URL is empty? 682 if ($url == '') { 683 throw new Exception(__('Empty category URL')); 684 } 685 686 return $url; 650 687 } 651 688 … … 669 706 670 707 # Check if title or url are unique 671 $ this->checkCategory($cur->cat_title,$cur->cat_url,$id);708 $cur->cat_url = $this->checkCategory($cur->cat_title,$cur->cat_url,$id); 672 709 673 710 if ($cur->cat_desc !== null) { -
inc/core/class.dc.blog.php
r1429 r1468 81 81 $this->desc = $b->blog_desc; 82 82 $this->url = $b->blog_url; 83 $this->host = preg_replace('|^([a-z]{3,}://)(.*?)/.*$|','$1$2',$this->url);83 $this->host = http::getHostFromURL($this->url); 84 84 $this->creadt = strtotime($b->blog_creadt); 85 85 $this->upddt = strtotime($b->blog_upddt); … … 91 91 $this->public_path = path::fullFromRoot($this->settings->system->public_path,DC_ROOT); 92 92 93 $this->post_status['-2'] = __(' pending');94 $this->post_status['-1'] = __(' scheduled');95 $this->post_status['0'] = __(' unpublished');96 $this->post_status['1'] = __(' published');97 98 $this->comment_status['-2'] = __(' junk');99 $this->comment_status['-1'] = __(' pending');100 $this->comment_status['0'] = __(' unpublished');101 $this->comment_status['1'] = __(' published');93 $this->post_status['-2'] = __('Pending'); 94 $this->post_status['-1'] = __('Scheduled'); 95 $this->post_status['0'] = __('Unpublished'); 96 $this->post_status['1'] = __('Published'); 97 98 $this->comment_status['-2'] = __('Junk'); 99 $this->comment_status['-1'] = __('Pending'); 100 $this->comment_status['0'] = __('Unpublished'); 101 $this->comment_status['1'] = __('Published'); 102 102 103 103 # --BEHAVIOR-- coreBlogConstruct … … 203 203 @param ids <b>mixed</b> Comment(s) ID(s) 204 204 @param del <b>boolean</b> If comment is delete, set this to true 205 @param affected_posts <b>mixed</b> Posts(s) ID(s) 206 */ 207 public function triggerComments($ids, $del=false, $affected_posts=null) 205 */ 206 public function triggerComments($ids,$del=false) 208 207 { 209 208 $co_ids = dcUtils::cleanIds($ids); 210 $a_ids = dcUtils::cleanIds($affected_posts);211 $a_tbs = array();212 209 213 210 # a) Retrieve posts affected by comments edition 214 if (empty($a_ids)) { 215 $strReq = 216 'SELECT post_id, comment_trackback '. 217 'FROM '.$this->prefix.'comment '. 218 'WHERE comment_id'.$this->con->in($co_ids). 219 'GROUP BY post_id,comment_trackback'; 220 221 $rs = $this->con->select($strReq); 222 223 while ($rs->fetch()) { 224 $a_ids[] = (integer) $rs->post_id; 225 $a_tbs[] = (integer) $rs->comment_trackback; 226 } 211 $strReq = 212 'SELECT post_id, comment_trackback '. 213 'FROM '.$this->prefix.'comment '. 214 'WHERE comment_id'.$this->con->in($co_ids). 215 'GROUP BY post_id,comment_trackback'; 216 217 $rs = $this->con->select($strReq); 218 219 $a_ids = $a_tbs = array(); 220 while ($rs->fetch()) { 221 $a_ids[] = (integer) $rs->post_id; 222 $a_tbs[] = (integer) $rs->comment_trackback; 227 223 } 228 224 … … 259 255 { 260 256 $nb_comment = $nb_trackback = 0; 261 //$cur->nb_comment = $nb_comment;262 257 foreach($b_ids as $b_key => $b_id) 263 258 { … … 510 505 $this->core->callBehavior('coreBeforeCategoryCreate',$this,$cur); 511 506 512 $id = $this->categories()->addNode($cur,$parent); 513 # Update category's cursor 514 $rs = $this->getCategory($id); 515 if (!$rs->isEmpty()) { 516 $cur->cat_lft = $rs->cat_lft; 517 $cur->cat_rgt = $rs->cat_rgt; 518 } 507 $this->categories()->addNode($cur,$parent); 519 508 520 509 # --BEHAVIOR-- coreAfterCategoryCreate … … 2229 2218 $co_ids = dcUtils::cleanIds($ids); 2230 2219 2231 if (empty($ co_ids)) {2220 if (empty($ids)) { 2232 2221 throw new Exception(__('No such comment ID')); 2233 }2234 2235 # Retrieve posts affected by comments edition2236 $affected_posts = array();2237 $strReq =2238 'SELECT distinct(post_id) '.2239 'FROM '.$this->prefix.'comment '.2240 'WHERE comment_id'.$this->con->in($co_ids);2241 2242 $rs = $this->con->select($strReq);2243 2244 while ($rs->fetch()) {2245 $affected_posts[] = (integer) $rs->post_id;2246 2222 } 2247 2223 … … 2273 2249 2274 2250 $this->con->execute($strReq); 2275 $this->triggerComments($co_ids, true, $affected_posts);2251 $this->triggerComments($co_ids,true); 2276 2252 $this->triggerBlog(); 2277 2253 } … … 2328 2304 2329 2305 if ($cur->comment_site !== null && $cur->comment_site != '') { 2330 if (!preg_match('|^http(s?)://| i',$cur->comment_site, $matches)) {2306 if (!preg_match('|^http(s?)://|',$cur->comment_site)) { 2331 2307 $cur->comment_site = 'http://'.$cur->comment_site; 2332 }else{2333 $cur->comment_site = strtolower($matches[0]).substr($cur->comment_site, strlen($matches[0]));2334 2308 } 2335 2309 } -
inc/core/class.dc.media.php
r1280 r1468 30 30 31 31 public $thumb_tp = '%s/.%s_%s.jpg'; ///< <b>string</b> Thumbnail file pattern 32 public $thumb_tp_alpha = '%s/.%s_%s.png'; ///< <b>string</b> Thumbnail file pattern (with alpha layer) 32 33 33 34 /** … … 298 299 $f->media_thumb = array(); 299 300 $p = path::info($f->relname); 300 $thumb = sprintf($this->thumb_tp,$this->root.'/'.$p['dirname'],$p['base'],'%s'); 301 $thumb_url = sprintf($this->thumb_tp,$this->root_url.$p['dirname'],$p['base'],'%s'); 301 $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 302 $thumb = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$this->root.'/'.$p['dirname'],$p['base'],'%s'); 303 $thumb_url = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$this->root_url.$p['dirname'],$p['base'],'%s'); 302 304 303 305 # Cleaner URLs … … 920 922 921 923 $p = path::info($file); 922 $thumb = sprintf($this->thumb_tp,$p['dirname'],$p['base'],'%s'); 924 $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 925 $thumb = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$p['dirname'],$p['base'],'%s'); 923 926 924 927 try … … 939 942 $rate = ($s[0] < 100 ? 95 : ($s[0] < 600 ? 90 : 85)); 940 943 $img->resize($s[0],$s[0],$s[1]); 941 $img->output( 'jpeg',$thumb_file,$rate);944 $img->output(($alpha ? 'png' : 'jpeg'),$thumb_file,$rate); 942 945 $img->loadImage($file); 943 946 } … … 958 961 { 959 962 $p = path::info($file->relname); 960 $thumb_old = sprintf($this->thumb_tp,$p['dirname'],$p['base'],'%s'); 963 $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 964 $thumb_old = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$p['dirname'],$p['base'],'%s'); 961 965 962 966 $p = path::info($newFile->relname); 963 $thumb_new = sprintf($this->thumb_tp,$p['dirname'],$p['base'],'%s'); 967 $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 968 $thumb_new = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$p['dirname'],$p['base'],'%s'); 964 969 965 970 foreach ($this->thumb_sizes as $suffix => $s) { … … 974 979 { 975 980 $p = path::info($f); 976 $thumb = sprintf($this->thumb_tp,'',$p['base'],'%s'); 981 $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 982 $thumb = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),'',$p['base'],'%s'); 977 983 978 984 foreach ($this->thumb_sizes as $suffix => $s) { -
inc/core/class.dc.media.php
r1381 r1468 499 499 @param post_id <b>integer</b> Post ID 500 500 @param media_id <b>integer</b> Optionnal media ID 501 @param return_rs <b>boolean</b> Whether to return a resultset (true) or an array (false, default value). 502 @return <b>array</b> Array or ResultSet of fileItems 503 */ 504 public function getPostMedia($post_id,$media_id=null,$return_rs=false) 501 @return <b>array</b> Array of fileItems 502 */ 503 public function getPostMedia($post_id,$media_id=null) 505 504 { 506 505 $params = array( … … 518 517 $f = $this->fileRecord($rs); 519 518 if ($f !== null) { 520 $res[] = $ return_rs ? new ArrayObject($f) : $f;521 } 522 } 523 524 return $re turn_rs ? staticRecord::newFromArray($res) : $res;519 $res[] = $f; 520 } 521 } 522 523 return $res; 525 524 } 526 525 -
inc/prepend.php
r1352 r1468 123 123 # Constants 124 124 define('DC_ROOT',path::real(dirname(__FILE__).'/..')); 125 define('DC_VERSION','2. 5.3-dev');125 define('DC_VERSION','2.6-dev'); 126 126 define('DC_DIGESTS',dirname(__FILE__).'/digests'); 127 127 define('DC_L10N_ROOT',dirname(__FILE__).'/../locales');
Note: See TracChangeset
for help on using the changeset viewer.