Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Thursday, October 15, 2026

Diff for phpMyEdit/phpMyEdit.class.php between version 1.21 and 1.22

version 1.21, 2002/10/29 16:17:57 version 1.22, 2002/10/29 16:54:47
Line 19 
Line 19 
  * http://www.platon.sk/projects/phpMyEdit/   * http://www.platon.sk/projects/phpMyEdit/
  */   */
   
 /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.20 2002/10/29 15:25:03 nepto Exp $ */  /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.21 2002/10/29 16:17:57 nepto Exp $ */
   
 /*      phpMyEdit intro {{{ */  /*      phpMyEdit intro {{{ */
 /*  /*
Line 184  class phpMyEdit
Line 184  class phpMyEdit
                 return $ret;                  return $ret;
         } /* }}} */          } /* }}} */
   
         function htmlDisplay($field, $str, $usemask = true, $usecodec = true, $disallow_empty = true) /* {{{ */          function htmlDisplay($field, $str, $usemask = true, $usecodec = true, $disallow_empty = true, $escape = true) /* {{{ */
         {          {
                 // undo the add slashes                  // undo the add slashes
                 $str = stripslashes($str);                  $str = stripslashes($str);
   
                 // if there's a field mask, use it as first arg to sprintf                  // if there's a field mask, use it as first arg to sprintf
                 if (isset($field['mask']) && $usemask) {                  if (isset($field['mask']) && $usemask) {
                         $str = sprintf($field['mask'],$str);                          $str = sprintf($field['mask'], $str);
                 }                  }
                 if ($usecodec) {                  if ($usecodec) { // if db codec is in effect, use it
                         // if db codec is in effect, use it                          isset($field['dbdecode']) && $str = eval('return '.$field['dbdecode'].'(\''.$str.'\');');
                         if (isset($field['dbdecode'])) {                          $escape                   && $str = htmlspecialchars($str);
                                 $str = htmlspecialchars(eval('return '.$field['dbdecode'].'(\''.$str.'\');'));  
                         } else {  
                                 $str = htmlspecialchars($str);  
                         }  
                 }                  }
                 if ($disallow_empty) {                  if ($disallow_empty) {
                         strlen($str) <= 0 && $str = '&nbsp;';                          strlen($str) <= 0 && $str = '&nbsp;';
Line 1064  return true;
Line 1060  return true;
         {          {
                 echo '<td>';                  echo '<td>';
                 if ($this->is_values2($k, $row["qf$k"])) {                  if ($this->is_values2($k, $row["qf$k"])) {
                         echo $this->fdd[$k]['values2'][$row['qf'.$k.'_idx']];                          echo nl2br($this->htmlDisplay($k, $this->fdd[$k]['values2'][$row['qf'.$k.'_idx']], true, true, true, false));
                 } else if ($row["qf$k"] == '') {  
                         echo '&nbsp;';  
                 } else {                  } else {
                         echo nl2br($this->htmlDisplay($this->fdd[$k], $row["qf$k"]));                          echo nl2br($this->htmlDisplay($this->fdd[$k], $row["qf$k"]));
                 }                  }
Line 2052  return true;
Line 2046  return true;
                                                         : '';                                                          : '';
                                                 isset($this->fdd[$k]['URLprefix'])  && $urllink  = $this->fdd[$k]['URLprefix'].$urllink;                                                  isset($this->fdd[$k]['URLprefix'])  && $urllink  = $this->fdd[$k]['URLprefix'].$urllink;
                                                 isset($this->fdd[$k]['URLpostfix']) && $urllink .= $this->fdd[$k]['URLpostfix'];                                                  isset($this->fdd[$k]['URLpostfix']) && $urllink .= $this->fdd[$k]['URLpostfix'];
                                                 $urllink = htmlspecialchars($urllink);                                                  if (strlen($urllink) <= 0 || strlen($urldisp) <= 0) {
                                                 $urldisp = htmlspecialchars($urldisp);                                                          echo '&nbsp;';
                                                 echo '<a '.$target.'class="pme_a_u" href="'.$urllink.'">'.$urldisp.'</a>';                                                  } else {
                                                           $urllink = htmlspecialchars($urllink);
                                                           $urldisp = htmlspecialchars($urldisp);
                                                           echo '<a '.$target.'class="pme_a_u" href="'.$urllink.'">'.$urldisp.'</a>';
                                                   }
                                         } elseif (isset($this->fdd[$k]['datemask'])) {                                          } elseif (isset($this->fdd[$k]['datemask'])) {
                                                 // display date according to a mask if any                                                  // display date according to a mask if any
                                                 //echo $this->mdate_set($row[$k],$this->fdd[$k]['type'],$this->fdd[$k]['datemask']);                                                  //echo $this->mdate_set($row[$k],$this->fdd[$k]['type'],$this->fdd[$k]['datemask']);
Line 2084  return true;
Line 2082  return true;
                                         } else {                                          } else {
                                                 // it's a normal field                                                  // it's a normal field
                                                 if ($this->is_values2($k, $row["qf$k"])) {                                                  if ($this->is_values2($k, $row["qf$k"])) {
                                                         $shortdisp  = $this->fdd[$k]['values2'][$row['qf'.$k.'_idx']];                                                          $escape_flag = false;
                                                         //$shortdisp .= ' ('.$row['qf'.$k.'_idx'].')';                                                          $shortdisp   = $this->fdd[$k]['values2'][$row['qf'.$k.'_idx']];
                                                         !isset($shortdisp) && $shortdisp = '';  
                                                         echo $shortdisp;  
                                                 } else {                                                  } else {
                                                           $escape_flag = true;
                                                         $shortdisp = $row["qf$k"];                                                          $shortdisp = $row["qf$k"];
                                                         if ($this->fdd[$k]['strip_tags']) {                                                          if ($this->fdd[$k]['strip_tags']) {
                                                                 $shortdisp = strip_tags($shortdisp);                                                                  $shortdisp = strip_tags($shortdisp);
Line 2098  return true;
Line 2095  return true;
                                                                 $shortdisp = ereg_replace("[\r\n\t ]+",' ',$shortdisp);                                                                  $shortdisp = ereg_replace("[\r\n\t ]+",' ',$shortdisp);
                                                                 $shortdisp = substr($shortdisp,0,$this->fdd[$k]['trimlen']-3).'...';                                                                  $shortdisp = substr($shortdisp,0,$this->fdd[$k]['trimlen']-3).'...';
                                                         }                                                          }
                                                         echo nl2br($this->htmlDisplay($this->fdd[$k], $shortdisp));  
                                                 }                                                  }
                                                   echo nl2br($this->htmlDisplay($this->fdd[$k], $shortdisp, true, true, true, $escape_flag));
                                         }                                          }
                                 } else {                                  } else {
                                         // it's hidden or a password                                          // it's hidden or a password

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top