function send_message($recipient_id, $message)
 {
     global $db;
     $images = new images();
     $sender_id = $_SESSION['user_data']['pet_data']['pet_id'];
     $recipient_id = htmlspecialchars($recipient_id);
     $message = htmlspecialchars($message);
     $date = strtotime(date('Y-m-d H:i:s'));
     $message_date = date('F j Y, H:i:sa');
     $query = "SELECT pet_id, name, lastname, image FROM ?:pets WHERE pet_id = ?i ";
     $parsed = $db->db_quote($query, $sender_id);
     $pet = $db->db_get_array($parsed);
     $pet_name = $pet[0]['name'] . ' ' . $pet[0]['lastname'];
     $image = $images->fn_get_image($pet[0]['pet_id'], 'pet', $pet[0]['image']);
     if (!$image) {
         $thumb = '/images/default-pic.png';
     } else {
         $thumb = $images->fn_generate_thumbnail('pet', _SITE_DOMAIN_HTTP_ . $image['image_path'], 32, 32, true);
     }
     $query = "INSERT INTO ?:messages ?e ";
     $param = array("sender_id" => $sender_id, "recipient_id" => $recipient_id, "message" => $message, "date" => $date, "status" => "N");
     $parsed = $db->db_quote($query, $param);
     $msg_id = $db->db_query($parsed);
     if ($msg_id) {
         $notify = 'Message sent successfully.';
     } else {
         $notify = 'Message sending failed.';
     }
     $data = array("message" => '<li data-message-id="' . $msg_id . '"><div class="message-check"><input type="checkbox" data-message-id="' . $msg_id . '" value="' . $msg_id . '" /></div><div class="message-thumb"><img src="' . $thumb . '" alt="' . $pet_name . '" /></div><div class="message-body"><a href="' . $sender_id . '">' . $pet_name . '</a><div class="message-date">' . $message_date . '</div><p>' . $message . '</p></div></li>', "notify" => $notify);
     return json_encode($data);
 }
Example #2
0
File: add.php Project: WanSpi/wcms
 public function init()
 {
     $this->view = false;
     $res = array();
     foreach ($_FILES as $file) {
         preg_match("/\\/(.+)/", $file["type"], $type);
         $url = $this->createPath() . "." . $type[1];
         move_uploaded_file($file["tmp_name"], $url);
         $image = new images();
         $image->url = $url;
         $image->name = $file["name"];
         $image->size = $file["size"];
         $image->save();
         $img = images::findFirst(array("where" => "url = '{$url}'"));
     }
     echo json_encode(array("id" => $img->id, "url" => $image->url), JSON_FORCE_OBJECT);
 }
Example #3
0
 /**
  * Class construct
  * @return void
  */
 function __construct()
 {
     // file_exists($file) and $this->_file = $file;
     $this->images = images::instance();
     $this->bookimage = BookImage::instance();
     $sitePath = \Yaf\Application::app()->getConfig()->toArray();
     $this->siteUrl = $sitePath['server']['imagesBook'];
     $this->path = $sitePath['path'];
 }
Example #4
0
 function upload()
 {
     $dir = IMAGES_ROOT . 'index/';
     @mkdir(IMAGES_ROOT);
     @mkdir($dir);
     if (!empty($_FILES['file']['name'])) {
         $img_id = md5(date('YmdHis'));
         $file = $dir . $img_id . '.jpg';
         $file_m = $dir . $img_id . '_m.jpg';
         copy($_FILES['file']['tmp_name'], $file);
         images::src($file);
         images::thumb($file_m);
         images::setWidth(150);
         images::resize();
         $array = array('img_id' => $img_id, 'img_set' => '0');
         db::table('images');
         db::smartInsert($array);
     }
     headers::self();
 }
Example #5
0
File: get.php Project: WanSpi/wcms
 public function init()
 {
     $this->view = false;
     $url = $this->getUrl();
     $id = $url[count($url) - 1];
     $image = images::findFirst(array("where" => "id = {$id}"));
     $file_extension = strtolower(substr(strrchr($image->url, "."), 1));
     switch ($file_extension) {
         case "gif":
             $ctype = "image/gif";
             break;
         case "png":
             $ctype = "image/png";
             break;
         case "jpeg":
         case "jpg":
             $ctype = "image/jpeg";
             break;
         default:
     }
     header('Content-type: ' . $ctype);
     echo file_get_contents($image->url);
     return false;
 }
Example #6
0
foreach ($splash as $obj) {
    ?>
					
		<?php 
    if ($obj->url != '') {
        ?>
			<a href="<?php 
        echo $obj->url;
        ?>
">
		<?php 
    }
    ?>
			
			
			<?php 
    echo images::isset_image("/images/_splash/_" . $obj->id . ".jpg", $obj->name, '');
    ?>
		
		<?php 
    if ($obj->url != '') {
        ?>
			</a>
		<?php 
    }
    ?>
					
	<?php 
}
?>
	
Example #7
0
	<?php 
foreach ($news as $obj) {
    ?>
						
				<div class="n_item">
					<a href="<?php 
    echo '/news/' . $obj->url;
    ?>
">
						<?php 
    echo images::isset_image("/images/_news/_" . $obj->id . ".jpg", $obj->zag, 'imgLeft style1');
    ?>
					</a>
					<div class="size10"><?php 
    echo system::show_data($obj->date_news);
    ?>
</div>
					<div><a class="block bold row pb5" href="<?php 
    echo '/news/' . $obj->url;
    ?>
"><?php 
    echo $obj->zag;
    ?>
</a></div>
					<div class="pb5"><?php 
    echo $obj->text_short;
    ?>
</div>
					<div align="left"><a href="<?php 
    echo '/news/' . $obj->url;
    ?>
 function show_posts($pet_id)
 {
     global $db;
     $images = new images();
     $friendly = new friendly();
     $posts = $db->db_get_array("SELECT u.name,u.lastname,u.image AS thumb,p.post_id,p.pet_id,p.date,p.text,p.image,\n                                    CASE WHEN IFNULL(ppl.pet_id,0) = 0 THEN 'Like' ELSE 'Unlike' END liked FROM `rck_pets` u\n                                    INNER JOIN `rck_posts` p ON u.pet_id = p.pet_id AND p.status = ?s\n                                    LEFT JOIN rck_pet_post_likes ppl ON ppl.post_id = p.post_id AND ppl.pet_id = p.pet_id\n                                    WHERE p.pet_id = ?i ORDER BY post_id DESC", "A", $pet_id);
     foreach ($posts as $key => $post) {
         $posts[$key]['image'] = $images->fn_get_image($post['post_id'], 'post', $post['image']);
         $thumb = $images->fn_get_image($post['pet_id'], 'pet', $post['thumb']);
         if (!$thumb) {
             $posts[$key]['thumb'] = _IMAGE_URL_ . 'default-pic.png';
         } else {
             $posts[$key]['thumb'] = $images->fn_generate_thumbnail('pet', $thumb['image_path'], 48, 48, true);
         }
         if ($post['pet_id'] == $pet_id) {
             $posts[$key]['button'] = '<div><a href="javascript:void(0);" class="delete-post" id="delete-post-' . $post['post_id'] . '" title="Delete this Post"><span>Delete</span></a></div>';
         } else {
             $posts[$key]['button'] = '';
         }
         $post_id = $post['post_id'];
         $tags = $db->db_get_array("select value from rck_opt_post_types_lang\n                                     inner join rck_post_types on rck_opt_post_types_lang.type_id = rck_post_types.type_id\n                                     where post_id = ?i and lang_code = ?s ", $post_id, _CLIENT_LANGUAGE_);
         $tmp = '';
         foreach ($tags as $tag) {
             $tdesc = $tag['value'];
             $tmp .= '<a href="' . $friendly->get_seourl_by_module("tags/{$tdesc}", true) . '">' . $tdesc . '</a>, ';
         }
         $posts[$key]['tags'] = substr($tmp, 0, strlen($tmp) - 2);
     }
     return $posts;
 }
function upload_form_perform()
{
    usleep(300);
    writelogs("upload_form_perform() -> OK {$_GET['qqfile']}", __FUNCTION__, __FILE__, __LINE__);
    $sock = new sockets();
    $sock->getFrameWork("services.php?lighttpd-own=yes");
    if (isset($_GET['qqfile'])) {
        $fileName = $_GET['qqfile'];
        if (function_exists("apache_request_headers")) {
            $headers = apache_request_headers();
            if ((int) $headers['Content-Length'] == 0) {
                writelogs("content length is zero", __FUNCTION__, __FILE__, __LINE__);
                die('{error: "content length is zero"}');
            }
        } else {
            writelogs("apache_request_headers() no such function", __FUNCTION__, __FILE__, __LINE__);
        }
    } elseif (isset($_FILES['qqfile'])) {
        $fileName = basename($_FILES['qqfile']['name']);
        writelogs("_FILES['qqfile']['name'] = {$fileName}", __FUNCTION__, __FILE__, __LINE__);
        if ($_FILES['qqfile']['size'] == 0) {
            writelogs("file size is zero", __FUNCTION__, __FILE__, __LINE__);
            die('{error: "file size is zero"}');
        }
    } else {
        writelogs("file not passed", __FUNCTION__, __FILE__, __LINE__);
        die('{error: "file not passed"}');
    }
    writelogs("upload_form_perform() -> OK {$_GET['qqfile']}", __FUNCTION__, __FILE__, __LINE__);
    if (count($_GET)) {
        $datas = json_encode(array_merge($_GET, array('fileName' => $fileName)));
        writelogs($datas, __FUNCTION__, __FILE__, __LINE__);
    } else {
        writelogs("query params not passed", __FUNCTION__, __FILE__, __LINE__);
        die('{error: "query params not passed"}');
    }
    writelogs("upload_form_perform() -> OK {$_GET['qqfile']} upload_max_filesize=" . ini_get('upload_max_filesize') . " post_max_size:" . ini_get('post_max_size'), __FUNCTION__, __FILE__, __LINE__);
    include_once dirname(__FILE__) . "/ressources/class.file.upload.inc";
    $allowedExtensions = array();
    $sizeLimit = qqFileUploader::toBytes(ini_get('upload_max_filesize'));
    $sizeLimit2 = qqFileUploader::toBytes(ini_get('post_max_size'));
    if ($sizeLimit2 < $sizeLimit) {
        $sizeLimit = $sizeLimit2;
    }
    $content_dir = dirname(__FILE__) . "/ressources/conf/upload/";
    $uploader = new qqFileUploader($allowedExtensions, $sizeLimit);
    $result = $uploader->handleUpload($content_dir);
    writelogs("upload_form_perform() -> OK {$resultTXT}", __FUNCTION__, __FILE__, __LINE__);
    $servername = $_GET["servername"];
    $TargetpathUploaded = base64_decode($_GET["TargetpathUploaded"]);
    if (!is_file("{$content_dir}{$fileName}")) {
        die("{error: \"{$content_dir}{$fileName} no such file \"}");
    }
    include_once dirname(__FILE__) . '/ressources/class.images.inc';
    $base = "ressources/profiles/icons";
    $uid = time();
    $jpeg_filename = "{$content_dir}{$fileName}";
    $jpegPhoto_datas = file_get_contents("{$content_dir}{$fileName}");
    $image = new images($jpeg_filename);
    $jpeg_dimensions = @getimagesize($jpeg_filename);
    $img_type = array(1 => "gif", 2 => 'jpg', 3 => 'png', 4 => 'swf', 5 => 'psd', 6 => 'bmp', 7 => 'tiff', 8 => 'tiff', 9 => 'jpc', 10 => 'jp2', 11 => 'jpx');
    $extension = "{$img_type[$jpeg_dimensions[2]]}";
    $thumbnail_path = "{$base}/background-{$servername}.{$extension}";
    if (!$image->thumbnail(393, 125, $thumbnail_path)) {
        die("{error: \"Create image error\"}");
    }
    $tpl = new templates();
    $thumbnail_data = @file_get_contents($thumbnail_path);
    $q = new mysql();
    if (!$q->TABLE_EXISTS("freeweb_slashsquid", "artica_backup")) {
        $q->BuildTables();
    }
    $sql = "SELECT servername FROM freeweb_slashsquid WHERE servername='{$servername}'";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    if ($ligne["servername"] != null) {
        $sql = "UPDATE freeweb_slashsquid SET logoname='" . basename($thumbnail_path) . "',\n\t\tlogoimg='" . mysql_escape_string2($thumbnail_data) . "' WHERE servername='{$servername}'";
    } else {
        $sql = "INSERT INTO freeweb_slashsquid (logoname,logoimg,servername) \n\t\tVALUES ('" . basename($thumbnail_path) . "','" . mysql_escape_string2($thumbnail_data) . "','{$servername}')";
    }
    $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        die("{error: \"" . $tpl->javascript_parse_text("{$q->mysql_error}") . "\"}");
    }
    echo htmlspecialchars(json_encode($result), ENT_NOQUOTES);
    return;
}
Example #10
0
File: edit.php Project: rair/yacs
 $context['text'] .= '<form method="post" action="' . $context['script_url'] . '" id="main_form" enctype="multipart/form-data"><div>';
 $fields = array();
 // the section
 if ($anchor) {
     $context['text'] .= '<input type="hidden" name="anchor" value="' . $anchor->get_reference() . '" />';
 }
 // the image
 $label = i18n::s('Image');
 $input = '';
 $hint = '';
 // display info on current version
 if (isset($item['id']) && $item['id']) {
     $details = array();
     // thumbnail image, if any
     if (isset($item['thumbnail_name'])) {
         $details[] = skin::build_image('inline', Images::get_thumbnail_href($item), '', images::get_icon_href($item));
     }
     // file name
     if (isset($item['image_name'])) {
         $details[] = $item['image_name'];
     }
     // last edition
     if ($item['edit_name']) {
         $details[] = sprintf(i18n::s('posted by %s %s'), Users::get_link($item['edit_name'], $item['edit_address'], $item['edit_id']), Skin::build_date($item['edit_date']));
     }
     // file size
     if (isset($item['image_size'])) {
         $details[] = Skin::build_number($item['image_size'], i18n::s('bytes'));
     }
     if (count($details)) {
         $input .= ucfirst(implode(BR, $details)) . BR . BR;
Example #11
0
function upload_form_perform()
{
    usleep(300);
    writelogs("upload_form_perform() -> OK {$_GET['qqfile']}", __FUNCTION__, __FILE__, __LINE__);
    $sock = new sockets();
    $sock->getFrameWork("services.php?lighttpd-own=yes");
    if (isset($_GET['qqfile'])) {
        $fileName = $_GET['qqfile'];
        if (function_exists("apache_request_headers")) {
            $headers = apache_request_headers();
            if ((int) $headers['Content-Length'] == 0) {
                writelogs("content length is zero", __FUNCTION__, __FILE__, __LINE__);
                die('{error: "content length is zero"}');
            }
        } else {
            writelogs("apache_request_headers() no such function", __FUNCTION__, __FILE__, __LINE__);
        }
    } elseif (isset($_FILES['qqfile'])) {
        $fileName = basename($_FILES['qqfile']['name']);
        writelogs("_FILES['qqfile']['name'] = {$fileName}", __FUNCTION__, __FILE__, __LINE__);
        if ($_FILES['qqfile']['size'] == 0) {
            writelogs("file size is zero", __FUNCTION__, __FILE__, __LINE__);
            die('{error: "file size is zero"}');
        }
    } else {
        writelogs("file not passed", __FUNCTION__, __FILE__, __LINE__);
        die('{error: "file not passed"}');
    }
    writelogs("upload_form_perform() -> OK {$_GET['qqfile']}", __FUNCTION__, __FILE__, __LINE__);
    if (count($_GET)) {
        $datas = json_encode(array_merge($_GET, array('fileName' => $fileName)));
        writelogs($datas, __FUNCTION__, __FILE__, __LINE__);
    } else {
        writelogs("query params not passed", __FUNCTION__, __FILE__, __LINE__);
        die('{error: "query params not passed"}');
    }
    writelogs("upload_form_perform() -> OK {$_GET['qqfile']} upload_max_filesize=" . ini_get('upload_max_filesize') . " post_max_size:" . ini_get('post_max_size'), __FUNCTION__, __FILE__, __LINE__);
    include_once dirname(__FILE__) . "/ressources/class.file.upload.inc";
    $allowedExtensions = array();
    $sizeLimit = qqFileUploader::toBytes(ini_get('upload_max_filesize'));
    $sizeLimit2 = qqFileUploader::toBytes(ini_get('post_max_size'));
    if ($sizeLimit2 < $sizeLimit) {
        $sizeLimit = $sizeLimit2;
    }
    $content_dir = dirname(__FILE__) . "/ressources/conf/upload/";
    $uploader = new qqFileUploader($allowedExtensions, $sizeLimit);
    $result = $uploader->handleUpload($content_dir);
    writelogs("upload_form_perform() -> OK {$resultTXT}", __FUNCTION__, __FILE__, __LINE__);
    $TargetpathUploaded = base64_decode($_GET["TargetpathUploaded"]);
    if (!is_file("{$content_dir}{$fileName}")) {
        die("{error: \"{$content_dir}{$fileName} no such file \"}");
    }
    include_once dirname(__FILE__) . '/ressources/class.images.inc';
    $uid = $_SESSION["uid"];
    $base = "ressources/profiles/icons";
    $user = new user($_SESSION["uid"]);
    $jpeg_filename = "{$content_dir}{$fileName}";
    $jpegPhoto_datas = file_get_contents("{$content_dir}{$fileName}");
    $image = new images($jpeg_filename);
    $jpeg_dimensions = @getimagesize($jpeg_filename);
    $img_type = array(1 => "gif", 2 => 'jpg', 3 => 'png', 4 => 'swf', 5 => 'psd', 6 => 'bmp', 7 => 'tiff', 8 => 'tiff', 9 => 'jpc', 10 => 'jp2', 11 => 'jpx');
    $extension = "{$img_type[$jpeg_dimensions[2]]}";
    $thumbnail_path = "{$base}/background-{$uid}.{$extension}";
    if (!$image->thumbnail(851, 315, $thumbnail_path)) {
        die("{error: \"Create image error\"}");
    }
    @file_put_contents("{$base}/background-{$uid}.loc", $thumbnail_path);
    echo htmlspecialchars(json_encode($result), ENT_NOQUOTES);
    return;
}
Example #12
0
 function text($str, $direct = 'bottom')
 {
     self::getSizes();
     self::$output_type = strtolower(substr(self::getMime(), strpos(self::getMime(), '/') + 1));
     $icfunc = "imagecreatefrom" . self::$output_type;
     $img = @$icfunc(self::$original);
     $color = imagecolorallocatealpha($img, self::$r, self::$g, self::$b, 0);
     if ($direct == 'bottom') {
         if (self::$font) {
             $font_y = self::$font_size * 1.3;
             imagettftext($img, self::$font_size, 0, 10, self::getHeight() - $font_y, $color, self::$font, $str);
         } else {
             imagestring($img, 2, 5, self::getHeight() - 17, $str, $color);
         }
     } else {
         if ($direct == 'top') {
             if (self::$font) {
                 $font_y = self::$font_size * 2;
                 imagettftext($img, self::$font_size, 0, 10, $font_y, $color, self::$font, $str);
             } else {
                 imagestring($img, 2, 5, 2, $str, $color);
             }
         }
     }
     imagejpeg($img, self::$thumb, self::$quality);
     self::destroy();
 }
Example #13
0
 /**
 * Изменяет и сохраняет изображение
 */
 function saveImage($src, $dst, $param = null)
 {
     $img = new images($src, isset($param['w']) ? intval($param['w']) : null, isset($param['h']) ? intval($param['h']) : null, isset($param['fixed']) ? true : false, isset($param['ha']) ? $param['ha'] : 'center', isset($param['va']) ? $param['va'] : 'middle', isset($param['rgb']) ? $param['rgb'] : null, isset($param['alpha']) ? true : false, isset($param['max']) ? $param['max'] : 1024);
     if (isset($param['waterMark'])) {
         $water = new images($param['waterMark'], isset($param['waterW']) ? intval($param['waterW']) : null, isset($param['waterH']) ? intval($param['waterH']) : null, isset($param['waterFixed']) ? true : false, isset($param['waterHa']) ? $param['waterHa'] : 'center', isset($param['waterVa']) ? $param['waterVa'] : 'middle', isset($param['waterRGB']) ? $param['waterRGB'] : null, isset($param['waterAlpha']) ? true : false, isset($param['waterMax']) ? $param['waterMax'] : 1024);
         $img->addWatermark($water, isset($param['waterOffsetX']) ? $param['waterOffsetX'] : 0, isset($param['waterOffsetY']) ? $param['waterOffsetY'] : 0, isset($param['waterOpacity']) ? $param['waterOpacity'] : 100, isset($param['waterAlignH']) ? $param['waterAlignH'] : null, isset($param['waterAlignV']) ? $param['waterAlignV'] : null);
     }
     $res = $img->save($dst);
     if (isset($param['waterMark'])) {
         $water->__destruct();
     }
     $img->__destruct();
     return $res;
 }
Example #14
0
 function multy_update_photo_catalog($id)
 {
     //echo "<pre>".print_r($_FILES,1)."</pre>";
     // проверяем на картинку
     for ($i = 1; $i <= COUNT_PHOTO_CATALOG; $i++) {
         // имя картинки
         $file_name = "file" . $i;
         if ($_FILES[$file_name]['name'] != "") {
             $name_file_destination = $id . '_' . $i . '.jpg';
             // -------------------------------------------------------------------
             $fileuplo = HOST . IMG_CATALOG_PATH . '/' . md5($_FILES[$file_name]['name']);
             move_uploaded_file($_FILES[$file_name]['tmp_name'], $fileuplo);
             // -------------------------------------------------------------------
             // большое
             $filename = HOST . IMG_CATALOG_PATH . '/03/' . $name_file_destination;
             images::img_resize($fileuplo, $filename, _SIZE_03_W, _SIZE_03_H, false, 0);
             // среднее фото
             $filename1 = HOST . IMG_CATALOG_PATH . '/02/' . $name_file_destination;
             images::img_resize($fileuplo, $filename1, _SIZE_02_W, _SIZE_02_H, false, 0);
             // маленькое фото
             $filename2 = HOST . IMG_CATALOG_PATH . '/01/' . $name_file_destination;
             images::img_resize($fileuplo, $filename2, _SIZE_01_W, _SIZE_01_H, false, 0);
             if (SAVE_ORIGINAL_PHOTO) {
                 $filename3 = HOST . IMG_CATALOG_PATH . '/original/' . $name_file_destination;
                 images::img_resize($fileuplo, $filename3, _SIZE_03_W, _SIZE_03_H, false, 0);
             }
             // + watermark
             if (WATERMARK_CATALOG) {
                 images::img_watermark($filename);
             }
             // удаляем загруженное фото
             if (file_exists($fileuplo)) {
                 unlink($fileuplo);
             }
         }
     }
 }
Example #15
0
								
       	<?php 
echo images::isset_image(IMG_NEWS_PATH . "/" . $obj->id . ".jpg", $obj->zag, 'floatleft', 'align="left"');
?>
                                    	
       	<!--<div class="floatright"><a target="_blank" href="/print/news/<?php 
echo $obj->id;
?>
"><img src="/images/_system/printer.gif" alt="Распечатать" /></a></div>-->
		
		<?php 
echo $obj->zag;
?>

        <div><b><?php 
echo system::show_data($obj->date_news);
?>
</b></div>
        <?php 
echo $obj->text;
?>
	
	
	<?php 
/*
	url  		<?php echo '/news/'.$obj->url; ?>
	data  		<?php echo system::show_data($obj->date_news); ?>
	img   		<?php echo images::isset_image("/images/news/_".$obj->id.".jpg",$obj->zag,''); ?>
	zag  		<?php echo $obj->zag; ?>
	text_short	<?php echo $obj->text_short; ?>
	text 		<?php echo $obj->text; ?>
                                include PATH_TEMPLATES . '/bookmarklet.php';
                                break;
                            case 'ad':
                                $locale = $_GET['locale'];
                                if (strlen($locale) > 35) {
                                    exit;
                                }
                                // deliver ad in iframe
                                require_once PATH_CORE . '/classes/adCode.class.php';
                                $adObj = new AdCodeTable();
                                $code = $adObj->fetch($locale);
                                break;
                            case 'scaleImg':
                                // scale image request
                                require_once PATH_CORE . '/classes/images.class.php';
                                $img = new images();
                                $img->fetchImage();
                                exit;
                                break;
                        }
                        echo $code;
                    }
                }
            }
        }
    }
}
exit;
function exportFile($path = '')
{
    if (file_exists($path)) {
Example #17
0
			<div class="g_wrap g_list">
			
	<?php 
foreach ($gallery as $obj) {
    ?>
						
				<a class="g_item" href="<?php 
    echo '/gallery/' . $obj->url;
    ?>
">
					<span class="g_inner">
						<?php 
    echo images::isset_image("/images/_gallery_grupa/_" . $obj->id . ".jpg", $obj->pole, 'style1 g_pic');
    ?>
					</span>
					<span class="g_title"><?php 
    echo $obj->pole;
    ?>
</span>
				</a>
						
	<?php 
}
?>
	
		</div>	
	
Example #18
0
<?php

require "class/images_class.php";
require "class/string_class.php";
$stringClass = new string();
session_start();
session_id($_GET['sessid']);
$imagesClass = new images();
switch ($_GET['type']) {
    case "project_confirm_ID":
        $type = "project_confirm_ID";
        break;
    case "add_project_confirm_ID":
        $type = "add_project_confirm_ID";
        break;
}
$imagesClass->print_image($_SESSION[$type]);
Example #19
0
    function uploadPhotos()
    {
        $dir = IMAGES_ROOT . 'items/';
        $dir_path = IMAGES_PATH . 'items/';
        if (!empty($_FILES['item_photos']['name'])) {
            $file_id = md5(date('YmdHis'));
            $file = $dir . $file_id . '.jpg';
            $file_m = $dir . $file_id . '_m.jpg';
            $file_path = $dir_path . $file_id . '_m.jpg';
            copy($_FILES['item_photos']['tmp_name'], $file);
            images::src($file);
            images::thumb($file);
            images::setWidth(268);
            images::resize();
            images::src($file);
            images::thumb($file_m);
            images::setWidth(48);
            images::resize();
            $array = array('file_id' => $file_id, 'file_date' => 'NOW()', 'item_id' => 0);
            db::table('catalog_items_photos');
            db::smartInsert($array);
            copy($_FILES['file']['tmp_name'], $file);
            buffer::set('
			<li id="file_id_' . $file_id . '">
				<input type="hidden" name="photos_id[' . $file_id . ']" value="' . $file_id . '">
				<img src="' . $file_path . '" />
				<a href="javascript:void(null);" onclick="deletePhotosFile(\'' . $file_id . '\');" title="Удалить файл" class="ico ico16 ico_delete">&nbsp;</a>
			</li>');
        }
    }
 public function executeSaveImages(sfWebRequest $request)
 {
     $data = $request->getPostParameter("stuff");
     //Sent from AJAX.
     if (!empty($data)) {
         $data = json_decode($data);
         //Decode from JSON to PHP array
         $color = $data->color;
         //eg, "red"
         $keywords = $data->keywords;
         //eg, "unicorns"
         $images = $data->images;
         // Array of URLs
         $keyword = new keywords();
         //MySQL INSERT.
         $keyword->setKeyword($keywords);
         $keyword->save();
         //Query executed
         $keyword_identifier = $keyword->identifier();
         $keyword_id = $keyword_identifier["id"];
         //$keyword->identifier()["id"]; not possible :(
         foreach ($images as $image_url) {
             $image = new images();
             //MySQL INSERT
             $image->setColor($color);
             //All images have the same $color and $keywords.
             $image->setUrl($image_url);
             $image->save();
             //Query executed
             $image_identifier = $image->identifier();
             $image_id = $image_identifier["id"];
             $image_keyword_relationship = new image_keyword_map();
             $image_keyword_relationship->setKeywordId($keyword_id);
             $image_keyword_relationship->setImageId($image_id);
             $image_keyword_relationship->save();
             //Query executed
         }
     }
 }
Example #21
0
									<div style="width:800px; border: solid 0px red;" align="center">
									
                                    	<div style="margin: 0 5px 5px 0;"><?php 
echo images::isset_image(IMG_NEWS_PATH . "/" . $obj->id . ".jpg", $obj->zag, '');
?>
</div>
                                    	
                                        <div>
                                        	<div><b><?php 
echo system::show_data($obj->date_news);
?>
</b></div>
                                            <b><?php 
echo $obj->zag;
?>
</b>
                                            <?php 
echo $obj->text;
?>
                                        </div><!-- .news_descr_block-->
                                    </div><!-- .news_item-->                            
	
	<?php 
/*
	url  		<?php echo '/news/'.$obj->url; ?>
	data  		<?php echo system::show_data($obj->date_news); ?>
	img   		<?php echo images::isset_image("/images/news/_".$obj->id.".jpg",$obj->zag,''); ?>
	zag  		<?php echo $obj->zag; ?>
	text_short	<?php echo $obj->text_short; ?>
	text 		<?php echo $obj->text; ?>