4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: Optimum on March 27, 2006, 06:24:09 PM

Title: [MOD-REQ] Modifying the Add Images function in ACP
Post by: Optimum on March 27, 2006, 06:24:09 PM
Hi,

since I was unable to find any good answer to my problem, I'll ask here.

Is it possible to add a new option in Add Images in ACP that would ask if the images should be written to the DB or just added (transfered) to the server? Something like: "Add images to DB?" YES/NO

If YES is selected, nothing would change. Everything would work as it is now.
If NO is selected, the images would only be added to the server folder, but wouldn't be written to the db.



..OR..



If the above can't be done, is it possible to make a new menu option "Upload images" (or something like that) in the ACP, which would include a upload box and category selector (so the upload would be done to the correct folder on server). That's all. You'd select the image from your local drive, select the category and press the button. Image would be transfered to the correct folder on server and you'd be able to work with it from there.


With either of above options, images would be on server, but it would be possible to modify them with different mods that currently can't work with images that are added to the db.
This is mainly useful for people who don't know anything about ftp and when you only have 1 or 2 image to add. It's usually faster to do it with ACP then ftp. 


Hope something could be done.

TIA!!
Mat
Title: Re: [MOD-REQ] Modifying the Add Images function in ACP
Post by: V@no on March 28, 2006, 01:33:45 AM
Ok, the easiest way to do is simply avoid adding any new information about image in the database.
So, in admin/images.php find:
Code: [Select]
        $result = $site_db->query($sql);
        $image_id = $site_db->get_insert_id();

        if ($result) {
          $search_words = array();
          foreach ($search_match_fields as $image_column => $match_column) {
            if (isset($HTTP_POST_VARS[$image_column.'_'.$i])) {
              $search_words[$image_column] = stripslashes($HTTP_POST_VARS[$image_column.'_'.$i]);
            }
          }
          add_searchwords($image_id, $search_words);
Replace with:
Code: [Select]
        $result = true;//$site_db->query($sql);
        $image_id = $site_db->get_insert_id();

        if ($result) {
          $search_words = array();
          foreach ($search_match_fields as $image_column => $match_column) {
            if (isset($HTTP_POST_VARS[$image_column.'_'.$i])) {
              $search_words[$image_column] = stripslashes($HTTP_POST_VARS[$image_column.'_'.$i]);
            }
          }
//          add_searchwords($image_id, $search_words);
Title: Re: [MOD-REQ] Modifying the Add Images function in ACP
Post by: Optimum on March 28, 2006, 09:10:15 AM
Thank you V@no!

Works great. I'd wish I had an option in ACP to turn this on and off, but just that it works!
Now I can use your "Check all images" MOD on ALL images that are uploaded to the gallery, either by ftp or with Add Images through ACP.

Thanks again!
Mat