Example #1
0
 function checkgeturl(&$url, $direct = false)
 {
     global $phpenv, $setctl;
     if ($this->check()) {
         if (!file_exists($this->getfname())) {
             $this->createsid();
         }
         $fname = $this->getfname();
         if (file_exists($fname)) {
             $sdir = noslash($setctl->get('storealbumrelative'));
             $imgsrc = slashstart($sdir) . '/' . kp_basename($fname);
             if (!$direct) {
                 $url = '<img alt="image" border="0" src="' . $imgsrc . '" height="' . $this->h . '" width="' . $this->w . '"/>';
             } else {
                 $url = $setctl->get('streamurl') . $phpenv['host'] . $imgsrc;
             }
             return true;
         }
     }
     return false;
 }
Example #2
0
 function finddirimage()
 {
     global $setctl;
     $albumfiles = explode(',', strtoupper($setctl->get('albumfiles')));
     for ($i = 0, $c = count($albumfiles); $i < $c; $i++) {
         $amatch = trim($albumfiles[$i]);
         if (empty($amatch)) {
             continue;
         }
         for ($i2 = 0, $c2 = count($this->rows); $i2 < $c2; $i2++) {
             if (fmatch(strtoupper(kp_basename($this->rows[$i2][1])), $amatch)) {
                 $fdesc = new filedesc(kp_basename($this->rows[$i2][1]));
                 $this->mime = $fdesc->mime;
                 $this->dirimageid = $this->rows[$i2][0];
                 return true;
             }
         }
     }
     return false;
 }