mbigler
Forum Replies Created
-
Forum: Plugins
In reply to: [File Manager] Can’t open PDF – error 404I’m not sure if you ever got a response to this, but I had the same problem when I installed this yesterday and discovered that it is due to the plugin being designed to function only when the root folder is set to your public_html folder in the plugin preferences. I was able to resolve this issue with a small modification to the main plugin .php file. If you can locate the section of the code with the comment label “Path View” there is an if statement that creates the URL, in the pro version this if statement begins on line 2487. My solution, which allows the root folder to be set to any folder below the public_html folder, was to change the if statement from this:
if(!empty($accessfolder)) {$siteUrl .= ‘/’.$accessfolder;}
to this:
if(!empty($accessfolder)) {$siteUrl .= substr($absolute_path, strpos($absolute_path, ‘public_html’)+11).$accessfolder;}
This assumes the root folder path you have set in the plugin preferences ends with a forward slash /
Forum: Plugins
In reply to: [WP Store Locator] Browser Key IssuesThanks, I thought I was waiting long enough but evidently not; it’s all good now.
Forum: Plugins
In reply to: [Inactive User Deleter] Multisite issuesI found a solution for this that seems to be working for me. In the main plugin file I changed the call to ‘wp_delete_user’ on lines 148 and 259 to ‘wpmu_delete_user’, the multi-site version of that function.
Forum: Plugins
In reply to: [Broadcast] Using ThreeWP Broadcast with Notification PluginThanks Edward, for some reason I didn’t get notified when you responded. I was able to make the modifications necessary to solve my problem, I ended up testing to make sure it broadcast correctly and then transitioning the post to “draft” status and then calling wp_publish_post() immediately before switching back to the original blog in the broadcasting.php file.
I did find an error on line 292, of the original code of that file, where the closing “)” was placed in the wrong spot.
Thank you for your quick response. The ThreeWP Broadcast plugin creates posts with the wp_insert_post() function. I have tried adding the filter, mentioned in the documentation you provided, to my functions.php file, but it did not fix the issue.
Forum: Plugins
In reply to: [BadgeOS] Achievement Steps not savingI modified the steps-ui.php file to echo the number of items in the $required_steps array before the loop that prints them out, and it returns 0 no matter what. Also, if I followed the code correctly, it looks like new achievement types are supposed to create a new post type; so I’m assuming when I create an achievement type of Badges that the post type for all achievements of that type should be badges, but new achievements are being saved with the ‘step’ post type…
Forum: Plugins
In reply to: [BadgeOS] Achievement Steps not savingI just updated to the latest version and I am still unable to save steps. They are being stored in the database, but when viewing a badge to modify the steps none are listed, and badges are not awarded for completing the “saved steps”. Any help would be appreciated.
Forum: Plugins
In reply to: [BadgeOS] Switch_to_blog call in Users.php causing issuesOk, so I went ahead and dug into it and switch_to_blog() is using a global array as you thought, but there are two issues resulting in the problem I was having. The first is that restore_current_blog() actually only references the previous blog in that array. The second is that a global variable called ‘switched’ is also being set to true when switch to blog is called. So, the following working solution may be the best way to do it:
function badgeos_get_network_achievement_types_for_user( $user_id ) { global $blog_id; // Store a copy of the original ID for later $cached_id = $blog_id; // Assume we have no achievement types $all_achievement_types = array(); // Loop through all active sites $sites = badgeos_get_network_site_ids(); foreach( $sites as $site_blog_id ) { // If we're polling a different blog, switch to it if ( $blog_id != $site_blog_id ) { switch_to_blog( $site_blog_id ); } // Merge earned achievements to our achievement type array $achievement_types = badgeos_get_user_earned_achievement_types( $user_id ); if ( is_array($achievement_types) ) { $all_achievement_types = array_merge($achievement_types,$all_achievement_types); } } if ( is_multisite() ) { // Restore the original blog so the sky doesn't fall switch_to_blog( $cached_id ); $GLOBALS['switched'] = FALSE; $GLOBALS['_wp_switched_stack'] = array(); } // Pare down achievement type list so we return no duplicates $achievement_types = array_unique( $all_achievement_types ); // Return all found achievements return $achievement_types; }Forum: Plugins
In reply to: [BadgeOS] Switch_to_blog call in Users.php causing issuesYeah I thought that was odd as well. BTW this works too:
function badgeos_get_network_achievement_types_for_user( $user_id ) { global $blog_id; // Store a copy of the original ID for later $cached_id = $blog_id; // Assume we have no achievement types $all_achievement_types = array(); // Loop through all active sites $sites = badgeos_get_network_site_ids(); foreach( $sites as $site_blog_id ) { // If we're polling a different blog, switch to it if ( $blog_id != $site_blog_id ) { switch_to_blog( $site_blog_id ); } // Merge earned achievements to our achievement type array $achievement_types = badgeos_get_user_earned_achievement_types( $user_id ); if ( is_array($achievement_types) ) { $all_achievement_types = array_merge($achievement_types,$all_achievement_types); } if ( is_multisite() ) { // Restore the original blog so the sky doesn't fall restore_current_blog(); } } // Pare down achievement type list so we return no duplicates $achievement_types = array_unique( $all_achievement_types ); // Return all found achievements return $achievement_types; }I just figured the first solution would be more efficient. It would seem that switch_to_blog() must be populating some global variable that is overwritten every time the function is called, and it would seem that restore_current_blog() must be referencing that same variable. Again, this is just an observation based on the way the functions appear to behave, as I haven’t dug into the source to see how they actually operate. Though, if that is true, and another plug-in is checking that global variable to see if the blog has been switched it would seem reasonable to think that would result in the problem I was having. The fix I have in place seems to be working without issue though.
Forum: Plugins
In reply to: [BadgeOS] Switch_to_blog call in Users.php causing issuesSure thing
function badgeos_get_network_achievement_types_for_user( $user_id ) { global $blog_id; // Store a copy of the original ID for later $cached_id = $blog_id; // Assume we have no achievement types $all_achievement_types = array(); // Loop through all active sites $sites = badgeos_get_network_site_ids(); foreach( $sites as $site_blog_id ) { // If we're polling a different blog, switch to it if ( $blog_id != $site_blog_id ) { switch_to_blog( $site_blog_id ); } // Merge earned achievements to our achievement type array $achievement_types = badgeos_get_user_earned_achievement_types( $user_id ); if ( is_array($achievement_types) ) { $all_achievement_types = array_merge($achievement_types,$all_achievement_types); } } if ( is_multisite() ) { // Restore the original blog so the sky doesn't fall switch_to_blog( $cached_id ); switch_to_blog( $cached_id ); restore_current_blog(); } // Pare down achievement type list so we return no duplicates $achievement_types = array_unique( $all_achievement_types ); // Return all found achievements return $achievement_types; }Forum: Plugins
In reply to: [BadgeOS] Switch_to_blog call in Users.php causing issuesSorry I should have pointed out that I hadn’t had a chance to yet.
I moved the is_multisite() test into the loop and replaced the switch_to_blog($cached_id) with restore_current_blog() and normal operations seemed to be restored.
I found that leaving the is_multisite() test where it is and changing it to the following also works:
if ( is_multisite() ) { // Restore the original blog so the sky doesn't fall switch_to_blog( $cached_id ); switch_to_blog( $cached_id ); restore_current_blog(); }I suppose if I was really ambitious I could dig in and see how restore_current_blog() actually works, but it seems as though the blog it references is always the blog you were on before the last call of switch_to_blog(). So, calling switch_to_blog(), with $cached_id set as the parameter, twice in a row, before calling restore_current_blog(), seems to do the trick.
There may be a more efficient way of accomplishing this, but I thought this might at least be more efficient than adding another function call to every iteration through the loop.
Forum: Plugins
In reply to: [BadgeOS] Switch_to_blog call in Users.php causing issuesThank you for the timely response. I would guess that the two issues are related, and I would bet that restoring the blog after each iteration would fix the problem.
Upon further investigation with the code changed to restore the current blog, as I mentioned before, and the community add on activated, the navigation is working but certain elements of the page are pulling information from what appears to be the second to last blog that was accessed in the foreach loop. For instance the link to visit the front end of the blog that is on the admin toolbar is stuck on that same site, the second to last one in the loop, regardless of which blog I visit. Also other plugins are no longer able to identify which blog I am on; so, plugins that require a license code, that aren’t enabled on the blog it is reporting that I am on, are behaving as if they have been installed on a new site.
Thanks again for looking into this.
Forum: Plugins
In reply to: [BuddyPress for LearnDash] Multisite InstallationIt still doesn’t seem to work. None of the settings are visible on the settings screen and nothing shows up on the profile pages. Tested this with a brand new installation of the latest version of wordpress, buddypress, and learndash
Forum: Plugins
In reply to: [BuddyPress for LearnDash] Multisite InstallationJust posting in this thread in the hopes of being notified of when these updates are expected. If you need people to test them I would be willing.