Sabre and Generalstats Cooperation – WP3 Multisite & new function
-
Hi Didier,
I hope you’re doing fine. – Congratulations to the 30,000 downloads!
Here’s the yearly update: ??
In the last two months I found some time to refactor all my plugins (OO, JS-menu-tabs, new options-functionality, …), though I’m not finshed yet. While reworking I also set my focus on the new WP3 multi-site features.
For GeneralStats I currently plan to use the following SQL-statement (which is based on the function
get_users_of_blog
in wp-includes/users.phpof WP 3.0-beta1) to count the users if Sabre is installed:SELECT COUNT (u.ID) FROM $wpdb->users as u, ".SABRE_TABLE." as s, $wpdb->usermeta as m WHERE u.ID = m.user_id AND m.meta_key = '".$wpdb->prefix."capabilities' AND u.ID=s.user_id AND s.status in ('ok') UNION SELECT COUNT(u.ID) FROM $wpdb->users as u LEFT JOIN ".SABRE_TABLE." as s ON u.ID=s.user_id WHERE s.user_id IS NULL";
Will this statement work with Sabre on Multisites? In other words, will there be only one Sabre Table for a multi-site WP installation?
Moreover I will offer a new function in GeneralStats 2.0 which can be used to echo/return a certain (cached) stat count. If you like to you could use the following code-block or something similar to output the user’s count somewhere in Sabre:
global $generalstats; if (!empty($generalstats) && is_object($generalstats) && method_exists($generalstats, 'get_count')) { $params=array( 'stat' => 0, 'display' => true ); $generalstats->count($params); }
Last but not least, with the new version I will inform the blog-admins within GeneralStats’s Admin Menu, that their users’ counts are based on Sabre. Currently I link to tools.php?page=sabre. Is that okay for you? As far as I know there is no WP method which returns a link to a tools-subpage?
Hope you don’t have to much work with Sabre and WordPress 3. – Have a good one!
Greetz,
Berny
- The topic ‘Sabre and Generalstats Cooperation – WP3 Multisite & new function’ is closed to new replies.