Author Topic: Upload multiple images via *.zip DONE  (Read 80570 times)

0 Members and 1 Guest are viewing this topic.

TheOracle

  • Guest
Re: Upload multiple images via *.zip DONE
« Reply #30 on: August 25, 2005, 05:02:16 PM »
Quote

define('ROOT_PATH', './../');
include('./upload.php');


Change to :

Code: [Select]

define('ROOT_PATH', './');
include(ROOT_PATH.'includes/upload.php');


Offline jkn

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Upload multiple images via *.zip DONE
« Reply #31 on: August 25, 2005, 05:47:42 PM »
in includes/upload2.php ???

i’ve now this error:

Warning: Failed opening './includes/upload.php' for inclusion (include_path='.:/usr/share/php') in /home/www/web19/html/images/includes/upload2.php on line 5

Warning: Failed opening './global.php' for inclusion (include_path='.:/usr/share/php') in /home/www/web19/html/images/includes/upload2.php on line 6

Fatal error: Failed opening required './includes/sessions.php' (include_path='.:/usr/share/php') in /home/www/web19/html/images/includes/upload2.php on line 7

Offline dipunm

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • london academy yearbook
Re: Upload multiple images via *.zip DONE
« Reply #32 on: August 25, 2005, 06:13:21 PM »
to: jkn

It is to my understanding that the error came after you made the changes that theoracle specified...
I tested theoracles changes and unfortunately, it doesn't work, instead it gives me a similar syntax error :mrgreen:

when you get an error which is not written onto the page, this means that the error is not a php error. Therefore, when the error specified line 4, you should have looked into the source of the loaded page and looked for line 4 from there.

If you did so, you would probably found that the error was in the change that theoracle specified.  :roll:

Unfortunately, theoracle did not realise that the part he told you to change was not written in php, instead it was written in javascript.

WHAT TO DO
 You should revert the file back to how it was before... this will cure all of your errors in the upload2.php file.

1) find

Code: [Select]
define('ROOT_PATH', './');
change back to

Code: [Select]
define('ROOT_PATH', './../');
2) find

Code: [Select]
top.location=''.$site_sess->url(ROOT_PATH.'checkandgo.php?sid=".$sid."&cat_id=".$cat_id.").''
change to

Code: [Select]
top.location='./../checkandgo.php?sid=<?php print "$sid?>&cat_id=<?php print "$cat_id?>'
However, as I mentioned before, the previous error has nothing to do with the upload process, only the checkandgo process and if anything, the problem lies in there.  :wink:

Unfortunately, as I said before, i only used the checkandgo mod, so I cant give support for this, i reccomend that you reinstall the checkandgo mod but if this doesnt work, you should try and post your question at the checkandgo (allinone) forum.

TheOracle

  • Guest
Re: Upload multiple images via *.zip DONE
« Reply #33 on: August 25, 2005, 06:14:53 PM »
Quote

I tested theoracles changes and unfortunately, it doesn't work, instead it gives me a similar syntax error


I never should of posted this. Put it back the way it was.  :oops:

Offline jkn

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Upload multiple images via *.zip DONE
« Reply #34 on: August 25, 2005, 08:13:42 PM »
thx guy's !

but now i have another error  :(


Fatal error: Cannot redeclare class upload in /home/www/web19/html/images/includes/upload.php on line 44

after line 44 is:

Code: [Select]
class Upload {

  var $upload_errors = array();
  var $accepted_mime_types = array();
  var $accepted_extensions = array();
  var $upload_mode = 3;

  var $image_type = "";
  var $max_width = array();
  var $max_height = array();
  var $max_size = array();
  var $upload_path = array();

  var $field_name;
  var $file_name;
  var $extension;

  var $image_size = 0;
  var $image_size_ok = 0;
  var $lang = array();
  var $upload_errors = array();

  function Upload() {
    global $config, $lang;

    $this->max_width['thumb'] = $config['max_thumb_width'];
    $this->max_width['media'] = $config['max_image_width'];
    $this->max_height['thumb'] = $config['max_thumb_height'];
    $this->max_height['media'] = $config['max_image_height'];
$this->auto_image['media'] = $config['auto_image'];

    $this->max_size['thumb'] = $config['max_thumb_size'] * 1024;
    $this->max_size['media'] = $config['max_media_size'] * 1024;

    $this->upload_mode = $config['upload_mode'];
    $this->lang = $lang;

    $this->set_allowed_filetypes();
  }


??? and thx for your help &answers!

jkn

Offline dipunm

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • london academy yearbook
Re: Upload multiple images via *.zip DONE
« Reply #35 on: August 26, 2005, 07:44:28 AM »
Well as far as i can see, you've missed out the '}' at the end of the upload class
put this on line JUST before   'function Upload() {'

this might fix the problem :wink:

Offline jkn

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Upload multiple images via *.zip DONE
« Reply #36 on: August 26, 2005, 08:41:34 AM »
no, that was not the complete function!  8)

but i'm fix this error - here they are 2x:

include(ROOT_PATH.'includes/upload.php');

in the upload2.php! and now .. it works!!  :D   :lol:   :D

thx guy's!!!

jkn

p.s. another little question: upload-resizing is ok, but how can i save the original uploading image in a separate folder!???  :oops:

Offline Jan Senf

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • event-pics.de und ihr seid dabei !
Re: Upload multiple images via *.zip DONE
« Reply #37 on: August 26, 2005, 10:57:03 AM »
ITīS WORKING !!!!
Great !

(ok, i didīn use the new upload2.php - my fault !!!)

One thing left...
Iīve no chance to enter some keywords because the page where i may enter them jumps to the next page within a second oder two ????


Offline dipunm

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • london academy yearbook
Re: Upload multiple images via *.zip DONE
« Reply #38 on: August 26, 2005, 11:50:14 AM »
Jan Senf:
yeh, I did that because there are a few things that the uploader can change on that page which shouldn't be available to any user such as choosing which name to put as the uploader. for this reason, i placed an autosubmit code in to prevent unauthorised changes. If you want to play with it, the file to edit is checkandgo.php (the one on the 4images directory).

find:
Code: [Select]
print "<SCRIPT LANGUAGE=\"Javascript\"> document.forms(\"formular\").submit() </SCRIPT>";(should be on line 242)

this is the code that autosubmits the form... delete it and you can see and enter the excess info without any interruption...
However...I DO NOT RECCOMMEND THIS BECAUSE IT GIVES USERS PERMISSION TO ACT MISCHEIVIOUSLY.

Also, I believe that the comment box, when filled in, is applied to ALL the pictures.

Offline dipunm

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • london academy yearbook
Re: Upload multiple images via *.zip DONE
« Reply #39 on: August 26, 2005, 12:38:02 PM »
jkn
Well, I dont use the auto resizer :roll:, You can decide what you want the mod to do to the picture once it is uploaded in the admin cpanel.

you should find CheckAndGo Settings in the General section of the menu on the left. :mrgreen:

If you want BOTH, big and resized images, and you dont mind that the big file is situated in a specific folder but 4images will not use it in any way, here's what to do:

in upload2.php:
find:
Code: [Select]
  if ($archive->extract(PCLZIP_OPT_PATH, $uploadDir,
                        PCLZIP_OPT_REMOVE_ALL_PATH) == 0) {
  die("Error : ".$archive->errorInfo(true));
 }else{
insert after:
Code: [Select]
big = $archive->extract(PCLZIP_OPT_PATH, ROOT_PATH.'put the directory here (relative to your 4images directory)', PCLZIP_OPT_REMOVE_ALL_PATH);
NOTE: the new directory cannot be the same as the original directory because it will simply be as if no change was made.
If you want the download link to download the big file but for the image to be resized when you view it, then let me know and i'll look into it  :wink:

ps. I take it youve solved the problem with checkandgo.php?
Quote
Warning: Invalid argument supplied for foreach() in /4images/checkandgo.php on line 332

Offline jkn

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Upload multiple images via *.zip DONE
« Reply #40 on: August 26, 2005, 02:23:29 PM »
hmmmm... i've added this as line 56:

Code: [Select]
big = $archive->extract(PCLZIP_OPT_PATH, ROOT_PATH.'/data/media/'.$cat_id.'/big/', PCLZIP_OPT_REMOVE_ALL_PATH);
but:   Parse error: parse error, unexpected '=' in /home/www/web19/html/images/includes/upload2.php on line 56

this mod is really fine, but it's nicer when we let the users download also the original uploaded files .. example from the "big" folder under the cat-folders!!

thx & by
jkn



Offline dipunm

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • london academy yearbook
Re: Upload multiple images via *.zip DONE
« Reply #41 on: August 26, 2005, 03:10:54 PM »
I guess i shudav tested the code first eh? :oops:

k, ill hav a go with the big pic mod

Offline dipunm

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • london academy yearbook
Re: Upload multiple images via *.zip DONE
« Reply #42 on: August 26, 2005, 04:13:33 PM »
Try this: its not tested so if you find any error with it, please send me the error messages or if it just doesnt work, tell me so i can fix it  :wink:

oh and make BACKUPS OF UPLOAD2.PHP AND CHECKANDGO.PHP

in checkandgo.php

find:
Code: [Select]
$sql = "INSERT INTO ".IMAGES_TEMP_TABLE." (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments, image_status)
          VALUES (".$cat_id.", ".$user_id.", '".$image_name."', '', '".$image_keywords."', ".$image_date.", ".$image_active.", '".$image_media_file."', '".$image_thumb_file."', '', ".$image_allow_comments.", '".$checkandgo_steps_status[0]."')";
replace with:
Code: [Select]
$sql = "INSERT INTO ".IMAGES_TEMP_TABLE." (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments, image_status)
          VALUES (".$cat_id.", ".$user_id.", '".$image_name."', '', '".$image_keywords."', ".$image_date.", ".$image_active.", '".$image_media_file."', '".$image_thumb_file."', '".$bigurl.$image_name."', ".$image_allow_comments.", '".$checkandgo_steps_status[0]."')";

in upload2.php:

delete everything AFTER :
Code: [Select]
include('./pclzip.lib.php');
replace with:
Code: [Select]
$uploadDir = ROOT_PATH.'/data/media/'.$cat_id.'/';
 $archive = new PclZip($uploadDir.$new_name);
  if ($archive->extract(PCLZIP_OPT_PATH, $uploadDir,
                        PCLZIP_OPT_REMOVE_ALL_PATH) == 0) {
  die("Error : ".$archive->errorInfo(true));
 }else{
$uploadDir2 = ROOT_PATH.'/data/media/'.$cat_id.'/big/';
if ($archive->extract(PCLZIP_OPT_PATH, $uploadDir2,
                        PCLZIP_OPT_REMOVE_ALL_PATH) == 0) {
  die("Error : ".$archive->errorInfo(true));
 }else{

?>
<script language="javascript">
top.location='./../checkandgo.php?sid=<?php print "$sid?>&cat_id=<?php print "$cat_id?>&bigurl=<?php print "$uploadDir2?>'
</script>
<?php
}
 }
unlink($uploadDir.$new_name);
}
?>

Offline jkn

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Upload multiple images via *.zip DONE
« Reply #43 on: August 26, 2005, 07:29:01 PM »
hee hee heee .. you are my hero of the day!!!  :mrgreen:

it works perfect with
Code: [Select]
[b][color=Red]'[/color][/b]".$bigurl.$image_name."[color=Red][b]'[/b][/color] in the sql-querie!!

:)

and the last question: can we add images .. also the check-and-go-prozess .. in a little java-skript window!??? otherwise i have my gallery-page -> click upload -> now i have a blanc and after the prozess i have again my gallery page! hmmm...?

jkn

Offline dipunm

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • london academy yearbook
Re: Upload multiple images via *.zip DONE
« Reply #44 on: August 26, 2005, 10:31:26 PM »
Quote
it works perfect with
Code:
'".$bigurl.$image_name."'
in the sql-querie!!

if you are gonna post a code, tags dont work inside them... it confused me wen i read it  :(
It's ok, i get it now...

HOWEVER, could you please rewrite your last question... i didnt quite get it  :? :oops:

if you're asking if the mod can work in a new window, you could try to edit the member_multiuploadform.html file in the template directory and in the form tag, put target="_blank"

(Im too tired to show where to change what, i'll modify this later... )

the change is not tested and i dont know if it will work