Photo Gallery

Started on the old forum in April 2008 · view the original in the archive · old links redirect here

53 replies · 5,550 views · started 18 years ago · 1 min read

TL;DR · summary of 53 replies
  • - The max.php script is not working with the gallery script and needs to be replaced.
  • - Users are facing issues viewing uploaded images on their mobile devices when using a form input type "file".
  • - To resolve the image upload issue for mobile users, a different code snippet was provided by Guest: [code]
  • - The solution involves adding specific PHP configuration settings in php.ini or global scope to allow all types of mobile phones to upload photos.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

13 participants
khan1 Developer · 101 posts #21

thanks a lot (smiles) sum tyms i talk just like i no nothing (lol)

laro696 Developer · 205 posts #24

I can crate 1 directory???how I name ? gallery directory is create...but not upload images in this...External image (may be gone)

Don't mind me. I don't know much lol. i started learning just a couple weeks back

khan1 Developer · 101 posts #25

khan u can update gallery script ???External image (may be gone)

i will update the script soon....... but please use proper english users and myself finding it difficult to understand your language

rukiya Lead · 569 posts #28

btw i am indian its ok (smiles) File Updated

because i had done wrong html coding the script was not working also the biggest problem was max file was not creating image

the above max file also doesnt work for this gallery script anyways thanks for helping us (smiles)

max file from http://www.2wap.org/forums/index.php?showtopic=2390 this topic works

change the max.php

<?php
include("config.php");
include("core.php");
connectdb();
$pic = mysql_fetch_array(mysql_query("SELECT * FROM ibwf_gallery WHERE id ='".$id."'"));
if($pic[3]!='')
{
$filename = "$pic[3]";
}
else 
{
$filename = "../images/nopic.jpg";
}
$height= 100;
$width= 100;
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);

if ($width && ($width_orig < $height_orig)) {
   $width = ($height / $height_orig) * $width_orig;
} else {
   $height = ($width / $width_orig) * $height_orig;
}

// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);

// Output
imagejpeg($image_p, null, 100);
ImageDestroy ($image_p);
?>

You wanna say this max.php doesnot give thumbnail view of an image?

khan1 Developer · 101 posts #29

yeah that max script doesnt works on this script

this 1 does

<?php
$height= 100;
$width= 100;
// Content type
header('Content-type: image/jpeg');
if(!$filename)
$filename="./images/nopic.jpg";
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);

if ($width && ($width_orig < $height_orig)) {
   $width = ($height / $height_orig) * $width_orig;
} else {
   $height = ($width / $width_orig) * $height_orig;
}

// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);

// Output
imagejpeg($image_p, null, 100);
ImageDestroy ($image_p);
?>
rukiya Lead · 569 posts #30

yeah that max script doesnt works on this script

this 1 does

<?php
$height= 100;
$width= 100;
// Content type
header('Content-type: image/jpeg');
if(!$filename)
$filename="./images/nopic.jpg";
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);

if ($width && ($width_orig < $height_orig)) {
   $width = ($height / $height_orig) * $width_orig;
} else {
   $height = ($width / $width_orig) * $height_orig;
}

// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);

// Output
imagejpeg($image_p, null, 100);
ImageDestroy ($image_p);
?>

i dont think so

khan1 Developer · 101 posts #31

your professional coder you know better than me

anyways if it doesnt work just replace max.php but for me this works

khan1 Developer · 101 posts #33

try replacing max file if it doesnt work than theirs problem with your server coz myself was also facing the same problem earlier

if still not working post your error so that other coders can help you

opticalpigion Lead · 593 posts #36

when i click on add photo i got this error

I don't know how did you get into here, but there's nothing to show

0 Home
else if($action=="useav") { $gid = $_GET["gid"]; addonline(getuid_sid($sid),"Updating Avatar",""); echo ""; echo ""; echo ""; echo ""; echo ""; echo "

"; $getimg = mysql_fetch_array(mysql_query("SELECT itemurl FROM ibwf_gallery WHERE id='".$gid."'")); $avatar = $getimg[0]; $uid = getuid_sid($sid); $res = mysql_query("Update ibwf_users SET avatar='".$avatar."' WHERE id='".$uid."'"); if($res) { echo "Avatar was successfully updated
"; }else{ echo "Database Error!
"; } echo "
"; echo ""; echo "Home"; echo "
"; echo ""; } else if($action=="delgal") { $gid = $_GET["gid"]; addonline(getuid_sid($sid),"Deleting Gallery Photo",""); echo ""; echo ""; echo ""; echo ""; echo ""; echo "

"; $itemowner = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_gallery WHERE id='".$gid."'")); if(ismod(getuid_sid($sid))||getuid_sid($sid)==$itemowner[0]) { $res = mysql_query("DELETE FROM ibwf_gallery WHERE id='".$gid."'"); $res2 = mysql_query("DELETE FROM ibwf_galcomments WHERE pid='".$gid."'"); $res3 = mysql_query("DELETE FROM ibwf_prate WHERE pid='".$gid."'"); if($res||res2||res3) { echo "Photo Deleted From Gallery
"; }else{ echo "Database Error!
"; } }else{ echo "You can't delete this Photo"; } echo "

"; echo ""; echo "Home"; echo "
"; echo ""; } else if($action=="addgal") { $itemurl = $_POST["itemurl"]; $uid = getuid_sid($sid); $nopl = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$uid."'")); if($nopl[0]=='M') { $usex = "M"; }else if($nopl[0]=='F'){ $usex = "F"; }else{ $usex = "M"; } echo ""; echo ""; echo ""; echo ""; echo ""; echo "

"; $res = mysql_query("INSERT INTO ibwf_gallery SET uid='".$uid."', itemurl='".$itemurl."', sex='".$usex."'"); if($res) { echo "User Photo Added
"; }else{ echo "Database Error
"; } echo "User Gallery
"; echo ""; echo "Home"; echo "
"; echo ""; }else if($action=="commentadd") { $text = $_POST["text"]; $prate = $_POST["prate"]; $gid = $_GET["gid"]; addonline(getuid_sid($sid),"Adding Photo Comment",""); echo ""; echo ""; echo ""; echo ""; echo ""; echo "

"; $crdate = time(); $uid = getuid_sid($sid); $res = false; if(trim($text)!="") { $res = mysql_query("INSERT INTO ibwf_galcomments SET text='".$text."', byuser='".$uid."', time='".$crdate."', pid='".$gid."'"); } if($res) { echo "Comment Added Successfully
"; }else{ echo "Error Adding Comment"; } if($prate!="") { $res2 = mysql_query("INSERT INTO ibwf_prate SET uid='".$uid."', pid='".$gid."', prate='".$prate."'"); if($res2) { echo "Photo rated successfully
"; }else{ echo "Database Error!
"; } } echo "

"; echo ""; echo "Home"; echo "
"; echo ""; }
opticalpigion Lead · 593 posts #38

i try to add upload option

its uploading picture in correct place but it dont show photo?

echo "<form method="post" enctype="multipart/form-data" action="genproc.php?action=addgal&sid=$sid">"; echo "<input type="file" name="itemurl"> "; echo "<input type="Submit" name="uploadform" value="Upload">"; echo "</form>";

why???????????????????? guide me plssss

Guest #39

i have also problem with my upload... on my site i can upload by computer and everything doing fine but on mobile dont have upload... something like hidden... i have just back to gallery but dont have upload

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close