WordPress.org

Ready to get started?Download WordPress

Forums

Sabre and Generalstats Cooperation - WP3 Multisite & new function (3 posts)

  1. Bernhard Riedl
    Member
    Posted 4 years ago #

    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

    http://wordpress.org/extend/plugins/sabre/

  2. dlo
    Member
    Posted 4 years ago #

    Hi Berny,

    Sorry for being so late in answering you but ultimately I had very little time to manage WordPress stuff.

    As for the 3.0 release, I just made sure that Sabre will continue to be operational in the same way as it was for 2.9 mono site. It means that Sabre is not supposed to work in a multisite environment as it's an untested case.

    I hope I have more time in the future to dedicate to Sabre's development and add this multisite support.

    I guess that the sql statement you show will work as I made no change in the table design.

    Finally, you still can use tools.php?page=sabre to link to Sabre's page.

    Happy WordPress programming and best regards,

    Didier

  3. DougJoseph
    Member
    Posted 4 years ago #

    Hi Didier

    I was using Sabre in 3.0 before I turned on 3.0's Multi Site (Network) feature. I know you are not supporting that. Just wanted to give you a heads up.

    I created a new site on the network. Then I added my main Admin account as a user on that new site. Not sure if I was supposed to do that (I am real green on this). Anyhow, that action somehow deleted the Admin account's status as a valid user. I can no longer log in with that account. Luckily I had a backup account with Admin status also, with which I can still log in.

    When I click into that main Admin user account, its confirmation status (at the bottom of the page, where the Sabre stuff is shown) shows empty.

    Here's where it gets interesting: I tried to manually confirm that account, to get it to be valid again, and Sabre gave me this reply:

    WordPress user doesn't need to confirm registration. Manual registration ineffective.

    So, somehow Sabre knows it is confirmed (on one hand), but at login time Sabre does not know it is confirmed (on the other hand).

    I guess I will try to edit the MySQL table(s) manually to get the account valid again. Any advice on that would be appreciated, but not expected, as I know you are not supporting this aspect.

    Thanks for a great plugin!

    -Doug Joseph

Topic Closed

This topic has been closed to new replies.

About this Topic