Author Topic: [MOD-REQ] Modifying the Add Images function in ACP  (Read 4422 times)

0 Members and 1 Guest are viewing this topic.

Offline Optimum

  • Newbie
  • *
  • Posts: 26
    • View Profile
[MOD-REQ] Modifying the Add Images function in ACP
« 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD-REQ] Modifying the Add Images function in ACP
« Reply #1 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);
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Optimum

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: [MOD-REQ] Modifying the Add Images function in ACP
« Reply #2 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