Quotas with Supporter & Upgrades plugins.

I’m running into some trouble with both the Supporter and Upgrades plugins installed and active.

Primarily, the Supporter plugin suits our business model, but not being a large company, we’re a bit tight on disk space, so we’ve set a minimal amount of space for free users, and a 1GB cap for Supporters using the plugin. We would, however, like to be able to offer 10GB, 50GB, and 100GB packages to the select few Supporters who absolutely need that extra space.

The apparent solution was to use the Upgrades plugin in conjunction, but, while each plugin works beautifully on its own, if one of our Supporter members tries to further upgrade their account using Upgrades, their “upgrade” gets clobbered by their smaller Supporter quota.

Any idea on a fix?

Would it be possible to integrate this functionality into the Supporter plugin, and get rid of the annoying $ vs credits inconsistency at the same time?

Thanks for your help in advance.

Nice new site design.

  • fuzu42
    • Site Builder, Child of Zeus

    I tried, but I’m still lost.

    I see the hashes and checks (& have added larger custom values) in the Upgrades quota.php file, but not in supporter-quota.php or supporter-framework.php because I can’t see where that hash check is taking place.

    All of our Supporters are getting their quotas re-set to the Supporter limit (1024MB) even though they’ve paid for additional space using Upgrades.

    On a related note, members who have upgraded their storage with Upgrades are still getting the dashboard_supporter_quota_message() printed to their dashboards. How do I check if $quota_upgrade_active == '1' from that function? (sorry, still new to php)

    Thanks!

  • Andrew
    • Champion of Loops

    I see the hashes and checks (& have added larger custom values) in the Upgrades quota.php file, but not in supporter-quota.php or supporter-framework.php because I can’t see where that hash check is taking place.

    The two plugins function very differently.

    Basically what you’re going to have to do is modify the supporter Quota routine so that it doesn’t run if an Upgrades package is active.

    Thanks,

    Andrew

  • fuzu42
    • Site Builder, Child of Zeus

    as followthrough, I added the following in supporter-quota.php’s config section

    global $w_blog_upload_space;

    $w_blog_upload_space = get_option("blog_upload_space");

    and modified the quota filter like so

    function supporter_quota_filter($space) {

    if (strpos($_SERVER, 'wpmu-options.php')){

    return $space;}

    //"UPGRADES" COMPATIBILITY FIX

    global $w_blog_upload_space;

    $supporter_quota = get_site_option("supporter_quota");

    if ($w_blog_upload_space > $supporter_quota) {

    $supporter_quota = $w_blog_upload_space;

    }

    //END FIX

    if (is_supporter() && $supporter_quota) {

    return $supporter_quota;

    } else {

    return $space;

    }

    }

    being a new php programmer, I’m sure this isn’t the most elegant solution…but it works

  • dink
    • Flash Drive

    Here’s what I do…

    When people first sign up they have X amount of webspace, when they sign up to supporters this increases to Y but if they need more space then they purchase Z through the Upgrades plugin. They can also purchase Z without signing up as a supporter.

    I use Supporters to open up all plugins/features plus give them a bit more space to be working with. If they want more space they pay for it through Z.

    Example values X=10, Y=50, Z=100

    The code below works for for WP3. Change Lines 55-64 of supporter-quota.php to the following.

    $supporter_quota = get_site_option(“supporter_quota”:wink:;

    $blogs_quota = get_blog_option($id,’blog_upload_space’:wink:;

    if ($blogs_quota > $supporter_quota) {

    return $blogs_quota;

    }

    elseif (is_supporter() && $supporter_quota) {

    return $supporter_quota;

    } else {

    return $space;

    }

    If you’re using WPMU instead change the second line to

    $blogs_quota = get_blog_option($blog_id,’blog_upload_space’:wink:;

    The above code doesn’t add Upgrade Quota and Supporter Quota together but thats easily done by creating another if statement and placing it just above the if statement in the code above. The code below works as long as Upgrade Quotas are the same or more than what the Supporter Quota is.

    if (is_supporter() && $blogs_quote >= $supporter_quota) {

    $blogs_quota += $supporter_quota;

    }

    I’ll also show people how to allow the same Domain Mapping plugin to be used by supporters only + being able to purchase it separately through Upgrades without signing up as a supporter. I’ll post that later in a new thread if I can’t find a relevant one to put it in. All in all in adds greater flexibility in what you can offer to your members.

  • fuzu42
    • Site Builder, Child of Zeus

    to: dink

    That’s exactly what we were previously doing. We found it to be confusing for our users. Instead we’re giving supporters a reasonable quota, and have installed Kaltura CE in our datacenter. We find that people are happier to pay for 2 distinct services than to have many options for one.