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 #1

Photo Gallery

Version: 1.0.0 Category: Other useful scripts

Description: lavalair xhtml ver---photo comments---rate photos---upload photos---male nd female photo category---admin can delete photos nd comments

Attachments: gallery.zip
WhiteWarrior Principal · 1,419 posts #3

work at wapdesire script???

Wapdesire is lavalair

SiLeNce Developer · 138 posts #7

delete photo only for database or in directory ?

rukiya Lead · 569 posts #9

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);
?>
rukiya Lead · 569 posts #11

and code for the random image for this gallery script is

$sql=mysql_fetch_array(mysql_query("SELECT uid, itemurl  FROM ibwf_gallery ORDER BY RAND() LIMIT 1"));
 $nick = getnick_uid($sql[0]);
echo "<img src=\"$sql[1]\" alt=\"$sql[0]\"/><a href=\"index.php?action=viewuser&who=$sql[0]&sid=$sid\">$nick</a>";
rukiya Lead · 569 posts #16

but I upload the image and not work...not view images correct...only nopic.jpg appars...External image (may be gone) goto phpmyadmin.then put this SQL query

DROP TABLE IF EXISTS `ibwf_gallery`;
CREATE TABLE `ibwf_gallery` (
  `id` int(100) NOT NULL auto_increment,
  `uid` int(100) NOT NULL,
  `sex` varchar(255) NOT NULL,
  `itemurl` varchar(255) NOT NULL,
  `file` varchar(250) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`itemurl`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3;
INSERT INTO `ibwf_gallery` VALUES (1, '1', 'M', '[url]http://coolbd.wen.ru/anim/1.jpg','a'[/url]);
INSERT INTO `ibwf_gallery` VALUES (2, '1', 'M', '[url]http://coolbd.wen.ru/anim/2.jpg','b'[/url]);
khan1 Developer · 101 posts #17

it doesnt work bcoz of my bad coding anyways thanks 4the correct SQL

after using above SQL file pic is showing

that means u need to add file > a

there seems to be problem with this code

echo "<form action=\"genproc.php?action=addgal&sid=$sid\" method=\"post\">";  
echo "Image URL: <input name=\"itemurl\" type=\"file\" value=\"\"/>
";
echo "
<input type=\"submit\" value=\"Add Photo\"/>";
echo "</form>";

by using itemurl user can only add http image links so i added file option

just checked my SQL it was correct the problem is with the above code

sweetangel Lead · 885 posts #18

goto phpmyadmin.then put this SQL query

DROP TABLE IF EXISTS `ibwf_gallery`;
CREATE TABLE `ibwf_gallery` (
  `id` int(100) NOT NULL auto_increment,
  `uid` int(100) NOT NULL,
  `sex` varchar(255) NOT NULL,
  `itemurl` varchar(255) NOT NULL,
  `file` varchar(250) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`itemurl`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3;
INSERT INTO `ibwf_gallery` VALUES (1, '1', 'M', 'http://coolbd.wen.ru/anim/1.jpg','a');
INSERT INTO `ibwf_gallery` VALUES (2, '1', 'M', 'http://coolbd.wen.ru/anim/2.jpg','b');

but if upload this code works upload gallery or not???

if like my post click:

External image (may be gone)

laro696 Developer · 205 posts #19

but I upload the image and not work...not view images correct...only nopic.jpg appars...External image (may be gone)

shouldn't u chmod 777 the directory where u upload the gallery images?

rukiya Lead · 569 posts #20

it doesnt work bcoz of my bad coding anyways thanks 4the correct SQL

after using above SQL file pic is showing

that means u need to add file > a

there seems to be problem with this code

echo "<form action=\"genproc.php?action=addgal&sid=$sid\" method=\"post\">";  
echo "Image URL: <input name=\"itemurl\" type=\"file\" value=\"\"/>
";
echo "
<input type=\"submit\" value=\"Add Photo\"/>";
echo "</form>";

by using itemurl user can only add http image links so i added file option just checked my SQL it was correct the problem is with the above code

If you use file as input type you have to use file uploader but if you use previous script you need to put photo URLs using the admin.php then everything is ok for the previous script.while you are adding urls with admin.php,the admproc.php INSERTs itemurl in ibwf_gallery sql table for the code in admproc.php

mysql_query("INSERT INTO ibwf_gallery SET uid='".$uid."', itemurl='".$itemurl."', sex='".$usex."'");

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