Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Nedeľa, 15. november 2026

Rozdiely pre Metafox/subst.inc.php medzi verziami 1.31 a 1.32

verzia 1.31, 2007/06/24 23:16:27 verzia 1.32, 2007/09/16 16:27:37
Riadok 17 
Riadok 17 
  * http://platon.sk/projects/Metafox/   * http://platon.sk/projects/Metafox/
  */   */
   
 /* $Platon: Metafox/subst.inc.php,v 1.30 2007-05-20 21:58:02 nepto Exp $ */  /* $Platon: Metafox/subst.inc.php,v 1.31 2007-06-24 23:16:27 nepto Exp $ */
   
 require_once 'cfgldr.inc.php';  require_once 'cfgldr.inc.php';
 require_once 'error.inc.php';  require_once 'error.inc.php';
Riadok 434  if ($ezin_db_article != '' && ! empty($e
Riadok 434  if ($ezin_db_article != '' && ! empty($e
         ezin_article_link_process($ezin_db_article);          ezin_article_link_process($ezin_db_article);
         ezin_article_counts_process($ezin_db_article);          ezin_article_counts_process($ezin_db_article);
         // This removes width="..." attribute from <image> tag at article_print page          // This removes width="..." attribute from <image> tag at article_print page
         if ($ezin_cgi['output'] == 'article_print') {          // if image is less than 10% smaller or bigger
                 $ezin_db_article['article_bodytext'] = preg_replace(          if ($ezin_cgi['output'] == 'article_print') { // {{{
                                 '/<image([^<>]*\s+)(width=("[^<>"]+"|[^<>\s]+))(|\s+[^<>]*)>/i',                  preg_match_all('|<image(-link)?\s+([^>\s]+)([^>]*width=([^>\s]+)[^>]*)>|i',
                                 '<image\1\4>', $ezin_db_article['article_bodytext']);                                  $ezin_db_article['article_bodytext'], $matches, PREG_SET_ORDER);
         }                  foreach ($matches as $key => $val) {
                           $treshold  = 10; // percent // TODO: should be configurable
                           $scaleskip = false;
                           $file      = $val[2];
                           $width     = $val[4];
                           $width     = preg_replace('/["\']/', '', trim($width));
                   $pct       = $width[strlen($width) - 1] == '%';
                           $width     = intval($width);
                           if ($width <= 0) {
                                   continue;
                           }
                           if ($pct) {
                                   if (abs(100 - $width) <= $treshold) {
                                           $scaleskip = true;
                                   }
                           } else {
                                   $ori_width = ezin_get_upload_image_width($file);
                                   if ($width > 0 && $ori_width > 0) {
                                           $div = $width / $ori_width;
                                           if (abs(1 - $div) * 100 <= $treshold) {
                                                   $scaleskip = true;
                                           }
                                   }
                           }
                           if ($scaleskip) {
                                   $ezin_db_article['article_bodytext'] = preg_replace(
                                                   '/<image(-link)?\s+'.$file.'(\s+[^<>]*)(width=("[^<>"]+"|[^<>\s]+))(|\s+[^<>]*)>/i',
                                                   '<image\1 '.$file.'\2\5>', $ezin_db_article['article_bodytext']);
                           }
                   }
           } // }}}
         ezin_handle_special_tags($ezin_db_article['article_hometext'], $ezin_db_article['article_hometext_flags']);          ezin_handle_special_tags($ezin_db_article['article_hometext'], $ezin_db_article['article_hometext_flags']);
         ezin_handle_special_tags($ezin_db_article['article_bodytext'], $ezin_db_article['article_bodytext_flags']);          ezin_handle_special_tags($ezin_db_article['article_bodytext'], $ezin_db_article['article_bodytext_flags']);
         ezin_process_text_flags($ezin_db_article['article_hometext'], 'article_hometext');          ezin_process_text_flags($ezin_db_article['article_hometext'], 'article_hometext');

Legend:
Odstranené z verzie1.31  
zmenené riadky
  Pridané vo verzii1.32

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok