function hotlinkimage($cat_id, $type, $imgid, $key)
 {
     global $mosConfig_live_site, $my;
     $gallery = new gallery($cat_id, false);
     if (!$key) {
         $key = $gallery->getImageKey($imgid);
     } else {
         $imgid = $gallery->_images[$key]->_id;
     }
     $image = new image($imgid);
     $image->getInfo();
     if ($this->_CONFIG['hotlinkProtection']) {
         $params = "uid=" . $my->id . "&catid=" . $cat_id . "&key=" . $key . "&type=" . $type;
         $params = $this->encrypt($params);
         return $mosConfig_live_site . "/components/com_zoom/www/image.php?q=" . $params;
     } else {
         if ($type == '0') {
             return $mosConfig_live_site . "/" . $this->_CONFIG['imagepath'] . $gallery->_dir . "/" . $image->_viewsize;
         } elseif ($type == '1') {
             return $mosConfig_live_site . "/" . $this->_CONFIG['imagepath'] . $gallery->_dir . "/" . $image->_filename;
         } else {
             return $image->_thumbnail;
         }
     }
 }
Example #2
0
 function comGenerateVideo()
 {
     require_once 'include/class/image.php';
     $image = new image(false);
     $image->video = 'flv';
     $image->id = $this->data['id'];
     $image->getCacheName();
     $image->getInfo();
     $image->generate();
     $this->html = ' setVideoGenerated()';
     $xml = '<?xml version="1.0" encoding="UTF-8" ?>
   <RESPONSE>
     <INFO>
       <COMMAND>' . $this->command . '</COMMAND>
       <ID>' . $this->data['id'] . '</ID>
       <PID>' . $this->data['pid'] . '</PID>
     </INFO>
   </RESPONSE>';
     $xml = preg_replace('/(\\s*)(.*)\\n/', "\\2\n", $xml);
     $xml = preg_replace('/>(\\s*)\\n(\\s*)</', "><", $xml);
     $this->html = $xml;
 }
Example #3
0
     $rating = "Explicit";
 } else {
     if ($rating == "q") {
         $rating = "Questionable";
     } else {
         $rating = "Safe";
     }
 }
 if ($userc->check_log()) {
     $user = $checked_username;
 } else {
     $user = "******";
 }
 $ip = $db->real_escape_string($_SERVER['REMOTE_ADDR']);
 $thumb = $image->thumbnail($iinfo[0] . "/" . $iinfo[1]);
 $isinfo = $image->getInfo();
 $query = "INSERT INTO {$post_table}(creation_date, hash, image, title, owner, height, width, ext, rating, tags, directory, source, active_date, ip) VALUES(NOW(), '" . md5_file("./images/" . $iinfo[0] . "/" . $iinfo[1]) . "', '" . $iinfo[1] . "', '{$title}', '{$user}', '" . $isinfo[1] . "', '" . $isinfo[0] . "', '{$ext}', '{$rating}', '{$tags}', '" . $iinfo[0] . "', '{$source}', '" . date("Ymd") . "', '{$ip}')";
 if (!is_dir("./thumbnails/" . $iinfo[0] . "/")) {
     $image->makethumbnailfolder($iinfo[0]);
 }
 if (!$thumb) {
     print "Thumbnail generation failed! A serious error occurred and the image could not be resized.<br /><br />";
 }
 if (!$db->query($query)) {
     print "failed to upload image.";
     print $query;
     unlink("./images/" . $iinfo[0] . "/" . $iinfo[1]);
     $image->folder_index_decrement($iinfo[0]);
     $ttags = explode(" ", $tags);
     foreach ($ttags as $current) {
         $tclass->deleteindextag($current);