davidinjp
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: NextGEN Gallery] Show exif with lightboxI setup a pretty simple and automated way to do this with lightbox or floatbox. Sample of what it looks like: https://dave.jp/my-gallery/temples-and-shrines-2
I modified /admin/functions.php so it automatically populates new photo descriptions. I just need to upload a new image or select “Import Meta data” for selected thumbs in the nextgen gallery admin panel to get the descriptions updated. It is simple this way. I also added tags to description.
in admin/functions.php go to this code:
foreach($imagesIds as $pic_id) { $picture = nggdb::find_image($pic_id); if (!$picture->error) { $meta = nggAdmin::get_MetaData($picture->imagePath); // get the title if (!$alttext = $meta['title']) $alttext = $picture->alttext; // get the caption / description field if (!$description = $meta['caption']) $description = $picture->description; // get the file date/time from exif $timestamp = $meta['timestamp']; // update database $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->nggpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", $alttext, $description, $timestamp, $pic_id) ); // add the tags if ($meta['keywords']) { $taglist = explode(',', $meta['keywords']); wp_set_object_terms($pic_id, $taglist, 'ngg_tag'); } // add tags }// error check } // foreach return true; } // ************************************************************** function get_MetaData($picPath) { // must be Gallery absPath + filename require_once(NGGALLERY_ABSPATH . '/lib/meta.php'); $meta = array(); $pdata = new nggMeta($picPath); $meta['title'] = $pdata->get_META('title'); $meta['caption'] = $pdata->get_META('caption'); $meta['keywords'] = $pdata->get_META('keywords'); $meta['timestamp'] = $pdata->get_date_time(); return $meta; }
I changed mine to look like this:
foreach($imagesIds as $pic_id) { $picture = nggdb::find_image($pic_id); if (!$picture->error) { $meta = nggAdmin::get_MetaData($picture->imagePath); // get the title if (!$alttext = $meta['title']) $alttext = ($meta['keywords'] . " " . $meta['camera']); // get the caption / description field if (!$description = $meta['caption']) $description = ($meta['exif_desc'] . "" . $meta['keywords']); // get the file date/time from exif $timestamp = $meta['timestamp']; // update database $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->nggpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", $alttext, $description, $timestamp, $pic_id) ); // add the tags if ($meta['keywords']) { $taglist = explode(',', $meta['keywords']); wp_set_object_terms($pic_id, $taglist, 'ngg_tag'); } // add tags }// error check } // foreach return true; } // ************************************************************** function get_MetaData($picPath) { // must be Gallery absPath + filename require_once(NGGALLERY_ABSPATH . '/lib/meta.php'); $meta = array(); $pdata = new nggMeta($picPath); $meta['title'] = $pdata->get_META('title'); $meta['caption'] = $pdata->get_META('caption'); $meta['keywords'] = $pdata->get_META('keywords'); $meta['timestamp'] = $pdata->get_date_time(); $meta['exif_desc'] = ($pdata->get_META('camera') . ", " . $pdata->get_META('focal_length') . ", " . $pdata->get_META('shutter_speed') . ", " . $pdata->get_META('aperture') . ", ISO " . $pdata->get_META('iso') . ", " . $pdata->get_META('created_timestamp')); return $meta; }
(Note, there should be a properly formatted “< br / >” inside the empty quotes in ‘$description = ($meta[‘exif_desc’] . “
” . $meta[‘keywords’]);’
above… I can’t get the br to stick when posting. )After updating functions.php as above, upload a new image, or just click on a thumb in the nextgen gallery admin panel and select “import metadata” from the drop down and click ok. You will see description field update with the exif and tags. You can still manually edit for certain images if you want to. This descrition should populate exif into lightbox, or floatbox in my case.
You will see a “/br” in the admin panel description text box, that is there to force a line break/carriage return between exif data and tags. You can easily take that and the tags out of the code of course.
I use floatbox, but it should work similar in lightbox as shown in my example: https://dave.jp/my-gallery/temples-and-shrines-2
Forum: Fixing WordPress
In reply to: Crazy long delay when I click write post/page WP 2.5Well, converting all my categories to tags did not help, but upgrading to version 2.51 finally did help. I’m only guessing that the db upgrade did not go well on the original upgrade to 2.5.
So this problem is resolved for me.
Forum: Fixing WordPress
In reply to: Crazy long delay when I click write post/page WP 2.5Still did not resolve this one. I have ruled out:
Not browser, or client side. Tried 3 browsers on two PC’s
Not mysql, zero activity there
not plugins, deactivated all
not the categories to tags thing, converted already
the action after clicking write/post is instant on the back-end, just not sending to the browser for two minutes later
there is no server or client side cpu utilization during the delay, just a small spike from httpd.exe of a few percent on server just when the write/post page finally does loadThis is something screwy, thinking I need to blow it all away and try a fresh config and import back to db. If that doesn’t fix it, I will roll back to earlier WP
Forum: Fixing WordPress
In reply to: Crazy long delay when I click write post/page WP 2.5No problem rpali. I just hope I can find someone else with the same problem. I can usually fix any problem on my own so this one is driving me nuts!! :=)
Forum: Fixing WordPress
In reply to: Crazy long delay when I click write post/page WP 2.5The other thread (https://www.ads-software.com/support/topic/164497?replies=13) is an entirely different problem from my own.
Once again, the only problem I have is that my Edit/Write pages take forever to load. There is no impact on the rest of the site or visitors to the website.
Forum: Fixing WordPress
In reply to: Crazy long delay when I click write post/page WP 2.5For me it didn’t happen until I upgraded to 2.5, so it’s something that was triggered by 2.5 since nothing else changed.
I also went through and manually diff’ed every file from my site against the full 2.5 WP install. Everything is as it should be. So somewhere there is an offending bit of code in the 2.5 files.
I did some tracing and resource monitoring too. The long delay may be as simple as bad HTML or CSS. I confirm there is no database activity after the initial click. It’s something in PHP or httpd is chocking, although everything shows zero resource utilization.
Forum: Fixing WordPress
In reply to: Crazy long delay when I click write post/page WP 2.5Hmm, tried a re-install, checked the database, scanned apache and php logs… still nothing… someone else must have run into this problem upgrading. Please let me know if you exist! ??
Forum: Fixing WordPress
In reply to: Crazy long delay when I click write post/page WP 2.5rpali, we have different problems. The site and everything in the admin UI performs very well, except for the write/edit post action itself. No other problems.
Forum: Fixing WordPress
In reply to: Crazy long delay when I click write post/page WP 2.5It is a server side issue. Same behavior in ff, safari, and IE.
ingejanse, I took a look at the thread you linked, but my sole remaining photography category only converts to create a new tag, but still remains a category. I can’t actually get rid of the category. I was able to delete the “default” category, but not my “photography” category which was set as the default for new posts before I upgraded to 2.5.
Also tried changing themes to classic and default… no impact. This is an odd one. I have no php or other other event errors. Strange because everything else in the UI is super fast…