Yangi formatda davom etish uchun: https://uzfor.net/view.php?act=post&id=85645
Postga havola
Kamron [1260] [off]
Shunda rasmlarga qanday o'lcham qo'ysa bo'ladi? Width va height qo'yish kerak
<?php /** * @package JohnCMS * @link http://johncms.com * @copyright Copyright (C) 2008-2011 JohnCMS Community * @license LICENSE.txt (see attached file) * @version VERSION.txt (see attached file) * @author http://johncms.com/about */ require('../incfiles/core.php'); $headmod = 'gallery'; $lng_gal = core::load_lng('gallery'); $textl = $lng['gallery']; require('../incfiles/head.php'); // Ограничиваем доступ к Галерее $error = ''; if (!$set['mod_gal'] && $rights < 7) { $error = $lng_gal['gallery_closed']; } elseif ($set['mod_gal'] == 1 && !$user_id) { $error = $lng['access_guest_forbidden']; } if ($error) { require_once('../incfiles/head.php'); echo '<div class="rmenu"><p>' . $error . '</p></div>'; require_once('../incfiles/end.php'); exit; } function setTransparency($new_image, $image_source) { if ($transparencyIndex >= 0) { } $transparencyIndex = imagecolorallocate($new_image, $transparencyColor['red'], $transparencyColor['green'], $transparencyColor['blue']); } 'new', 'edf', 'delf', 'edit', 'del', 'load', 'upl', 'cral', 'razd' ); require_once($act . '.php'); } else { if (!$set['mod_gal']) { echo '<p><font color="#FF0000"><b>' . $lng_gal['gallery_closed'] . '</b></font></p>'; } if ($id) { switch ($ms['type']) { case 'rz': /* ----------------------------------------------------------------- Просмотр раздела ----------------------------------------------------------------- */ echo '<div class="phdr"><i class="fa fa-picture-o" style="color:#ffffff;"></i> <a href="index.php"><b>' . $lng['gallery'] . '</b></a> | ' . $ms['text'] . '</div>'; $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery` WHERE `type` = 'al' AND `refid` = '$id'"), 0); if ($total) { $req = mysql_query("SELECT * FROM `gallery` WHERE `type` = 'al' AND `refid` = '$id' ORDER BY `time` DESC LIMIT $start, $kmess"); echo $i % 2 ? '<div class="list2">' : '<div class="list1">'; $total_f = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery` WHERE `type` = 'ft' AND `refid` = '" . $res['id'] . "'"), 0); echo '<a href="index.php?id=' . $res['id'] . '">' . $res['text'] . '</a> (' . $total_f . ')</div>'; ++$i; } } else { echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>'; } echo '<div class="phdr"><i class="fa fa-spinner" style="color:#ffffff;"></i> ' . $lng['total'] . ': ' . $total . '</div><p>'; if ($total > $kmess) { echo '<p>' . functions::display_pagination('index.php?id=' . $id . '&', $start, $total, $kmess) . '</p>' . '<p><form action="index.php?id=' . $id . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/>' . '</form></p>'; } if ($rights >= 6) { echo "<div class='menu'><i class='fa fa-plus-square' style='color:red;'></i> <a href='index.php?act=cral&id=" . $id . "'>" . $lng_gal['create_album'] . "</a><br/>"; echo "<i class='fa fa-trash-o' style='color:red;'></i> <a href='index.php?act=del&id=" . $id . "'>" . $lng_gal['delete_section'] . "</a><br/>"; echo "<i class='fa fa-wrench' style='color:red;'></i> <a href='index.php?act=edit&id=" . $id . "'>" . $lng_gal['edit_section'] . "</a><br/>"; } echo "<i class='fa fa-share-square-o' style='color:red;'></i> <a href='index.php'>Galereya</a></p>"; break; case 'al': /* ----------------------------------------------------------------- Просмотр альбома ----------------------------------------------------------------- */ if ($imd != "." && $imd != ".." && $imd != "index.php") { $im[] = $imd; } } for ($imi = 0; $imi < $totalim; $imi++) { $ftime1 = $tim - 10; if ($filtime[$imi] < $ftime1) { } } echo '<div class="phdr"><i class="fa fa-picture-o" style="color:#ffffff;"></i> <a href="index.php"><b>' . $lng['gallery'] . '</b></a> | <a href="index.php?id=' . $ms['refid'] . '">' . $rz1['text'] . '</a> | ' . $ms['text'] . '</div>'; $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery` WHERE `type` = 'ft' AND `refid` = '$id'"), 0); $req = mysql_query("SELECT * FROM `gallery` WHERE `type` = 'ft' AND `refid` = '$id' ORDER BY `time` DESC LIMIT $start, $kmess"); echo $i % 2 ? '<div class="list2">' : '<div class="list1">'; echo '<a href="index.php?id=' . $fot1['id'] . '">'; $infile = "foto/$fot1[name]"; $razm = $_SESSION['frazm']; } else { $razm = 100; } $width = $sizs[0]; $height = $sizs[1]; $quality = 80; $x_ratio = $razm / $width; $y_ratio = $razm / $height; if (($width <= $razm) && ($height <= $razm)) { $tn_width = $width; $tn_height = $height; } else { if (($x_ratio * $height) < $razm) { $tn_width = $razm; } else { $tn_height = $razm; } } $format = functions::format($infile); switch ($format) { case "gif": break; case "jpg": case "jpeg": break; case "png": break; } setTransparency($im1, $im); $namefile = "$fot1[name]"; switch ($format) { case "gif": $imagnam = "temp/$namefile.temp.gif"; echo "<img src='" . $imagnam . "' alt=''/><br/>"; break; case "jpg": case "jpeg": $imagnam = "temp/$namefile.temp.jpg"; echo "<img src='" . $imagnam . "' alt=''/><br/>"; break; case "png": $imagnam = "temp/$namefile.temp.png"; echo "<img src='" . $imagnam . "' alt=''/><br/>"; break; } echo '</a>'; echo "$fot1[text]<br/>"; } if ($rights >= 6) { echo "<a href='index.php?act=edf&id=" . $fot1['id'] . "'>" . $lng['edit'] . "</a> | <a href='index.php?act=delf&id=" . $fot1['id'] . "'>" . $lng['delete'] . "</a><br/>"; } } else { echo $lng_gal['image_missing'] . '<br /><a href="index.php?act=delf&id=' . $fot1['id'] . '">' . $lng['delete'] . '</a>'; } echo "</div>"; ++$i; } echo '<div class="phdr"><i class="fa fa-spinner" style="color:#ffffff;"></i> ' . $lng['total'] . ': ' . $total . '</div><p>'; if ($total > $kmess) { echo '<p>' . functions::display_pagination('index.php?id=' . $id . '&', $start, $total, $kmess) . '</p>' . '<p><form action="index.php?id=' . $id . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/>' . '</form></p>'; } if (($user_id && $rz1['user'] == 1 && $ms['text'] == $login && !$ban['1'] && !$ban['14']) || $rights >= 6) { echo '<div class="menu"><i class="fa fa-download" style="color:red;"></i> <a href="index.php?act=upl&id=' . $id . '">' . $lng_gal['upload_photo'] . '</a><br/>'; } if ($rights >= 6) { echo "<i class='fa fa-trash' style='color:red;'></i> <a href='index.php?act=del&id=" . $id . "'>" . $lng_gal['delete_album'] . "</a><br/>"; echo "<i class='fa fa-pencil' style='color:red;'></i> <a href='index.php?act=edit&id=" . $id . "'>" . $lng_gal['edit_album'] . "</a><br/>"; } echo "<i class='fa fa-share-square-o' style='color:red;'></i> <a href='index.php'>" . $lng_gal['to_gallery'] . "</a></p>"; break; case 'ft': /* ----------------------------------------------------------------- Просмотр фото ----------------------------------------------------------------- */ echo "<br/> "; $infile = "foto/$ms[name]"; $razm = $_SESSION['frazm']; } else { $razm = 50; } $width = $sizs[0]; $height = $sizs[1]; $format = functions::format($infile); switch ($format) { case "gif": break; case "jpg": break; case "jpeg": break; case "png": break; } setTransparency($im1, $im); $namefile = "$ms[name]"; switch ($format) { case "gif": $imagnam = "temp/$namefile.gif"; echo "<img src='" . $imagnam . "' alt=''/><br/>"; break; case "jpg": case "jpeg": $imagnam = "temp/$namefile.jpg"; echo "<img src='" . $imagnam . "' alt=''/><br/>"; break; case "png": $imagnam = "temp/$namefile.png"; echo "<img src='" . $imagnam . "' alt=''/><br/>"; break; } $fwidth = $sizs[0]; $fheight = $sizs[1]; echo "<p>" . $lng['description'] . ": $ms[text]<br/>"; echo $lng_gal['dimensions'] . ": $fwidth*$fheight пкс.<br/>"; echo $lng_gal['weight'] . ": $fotsz кб.<br/>"; echo $lng['date'] . ': ' . functions::display_date($ms['time']) . '<br/>'; echo $lng_gal['posted_by'] . ": $ms[avtor]<br/>"; echo "<a href='foto/$ms[name]'>" . $lng['download'] . "</a><br /><br />"; echo "<a href='index.php?id=" . $ms['refid'] . "'>" . $lng['back'] . "</a><br/>"; echo "<a href='index.php'>" . $lng_gal['to_gallery'] . "</a></p>"; break; default : break; } } else { /* ----------------------------------------------------------------- Главная страница Галлереи ----------------------------------------------------------------- */ echo '<p><a href="index.php?act=new">' . $lng_gal['new_photo'] . '</a> (' . counters::gallery(1) . ')</p>'; echo '<div class="phdr"><i class="fa fa-image" style="color:#ffffff;"></i> <b>' . $lng['gallery'] . '</b></div>'; echo $i % 2 ? '<div class="list2">' : '<div class="list1">'; echo '<a href="index.php?id=' . $res['id'] . '">' . $res['text'] . '</a> (' . $countal . ')</div>'; ++$i; } echo '<div class="phdr"><i class="fa fa-spinner" style="color:#ffffff;"></i> ' . $lng['total'] . ': ' . $total . '</div><p>'; if ($rights >= 6) { echo "<div class='menu'><i class='fa fa-plus-square' style='color:red;'></i> <a href='index.php?act=razd'>" . $lng_gal['create_section'] . "</a><br/>"; } echo "</p>"; } } require('../incfiles/end.php'); ?>
Shunda rasmlarga qanday o'lcham qo'ysa bo'ladi? Width va height qo'yish kerak