コード例 #1
0
 protected static function image($html, $which, $where)
 {
     $img = getPlugin($which);
     $size = zp_imageDims($img);
     $wide = $size['width'];
     $high = $size['height'];
     $img = str_replace(SERVERPATH, WEBPATH, $img);
     $html .= '<img src="' . $img . '" class="imageasflag" width="' . $wide . 'px" height="' . $high . 'px" alt="" style="max-width:' . $wide . 'px; position: ' . $where . '" />' . "\n";
     return $html;
 }
コード例 #2
0
 /**
  * Update this object's values for width and height.
  *
  */
 function updateDimensions()
 {
     $discard = NULL;
     $size = zp_imageDims($this->localpath, $discard);
     $width = $size['width'];
     $height = $size['height'];
     if (zp_imageCanRotate() && getOption('auto_rotate')) {
         // Swap the width and height values if the image should be rotated
         $splits = preg_split('/!([(0-9)])/', $this->get('EXIFOrientation'));
         $rotation = $splits[0];
         switch ($rotation) {
             case 5:
             case 6:
             case 7:
             case 8:
                 $width = $size['height'];
                 $height = $size['width'];
                 break;
         }
     }
     $this->set('width', $width);
     $this->set('height', $height);
 }
コード例 #3
0
function upload_extra($uploadlimit, $passedalbum)
{
    global $_zp_current_admin_obj, $upload_extensions;
    ?>
	<script type="text/javascript">
		// <!-- <![CDATA[
		if (FlashDetect.installed) {
			$(document).ready(function() {
				$('#fileUpload').uploadify({
					'uploader': '<?php 
    echo WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
    ?>
/uploader_flash/uploadify.swf',
					'cancelImg': 'images/fail.png',
					'script': '<?php 
    echo WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
    ?>
/uploader_flash/uploader.php',
					'scriptData': {
												'auth': '<?php 
    echo $_zp_current_admin_obj->getPass();
    ?>
',
												'id': '<?php 
    echo $_zp_current_admin_obj->getID();
    ?>
',
												'XSRFToken': '<?php 
    echo getXSRFToken('upload');
    ?>
'
												},
					'folder': '/',
					'multi': true,
					<?php 
    $uploadbutton = SERVERPATH . '/' . ZENFOLDER . '/locale/' . getOption('locale') . '/select_files_button.png';
    if (!file_exists($uploadbutton)) {
        $uploadbutton = SERVERPATH . '/' . ZENFOLDER . '/images/select_files_button.png';
    }
    $discard = NULL;
    $info = zp_imageDims($uploadbutton, $discard);
    if ($info['height'] > 60) {
        $info['height'] = round($info['height'] / 3);
        $rollover = "'rollover': true,";
    } else {
        $rollover = "";
    }
    $uploadbutton = str_replace(SERVERPATH, WEBPATH, $uploadbutton);
    ?>
					'buttonImg': '<?php 
    echo $uploadbutton;
    ?>
',
					'height': '<?php 
    echo $info['height'];
    ?>
',
					'width': '<?php 
    echo $info['width'];
    ?>
',
					<?php 
    echo $rollover;
    ?>
					'checkScript': '<?php 
    echo WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
    ?>
/uploader_flash/check.php',
					'displayData': 'speed',
					'simUploadLimit': 3,
					'sizeLimit': <?php 
    echo $uploadlimit;
    ?>
,
					'onAllComplete':	function(event, data) {
															if (data.errors) {
																return false;
															} else {
															<?php 
    if (zp_loggedin(ALBUM_RIGHTS | MANAGE_ALL_ALBUM_RIGHTS)) {
        ?>
																launchScript('admin-edit.php',['page=edit','subpage=1','tab=imageinfo','album='+encodeURIComponent($('#folderdisplay').val()),'uploaded=1','albumimagesort=id_desc']);
																<?php 
    } else {
        ?>
																launchScript('admin-upload.php',['uploaded=1']);
																<?php 
    }
    ?>
															}
														},
					'fileDesc': '<?php 
    echo gettext('Zenphoto supported file types | all files');
    ?>
',
					'fileExt': '<?php 
    $list = implode(';*.', $upload_extensions);
    echo '*.' . $list . ' | *.*';
    ?>
'
				});
		});
		}
		// ]]> -->
	</script>
	<div id="fileUpload" style="color:red">
		<?php 
    echo gettext("There appears to be no <em>Flash</em> plugin installed in your browser.");
    ?>
	</div>
	<p class="buttons" id="fileUploadbuttons" style="display: none;">
		<a href="javascript:$('#fileUpload').uploadifySettings('folder','/'+$('#publishalbumslot').val()+':'+$('#folderdisplay').val()+':'+$('#albumtitle').val());
												$('#fileUpload').uploadifyUpload()"><img src="images/pass.png" alt="" /><?php 
    echo gettext("Upload");
    ?>
</a>
		<a href="javascript:$('#fileUpload').uploadifyClearQueue()"><img src="images/fail.png" alt="" /><?php 
    echo gettext("Cancel");
    ?>
</a>
	<br clear="all" /><br />
	</p>
	<?php 
}
コード例 #4
0
ファイル: class-image.php プロジェクト: ariep/ZenPhoto20-DEV
 /**
  * Update this object's values for width and height.
  *
  */
 function updateDimensions()
 {
     $discard = NULL;
     $size = zp_imageDims($this->localpath);
     $width = $size['width'];
     $height = $size['height'];
     if (zp_imageCanRotate()) {
         // Swap the width and height values if the image should be rotated
         switch (substr(trim($this->get('rotation'), '!'), 0, 1)) {
             case 5:
             case 6:
             case 7:
             case 8:
                 $width = $size['height'];
                 $height = $size['width'];
                 break;
         }
     }
     $this->set('width', $width);
     $this->set('height', $height);
 }