Changes in [1619:5d925866b5b3:1620:542c321dc040]
- Files:
-
- 43 edited
-
admin/blog_pref.php (modified) (1 diff)
-
admin/index.php (modified) (2 diffs)
-
admin/install/index.php (modified) (3 diffs)
-
admin/post.php (modified) (1 diff)
-
admin/post_media.php (modified) (1 diff)
-
admin/services.php (modified) (1 diff)
-
admin/style/install.css (modified) (1 diff)
-
admin/update.php (modified) (1 diff)
-
admin/user.php (modified) (2 diffs)
-
inc/admin/prepend.php (modified) (1 diff)
-
inc/config.php.in (modified) (1 diff)
-
inc/core/class.dc.blog.php (modified) (8 diffs)
-
inc/core/class.dc.core.php (modified) (1 diff)
-
inc/public/lib.tpl.context.php (modified) (2 diffs)
-
locales/bn/main.po (modified) (2 diffs)
-
locales/ca/main.po (modified) (2 diffs)
-
locales/cs/main.po (modified) (2 diffs)
-
locales/da/main.po (modified) (2 diffs)
-
locales/de/main.po (modified) (2 diffs)
-
locales/en/main.po (modified) (2 diffs)
-
locales/eo/main.po (modified) (2 diffs)
-
locales/es-ar/main.po (modified) (2 diffs)
-
locales/es/main.po (modified) (2 diffs)
-
locales/eu/main.po (modified) (2 diffs)
-
locales/fr/main.po (modified) (2 diffs)
-
locales/hu/main.po (modified) (2 diffs)
-
locales/it/main.po (modified) (2 diffs)
-
locales/ja/main.po (modified) (2 diffs)
-
locales/ko/main.po (modified) (2 diffs)
-
locales/lt/main.po (modified) (1 diff)
-
locales/nl/main.po (modified) (2 diffs)
-
locales/oc/main.po (modified) (2 diffs)
-
locales/pl/main.po (modified) (2 diffs)
-
locales/pt-br/main.po (modified) (2 diffs)
-
locales/pt/main.po (modified) (2 diffs)
-
locales/ro/main.po (modified) (2 diffs)
-
locales/ru/main.po (modified) (2 diffs)
-
locales/sr/main.po (modified) (2 diffs)
-
locales/sv/main.po (modified) (2 diffs)
-
locales/te/main.po (modified) (2 diffs)
-
locales/tr/main.po (modified) (2 diffs)
-
locales/zh-cn/main.po (modified) (2 diffs)
-
plugins/pages/page.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
admin/blog_pref.php
r1615 r1620 111 111 # Image default size combo 112 112 $img_default_size_combo = array(); 113 $media = new dcMedia($core); 114 $img_default_size_combo[__('original')] = 'o'; 115 foreach ($media->thumb_sizes as $code => $size) { 116 $img_default_size_combo[__($size[2])] = $code; 113 try { 114 $media = new dcMedia($core); 115 $img_default_size_combo[__('original')] = 'o'; 116 foreach ($media->thumb_sizes as $code => $size) { 117 $img_default_size_combo[__($size[2])] = $code; 118 } 119 } catch (Exception $e) { 120 $core->error->add($e->getMessage()); 117 121 } 118 122 -
admin/index.php
r1558 r1620 247 247 } 248 248 249 $err = array(); 250 251 # Check cache directory 252 if (!is_dir(DC_TPL_CACHE)) { 253 $err[] = '<p>'.sprintf(__('Cache directory %s does not exist.'),DC_TPL_CACHE).'</p>'; 254 } else if (!is_writable(DC_TPL_CACHE)) { 255 $err[] = '<p>'.sprintf(__('Cache directory %s is not writable.'),DC_TPL_CACHE).'</p>'; 256 } 257 258 # Check public directory 259 if (!is_dir($core->blog->public_path)) { 260 $err[] = '<p>'.sprintf(__('Directory %s does not exist.'),$core->blog->public_path).'</p>'; 261 } else if (!is_writable($core->blog->public_path)) { 262 $err[] = '<p>'.sprintf(__('Directory %s is not writable.'),$core->blog->public_path).'</p>'; 263 } 264 265 # Error list 266 if (count($err) > 0) { 267 echo '<div class="error"><p><strong>Erreur :</strong></p>'. 268 '<ul><li>'.implode("</li><li>",$err).'</li></ul></div>'; 269 } 270 249 271 # Plugins install messages 250 272 if (!empty($plugins_install['success'])) … … 267 289 # Dashboard columns (processed first, as we need to know the result before displaying the icons.) 268 290 $dashboardItems = ''; 291 292 # Dotclear updates notifications 293 if ($core->auth->isSuperAdmin() && is_readable(DC_DIGESTS)) 294 { 295 $updater = new dcUpdate(DC_UPDATE_URL,'dotclear',DC_UPDATE_VERSION,DC_TPL_CACHE.'/versions'); 296 $new_v = $updater->check(DC_VERSION); 297 $version_info = $new_v ? $updater->getInfoURL() : ''; 298 299 if ($updater->getNotify() && $new_v) { 300 $dashboardItems .= 301 '<div id="upg-notify" class="static-msg"><p>'.sprintf(__('Dotclear %s is available!'),$new_v).'</p> '. 302 '<ul><li><strong><a href="update.php">'.sprintf(__('Upgrade now'),$new_v).'</a></strong>'. 303 '</li><li><a href="update.php?hide_msg=1">'.__('Remind me later').'</a>'. 304 ($version_info ? ' </li><li>'.sprintf(__('<a href=\"%s\">Information about this version</a>.'),$version_info) : ''). 305 '</li></ul></div>'; 306 } 307 } 269 308 270 309 # Errors modules notifications -
admin/install/index.php
r1553 r1620 267 267 268 268 <script type="text/javascript" src="../js/jquery/jquery.js"></script> 269 <?php echo dcPage::jsLoad('../js/jquery/jquery.pwstrength.js'); ?> 269 270 <script type="text/javascript"> 270 271 //<![CDATA[ … … 278 279 $(this).val(this.value.replace(login_re,'')); 279 280 }); 281 282 <?php echo "\$('#u_pwd').pwstrength({texts: ['". 283 sprintf(__('Password strength: %s'),__('very weak'))."', '". 284 sprintf(__('Password strength: %s'),__('weak'))."', '". 285 sprintf(__('Password strength: %s'),__('mediocre'))."', '". 286 sprintf(__('Password strength: %s'),__('strong'))."', '". 287 sprintf(__('Password strength: %s'),__('very strong'))."']});\n"; ?> 280 288 281 289 $('#u_login').parent().after($('<input type="hidden" name="u_date" value="' + Date().toLocaleString() + '" />')); … … 329 337 330 338 '<fieldset><legend>'.__('Username and password').'</legend>'. 331 '<p><label for="u_login" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Username:').'</label> '. 332 form::field('u_login',30,32,html::escapeHTML($u_login)).'</p>'. 333 '<p><label for="u_pwd" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Password:').'</label> '. 334 form::password('u_pwd',30,255).'</p>'. 335 '<p><label for="u_pwd2" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Confirm password:').'</label> '. 336 form::password('u_pwd2',30,255).'</p>'. 339 '<p><label for="u_login" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Username:').' '. 340 form::field('u_login',30,32,html::escapeHTML($u_login)).'</label></p>'. 341 '<div class="pw-table">'. 342 '<p class="pw-cell">'. 343 '<label for="u_pwd" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('New password:').'</label>'. 344 form::password('u_pwd',30,255,'','','',false,' data-indicator="pwindicator" '). 345 '</p>'. 346 '<div id="pwindicator">'. 347 ' <div class="bar"></div>'. 348 ' <p class="label no-margin"></p>'. 349 '</div>'. 350 '</div>'. 351 '<p><label for="u_pwd2" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Confirm password:').' '. 352 form::password('u_pwd2',30,255).'</label></p>'. 337 353 '</fieldset>'. 338 354 -
admin/post.php
r1619 r1620 147 147 try { 148 148 $core->media = new dcMedia($core); 149 } catch (Exception $e) {} 149 } catch (Exception $e) { 150 $core->error->add($e->getMessage()); 151 } 150 152 } 151 153 } -
admin/post_media.php
r1179 r1537 26 26 } 27 27 28 if ($post_id && $media_id && !empty($_POST['attach'])) 29 { 30 $core->media = new dcMedia($core); 31 $core->media->addPostMedia($post_id,$media_id); 32 http::redirect($core->getPostAdminURL($rs->post_type,$post_id,false)); 33 } 28 try { 29 if ($post_id && $media_id && !empty($_POST['attach'])) 30 { 31 $core->media = new dcMedia($core); 32 $core->media->addPostMedia($post_id,$media_id); 33 http::redirect($core->getPostAdminURL($rs->post_type,$post_id,false)); 34 } 34 35 35 try {36 36 $core->media = new dcMedia($core); 37 37 $f = $core->media->getPostMedia($post_id,$media_id); -
admin/services.php
r1500 r1538 238 238 } 239 239 240 $core->media = new dcMedia($core); 241 $file = $core->media->getFile($id); 240 try { 241 $core->media = new dcMedia($core); 242 $file = $core->media->getFile($id); 243 } catch (Exception $e) {} 242 244 243 245 if ($file === null || $file->type != 'application/zip' || !$file->editable) { -
admin/style/install.css
r1330 r1620 158 158 border: 1px solid #2C8FD1; 159 159 } 160 161 162 /* --------------------------------------------------------------- password indcator */ 163 .pw-table { 164 display: table; 165 margin-bottom: 1em; 166 } 167 .pw-cell { 168 display: table-cell; 169 margin-bottom: 1em; 170 } 171 #pwindicator { 172 display: table-cell; 173 vertical-align: bottom; 174 padding-left: 1.5em; 175 height: 3.8em; 176 } 177 #pwindicator .bar { 178 height: 6px; 179 margin-bottom: 4px; 180 } 181 .pw-very-weak .bar { 182 background: #900; 183 width: 30px; 184 } 185 .pw-weak .bar { 186 background: #c00; 187 width: 60px; 188 } 189 .pw-mediocre .bar { 190 background: #f60; 191 width: 90px; 192 } 193 .pw-strong .bar { 194 background: #060; 195 width: 120px; 196 } 197 .pw-very-strong .bar { 198 background: #0c0; 199 width: 150px; 200 } -
admin/update.php
r1553 r1620 249 249 '<p class="message">'. 250 250 __("Congratulations, you're one click away from the end of the update."). 251 ' <strong><a href="index.php?logout=1">'.__('Finish the update ').'</a>.</strong>'.251 ' <strong><a href="index.php?logout=1">'.__('Finish the update.').'</a></strong>'. 252 252 '</p>'; 253 253 } -
admin/user.php
r1609 r1620 172 172 dcPage::open($page_title, 173 173 dcPage::jsConfirmClose('user-form'). 174 dcPage::jsLoad('js/jquery/jquery.pwstrength.js'). 175 '<script type="text/javascript">'."\n". 176 "//<![CDATA[\n". 177 "\$(function() {\n". 178 " \$('#new_pwd').pwstrength({texts: ['". 179 sprintf(__('Password strength: %s'),__('very weak'))."', '". 180 sprintf(__('Password strength: %s'),__('weak'))."', '". 181 sprintf(__('Password strength: %s'),__('mediocre'))."', '". 182 sprintf(__('Password strength: %s'),__('strong'))."', '". 183 sprintf(__('Password strength: %s'),__('very strong'))."']});\n". 184 "});\n". 185 "\n//]]>\n". 186 "</script>\n". 174 187 175 188 # --BEHAVIOR-- adminUserHeaders … … 211 224 212 225 echo 213 '<p><label for="new_pwd" '.($user_id != '' ? '' : 'class="required"').'>'. 214 ($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> '). 215 ($user_id != '' ? __('New password:') : __('Password:')).'</label> '. 216 form::password('new_pwd',20,255). 217 '</p>'. 226 '<form action="user.php" method="post" id="user-form">'. 227 '<fieldset><legend>'.__('User information').'</legend>'. 228 '<div class="two-cols">'. 229 '<div class="col">'. 230 '<p><label for="user_id" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Username:').' '. 231 form::field('user_id',20,255,html::escapeHTML($user_id)). 232 '</label></p>'. 233 '<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p>'. 234 235 '<div class="pw-table">'. 236 '<p class="pw-cell">'. 237 '<label for="new_pwd" '.($user_id != '' ? '' : 'class="required"').'>'. 238 ($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> '). 239 ($user_id != '' ? __('New password:') : __('Password:')).'</label>'. 240 form::password('new_pwd',20,255,'','','',false,' data-indicator="pwindicator" '). 241 '</p>'. 242 '<div id="pwindicator">'. 243 ' <div class="bar"></div>'. 244 ' <p class="label no-margin"></p>'. 245 '</div>'. 246 '</div>'. 218 247 '<p class="form-note">'.__('Password must contain at least 6 characters.').'</p>'. 219 248 -
inc/admin/prepend.php
r1604 r1620 322 322 $core->auth->check('usage,contentadmin',$core->blog->id),'menu-new-post'); 323 323 324 $_menu['System']->prependItem(__('Update s'),'update.php','images/menu/update.png',324 $_menu['System']->prependItem(__('Update'),'update.php','images/menu/update.png', 325 325 preg_match('/update.php(\?.*)?$/',$_SERVER['REQUEST_URI']), 326 326 $core->auth->isSuperAdmin() && is_readable(DC_DIGESTS)); -
inc/config.php.in
r1179 r1535 50 50 51 51 // Template cache directory 52 define('DC_TPL_CACHE', dirname(__FILE__).'/../cache');52 define('DC_TPL_CACHE',path::real(dirname(__FILE__).'/..').'/cache'); 53 53 54 54 -
inc/core/class.dc.blog.php
r1610 r1620 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 */ 206 public function triggerComments($ids,$del=false) 207 { 208 $co_ids = dcUtils::cleanIds($ids); 209 210 # a) Retrieve posts affected by comments edition 205 @param affected_posts <b>mixed</b> Posts(s) ID(s) 206 */ 207 public function triggerComments($ids, $del=false, $affected_posts=null) 208 { 209 $comments_ids = dcUtils::cleanIds($ids); 210 211 # Get posts affected by comments edition 212 if (empty($affected_posts)) { 213 $strReq = 214 'SELECT post_id '. 215 'FROM '.$this->prefix.'comment '. 216 'WHERE comment_id'.$this->con->in($comments_ids). 217 'GROUP BY post_id'; 218 219 $rs = $this->con->select($strReq); 220 221 $affected_posts = array(); 222 while ($rs->fetch()) { 223 $affected_posts[] = (integer) $rs->post_id; 224 } 225 } 226 227 if (!is_array($affected_posts) || empty($affected_posts)) { 228 return; 229 } 230 231 # Count number of comments if exists for affected posts 211 232 $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; 223 } 224 225 # b) Count comments of each posts previously retrieved 226 # Note that this does not return posts without comment 227 $strReq = 228 'SELECT post_id, COUNT(post_id) AS nb_comment,comment_trackback '. 233 'SELECT post_id, COUNT(post_id) AS nb_comment, comment_trackback '. 229 234 'FROM '.$this->prefix.'comment '. 230 235 'WHERE comment_status = 1 '. 231 (count($a_ids) > 0 ? 'AND post_id'.$this->con->in($a_ids) : ' '); 232 233 if ($del) { 234 $strReq .= 235 'AND comment_id NOT'.$this->con->in($co_ids); 236 } 237 238 $strReq .= 236 'AND post_id'.$this->con->in($affected_posts). 239 237 'GROUP BY post_id,comment_trackback'; 240 238 241 239 $rs = $this->con->select($strReq); 242 240 243 $ b_ids = $b_tbs = $b_nbs = array();241 $posts = array(); 244 242 while ($rs->fetch()) { 245 $b_ids[] = (integer) $rs->post_id; 246 $b_tbs[] = (integer) $rs->comment_trackback; 247 $b_nbs[] = (integer) $rs->nb_comment; 248 } 249 250 # c) Update comments numbers on posts 251 # This compare previous requests to update also posts without comment 243 if ($rs->comment_trackback) { 244 $posts[$rs->post_id]['trackback'] = $rs->nb_comment; 245 } else { 246 $posts[$rs->post_id]['comment'] = $rs->nb_comment; 247 } 248 } 249 250 # Update number of comments on affected posts 252 251 $cur = $this->con->openCursor($this->prefix.'post'); 253 254 foreach($a_ids as $a_key => $a_id) 255 { 256 $nb_comment = $nb_trackback = 0; 257 foreach($b_ids as $b_key => $b_id) 258 { 259 if ($a_id != $b_id || $a_tbs[$a_key] != $b_tbs[$b_key]) { 260 continue; 261 } 262 263 if ($b_tbs[$b_key]) { 264 $nb_trackback = $b_nbs[$b_key]; 265 } else { 266 $nb_comment = $b_nbs[$b_key]; 267 } 268 } 269 270 if ($a_tbs[$a_key]) { 271 $cur->nb_trackback = $nb_trackback; 252 foreach($affected_posts as $post_id) 253 { 254 $cur->clean(); 255 256 if (!array_key_exists($post_id,$posts)) { 257 $cur->nb_trackback = 0; 258 $cur->nb_comment = 0; 272 259 } else { 273 $cur->nb_comment = $nb_comment; 274 } 275 $cur->update('WHERE post_id = '.$a_id); 260 $cur->nb_trackback = empty($posts[$post_id]['trackback']) ? 0 : $posts[$post_id]['trackback']; 261 $cur->nb_comment = empty($posts[$post_id]['comment']) ? 0 : $posts[$post_id]['comment']; 262 } 263 264 $cur->update('WHERE post_id = '.$post_id); 276 265 } 277 266 } … … 509 498 $this->core->callBehavior('coreBeforeCategoryCreate',$this,$cur); 510 499 511 $this->categories()->addNode($cur,$parent); 500 $id = $this->categories()->addNode($cur,$parent); 501 # Update category's cursor 502 $rs = $this->getCategory($id); 503 if (!$rs->isEmpty()) { 504 $cur->cat_lft = $rs->cat_lft; 505 $cur->cat_rgt = $rs->cat_rgt; 506 } 512 507 513 508 # --BEHAVIOR-- coreAfterCategoryCreate … … 739 734 - no_content: Don't retrieve entry content (excerpt and content) 740 735 - post_type: Get only entries with given type (default "post", array for many types and '' for no type) 741 - post_id: (integer ) Get entry with given post_id736 - post_id: (integer or array) Get entry with given post_id 742 737 - post_url: Get entry with given post_url field 743 738 - user_id: (integer) Get entries belonging to given user ID … … 759 754 - limit: Limit parameter 760 755 - sql_only : return the sql request instead of results. Only ids are selected 756 - exclude_post_id : (integer or array) Exclude entries with given post_id 761 757 762 758 Please note that on every cat_id or cat_url, you can add ?not to exclude … … 852 848 } 853 849 $strReq .= 'AND P.post_id '.$this->con->in($params['post_id']); 850 } 851 852 if (isset($params['exclude_post_id']) && $params['exclude_post_id'] !== '') { 853 if (is_array($params['exclude_post_id'])) { 854 array_walk($params['exclude_post_id'],create_function('&$v,$k','if($v!==null){$v=(integer)$v;}')); 855 } else { 856 $params['exclude_post_id'] = array((integer) $params['exclude_post_id']); 857 } 858 $strReq .= 'AND P.post_id NOT '.$this->con->in($params['exclude_post_id']); 854 859 } 855 860 … … 2235 2240 $co_ids = dcUtils::cleanIds($ids); 2236 2241 2237 if (empty($ ids)) {2242 if (empty($co_ids)) { 2238 2243 throw new Exception(__('No such comment ID')); 2244 } 2245 2246 # Retrieve posts affected by comments edition 2247 $affected_posts = array(); 2248 $strReq = 2249 'SELECT post_id '. 2250 'FROM '.$this->prefix.'comment '. 2251 'WHERE comment_id'.$this->con->in($co_ids). 2252 'GROUP BY post_id'; 2253 2254 $rs = $this->con->select($strReq); 2255 2256 while ($rs->fetch()) { 2257 $affected_posts[] = (integer) $rs->post_id; 2239 2258 } 2240 2259 … … 2266 2285 2267 2286 $this->con->execute($strReq); 2268 $this->triggerComments($co_ids, true);2287 $this->triggerComments($co_ids, true, $affected_posts); 2269 2288 $this->triggerBlog(); 2270 2289 } … … 2321 2340 2322 2341 if ($cur->comment_site !== null && $cur->comment_site != '') { 2323 if (!preg_match('|^http(s?)://| ',$cur->comment_site)) {2342 if (!preg_match('|^http(s?)://|i',$cur->comment_site, $matches)) { 2324 2343 $cur->comment_site = 'http://'.$cur->comment_site; 2344 }else{ 2345 $cur->comment_site = strtolower($matches[0]).substr($cur->comment_site, strlen($matches[0])); 2325 2346 } 2326 2347 } -
inc/core/class.dc.core.php
r1179 r1593 928 928 929 929 if (!empty($params['q'])) { 930 $params['q'] = str _replace('*','%',$params['q']);930 $params['q'] = strtolower(str_replace('*','%',$params['q'])); 931 931 $where .= 932 932 'AND ('. -
inc/public/lib.tpl.context.php
r1179 r1537 416 416 global $core, $_ctx; 417 417 418 $media = new dcMedia($core); 419 $sizes = implode('|',array_keys($media->thumb_sizes)).'|o'; 420 if (!preg_match('/^'.$sizes.'$/',$size)) { 421 $size = 's'; 422 } 423 $p_url = $core->blog->settings->system->public_url; 424 $p_site = preg_replace('#^(.+?//.+?)/(.*)$#','$1',$core->blog->url); 425 $p_root = $core->blog->public_path; 426 427 $pattern = '(?:'.preg_quote($p_site,'/').')?'.preg_quote($p_url,'/'); 428 $pattern = sprintf('/<img.+?src="%s(.*?\.(?:jpg|jpeg|gif|png))"[^>]+/msui',$pattern); 429 430 $src = ''; 431 $alt = ''; 432 433 # We first look in post content 434 if (!$cat_only && $_ctx->posts) 435 { 436 $subject = ($content_only ? '' : $_ctx->posts->post_excerpt_xhtml).$_ctx->posts->post_content_xhtml; 437 if (preg_match_all($pattern,$subject,$m) > 0) 418 try { 419 $media = new dcMedia($core); 420 $sizes = implode('|',array_keys($media->thumb_sizes)).'|o'; 421 if (!preg_match('/^'.$sizes.'$/',$size)) { 422 $size = 's'; 423 } 424 $p_url = $core->blog->settings->system->public_url; 425 $p_site = preg_replace('#^(.+?//.+?)/(.*)$#','$1',$core->blog->url); 426 $p_root = $core->blog->public_path; 427 428 $pattern = '(?:'.preg_quote($p_site,'/').')?'.preg_quote($p_url,'/'); 429 $pattern = sprintf('/<img.+?src="%s(.*?\.(?:jpg|jpeg|gif|png))"[^>]+/msui',$pattern); 430 431 $src = ''; 432 $alt = ''; 433 434 # We first look in post content 435 if (!$cat_only && $_ctx->posts) 438 436 { 439 foreach ($m[1] as $i => $img) { 440 if (($src = self::ContentFirstImageLookup($p_root,$img,$size)) !== false) { 441 $dirname = str_replace('\\', '/', dirname($img)); 442 $src = $p_url.($dirname != '/' ? $dirname : '').'/'.$src; 443 if (preg_match('/alt="([^"]+)"/',$m[0][$i],$malt)) { 444 $alt = $malt[1]; 437 $subject = ($content_only ? '' : $_ctx->posts->post_excerpt_xhtml).$_ctx->posts->post_content_xhtml; 438 if (preg_match_all($pattern,$subject,$m) > 0) 439 { 440 foreach ($m[1] as $i => $img) { 441 if (($src = self::ContentFirstImageLookup($p_root,$img,$size)) !== false) { 442 $dirname = str_replace('\\', '/', dirname($img)); 443 $src = $p_url.($dirname != '/' ? $dirname : '').'/'.$src; 444 if (preg_match('/alt="([^"]+)"/',$m[0][$i],$malt)) { 445 $alt = $malt[1]; 446 } 447 break; 445 448 } 446 break;447 449 } 448 450 } 449 451 } 450 } 451 452 # No src, look in category description if available 453 if (!$src && $with_category && $_ctx->posts->cat_desc) 454 { 455 if (preg_match_all($pattern,$_ctx->posts->cat_desc,$m) > 0) 456 { 457 foreach ($m[1] as $i => $img) { 458 if (($src = self::ContentFirstImageLookup($p_root,$img,$size)) !== false) { 459 $dirname = str_replace('\\', '/', dirname($img)); 460 $src = $p_url.($dirname != '/' ? $dirname : '').'/'.$src; 461 if (preg_match('/alt="([^"]+)"/',$m[0][$i],$malt)) { 462 $alt = $malt[1]; 452 453 # No src, look in category description if available 454 if (!$src && $with_category && $_ctx->posts->cat_desc) 455 { 456 if (preg_match_all($pattern,$_ctx->posts->cat_desc,$m) > 0) 457 { 458 foreach ($m[1] as $i => $img) { 459 if (($src = self::ContentFirstImageLookup($p_root,$img,$size)) !== false) { 460 $dirname = str_replace('\\', '/', dirname($img)); 461 $src = $p_url.($dirname != '/' ? $dirname : '').'/'.$src; 462 if (preg_match('/alt="([^"]+)"/',$m[0][$i],$malt)) { 463 $alt = $malt[1]; 464 } 465 break; 463 466 } 464 break;465 467 } 466 } 467 }; 468 } 469 470 if ($src) { 471 if ($no_tag) { 472 return $src; 473 } else { 474 return '<img alt="'.$alt.'" src="'.$src.'" class="'.$class.'" />'; 475 } 468 }; 469 } 470 471 if ($src) { 472 if ($no_tag) { 473 return $src; 474 } else { 475 return '<img alt="'.$alt.'" src="'.$src.'" class="'.$class.'" />'; 476 } 477 } 478 479 } catch (Exception $e) { 480 $core->error->add($e->getMessage()); 476 481 } 477 482 } … … 485 490 $base = $info['base']; 486 491 487 $media = new dcMedia($core); 488 $sizes = implode('|',array_keys($media->thumb_sizes)); 489 if (preg_match('/^\.(.+)_('.$sizes.')$/',$base,$m)) { 490 $base = $m[1]; 491 } 492 493 $res = false; 494 if ($size != 'o' && file_exists($root.'/'.$info['dirname'].'/.'.$base.'_'.$size.'.jpg')) 495 { 496 $res = '.'.$base.'_'.$size.'.jpg'; 497 } 498 else 499 { 500 $f = $root.'/'.$info['dirname'].'/'.$base; 501 if (file_exists($f.'.'.$info['extension'])) { 502 $res = $base.'.'.$info['extension']; 503 } elseif (file_exists($f.'.jpg')) { 504 $res = $base.'.jpg'; 505 } elseif (file_exists($f.'.jpeg')) { 506 $res = $base.'.jpeg'; 507 } elseif (file_exists($f.'.png')) { 508 $res = $base.'.png'; 509 } elseif (file_exists($f.'.gif')) { 510 $res = $base.'.gif'; 511 } elseif (file_exists($f.'.JPG')) { 512 $res = $base.'.JPG'; 513 } elseif (file_exists($f.'.JPEG')) { 514 $res = $base.'.JPEG'; 515 } elseif (file_exists($f.'.PNG')) { 516 $res = $base.'.PNG'; 517 } elseif (file_exists($f.'.GIF')) { 518 $res = $base.'.GIF'; 519 } 492 try { 493 $media = new dcMedia($core); 494 $sizes = implode('|',array_keys($media->thumb_sizes)); 495 if (preg_match('/^\.(.+)_('.$sizes.')$/',$base,$m)) { 496 $base = $m[1]; 497 } 498 499 $res = false; 500 if ($size != 'o' && file_exists($root.'/'.$info['dirname'].'/.'.$base.'_'.$size.'.jpg')) 501 { 502 $res = '.'.$base.'_'.$size.'.jpg'; 503 } 504 else 505 { 506 $f = $root.'/'.$info['dirname'].'/'.$base; 507 if (file_exists($f.'.'.$info['extension'])) { 508 $res = $base.'.'.$info['extension']; 509 } elseif (file_exists($f.'.jpg')) { 510 $res = $base.'.jpg'; 511 } elseif (file_exists($f.'.jpeg')) { 512 $res = $base.'.jpeg'; 513 } elseif (file_exists($f.'.png')) { 514 $res = $base.'.png'; 515 } elseif (file_exists($f.'.gif')) { 516 $res = $base.'.gif'; 517 } elseif (file_exists($f.'.JPG')) { 518 $res = $base.'.JPG'; 519 } elseif (file_exists($f.'.JPEG')) { 520 $res = $base.'.JPEG'; 521 } elseif (file_exists($f.'.PNG')) { 522 $res = $base.'.PNG'; 523 } elseif (file_exists($f.'.GIF')) { 524 $res = $base.'.GIF'; 525 } 526 } 527 } catch (Exception $e) { 528 $core->error->add($e->getMessage()); 520 529 } 521 530 -
locales/bn/main.po
r1615 r1620 836 836 msgstr "পড়ে মনে করিয়ে দিও" 837 837 838 msgid " information about this version"838 msgid "<a href=\"%s\">Information about this version</a>." 839 839 msgstr "" 840 840 … … 2397 2397 msgstr "ব্লগ" 2398 2398 2399 msgid "Update s"2399 msgid "Update" 2400 2400 msgstr "" 2401 2401 -
locales/ca/main.po
r1615 r1620 867 867 msgstr "" 868 868 869 msgid " information about this version"869 msgid "<a href=\"%s\">Information about this version</a>." 870 870 msgstr "" 871 871 … … 2478 2478 msgstr "Blog" 2479 2479 2480 msgid "Update s"2480 msgid "Update" 2481 2481 msgstr "" 2482 2482 -
locales/cs/main.po
r1615 r1620 844 844 msgstr "Připomenout později" 845 845 846 msgid " information about this version"846 msgid "<a href=\"%s\">Information about this version</a>." 847 847 msgstr "" 848 848 … … 2399 2399 msgstr "Blog" 2400 2400 2401 msgid "Update s"2401 msgid "Update" 2402 2402 msgstr "Aktualizace" 2403 2403 -
locales/da/main.po
r1615 r1620 845 845 msgstr "Påmind mig senere" 846 846 847 msgid " information about this version"847 msgid "<a href=\"%s\">Information about this version</a>." 848 848 msgstr "" 849 849 … … 2409 2409 msgstr "" 2410 2410 2411 msgid "Update s"2411 msgid "Update" 2412 2412 msgstr "" 2413 2413 -
locales/de/main.po
r1615 r1620 841 841 msgstr "Erinnere mich später" 842 842 843 msgid " information about this version"843 msgid "<a href=\"%s\">Information about this version</a>." 844 844 msgstr "Informationen zu dieser Version" 845 845 … … 2400 2400 msgstr "Blog" 2401 2401 2402 msgid "Update s"2402 msgid "Update" 2403 2403 msgstr "Aktualisierungen" 2404 2404 -
locales/en/main.po
r1615 r1620 829 829 msgstr "" 830 830 831 msgid "information about this version" 831 #, php-format 832 msgid "<a href=\"%s\">Information about this version</a>." 832 833 msgstr "" 833 834 … … 2358 2359 msgstr "" 2359 2360 2360 msgid "Update s"2361 msgid "Update" 2361 2362 msgstr "" 2362 2363 -
locales/eo/main.po
r1615 r1620 826 826 msgstr "" 827 827 828 msgid " information about this version"828 msgid "<a href=\"%s\">Information about this version</a>." 829 829 msgstr "" 830 830 … … 2346 2346 msgstr "" 2347 2347 2348 msgid "Update s"2348 msgid "Update" 2349 2349 msgstr "" 2350 2350 -
locales/es-ar/main.po
r1615 r1620 847 847 msgstr "Recordar mas tarde" 848 848 849 msgid " information about this version"849 msgid "<a href=\"%s\">Information about this version</a>." 850 850 msgstr "" 851 851 … … 2416 2416 msgstr "Blog" 2417 2417 2418 msgid "Update s"2418 msgid "Update" 2419 2419 msgstr "Actualizaciones" 2420 2420 -
locales/es/main.po
r1615 r1620 850 850 msgstr "Recordármelo más tarde" 851 851 852 msgid " information about this version"852 msgid "<a href=\"%s\">Information about this version</a>." 853 853 msgstr "" 854 854 … … 2421 2421 msgstr "Blog" 2422 2422 2423 msgid "Update s"2423 msgid "Update" 2424 2424 msgstr "Actualizaciones" 2425 2425 -
locales/eu/main.po
r1615 r1620 826 826 msgstr "" 827 827 828 msgid " information about this version"828 msgid "<a href=\"%s\">Information about this version</a>." 829 829 msgstr "" 830 830 … … 2346 2346 msgstr "" 2347 2347 2348 msgid "Update s"2348 msgid "Update" 2349 2349 msgstr "" 2350 2350 -
locales/fr/main.po
r1615 r1620 889 889 msgstr "Me le rappeler plus tard" 890 890 891 msgid "information about this version" 892 msgstr "Information à propos de cette version" 891 #, php-format 892 msgid "<a href=\"%s\">Information about this version</a>." 893 msgstr "<a href=\"%s\">Information à propos de cette version</a>." 893 894 894 895 msgid "Some plugins are installed twice:" … … 2516 2517 msgstr "Blog" 2517 2518 2518 msgid "Update s"2519 msgstr "Mise sà jour"2519 msgid "Update" 2520 msgstr "Mise à jour" 2520 2521 2521 2522 msgid "Languages" -
locales/hu/main.po
r1615 r1620 867 867 msgstr "Értesíts később" 868 868 869 msgid " information about this version"869 msgid "<a href=\"%s\">Information about this version</a>." 870 870 msgstr "" 871 871 … … 2457 2457 msgstr "Blog" 2458 2458 2459 msgid "Update s"2459 msgid "Update" 2460 2460 msgstr "Frissítések" 2461 2461 -
locales/it/main.po
r1615 r1620 843 843 msgstr "Ricorda in seguito" 844 844 845 msgid " information about this version"845 msgid "<a href=\"%s\">Information about this version</a>." 846 846 msgstr "" 847 847 … … 2398 2398 msgstr "Blog" 2399 2399 2400 msgid "Update s"2400 msgid "Update" 2401 2401 msgstr "Aggiornamenti" 2402 2402 -
locales/ja/main.po
r1615 r1620 852 852 msgstr "後で再度知らせる" 853 853 854 msgid " information about this version"854 msgid "<a href=\"%s\">Information about this version</a>." 855 855 msgstr "" 856 856 … … 2430 2430 msgstr "ブログ" 2431 2431 2432 msgid "Update s"2432 msgid "Update" 2433 2433 msgstr "アップデート" 2434 2434 -
locales/ko/main.po
r1615 r1620 851 851 msgstr "나중에 다시 알려줌" 852 852 853 msgid " information about this version"853 msgid "<a href=\"%s\">Information about this version</a>." 854 854 msgstr "" 855 855 … … 2431 2431 msgstr "블로그" 2432 2432 2433 msgid "Update s"2433 msgid "Update" 2434 2434 msgstr "DotClear 갱신" 2435 2435 -
locales/lt/main.po
r1615 r1620 2205 2205 msgstr "Blogas" 2206 2206 2207 msgid "Update s"2207 msgid "Update" 2208 2208 msgstr "Atnaujinimai" 2209 2209 -
locales/nl/main.po
r1615 r1620 829 829 msgstr "" 830 830 831 msgid " information about this version"831 msgid "<a href=\"%s\">Information about this version</a>." 832 832 msgstr "" 833 833 … … 2361 2361 msgstr "" 2362 2362 2363 msgid "Update s"2363 msgid "Update" 2364 2364 msgstr "" 2365 2365 -
locales/oc/main.po
r1615 r1620 835 835 msgstr "" 836 836 837 msgid " information about this version"837 msgid "<a href=\"%s\">Information about this version</a>." 838 838 msgstr "" 839 839 … … 2379 2379 msgstr "Blòg" 2380 2380 2381 msgid "Update s"2381 msgid "Update" 2382 2382 msgstr "" 2383 2383 -
locales/pl/main.po
r1615 r1620 837 837 msgstr "Przypomnij mi później" 838 838 839 msgid " information about this version"839 msgid "<a href=\"%s\">Information about this version</a>." 840 840 msgstr "informacje o tej wersji" 841 841 … … 2372 2372 msgstr "Blog" 2373 2373 2374 msgid "Update s"2374 msgid "Update" 2375 2375 msgstr "Uaktualnienia" 2376 2376 -
locales/pt-br/main.po
r1615 r1620 870 870 msgstr "" 871 871 872 msgid " information about this version"872 msgid "<a href=\"%s\">Information about this version</a>." 873 873 msgstr "" 874 874 … … 2497 2497 msgstr "Blog" 2498 2498 2499 msgid "Update s"2499 msgid "Update" 2500 2500 msgstr "" 2501 2501 -
locales/pt/main.po
r1615 r1620 848 848 msgstr "Lembrar-me mais tarde" 849 849 850 msgid " information about this version"850 msgid "<a href=\"%s\">Information about this version</a>." 851 851 msgstr "" 852 852 … … 2408 2408 msgstr "Blog" 2409 2409 2410 msgid "Update s"2410 msgid "Update" 2411 2411 msgstr "Actualizações" 2412 2412 -
locales/ro/main.po
r1615 r1620 828 828 msgstr "" 829 829 830 msgid " information about this version"830 msgid "<a href=\"%s\">Information about this version</a>." 831 831 msgstr "" 832 832 … … 2357 2357 msgstr "" 2358 2358 2359 msgid "Update s"2359 msgid "Update" 2360 2360 msgstr "" 2361 2361 -
locales/ru/main.po
r1615 r1620 847 847 msgstr "Напомнить мне позже" 848 848 849 msgid " information about this version"849 msgid "<a href=\"%s\">Information about this version</a>." 850 850 msgstr "" 851 851 … … 2399 2399 msgstr "Блог" 2400 2400 2401 msgid "Update s"2401 msgid "Update" 2402 2402 msgstr "Обновления" 2403 2403 -
locales/sr/main.po
r1615 r1620 858 858 msgstr "" 859 859 860 msgid " information about this version"860 msgid "<a href=\"%s\">Information about this version</a>." 861 861 msgstr "" 862 862 … … 2444 2444 msgstr "Blog" 2445 2445 2446 msgid "Update s"2446 msgid "Update" 2447 2447 msgstr "" 2448 2448 -
locales/sv/main.po
r1615 r1620 826 826 msgstr "" 827 827 828 msgid " information about this version"828 msgid "<a href=\"%s\">Information about this version</a>." 829 829 msgstr "" 830 830 … … 2346 2346 msgstr "" 2347 2347 2348 msgid "Update s"2348 msgid "Update" 2349 2349 msgstr "" 2350 2350 -
locales/te/main.po
r1615 r1620 854 854 msgstr "" 855 855 856 msgid " information about this version"856 msgid "<a href=\"%s\">Information about this version</a>." 857 857 msgstr "" 858 858 … … 2426 2426 msgstr "బ్లాగు" 2427 2427 2428 msgid "Update s"2428 msgid "Update" 2429 2429 msgstr "" 2430 2430 -
locales/tr/main.po
r1615 r1620 840 840 msgstr "Gelecekte beni hatırla" 841 841 842 msgid " information about this version"842 msgid "<a href=\"%s\">Information about this version</a>." 843 843 msgstr "" 844 844 … … 2404 2404 msgstr "Blog" 2405 2405 2406 msgid "Update s"2406 msgid "Update" 2407 2407 msgstr "Güncellemeler" 2408 2408 -
locales/zh-cn/main.po
r1615 r1620 845 845 msgstr "稍后提醒我" 846 846 847 msgid " information about this version"847 msgid "<a href=\"%s\">Information about this version</a>." 848 848 msgstr "" 849 849 … … 2407 2407 msgstr "博客" 2408 2408 2409 msgid "Update s"2409 msgid "Update" 2410 2410 msgstr "更新" 2411 2411 -
plugins/pages/page.php
r1619 r1620 139 139 $core->media = new dcMedia($core); 140 140 $post_media = $core->media->getPostMedia($post_id); 141 } catch (Exception $e) {} 141 } catch (Exception $e) { 142 $core->error->add($e->getMessage()); 143 } 142 144 } 143 145 }
Note: See TracChangeset
for help on using the changeset viewer.
