コード例 #1
0
ファイル: core.php プロジェクト: Amadeus1998/pictshare
function whatToDo($url)
{
    $pm = new PictshareModel();
    $data = $pm->urlToData($url);
    if (!is_array($data) || !$data['hash']) {
        if (UPLOAD_FORM_LOCATION && $url == UPLOAD_FORM_LOCATION || !UPLOAD_FORM_LOCATION && ($url = '/')) {
            $upload_answer = $pm->ProcessUploads();
            if ($_POST['submit'] == $pm->translate(3) && $upload_answer) {
                $o = $upload_answer;
            } else {
                $o .= $pm->renderUploadForm();
            }
            $vars['content'] = $o;
            $vars['slogan'] = $pm->translate(2);
        }
        if (!$vars && LOW_PROFILE) {
            header('HTTP/1.0 404 Not Found');
            exit;
        } else {
            if (!$vars) {
                $vars['content'] = $pm->translate(12);
                $vars['slogan'] = $pm->translate(2);
            }
        }
        render($vars);
    } else {
        renderImage($data);
    }
}
コード例 #2
0
ファイル: product.m.php プロジェクト: lotcz/zshop
 public function renderImage($size = null, $css = '')
 {
     if ($this->val('product_image')) {
         global $images;
         $images->renderImage($this->val('product_image'), $size, $this->val('product_name'), $css);
     } else {
         renderImage('no-image.png', t('Image missing'), $size);
     }
 }
コード例 #3
0
ファイル: header.b.php プロジェクト: lotcz/zshop
<?php

global $globals, $config;
?>
<div class="header basic-bg spaced">
	<div class="row">	
		<div class="col-md-2 text-left">
			<a href="<?php 
echo $config['base_url'];
?>
" alt="<?php 
echo t('Home');
?>
">
				<?php 
renderImage('logo.jpg', 'Logo', 'img-circle img-responsive logo');
?>
			</a>
		</div>
		
		<div class="col-md-4">
			<span class="main-title"><?php 
echo $globals['site_title'];
?>
</span>
		</div>	
		
		<div class="col-md-6 text-right">		
			<?php 
renderBlock('menu');
renderBlock('cart');
コード例 #4
0
ファイル: cart.v.php プロジェクト: lotcz/zshop
					<div class="table-responsive panel panel-default">
						<table class="table">									
							<tbody>
								<?php 
        foreach ($products as $product) {
            ?>
											<tr class="item" id="cart_prod_<?php 
            echo $product->val('product_id');
            ?>
">
												<td>
													<?php 
            if ($product->val('product_image')) {
                $images->renderImage($product->val('product_image'), 'mini-thumb');
            } else {
                renderImage('no-image.png', 'missing image', 'mini-thumb');
            }
            ?>
												</td>
												<td>
													<?php 
            renderLink($product->val('alias_url'), $product->val('product_name'));
            ?>
												</td>
												
												<td class="text-right">
													<span><?php 
            echo formatPrice($product->val('product_price'));
            ?>
</span>
													<input type="hidden" id="item-price-<?php 
コード例 #5
0
ファイル: upload_image.php プロジェクト: sdgdsffdsfff/TCMKS
        $images = array();
    }
    $image_id = upload_image($dbc, $name, $subject, $discription);
    insert_into_segment($dbc, $segment_id, $image_id);
    array_push($images, $image_id);
    if (!empty($images)) {
        echo '<div class = "span6">';
        echo "<legend>已上传如下图片!您可继续上传图片,或<a href = \"article.php?id={$article_id}#s{$segment_id}\">返回</a>.</legend>";
        $left = true;
        foreach ($images as $cur_image) {
            if ($left) {
                echo '<ul class = "thumbnails">';
                renderImage($dbc, $cur_image);
                $left = false;
            } else {
                renderImage($dbc, $cur_image);
                echo '</ul>';
                $left = true;
            }
        }
        echo '</div >';
    }
}
?>


    <div class="span3">
        <form enctype="multipart/form-data" class="form-horizontal" method="post" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
">
コード例 #6
0
<?php

/**
 * Created by PhpStorm.
 * User: vasilepop
 * Date: 8/10/15
 * Time: 5:35 PM
 */
function renderImage($imageResource, $imageType)
{
    switch ($imageType) {
        case 'jpg':
        case 'jpeg':
            header('Content-type: image/jpeg');
            imagejpeg($imageResource);
            break;
        case 'png':
            header('Content-type: image/png');
            imagepng($imageResource);
            break;
        default:
            throw new DomainException('Unknown image type: ' . $imageType);
            break;
    }
    imagedestroy($imageResource);
}
renderImage("me.jpg", "jpg");
renderImage("me", "png");
renderImage("me", "ico");