@szkorzonek – The following should help you to accomplish this:
add_filter('ngg_datamapper_table_name', 'something', 10, 2);
function something( $table_name, $name ) {
global $table_prefix;
if ( strpos( $table_name, ‘ngg' ) !== FALSE ) {
return $table_prefix . $name;
}
}
The callback function is noted as “something” use whatever is most appropriate for your installation.
The return value of $table_prefix . $name will return by default the main WordPress installation site, if you want to use a different sub-site then set the $table_prefix appropriately, for example, site 3 would use wp_3_ as the $table_prefix
Also to note, all images should be uploaded to the specific site being used for all the other sub-sites.
Thanks!
– Cais.
Dear Cais,
thank you very much for taking a look at this thread. I tried to follow steps you mentioned, but unfortunately each time I read your hint I understand less. It seems I am a newbie in this kind of problems. If you be so kind and simplify the solution, I would appreciate it a lot.
Thank you again,
Szymon.
@szkorzonek – Copy and paste the code snippet into every theme you are using on the Multisite instance and only use the main (read: first) sub-site to upload images to. You will need to maintain this with every update to every theme in use as well.
I would say the most simplified method, and least prone to possible issues, is to not use the code and upload the images as needed to each specific sub-site.
Thanks!
– Cais.
Dear Cais,
I noticed what I had been doing wrong – there is single quotation mark instead of apostrophe in 4th line of your code. Unfortunately even if I successfully upload the code (to functions.php) and plugin is set up correctly, it seems not to work. I have the gallery path wp-content/uploads/nggallery/ and all pictures upload there, but none of them shows up in the plugin overview/manage galleries option of different sub-site that used to upload, never mind the sub-site I use to upload.
There is also one more interesting thing I noticed. When I create a post and add gallery to it via button Attach NextGEN Gallery to Post there shows up only that gallery, which was uploaded to that sub-site, but when I copy-paste the code from post’s text builder to the other site on building mode (or when I insert a shortcode) a thumbnail of gallery of other sub-site appears! Unfortunately after publishing this post instead of gallery there is only Invalid Displayed Gallery (or no images were found) text.
Have you got any ideas of fixing this?
Thank you very much!
Szymon
@szkorzonek – You will need to use the standard Multisite installation setting for the gallery path option (wp-content/uploads/sites/%BLOG_ID%/nggallery/) under Network Plugins > Gallery for the above code to work.
– Cais.
Dear Cais,
I am sorry for lack of respond.
I followed every step you mentioned (edit functions.php, edit gallery path option to default wp-content/uploads/sites/%BLOG_ID%/nggallery/ in multisite settings) and unfortunately it does not work. Neither galleries show in second sub-site dashboard nor using shortcode made them appear after publishing the post.
I have noticed, that on my first sub-site I have got option to change path where my galleries are stored (like on multisite settings), but on the second one this setting is missing.
I really enjoyed using this plugin while not having multisite active, so please, have you got any more hints?
Regards,
Szymon
@szkorzonek – This has worked in other instances and was one of the reasons this particular filter was added to the code. Although strictly speaking this is a “customization” to NextGEN Gallery you are welcome to send us a Bug Report (https://imagely.com/report-bug/ … please reference this topic) so we can get a better look under the page at your site.
Please include as many details as you can about your site and the issue at hand so we can review this further.
Thanks!
– Cais.
I’m having the same issue and was wondering if you ever resolved this issue?
@jlillibridge , I worked around this problem and I uploaded pics to a gallery on Google+. There is quite nice plugin to show whole gallery on a page as a list of thumbnails, so it works for me, especially for huge or often updated galerries. For smaller and constant one I upload photos to each sub-site and use NextGEN Gallery plugin to show them.
I did not send plugin authors any bug report, so if you need more help feel free to use guidelines in the last Cais’ post.
Regards,
Szymon
@jlillibridge – It is generally best to start a new topic if you have not found any resolutions within a topic’s suggestions.
That being the case, please start your own topic so we can try to help you with your specific issue on your specific site.
See http://codex.wordpress.org/Forum_Welcome#Where_To_Post
Thanks!
– Cais.