本文整理汇总了PHP中get_width_height函数的典型用法代码示例。如果您正苦于以下问题:PHP get_width_height函数的具体用法?PHP get_width_height怎么用?PHP get_width_height使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_width_height函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
foreach ($flashdb as $key => $val) {
if ($key != $id) {
$temp[] = $val;
}
}
put_flash_xml($temp);
set_flash_data($_CFG['flash_theme'], $error_msg = '');
ecs_header("Location: flashplay.php?act=list\n");
exit;
} elseif ($_REQUEST['act'] == 'add') {
admin_priv('flash_manage');
if (empty($_POST['step'])) {
$url = isset($_GET['url']) ? $_GET['url'] : 'http://';
$src = isset($_GET['src']) ? $_GET['src'] : '';
$rt = array('act' => 'add', 'img_url' => $url, 'img_src' => $src);
$width_height = get_width_height();
$smarty->assign('width_height', sprintf($_LANG['width_height'], $width_height['width'], $width_height['height']));
$smarty->assign('action_link', array('text' => $_LANG['go_url'], 'href' => 'flashplay.php?act=list'));
$smarty->assign('rt', $rt);
$smarty->display('flashplay_add.htm');
} elseif ($_POST['step'] == 2) {
if (!empty($_FILES['img_file_src']['name'])) {
if (!get_file_suffix($_FILES['img_file_src']['name'], $allow_suffix)) {
sys_msg($_LANG['invalid_type']);
}
$name = date('Ymd');
for ($i = 0; $i < 6; $i++) {
$name .= chr(mt_rand(97, 122));
}
$name .= '.' . end(explode('.', $_FILES['img_file_src']['name']));
$target = ROOT_PATH . DATA_DIR . '/afficheimg/' . $name;
示例2: resize_image
function resize_image($file, $quality, $dimension, $resize_type = 1, $height = false)
{
global $convert_options;
$image_info = defined("IN_CP") ? getimagesize($file) : @getimagesize($file);
if (!$image_info) {
return false;
}
$file_bak = $file . ".bak";
if (!rename($file, $file_bak)) {
return false;
}
$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type, $height);
$resize_handle = "resize_image_" . $convert_options['convert_tool'];
if ($resize_handle($file_bak, $file, $quality, $width_height['width'], $width_height['height'], $image_info)) {
@chmod($file, CHMOD_FILES);
@unlink($file_bak);
return true;
} else {
rename($file_bak, $file);
return false;
}
}
示例3: show_data_all
function show_data_all(){
global $db,$smarty;
$sql = "select * from new_ziping_table";
if($_REQUEST['school_name']!="" && $_REQUEST['school_name']!="所有類別")
{
$smarty->assign('school_name',$_REQUEST['school_name']);
$sql.=" where member_sort='".$_REQUEST['school_name']."'";
}
$res = $db->query($sql);
$data = $db->fetch_all_array($sql);
for($di=0;$di<count($data);$di++){
$data[$di]['data2'] = show_data2($data[$di]['school_id']);
$col_24=array();
$count_24=0;
$col_25=array();
$col_26=array();
$col_27=array();
$col_28=array();
$col_29=array();
$col_30=array();
$count_30=0;
$col_31=array();
$col_32=array();
$col_33=array();
$col_34=array();
$col_35s=array();
$col_35str="";
//print_r($col_35s);
$col_35str2="";
$col_24=split("#",$data[$di]['col_24']);
$count_24=count($col_24);
$col_25=split("#",$data[$di]['col_25']);
$col_26=split("#",$data[$di]['col_26']);
$col_27=split("#",$data[$di]['col_27']);
$col_28=split("#",$data[$di]['col_28']);
$col_29=split("#",$data[$di]['col_29']);
$col_30=split("#",$data[$di]['col_30']);
$count_30=count($col_30);
$col_31=split("#",$data[$di]['col_31']);
$col_32=split("#",$data[$di]['col_32']);
$col_33=split("#",$data[$di]['col_33']);
$col_34=split("#",$data[$di]['col_34']);
$col_35s=split("@",$data[$di]['col_35']);
$col_35str="";
//print_r($col_35s);
$col_35str2="";
$col_35str_arr = array();
$i=0;
foreach($col_35s as $c35){
$c35 = substr($c35,strlen($c35)-1,1)=='#'?substr($c35,0,strlen($c35)-1):$c35;
$c35 = $c35!=''?explode('#',$c35):array();
$temp_str = '';
foreach($c35 as $img){
$jpgdata=GetImageSize("../../uploadfiles/images/".$img);
$newjpgdata = get_width_height(213,213,$jpgdata[0],$jpgdata[1]);
$temp_str.="<img id='col_l_35_$i' src='http://ee.tp.edu.tw/uploadfiles/images/".$img."' width='".$newjpgdata['width']."' height='".$newjpgdata['height']."' />";
$temp_str.="<br />";
$i++;
}
$col_35str_arr[] = $temp_str;
}
$col_40 = array();
$col_40 = split("#",$data[$di]['col_40']);
$str="";
$c40_pd = count($col_40);
for($i=1;$i<$c40_pd;$i++){
$jpgdata=GetImageSize("../../uploadfiles/images/".$col_40[$i-1]);
$newjpgdata = get_width_height(213,213,$jpgdata[0],$jpgdata[1]);
$str.="<img id='col_l_40_$i' src='http://ee.tp.edu.tw/uploadfiles/images/".$col_40[$i-1]."' width='".$newjpgdata['width']."' height='".$newjpgdata['height']."' />";
$str.="<br />";
}
$data[$di]['str'] = $str;
$colstr="";
for($i=0;$i<count($col_24)-1;$i++){
$colstr.="
<tr id='row".$i."' name='row".$i."'>
<td>
<table width=\"100%\" border=\"1\" bgcolor='#FFFFFF'>
<tr>
<td>活 動 ". $i ." :".$col_24[$i]."</td>
<td> </td>
</tr>
<tr>
<td> 辦理時間:".$col_25[$i]."</td>
<td>活動地點: ".$col_26[$i]."</td>
</tr>
<tr>
<td> 辦理方式: ".$col_27[$i]."</td>
<td>參加人次: ".$col_28[$i]."</td>
</tr>
<tr>
<td colspan=\"3\">
<a id='col_l_29_$i' href='http://ee.tp.edu.tw/uploadfiles/file/".$col_29[$i]."' >".$col_29[$i]."</a>
</td>
</tr>
</table>
//.........这里部分代码省略.........
示例4: resize
echo "<img src='" . resize($rowPrev->imgoriginalname, $ad_thumbwidth1, $ad_thumbheight1, $ad_crop, '1:1', 0, $obj->catid) . "' " . get_width_height($rowPrev->imgoriginalname, $ad_thumbwidth1, $ad_thumbheight1, $obj->catid, '1:1') . " class='dgimg' alt='' /></a>\n";
}
}
?>
</div>
<div style="position:absolute;right:0;top: <?php
echo $hres;
?>
px">
<?php
$db->setQuery("SELECT * FROM #__datsogallery WHERE id = " . $nid);
$rowsNext = $db->loadObjectList();
if (count($rowsNext)) {
foreach ($rowsNext as $rowNext) {
echo "<a href='" . JRoute::_('index.php?option=com_datsogallery&task=image&catid=' . $obj->catid . '&id=' . $nid . $itemid) . $na . "'>\n";
echo "<img src='" . resize($rowNext->imgoriginalname, $ad_thumbwidth1, $ad_thumbheight1, $ad_crop, '1:1', 0, $obj->catid) . "' " . get_width_height($rowNext->imgoriginalname, $ad_thumbwidth1, $ad_thumbheight1, $obj->catid, '1:1') . " class='dgimg' alt='' /></a>\n";
}
}
?>
</div>
</div>
<?php
}
if ($dg_theme == 'customtheme') {
$bg_img_over = '#' . $dg_body_background_td_hover;
$bg_img_out = '#' . $dg_body_background;
} else {
$bg_img_over = $dg_theme != 'lightteme' && $dg_theme == 'darktheme' ? '#909090' : '#FCFCFC';
$bg_img_out = $dg_theme != 'lightteme' && $dg_theme == 'darktheme' ? '#808080' : '#F9F9F9';
}
if ($ad_showdetail) {
示例5: elseif
}
if ($image_info[2] == 1 || $image_info[2] == 2 || $image_info[2] == 3) {
$ok = 0;
if ($resize_type == 1 && ($image_info[0] > $dimension || $image_info[1] > $height)) {
$ok = 1;
} elseif ($resize_type == 2 && $image_info[0] > $dimension) {
$ok = 1;
} elseif ($resize_type == 3 && $image_info[1] > $height) {
$ok = 1;
}
if ($ok) {
$imgs .= "<tr class=\"" . get_row_bg() . "\">";
$imgs .= "<td><input type=\"checkbox\" name=\"image_list[" . $image_row['image_id'] . "]\" value=\"1\" checked=\"checked\"></td>\n";
$imgs .= "<td><b>" . $image_row[$sql_image_type] . "</b></td>\n";
$imgs .= "<td>" . $image_info[0] . "x" . $image_info[1] . "</td>";
$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type, $height);
$imgs .= "<td>" . $width_height['width'] . "x" . $width_height['height'] . "</td>";
$imgs .= "<td>" . $quality . "</td>";
$imgs .= "</tr>\n";
$imgs .= "<input type=\"hidden\" name=\"image_dimensions[" . $image_row['image_id'] . "]\" value=\"" . $image_info[0] . "x" . $image_info[1] . "\">";
$image_counter++;
}
}
}
if ($image_counter == $num_newimages) {
break;
}
}
}
if (empty($imgs)) {
echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td class=\"tableborder\">\n<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n";
示例6: foreach
</div>
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="dg_body_background">
<?php
$rowcounter = 0;
if (count($rows) > 0) {
foreach ($rows as $row) {
if ($ad_ncsc) {
$cw = 100 / $ad_cp . "%";
}
if ($rowcounter % $ad_cp == 0) {
echo '<tr>';
}
echo '<td width="' . $cw . '" class="dg_body_background_td" align="center" valign="top">';
$ld = "<a href='" . JRoute::_("index.php?option=com_datsogallery&task=image&catid=" . $row->catid . "&id=" . $row->id . $itemid) . "' title='" . $row->imgtitle . "'>";
echo $ld;
echo "<img src=\"" . resize($row->imgoriginalname, $ad_thumbwidth, $ad_thumbheight, $ad_crop, $ad_cropratio, 0, $row->catid) . "\" " . get_width_height($row->imgoriginalname, $ad_thumbwidth, $ad_thumbheight, $row->catid, $ad_cropratio) . " class=\"dgimg\" title=\"" . $row->imgtitle . "\" alt=\"" . $row->imgtitle . "\" /></a>";
if ($ad_showdetail) {
echo "<div style=\"width:" . $ad_thumbwidth . "px;margin:10px auto 0 auto;text-align:left;text-transform: uppercase;\">";
echo $ad_showimgtitle ? $ld . '<span>' . $row->imgtitle . '</span></a><br />' : '';
?>
<span>
<?php
echo $ad_showfimgdate ? '<strong>' . JText::_('COM_DATSOGALLERY_DATE_ADD') . '</strong>: ' . strftime($ad_datef, $row->imgdate) . '<br />' : '';
echo $task == 'purchases' ? '<strong>' . JText::_('COM_DATSOGALLERY_DATE_PURCHASED') . '</strong>: ' . strftime($ad_datef, strtotime($row->date)) . '<br />' : '';
echo $task == 'purchases' ? '<strong>' . JText::_('COM_DATSOGALLERY_PRICE') . '</strong>: ' . currencySymbol($ad_pp_currency) . $row->imgprice . '<br />' : '';
echo $ad_showimgcounter ? '<strong>' . JText::_('COM_DATSOGALLERY_HITS') . '</strong>: ' . $row->imgcounter . '<br />' : '';
echo $ad_showdownloads ? '<strong>' . JText::_('COM_DATSOGALLERY_DOWNLOADS') . '</strong>: ' . $row->imgdownloaded . '<br />' : '';
echo $ad_showrating ? showVote($row->id, $row->imgvotes, $row->imgvotesum) : '';
if ($ad_showcomments) {
$db->setQuery('SELECT COUNT(cmtid) FROM #__datsogallery_comments WHERE cmtpic = ' . $row->id . ' AND published = 1');
$comments = $db->loadResult();
示例7: showBasket
function showBasket()
{
$db = JFactory::getDBO();
$user = JFactory::getUser();
require JPATH_COMPONENT_ADMINISTRATOR . DS . 'config.datsogallery.php';
require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'images.datsogallery.php';
$db->setQuery('SELECT a.*, c.image_id' . ' FROM #__datsogallery AS a,' . ' #__datsogallery_basket AS c' . ' WHERE a.id = c.image_id' . ' AND c.user_id = ' . (int) $user->id . ' GROUP BY a.id' . ' ORDER BY c.id ASC');
$rows = $db->loadObjectList();
$out = "";
?>
<script type="text/javascript">
datso(document).ready(function() {
datso(".dg_item_id").click(function () {
var id = datso(this).attr("id");
var data = 'id=' + id;
var parent = datso(this);
datso(this).css({
opacity: '1.0'
}, 50);
datso.ajax({
type: "post",
url: siteurl + 'index.php?option=com_datsogallery&task=addtobasket&format=raw',
data: data,
cache: false,
success: function (response) {
parent.animate({
opacity: '0'
}, 300).hide(1);
datso(".dg_slider").html(response);
update_subtotal();
update_total();
}
});
return false;
});
});
</script>
<?php
if (count($rows) > 0) {
foreach ($rows as $row) {
$out .= "<div class=\"dg_basket\">\n";
$out .= " <ul>\n";
$out .= " <li id=\"image\"><img src=\"" . resize($row->imgoriginalname, $ad_thumbwidth1, $ad_thumbheight1, $ad_crop, '1:1', 0, $row->catid) . "\" " . get_width_height($row->imgoriginalname, $ad_thumbwidth1, $ad_thumbheight1, $row->catid, '1:1') . " class=\"dgimg\" alt=\"\" /></li>\n";
$out .= " <li id=\"item\">" . shortName($row->imgtitle, 10) . "</li>\n";
$out .= " <li id=\"cost\"><span>" . JText::_('COM_DATSOGALLERY_PRICE') . ":</span> " . currencySymbol($ad_pp_currency) . $row->imgprice . "</li><br />\n";
$out .= " <li class=\"dg_basket_box\">\n";
$out .= " <span class=\"dg_item_id\" id=\"" . $row->id . "\">\n";
$out .= " <span title=\"" . JText::_('COM_DATSOGALLERY_REMOVE_FROM_BASKET') . "\"><span class=\"remove_from_basket\"></span></span>\n";
$out .= " </span>\n";
$out .= " </li>\n";
$out .= " </ul>\n";
$out .= "</div>\n";
}
$out .= "<div class=\"dg_clear\"></div>\n";
} else {
$out .= "<div style=\"font-size:16px;text-align:center;\">" . JText::_('COM_DATSOGALLERY_EMPTY_BASKET') . "</div>";
$out .= "<div class=\"dg_clear\"></div>";
}
return $out;
}
示例8: create_thumbnail
function create_thumbnail($src, $dest, $quality, $dimension, $resize_type)
{
global $_CONFQUIZ;
if (file_exists($dest)) {
@unlink($dest);
}
$image_info = defined("IN_CP") ? getimagesize($src) : @getimagesize($src);
if (!$image_info) {
return false;
}
$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type);
$resize_handle = "resize_image_" . $_CONFQUIZ['convert_tool'];
if ($resize_handle($src, $dest, $quality, $width_height['width'], $width_height['height'], $image_info)) {
@chmod($dest, 0755);
return true;
} else {
return false;
}
}