Beispiel #1
0
 public function analyse($attach)
 {
     if ($attach['type'] == 'img' && $attach['cost'] == 0) {
         $atype = 'pic';
         $url = Pw::getPath($attach['path']);
         $img = PwUbbCode::createImg(Pw::getPath($attach['path'], $attach['ifthumb'] & 1), $this->imgWidth, $this->imgHeight, $url, $this->imgLazy);
         $attr = '';
         if ($this->imgLazy && ($tmp = $this->_compare($attach['width'], $attach['height'], $this->imgWidth, $this->imgHeight))) {
             $attr .= ' width="' . $tmp[0] . '"';
             $attr .= ' height="' . $tmp[1] . '"';
         }
         $attach['descrip'] && ($attr .= ' alt="' . WindSecurity::escapeHTML($attach['descrip']) . '"');
         $attr && ($img = substr($img, 0, -3) . $attr . ' />');
         $attach += array('url' => $url, 'img' => $img, 'miniUrl' => Pw::getPath($attach['path'], $attach['ifthumb']));
     } else {
         $atype = 'downattach';
         $attach += array('cname' => '', 'ext' => strtolower(substr(strrchr($attach['name'], '.'), 1)));
     }
     return array($atype, $attach);
 }