Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - SunnyUK

Pages: 1 [2] 3
16
Just in case anyone else would like to be able to also delete the "big" files, here's the solution I came up with after seeing that this issue hadn't been tackled by anyone else before.

In lang\english\admin.php search for
Code: [Select]
$lang['thumb_delete_success'] = "Thumbnail file deleted";
$lang['thumb_delete_error'] = "Error deleting thumbnail file";

Insert this after:
Code: [Select]
$lang['bigimage_delete_success'] = "Big image file deleted";
$lang['bigimage_delete_error'] = "Error deleting big image file";

Do the same in \lang\deutch\admin.php

in admin\images.php search for
Code: [Select]
      if (!empty($image_row['image_thumb_file']) && !is_remote($image_row['image_thumb_file']) && !is_local_file($image_row['image_thumb_file'])) {
        if (@unlink(THUMB_PATH."/".$image_row['cat_id']."/".$image_row['image_thumb_file'])) {
          echo "&nbsp;&nbsp;".$lang['thumb_delete_success']." (".$image_row['image_thumb_file'].")<br />\n";
        }
        else {
          $error_log[] = "<b>".$lang['thumb_delete_error']." (".$image_row['image_thumb_file'].")<br />\n";
        }
      }

(this is within a function called delete_images)

After that code, insert
Code: [Select]
/* We should also delete the "big" version in folder /download */
      if (!is_remote($image_row['image_media_file']) && !is_local_file($image_row['image_media_file'])) {
        $download_del = MEDIA_PATH."/".$image_row['cat_id']."/download/".$image_row['image_media_file'];
if (file_exists($download_del)) {

          if (@unlink($download_del)) {
            echo "&nbsp;&nbsp;".$lang['bigimage_delete_success']." (".$image_row['image_media_file'].")<br />\n";
          }
          else {
            $error_log[] = "<b>".$lang['bigimage_delete_error']." (".$download_del.")<br />";
          }
}
      }

If your "big" folder is not called \download, then you need to replace the /download/ with your "big folder"-name in this line of my code:
Code: [Select]
        $download_del = MEDIA_PATH."/".$image_row['cat_id']."/download/".$image_row['image_media_file'];

17
Firstly, thanks a bunch for this great mod. It's great functionality!

When an image is deleted, both the image and the thumbnail gets deleted. However, the "big" or "download" version does not automatically get deleted at the same time.

Any idea about how to fix that?

Thanks in advance

18
Not sure whether it works with v 1.7.4, but check http://www.4homepages.de/forum/index.php?topic=21053.0 which is about turning the EXIF data into individual database fields you can refer to as make, model, aperture, etc.

19
Mods & Plugins (Releases & Support) / Re: [MOD] Exif V.1.7.6
« on: June 22, 2008, 05:38:07 PM »
Great mod, Rembrandt. Thank you VERY much for sharing it! :)

I've found an upleasant error, though. In the rebuild_exifindex function, there's an overspill between iterations. If a file doesn't have EXIF data, rebuild_exifindex.php will assign it the exif data from the previous image.

The fix is edit the attached rebuild_exifindex.php and search for
Code: [Select]
while ($row = $site_db->fetch_array($result)) {
    echo "Processing image <b>".$row['image_name']."</b>, ID ".$row['image_id']." ...<br>";

After this insert
Code: [Select]
unset($Make);
unset($Model);
unset($DateTimeOriginal);
unset($ISOSpeedRatings);
unset($ExposureTime);
unset($FNumber);
unset($FocalLength);
unset($ExposureBiasValue);
unset($ApertureValue);
unset($MaxApertureValue);
unset($MeteringMode);
unset($Flash);
unset($ExposureProgram);
unset($ExposureMode);
unset($WhiteBalance);
unset($GPSLongitudeRef);
unset($GPSLatitudeRef);
unset($GPSLongitude);
unset($GPSLatitude);
unset($GPSAltitude);
unset($GPSTrack);

20
Hello nobby,

Thank you very much for taking the time to reply. Unfortunately that does not work. The "delete" button only deletes the image and the thumbnail.

I was looking for a way to delete the image, the thumbnail and any big version of the image residing in \data\media\<category>\download

I have found a delete function in member.php and tried to tweak it but without luck.

Any help would be greatfully appreciated.

Thanks in advance,
Tomas

21
I installed the "alternate directory for download files" mod (http://www.4homepages.de/forum/index.php?topic=7499.msg33712#msg33712) and got it working. So now for each image I typically have

\data\media\<category>\picture.jpg
\data\media\<category>\download\picture.jpg
\data\thumbnails\<category>\picture.jpg

When I delete an image (from the detail screen), the \data\media\<category>\download\picture.jpg is not deleted.

How can I tweak the system so that it does get deleted together with the two other files?

Any assistance would be greatly appreciated!

Thanks in advance,
Tomas

22
I've struggled with this MOD for some hours now. There is something wrong with downloads from the \big directory (and yes, I have read all 8 pages in detail and been over the code several times). But the good news is that the mod works (at least for me) if the big files are stored in \download.

So an easy way around it is to update admin\checkimages.php and make "download" the default directory for oversized images:
Code: [Select]
$big_folder_default = "download"; //name of the "big" folder where original image will be copied to, if its bigger then size set in the settings.
Just thought this might help some of the other people who have struggled with the download still being of the reduced size even when there is a bigger file they'd like to download.

23
Is there a way I can re-upload an image without having it processed as a new picture? Basically I would like to be able to amend the picture (say, add more IPTC information) and upload (via FTP) to my 4images album without either a) the existing comments/ratings disappearing and without b) the picture being marked as "new".

Any assistance would be greatly appreciated.

24
Mods & Plugins (Requests & Discussions) / Multi-word keywords
« on: May 31, 2008, 12:43:33 AM »
First of all, I am not a php programmer. In fact today was the first time I ever tried to write a single php statement. So beware that what follows might be utter rubish! ;)

Having said that, I wanted to be able to handle keywords which consists of several individual words. Out-of-the-box 4images would treat the keyword <Summer evening> as two separate words. In English where a lot of phrases are made up of individual words without a dash or anything in between, this feels awkward.

I have spent hours scanning the forum, and it seems that others have asked for this without it being resolved.

My solution builds upon Rembrandt's IPTC V.1.7.6 Suchfelder erweiterung mod: http://www.4homepages.de/forum/index.php?topic=21141.0
Do not attempt this mini-mod-attempt without first having applied Rembrand's mod.

Here goes

a) The idea is to convert spaces to underscores when keywords come into the system and convert underscores back to spaces when keywords are displayed (the keywords table strip underscores away, so a keyword <Summer_Evening> will be stored there as <SummerEvening> which is pretty perfect as it prevents hits if people search for <Summer>).
b) keywords can come into the system from IPTC tags (which corresponds to the tags displayed by e.g. Vista or Photoshop) - see edit 2) below
c) keywords can be entered directly on the "edit image" form in the APC. I don't know how to intercept that... if anyone has an idea, please shout!
d) keywords are shown on the detail screen as clickable hyperlinks - see edit 1) below

1) Edit includes\functions.php.

Find

Code: [Select]
  if (!empty($image_row['image_keywords'])) {
    $split_keywords = explode(" ", $image_row['image_keywords']);
    $keywords = "";
    foreach ($split_keywords as $key => $val) {
        $keywords .= (($keywords != "" ) ? ", " : "")."<a href=\"".$site_sess->url(ROOT_PATH."search.php?search_keywords=".urlencode($val))."\">".format_text($val, 2)."</a>";
    }

Replace by

Code: [Select]
  if (!empty($image_row['image_keywords'])) {
    $split_keywords = explode(" ", $image_row['image_keywords']);
    $keywords = "";
    foreach ($split_keywords as $key => $val) {
        $oldval = $val;
        if ($val != "") {
        $val = str_replace('_', ' ', $val);
}
        $keywords .= (($keywords != "" ) ? ", " : "")."<a href=\"".$site_sess->url(ROOT_PATH."search.php?search_keywords=".urlencode($oldval))."\">".format_text($val, 2)."</a>";
    }

2) Edit \admin\checkimages.php

Find

Code: [Select]
  $iptc_keywords_default = 0; //auto insert keyword from IPTC (0 or 1)

Replace with
Code: [Select]
  $iptc_keywords_default = 1; //auto insert keyword from IPTC (0 or 1)

Find

Code: [Select]
                $caption = ($iptc_description && isset($iptc['2#120'][0])) ? $iptc['2#120'][0] : "";
                $keywords = "";
                if ($iptc_keywords && isset($iptc['2#025']))
                {
                  foreach ($iptc['2#025'] as $val)
                  {
                    $keywords .= (($keywords != "" ) ? " " : "").$val;
                  }

Replace with

Code: [Select]
                $caption = ($iptc_description && isset($iptc['2#120'][0])) ? $iptc['2#120'][0] : "";
                $keywords = "";
                if ($iptc_keywords && isset($iptc['2#025']))
                {
                  foreach ($iptc['2#025'] as $val)
                  {
                    $val = str_replace(' ', '_', $val);
                    $keywords .= (($keywords != "" ) ? " " : "").$val;
                  }

3) This works if you get your pictures into the database by
a) FTP'ing the images to your site
b) running a "check images" from the APC

4) This also works if you type in keywords with underscores in place. So say you wanted to type in the tag <Summer Evening>, you would type it in as <Summer_Evening>. I have not been able figure out how to get checkimage.php to automatically replace <Summer Evening> with <Summer_Evening> for you, so unless someone can point me in the right direction (?), I can't help here. As I aim to have my images tagged before upload, it's not a huge problem for me, but it would be nice to find a solution.

As I started by saying, this is my first attempt at modifying 4images or anything else in php. It is entirely possible that this "mod" will break something or that there are side effects which I haven't considered. So use it at your own peril. Having said that, if you do use it, please let me know if it also works acceptable for you or if you run into problems.

25
TMO, checkimages doesn't seem to run when pictures are uploaded via the "upload" button on your 4images website. But if you FTP the images into the root folder of your 4images and then do a "check new images", it will find them and do everything for you.

26
By jolly, TMO, you're absolutely right!  I've checked it and it seems like it's necessary to do both the rebuild_iptc_index and the rebuild_search_index. So if this is due to a misunderstanding in how to apply the mod, you and I must have made the same mistake.


27
Thank you for this script. It's very close to what I was looking for, but not exactly. Maybe someone can explain to me how I can make it suit my purposes completely?

1) instead of generating the keywords from all sorts of fields, I would like to generate them from the ITPC keywords (the intention is that if people have already tagged their photos, these tags should become 4images keywords) - and only from the ITPC keywords.

2) instead of having a script that runs on request, I would like it integrated in the upload process so it does its magic each and every time somebody uploads a new image.

Is this possible? Any hints about how to go about it would be greatly appreciated.

(I'm using 4images 1.7.6 and am not a php programmer)

28
I would also be very interested in a solution to this.... :)

29
Phew, that was a tough one to crack for a non-php coder like myself. I'm offering the solution here just in case anyone else stumbles into the same problem.

In step 4 of the description of the mod, it is essential to add a comma to the last line of the existing code from
Code: [Select]
  "image_keywords" => "keys_match"to
Code: [Select]
  "image_keywords" => "keys_match",
It looks like this fixes all my problems... the screens now come up as I expected and the amended search screen works.

Great mod, Rembrandt. Thank you so much for developing it :)

30
After attempting this mod, I now find that "validate images" and "check new images" just gives me a blank screen. And whereas an upload normally gives a confirmation about the file being saved, it now ends with a blank screen (although the file DOES get uploaded).

Are there anything in these symptoms that points towards what might be wrong?  Any assistance would be greatly appreciated.

Pages: 1 [2] 3