Hi there Im in need of some help with a script that i recently bought and am having a little trouble with one perticular part of it. The script is 'The Grand Tutorial' ( www.thegrandtutorial.com ) and its all installed but one problem i have is when adding a tutorial via Admin CP there is a option that you can upload a image to go at the top of that perticular page. When uploaded, i get an error message saying: Warning: imagecreatefromjpeg(/home/USERNAME/public_html/images/upload/steps/step_4ff9c22298c7.jpg): failed to open stream: No such file or directory in /home/tutorlov/public_html/admin/functions.php on line 584 Warning: imagesx(): supplied argument is not a valid Image resource in /home/tutorlov/public_html/admin/functions.php on line 591 Warning: imagesy(): supplied argument is not a valid Image resource in /home/tutorlov/public_html/admin/functions.php on line 592 On those perticular lines i have: 584- if($ext == 'jpg' || $ext == 'jpeg'){ 591- Nothing there 592- $xw = imagesx($img); Im really hoping that somebody can help me in sorting this problem out as soon as possible. If any more infomation is needed ( such as the whole code ) please either PM or post below. Thanks very much
What file type are you trying to upload? Also, do you have the permissions set correctly to allow files to be uploaded to that directory?
Hi Stan, I have set the permissions to '777' so it should work. And im trying to upload a either a .png file or a .jpg file. Thanks
can you see this file in the tree: /home/USERNAME/public_html/images/upload/steps/step_4ff9c22298c7.jpg ?
Hi there No i dont get that, there is nothing there. On the page there is a link ( which there isnt suppost to be ) which goes to: http://www.tutorialove.com/images/upload/steps/step_4ff9c22298c7.jpg And as you can see that is dead. Thanks
I havnt changed that. As that would most proably just be there to show the buyer of the script that their Username would go there...? Im proably wrong. But ive looked for that, and cannot find where i change it anywhere
Without knowing more about the script, it sounds to me like you need to change that USERNAME to a real value - i.e. for a directory that exists and this script has access to. If you could paste a lines 580 to 584 from /home/tutorlov/public_html/admin/functions.php, it would be easier to see what is going on.
Here are some lines of the code as you requested: 582 - function imgsizemod($image = '', $ext = ''){ 584 -if($ext == 'jpg' || $ext == 'jpeg'){ 585 - $img = imagecreatefromjpeg($image); 586 - } elseif($ext == 'png'){ 587 - $img = imagecreatefrompng($image); 588 - } else { 589 - return basename($image); Any more request for the code, please say Thanks
Nope, that's where the imgsizemod function is declared - you should look for 'imgsizemod(' in your scripts (not in the file where you found the line above) and check the first param
Now we are getting somewhere - now you should look for a file called 'config.inc.php' or something like that (it should be included ore required at the beginning of each script) and check what's the value for $config['image_dir'] - and possibly change it to an existing (and writable) directory on your server
I was wondering, looking around would this be of any help: global $config; @move_uploaded_file($_FILES['s_img']['tmp_name'], $config['image_dir'].'/steps/'.$nflm); $insert['s_img'] = $nflm; $thumb = $this->imgsizemod($config['image_dir'].'/steps/'.$nflm, $ext); $insert['s_thumb'] = $thumb;
Somewhere there will be a line that starts: "$config['image_dir']=..." See if you can find that somewhere - it might be in a different PHP file though. If you can find that then paste it here we might get a bit further