Chi Kien Uong
Geranienstraße 30
71034 Böblingen
Deutschland / Germany
|
If you are not registered or logged in, you may still use these forums but with limited features.
Show recent topics
|
|
|
Author |
Message |
|
Hi Jam_n,
All of the Advanced Guestbook files are there. All of the permissions were set correctly, except for the Templates folder. I set the permissions to 777 and still no picture. The lib/image.class.php file seems to be okay, but I'm not really sure what I should be looking for there. Any other suggestions?
Jay
This is the code that is in the lib/image.class.php file currently on WANTED's host server:
<?php
/**
* ----------------------------------------------
* Advanced Guestbook 2.3.1 (PHP/MySQL)
* Copyright (c)2001 Chi Kien Uong
* URL: http://www.proxy2.de
* ----------------------------------------------
*/
class gb_image {
var $imagick = ''; /*
* Windows: c:/imagemagick/convert.exe
*/
var $max_width;
var $max_height;
var $min_filesize = 10240;
var $destdir = '.';
var $prefix = '';
var $supported_types = '';
function gb_image() {
$this->max_width = 300;
$this->max_height = 85;
$this->get_supported_types();
}
function set_border_size($max_width,$max_height) {
if ($max_width>0 && $max_height>0) {
$this->max_width = $max_width;
$this->max_height = $max_height;
return true;
} else {
return false;
}
}
function set_prefix($strg) {
$bad_chars = array("\\","/","*","?","\"","<",">","|");
for ($i=0; $i<sizeof($bad_chars); $i++) {
if (strstr($strg, $bad_chars[$i])) {
return false;
}
}
$this->prefix = $strg;
return true;
}
function set_destdir($img_dir) {
if (!is_dir("$img_dir")) {
return false;
}
$this->destdir = $img_dir;
return true;
}
function get_supported_types() {
if (extension_loaded("gd")) {
if (function_exists("imagegif")) {
$this->supported_types['1'] = "GIF";
}
if (function_exists("imagejpeg")) {
$this->supported_types['2'] = "JPEG";
}
if (function_exists("imagepng")) {
$this->supported_types['3'] = "PNG";
}
return (is_array($this->supported_types) && count($this->supported_types)>0) ? $this->supported_types : false;
} else {
return false;
}
}
function is_imagick() {
$is_safe_mode = get_cfg_var("safe_mode");
if ($is_safe_mode) {
return false;
}
if (eregi("convert",$this->imagick)) {
return true;
} elseif ($this->imagick != "none") {
if (!eregi("WIN",PHP_OS)) {
$retval = exec("whereis convert");
if (!empty($retval)) {
$this->imagick = "convert";
return true;
}
}
$this->imagick = "none";
return false;
} else {
return false;
}
}
function create_thumbnail($source,$destination='') {
$img_filesize = (file_exists("$source")) ? filesize("$source") : false;
$destination = trim($destination);
if (strstr($destination, "/") || strstr($destination, "\\")) {
$new_file = $destination;
} elseif ($destination=='') {
$new_file = $this->destdir."/".$this->prefix.basename($source);
} else {
$new_file = $this->destdir."/".$this->prefix.$destination;
}
if (!$img_filesize || $img_filesize <= $this->min_filesize) {
return false;
}
$size = GetImageSize("$source");
$new_size = $this->get_img_size_format($size[0],$size[1]);
if ($this->is_imagick()) {
if (is_array($size) && count($size)>0) {
exec($this->imagick." -quality 90 -antialias -scale $new_size[0]x$new_size[1] $source $new_file");
}
} else {
$type = "$size[2]";
if (isset($this->supported_types["$type"])) {
switch ($type) {
case "1" :
$im = ImageCreateFromGIF("$source");
$new_im = ImageCreate($new_size[0],$new_size[1]);
ImageCopyResized($new_im,$im,0,0,0,0,$new_size[0],$new_size[1],$size[0],$size[1]);
ImageGIF($new_im,$new_file);
break;
case "2" :
$im = ImageCreateFromJPEG("$source");
$new_im = ImageCreate($new_size[0],$new_size[1]);
ImageCopyResized($new_im,$im,0,0,0,0,$new_size[0],$new_size[1],$size[0],$size[1]);
ImageJPEG($new_im,$new_file,90);
break;
case "3" :
$im = ImageCreateFromPNG("$source");
$new_im = ImageCreate($new_size[0],$new_size[1]);
ImageCopyResized($new_im,$im,0,0,0,0,$new_size[0],$new_size[1],$size[0],$size[1]);
ImagePNG($new_im,$new_file);
break;
}
}
}
return (file_exists("$new_file")) ? true : false;
}
function set_min_filesize($file_size) {
if ($file_size>4096) {
$this->min_filesize = $file_size;
return true;
} else {
return false;
}
}
function get_img_size_format($img_width,$img_height) {
if ($img_width>$this->max_width) {
$tag_height = ($this->max_width/$img_width)*$img_height;
$tag_width = $this->max_width;
if ($tag_height>$this->max_height) {
$tag_width = ($this->max_height/$tag_height)*$tag_width;
$tag_height = $this->max_height;
}
} elseif ($img_height>$this->max_height) {
$tag_width = ($this->max_height/$img_height)*$img_width;
$tag_height = $this->max_height;
if ($tag_width>$this->max_width) {
$tag_height = ($this->max_width/$tag_width)*$tag_height;
$tag_width = $this->max_width;
}
} else {
$tag_width = $img_width;
$tag_height = $img_height;
}
$tag_width = round($tag_width);
$tag_height = round($tag_height);
return array(
"$tag_width",
"$tag_height",
"width=\"$tag_width\" height=\"$tag_height\""
);
}
}
?>
|
|
|
Hi Jam_n,
I hope you know that the hate post wasn't mine. To set the record straight, I posted a quote to it.
Thanks for looking into this. From different posts in the forum and your ip address, I kinda figured that you were the one checking this out.
ANYWAY, I checked with our host and file_uploads is "ON." Pictures upload to the WANTED phpBB just fine, which verifies this.
I don't know if this helps but, when I click on "To check your environmental variables, click here," in the admin section, nothing is returned.
Any suggestions
Jay
|
|
|
Jay Pooitras wrote:Thanks a lot you assholes, thanks for motherfucking nothing.
I hate you all!!!!!!!!
This was not my post -- some idiot besmirched my good name with this post!
The individuals who host this Forum do not deserve the language or abuse that this idiot has inflicted on them. These hosts are providing valuable and free technical assistance to people like myself, and are due only our respect and gratitude.
To the idiot who posted this. First of all, you could at least spell my name right. Second of all, the amount of your intelligence is only exceeded by the amount of your wit! Get a life
Jay Poitras
|
|
|
Hi,
I noticed that someone went to our guestbook and did a test to upload a picture. I also notice that the picture did not upload. After this test, do you have any suggestions
Thanks,
Jay
|
|
|
Hello,
Last week I posted a topic regarding not being able to see user pictures that were uploaded to the Advanced Guest Book -- no replies. :o
I would really like to get the feature working. Could someone please help me out?
Please refer to the topic I posted last week to get specifics.
Respect,
Jay Poitras
|
|
|
Hello,
I have just installed Advanced Guestbook 2.3.1 on our Website and it's a beautiful thing! The only difficulty that I have encountered is that I cannot upload any user pictures (smilies work fine). I have read quite a few of the topics here and tried the recommended fixes, i.e., I changed the permissions of the img folder to 777, etc., to no avail.
Do you have any suggestions? I know this feature should work; I've seen it working on quite a few websites.
Any help would be appreciated.
Thank you,
Jay Poitras
[/url]
|
|
|
|
|
|
Based on the open source JForum
|