Benjamin
Forum Replies Created
-
What exactly does the code you have right now look like?
The snippet you last pasted will only set the description to the date if the description is empty; to make it always apply you’ll need to remove the if() and its braces ({}) like so:
add_action('ngg_added_new_image', function($image) { $mapper = C_Image_Mapper::get_instance(); $date = new \DateTime($image->imagedate); $image->description = $date->format('F j, Y'); $mapper->save($image); });Sorry again for not noticing your followup questions! I’ve replied to the original thread.
Hi @robertboyl, I didn’t notice the notification email on this thread, my apologies!
To use a nicer format change the
F j, Ytod/m/y— howDateTime->format()works is documented here on php.net — just scroll down to the the format table.What does the code you are using look like now? Images’ description is stored in the
descriptionattribute, and the title is inalttext— the following will force the title and description for all new images:add_action('ngg_added_new_image', function($image) { $mapper = C_Image_Mapper::get_instance(); $image->description = 'DESCRIPTION'; $image->alttext = 'TITLE'; $mapper->save($image); });Hi @laimermic! Your English is just fine!
I did fix a similar issue recently, but your problem appears to be separate.
I’ve committed a fix for this problem and it will probably be released with NextGEN 3.14 on the 11th.
If you’re comfortable with (S)FTP and editing PHP code you can update your
nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.phpfile and add this snippet immediately after line 106 (global $wp_query):if (!isset($wp_query->posts) || !is_array($wp_query->posts)) return;Hi @sellrion !
NextGEN 2.0 has been built on a framework that’s a little difficult to work with, the relevant parts of
$displayed_gallerycan be found in it’s_stdObjectattribute. I’ll be working soon on making it much simpler to work with and easy to inspect, but to answer your questions:1: NextGEN can display more than one gallery at a time with mixed sorting so in the code side we have “displayed galleries”; you can get that list by accessing
$displayed_gallery->container_idswhich is an array.2, 3, 4, 5: Because of #1 NextGEN’s templates don’t have gallery information beyond their ID. You can retrieve them using NextGEN’s internal API:
$mapper = C_Gallery_Mapper::get_instance(); $gallery = $mapper->find($gallery_id); $title = $gallery->title; $desc = $gallery->galdesc; $slug = $gallery->slug;Unfortunately we don’t store gallery creation or modification times, there’s no reliable way to get that information. You could maybe check the creation timestamp of the gallery folder on the filesystem but that has complications. I’m sorry I can’t help much there.
- This reply was modified 4 years, 12 months ago by Benjamin.
Hi @j_schumann
Defining the following should fix your problem. We intend to remove this entirely soon so it won’t be necessary.
define('NGG_DISABLE_RESOURCE_MANAGER', TRUE);Forum: Plugins
In reply to: [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery] Update failHi @koolwebs That sounds like the updater may have had an error when downloading the new zip file; deleting nextgen and re-installing it should correct the problem.
Hi @shackadeli
Can you please try adding the following to your wp-config.php?
define('NGG_DISABLE_RESOURCE_MANAGER', TRUE);Let me know how it goes, if that doesn’t fix it I’ll have to do some debugging.
Thanks!
Hi @roelani
Are there any similarities amongst the galleries that can or can’t be sorted; such as the number of the images they contain?
Our next release will include the legacy templates recreated as our new “view” templates. All you’ll need to do is change your display setting and verify everything still looks good on your site.
I’m not sure what to say. I’m not able to reproduce that problem on your site with Chrome, Firefox, and Edge on Windows 10 and Linux. Safari on my Mac mini is also behaving correctly. Does this happen with our other lightbox options?
Hello @azizpbrimah
Which notifications are not going away?
Hi @ilpanzio
I’ve noticed that there’s been some problems lately with a third party library we updated that is causing problems for people using Safari 13 and older. Upgrading to Safari 13.1 (from March 2020) or Safari 14 should fix the problem.
Could you do the following please: while editing a page either press F12 or right click somewhere and select “Inspect element” to bring up the developer tools. Reload the page, and then select the “Network” tab. Go about editing the page in a way that will cause it to break, and then go ahead and click “Save” — then back in the Network tab select the very last entry that was just created and go to its “Response” tab and copy / paste the results here?
I know it’s a bit lengthy, sorry, but I’m not able to reproduce the problem locally so I don’t know what is the causing the problem for you in this instance.
Hi @mrmic
I haven’t tested “Page Builder by SiteOrigin” yet but adding either of these two lines to your
wp-config.phpmay solve the issue.define('NGG_DISABLE_RESOURCE_MANAGER', TRUE); define('NGG_DISABLE_FILTER_THE_CONTENT', TRUE);If that doesn’t fix your issue let me know and I will try to ensure some time is spent on it during our next release cycle.