Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<a onClick="open('http://burkoff.org', 'име','toolbar=0,location=0,history=0,resizable=0,width=284,height=300')" href="javascript:void(0)" color="#00ffcc">САЙТ</a>
<?php
$myimg = "http://www.google.com/images/logo.gif";
list($width, $height, $type, $attr) = getimagesize($myimg);
$widthh=("$width+10");
$heightt=("$height+10");
echo "<a onClick=\"open('$myimg', 'име','toolbar=0,location=0,history=0,resizable=0,width=$widthh,height=$heightt')\" href=\"javascript:void(0)\" color=\"#00ffcc\">Картинка</a>";
?>
<?php
$myimg = "http://www.google.com/images/logo.gif";
list($width, $height, $type, $attr) = getimagesize($myimg);
$widthh=$width+20;
$heightt=$height+20;
?>
<a onClick="open('<?php echo "$myimg" ?>', 'име','toolbar=0,location=0,history=0,resizable=0,width=<?php echo "$widthh"; ?>,height=<?php echo "$heightt"; ?>')" href="javascript:void(0)" color="#00ffcc">Картинка</a>
ci76 каза:горе при $myimg = "http://www.google.com/images/logo.gif"; какво трябва да сложа там те са ми в папка image обаче са доста не е една променливата е $file
<LINK href="css/css.css" type=text/css rel=stylesheet>
<table border=0>
<div class="mt f">Галерия</div>
<div class="mg b">
<form method=post action="gallery.php" style="text-align:center;" enctype="multipart/form-data">
<table class="f3" align=center>
<tr>
<td align=right>Добави снимка: </td>
<td align=left><input name="photo" type="file" class="s" size=40></td>
</tr>
<tr>
<td align=right>Заглавие: </td>
<td align=left><input type="text" name="title" size=55 class="s"></td>
</tr>
<tr>
<td align=center colspan=2><input type="submit" value="Добави" class="s"> </td>
</tr>
</table>
<?php
# Качване на евентуални файлове
include "funcs.php";
$cfg = Array();
if(file_exists("../gallery/gallery.cfg")){
if(filesize("../gallery/gallery.cfg") > 0)
$cfg = unserialize(getfile("../gallery/gallery.cfg"));
}
if(basename($_GET["del"]) != ""){
unlink("../gallery/thumbs/".basename($_GET["del"]));
unlink("../gallery/images/".basename($_GET["del"]));
$cfg[basename($_GET["del"])]="";
unset($cfg[basename($_GET["del"])]);
$xml .= '<?xml version="1.0" encoding="UTF-8"?>
<simpleviewerGallery maxImageWidth="480" maxImageHeight="480" textColor="0xFFFFFF" frameColor="0xffffff" frameWidth="20" stagePadding="40" thumbnailColumns="3" thumbnailRows="3" navPosition="left" title="Галерия" enableRightClickOpen="true" backgroundImagePath="" imagePath="" thumbPath="">
';
foreach($cfg as $fl => $cap){
$xml.='<image><filename>'.$fl.'</filename><caption>'.mb_convert_encoding($cap, "UTF-8", "windows-1251").'</caption></image>';
}
$xml.='</simpleviewerGallery>';
setfile("../gallery/gallery.xml", $xml);
setfile("../gallery/gallery.cfg", serialize($cfg));
}
$fstatus = Array();
$directory = getpath(__FILE__)."../gallery/";
if(count($_FILES) > 0){
foreach($_FILES as $p => $file){
if($file["name"] != ""){
$cnt = 0;
$file["name"] = str_replace(" ", "_", $file["name"]);
while(file_exists($directory.$file["name"]) == true){
$file["name"] = $cnt."_".$file["name"];
$cnt++;
}
if (move_uploaded_file($file["tmp_name"], $directory.$file["name"])){
$fstatus[$file["name"]] = true;
# image was uploaded => resize (twice)
$fileR = $directory.$file["name"];
$what = getimagesize($fileR);
switch( $what['mime'] ){
case 'image/png' : $src_id = imagecreatefrompng($fileR); break;
case 'image/jpeg': $src_id = imagecreatefromjpeg($fileR); break;
case 'image/gif' : $old_id = imagecreatefromgif($fileR); $src_id = imagecreatetruecolor($what[0],$what[1]); imagecopy($src_id,$old_id,0,0,0,0,$what[0],$what[1]); break;
default: break;
}
list($width, $height) = getimagesize($fileR);
$w = $width; $h = $height;
if($width > $height){
$ratio = $width / 600;
$width = 600;
$height = floor($height / $ratio);
}
else{
$ratio = $height / 600;
$height = 600;
$width = floor($width / $ratio);
}
if($width > $height){
$ratio = $width / 87;
$width_t = 87;
$height_t = floor($height / $ratio);
}
else{
$ratio = $height / 87;
$height_t = 87;
$width_t = floor($width / $ratio);
}
$image_new = imagecreatetruecolor($width, $height);
$image_thumb = imagecreatetruecolor($width_t, $height_t);
imagecopyresampled($image_new, $src_id, 0, 0, 0, 0, $width, $height, $w, $h);
imagecopyresampled($image_thumb, $src_id, 0, 0, 0, 0, $width_t, $height_t, $w, $h);
imagejpeg ($image_new, $directory."images/".$file["name"], 80);
imagejpeg ($image_thumb, $directory."thumbs/".$file["name"], 80);
if(file_exists("../gallery/".$file["name"])) unlink("../gallery/".$file["name"]);
# set .cfg file
$cfg[$file["name"]] = htmlspecialchars(stripslashes($_POST["title"]), ENT_QUOTES);
setfile("../gallery/gallery.cfg", serialize($cfg));
# build XML
$xml .= '<?xml version="1.0" encoding="UTF-8"?>
<simpleviewerGallery maxImageWidth="480" maxImageHeight="480" textColor="0xFFFFFF" frameColor="0xffffff" frameWidth="20" stagePadding="40" thumbnailColumns="3" thumbnailRows="3" navPosition="left" title="Галерия" enableRightClickOpen="true" backgroundImagePath="" imagePath="" thumbPath="">
';
foreach($cfg as $fl => $cap){
$xml.='<image><filename>'.$fl.'</filename><caption>'.mb_convert_encoding($cap, "UTF-8", "windows-1251").'</caption></image>';
}
$xml.='</simpleviewerGallery>';
setfile("../gallery/gallery.xml", $xml);
}
else{ $fstatus[$file["name"]] = false; }
}
}
}
'<table width=100%><tr>'
;
$c = 1;
if ($handle = opendir('../gallery/thumbs/')) {
while (false !== ($file = readdir($handle))) {
print'
<td>';
$myimg = ""../gallery/images/'.$file.'";
list($width, $height, $type, $attr) = getimagesize($myimg);
$widthh=$width+20;
$heightt=$height+20;
?>
<a onClick="open('<?php echo "$myimg" ?>', 'име','toolbar=0,location=0,history=0,resizable=0,width=<?php echo "$widthh"; ?>,height=<?php echo "$heightt"; ?>')" href="javascript:void(0)" color="#00ffcc"><img src="../gallery/thumbs/<?php echo $file; ?>" class="img"></a>
<?php
<Td><a href="../gallery/images/'.$file.'" target="open.php"><img src="../gallery/thumbs/'.$file.'" class="img"></a> '.$cfg["$file"].' <a href="gallery.php?del='.$file.'">[X]</a></td>';
if($c == 6){ $c = 0;
print'</tr><tr height=8><td colspan=6></td></tr>'; }
$c++;
}
}
closedir($handle);?>
</tr></table>
</div>
ci76 каза:Parse error: parse error, unexpected '<' in c:\www\otzwuk\admin\gallery.php on line 1
<LINK href="css/css.css" type=text/css rel=stylesheet>
<table border=0>
<div class="mt f">Галерия</div>
<div class="mg b">
<form method=post action="gallery.php" style="text-align:center;" enctype="multipart/form-data">
<table class="f3" align=center>
<tr>
<td align=right>Добави снимка: </td>
<td align=left><input name="photo" type="file" class="s" size=40></td>
</tr>
<tr>
<td align=right>Заглавие: </td>
<td align=left><input type="text" name="title" size=55 class="s"></td>
</tr>
<tr>
<td align=center colspan=2><input type="submit" value="Добави" class="s"> </td>
</tr>
</table>
<?php
# Качване на евентуални файлове
include "funcs.php";
$cfg = Array();
if(file_exists("../gallery/gallery.cfg")){
if(filesize("../gallery/gallery.cfg") > 0)
$cfg = unserialize(getfile("../gallery/gallery.cfg"));
}
if(basename($_GET["del"]) != ""){
unlink("../gallery/thumbs/".basename($_GET["del"]));
unlink("../gallery/images/".basename($_GET["del"]));
$cfg[basename($_GET["del"])]="";
unset($cfg[basename($_GET["del"])]);
$xml .= '<?xml version="1.0" encoding="UTF-8"?>
<simpleviewerGallery maxImageWidth="480" maxImageHeight="480" textColor="0xFFFFFF" frameColor="0xffffff" frameWidth="20" stagePadding="40" thumbnailColumns="3" thumbnailRows="3" navPosition="left" title="Галерия" enableRightClickOpen="true" backgroundImagePath="" imagePath="" thumbPath="">
';
foreach($cfg as $fl => $cap){
$xml.='<image><filename>'.$fl.'</filename><caption>'.mb_convert_encoding($cap, "UTF-8", "windows-1251").'</caption></image>';
}
$xml.='</simpleviewerGallery>';
setfile("../gallery/gallery.xml", $xml);
setfile("../gallery/gallery.cfg", serialize($cfg));
}
$fstatus = Array();
$directory = getpath(__FILE__)."../gallery/";
if(count($_FILES) > 0){
foreach($_FILES as $p => $file){
if($file["name"] != ""){
$cnt = 0;
$file["name"] = str_replace(" ", "_", $file["name"]);
while(file_exists($directory.$file["name"]) == true){
$file["name"] = $cnt."_".$file["name"];
$cnt++;
}
if (move_uploaded_file($file["tmp_name"], $directory.$file["name"])){
$fstatus[$file["name"]] = true;
# image was uploaded => resize (twice)
$fileR = $directory.$file["name"];
$what = getimagesize($fileR);
switch( $what['mime'] ){
case 'image/png' : $src_id = imagecreatefrompng($fileR); break;
case 'image/jpeg': $src_id = imagecreatefromjpeg($fileR); break;
case 'image/gif' : $old_id = imagecreatefromgif($fileR); $src_id = imagecreatetruecolor($what[0],$what[1]); imagecopy($src_id,$old_id,0,0,0,0,$what[0],$what[1]); break;
default: break;
}
list($width, $height) = getimagesize($fileR);
$w = $width; $h = $height;
if($width > $height){
$ratio = $width / 600;
$width = 600;
$height = floor($height / $ratio);
}
else{
$ratio = $height / 600;
$height = 600;
$width = floor($width / $ratio);
}
if($width > $height){
$ratio = $width / 87;
$width_t = 87;
$height_t = floor($height / $ratio);
}
else{
$ratio = $height / 87;
$height_t = 87;
$width_t = floor($width / $ratio);
}
$image_new = imagecreatetruecolor($width, $height);
$image_thumb = imagecreatetruecolor($width_t, $height_t);
imagecopyresampled($image_new, $src_id, 0, 0, 0, 0, $width, $height, $w, $h);
imagecopyresampled($image_thumb, $src_id, 0, 0, 0, 0, $width_t, $height_t, $w, $h);
imagejpeg ($image_new, $directory."images/".$file["name"], 80);
imagejpeg ($image_thumb, $directory."thumbs/".$file["name"], 80);
if(file_exists("../gallery/".$file["name"])) unlink("../gallery/".$file["name"]);
# set .cfg file
$cfg[$file["name"]] = htmlspecialchars(stripslashes($_POST["title"]), ENT_QUOTES);
setfile("../gallery/gallery.cfg", serialize($cfg));
# build XML
$xml .= '<?xml version="1.0" encoding="UTF-8"?>
<simpleviewerGallery maxImageWidth="480" maxImageHeight="480" textColor="0xFFFFFF" frameColor="0xffffff" frameWidth="20" stagePadding="40" thumbnailColumns="3" thumbnailRows="3" navPosition="left" title="Галерия" enableRightClickOpen="true" backgroundImagePath="" imagePath="" thumbPath="">
';
foreach($cfg as $fl => $cap){
$xml.='<image><filename>'.$fl.'</filename><caption>'.mb_convert_encoding($cap, "UTF-8", "windows-1251").'</caption></image>';
}
$xml.='</simpleviewerGallery>';
setfile("../gallery/gallery.xml", $xml);
}
else{ $fstatus[$file["name"]] = false; }
}
}
}
'<table width=100%><tr>'
;
$c = 1;
if ($handle = opendir('../gallery/thumbs/')) {
while (false !== ($file = readdir($handle))) {
print'
<td>';
$myimg = "../gallery/images/'.$file.'";
list($width, $height, $type, $attr) = getimagesize($myimg);
$widthh=$width+20;
$heightt=$height+20;
?>
<a onClick="open('<?php echo "$myimg" ?>', 'име','toolbar=0,location=0,history=0,resizable=0,width=<?php echo "$widthh"; ?>,height=<?php echo "$heightt"; ?>')" href="javascript:void(0)" color="#00ffcc"><img src="../gallery/thumbs/<?php echo $file; ?>" class="img"></a>
<?php
echo '<Td><a href="../gallery/images/'.$file.'" target="open.php"><img src="../gallery/thumbs/'.$file.'" class="img"></a> '.$cfg["$file"].' <a href="gallery.php?del='.$file.'">[X]</a></td>';
if($c == 6){ $c = 0;
print'</tr><tr height=8><td colspan=6></td></tr>'; }
$c++;
}
}
closedir($handle);?>
</tr></table>
</div>
ci76 каза:махнах онова за триенето и се оправи ама сега как ще си ги трия