kimaldis
Forum Replies Created
-
It’s looking like a browser or server cache thing going on. Using a query string on the url, changing it for each page refresh will reflect any changes in the template file.
Sorry for the noise.
That’s useful. Thank you very much.
I don’t suppose you have any pointers towards getting going with custom lightboxes?
– K.
Any time.
I didn’t spot a columns count parameter so I added my own.
If I can be frank, I’m finding documentation at this level either sparse, sketchy or scattered. Things like the $gallery & $image objects seem to be largely undocumented and I can find nothing that resembles an API for NextGen. I’ve had to dig quite deep. I’m now looking into custom lightboxes and that’s proving interesting too. Maybe you have some links that I may have missed?
Mulling this over the weekend I couldn’t see any immediately obvious way to do this so I hacked a workaround. This code snippet searches for nggallery shortcodes in the post, checks the shortcode id against the gallery id handed to the template and pulls attributes from it if it matches. It will fall apart a bit if there are two galleries with the same id being shown in the page but I really can’t see that happening in a sensible world.
global $post; $pattern = get_shortcode_regex(); $thisGalleryID = $images[0]->galleryid; // obscure place to get it but I can't find it in the rather badly documented $gallery object. // grep all nggallery shortcodes in the post. if ( preg_match_all( '/'. $pattern .'/s', $post->post_content, $matches ) && array_key_exists( 2, $matches ) && in_array( 'nggallery', $matches[2] ) ) { $attributeStrings = $matches[3]; // an array of attribute strings, one for each shortcode found in the post. $found = false; foreach ($attributeStrings as $i => $attributes) { $attrs = shortcode_parse_atts( $attributes ); $id = $attrs['id'] or false; $columns = $attrs['columns'] or 5; $info = $attrs['info'] or false; // show the title banner to bottom of image $infohover = $attrs['infohover'] or false; // show/hide info bar on hover $downloadable = $attrs['downloadable'] or false; if ( $id == $thisGalleryID ) { // gid in the shortcode matches gid sent to this template? $found = true; break; } } if ( !$found ) { echo "couldn't find a shortcode match for this gallery ($thisGalleryID)<br>"; } }
Sorry, I maybe didn’t explain myself that well. I’ve built a KA-template.php template, placed it in the correct place in themes. I insert it into a post using:
[nggallery id=1 template=KA]
I would like to be able to have some control over, say, the number of columns displayed in the post by using an attribute in the shortcode:
[nggallery id=1 template=KA columns=5]
but there doesn’t seem to be a way to get at attributes in the shortcode from php code in the template file. Does that make more sense?
After a lot of messing about here’s what I know:
Nextgen doesn’t play nice with roles created by other plugins. If you assign a non-wordpress role to all of Nextgen’s capabilities you will lose Nextgen from the admin menu bar along with any ability to modify options. This holds true for any user with any role including Administrator. The only way to get it back is to restore from a previous database. If you haven’t done that prior to this relatively simple operation you’re absolutely stuffed, if you want Nextgen back … well kind of tough.
I’ve spent enough time on this so if you don’t mind you’ll have to take this as your bug report.
Thus far, and for reasons other than just this, I’m not that impressed with Nextgen.
I’m pretty sure this is something gone wrong with Nextgen itself. I’ve just restored the site from a backup made yesterday, Nextgen is still invisible in the admin menu. That strikes me as odd.
De-activating the plugin that created the anonymous role hasn’t fixed the problem.
I’ve also installed Role Manager,used that to give the anonymous role every capability that exists. That didn’t work either.
yeah, I looked in the database, found an options entry for nextgen but it’s encoded in some way.
I’ll wait until I have something worked out before getting into reports, I’m reluctant to have anyone messing around in a customer’s site. Although if I get really desperate I may change my mind.
kyp.
I’ve a feeling it might be from the Woocommerce plugin. It’s a live site, I’m going to have to be careful about disabling it.
I’ve tried forcing current_user_can() to return true. That gives me the nextgen gallery back in the WP admin page but I’m still being blocked from the other options menu – “Not Authorized” – which is the one I want. You wouldn’t have any tips on what I might be able to temporarily hack to get it back, would you? I’ve taken the site off line while I’m messing with ti.
That’ll teach me to mess around with a live site, won’t it.
Same problem here, double checked album & gallery ids, tried the source= thing, I can’t display galleries anywhere.
With all due respect, gallery display shortcode failure is both major and fundamental. The thread is marked ‘resolved’ when it’s patently not and there doesn’t seem to have been any developer response here for several months.
Forum: Plugins
In reply to: [UpdraftPlus: WP Backup & Migration Plugin] dropbox errorI dropped a call to curl_error() into the fetch method in curl.php. it comes back with “couldn’t connect to host” which is the same error backupwp came up with. The url is https://api.dropbox.com/1/ which, if I paste into a browser gives me “{“error”: “Not Found”}” in the browser window. I’m only vaguely familiar with POSTS and GETS of this kind, I’m not sure of the relevance of that.
I may run this by dropbox and dreamhost, I don’t think the problem’s at your end.
Options array, if it’s any help:-
Array
(
[64] => 1
[41] => 1
[42] => 1
[2] => 0
[19913] => 1
[52] => 0
[10065] => /home/kimald5/public_html/dogdays/wp-content/plugins/updraftplus/includes/Dropbox/OAuth/Consumer/ca-bundle.pem
[47] => 1
[10015] => Array
(
[oauth_consumer_key] => m64nob6f8yhc84m
[oauth_signature_method] => PLAINTEXT
[oauth_version] => 1.0
[oauth_signature] => gt7fi0nze4p4g9q&
))
Forum: Plugins
In reply to: [UpdraftPlus: WP Backup & Migration Plugin] dropbox errorSorry, exactly the same error.
For the hell of it I updated and reactivated an older installation of backwpup which gives me a “can’t connect to host” error. Doesn’t tell me which host but I can only assume Dropbox. It’s beginning to look like a problem at my end.
I’ve been having the same problem for a while now. It started a couple of weeks back with errors in the log. Now I’ve upgraded to the newer version it’s happening when I try and re-authenticate dropbox.
Dropbox API: (7) couldn't connect to host
It would help to have slightly more information in the error. Even a line number would help locate the problem. ??
Forum: Plugins
In reply to: [UpdraftPlus: WP Backup & Migration Plugin] dropbox errorI’ve just started getting a similar problem, same error but only on line 291 (see below). In this instance Curl is enabled. The error started when an inadvertent stop was put on Dropbox payments. The account has been reactivated but the error persists. It’s affecting authentication too. Any thoughts?
error: Cannot access empty property in /home/kimald5/public_html/dogdays/wp-content/plugins/updraftplus/includes/Dropbox/OAuth/Consumer/ConsumerAbstract.php on line 292