Paid Subscriptions

Started by Grudge, August 12, 2006, 06:09:49 AM

Previous topic - Next topic

antoniosaucedo

Quote from: madfiddler on August 31, 2011, 04:19:16 PM

I don't think I've ever had a mail for the forum relating to subscriptions, even though it's set. I still have to do the accept by hand :(

And what are you doing when the subscription finished? Do you have to get inside every day for search finished subscriptions and set manually for each user?  Because I see that the forum automatically set the new member group for the subscripts but not downgrade when the time finished.

Is there any way to do it automatically ?  thanks

madfiddler

WHen the subscription finishes, then unfortunately it finishes unless they have it set to recurring in which I still get an email from paypal which makes me go to the forum to sort it out. Same with any subscription. The paypal email tells me I need to sort it on the forum.

ctcp

This mode working in SMF 2.02? if yes how to setup it ?

http://custom.simplemachines.org/mods/index.php?mod=413

im looking the setup guide but to many lines missing for example
./Sources/Subs.php
this lines not existe in my php code


Find: [Select]
$context['admin_areas']['members']['areas']['ban_members'] = '<a href="' . $scripturl . '?action=ban">' . $txt['ban_title'] . '</a>';
Add Before: [Select]
if (allowedTo('admin_forum'))
$context['admin_areas']['members']['areas']['paid_subscriptions'] = '<a href="' . $scripturl . '?action=paidsubscribe">' . $txt['paid_subscriptions'] . '</a>';


madfiddler

You don't need that mod anymore as it's built in to SMF. You need to turn it on in the settings though. Having said that, the mod still doesn't work automatically for me :(

Biology Forums

Quote from: madfiddler on January 02, 2012, 01:44:44 PM
You don't need that mod anymore as it's built in to SMF. You need to turn it on in the settings though. Having said that, the mod still doesn't work automatically for me :(

It's because the mod is configured to work with the default theme only. If you have another theme, it will not work.

madfiddler

ahh gotchya, apologies for any confusion caused ctcp.

Biology Forums

I've been recently getting:

"Could not connect to paypal server"

As an error whenever someone creates a subscription, would could be the issue? I haven't changed anything.

stylusss

Quote from: Blue Crab on March 09, 2010, 08:55:33 AM
Quote from: Paracelsus on January 25, 2010, 06:10:27 AM
Does anyone know how to implement the PM functionality on this MOD? It shouldn't be too hard since smf 2.0 subscription feature is an improved version of this MOD.

Ok, I hacked this together last night.

This mod will warn people two weeks before one of their subscriptions expires. Just replace the "autoCheckSubscriptions()" function (in Sources/ManagePaid.php) with this one. You will also want to edit the $txt[paid_reminder_body] text in Themes/default/languages/ManagePaid.english.php to set the notification the way you want it to be.

I tested this on my forum and it works like a charm.


// Function called to clean up expired subscriptions.
function autoCheckSubscriptions()
{
    global $db_prefix, $sourcedir, $txt;

    // Set notification time to be two weeks before subscription expires.
    // Expressed in seconds, so 14 days * 24 hours * 60 mins * 60 secs.
    $expire_time = time() + (14 * 24 * 60 * 60);

    // Select all subscriptions that are due to expire.
    $request = db_query("
        SELECT ID_SUBLOG, ID_SUBSCRIBE, ID_MEMBER
        FROM {$db_prefix}log_subscribed
        WHERE status = 2
        AND reminder_sent = 0
        AND endTime < $expire_time", __FILE__, __LINE__);

    // Step through each row and send a notification to each user.
    while ($row = mysql_fetch_assoc($request))
    {
        // Update "reminder_sent" flag that so we only remind them once.
        db_query("
            UPDATE {$db_prefix}log_subscribed
            SET reminder_sent = 1
            WHERE ID_SUBLOG = " . $row['ID_SUBLOG']);

        // Grab the user's name and e-mail address.
        $request2 = db_query("
            SELECT ID_MEMBER, realName, memberName, emailAddress
            FROM {$db_prefix}members
            WHERE ID_MEMBER = " . $row['ID_MEMBER'] . "
            LIMIT 1", __FILE__, __LINE__);
       
        $row2 = mysql_fetch_assoc($request2);
        mysql_free_result($request2);
       
        require_once($sourcedir . '/Subs-Post.php');

        // Send the subscription expiration warning via e-mail.
        sendmail($row2['emailAddress'], $txt['paid_reminder_subject'],
            sprintf($txt['sendtopic_dear'], $row2['realName']) . "\n\n" .
            "$txt[paid_reminder_body]\n\n" .
            $txt[130]);
    }
    mysql_free_result($request);
   
    // Find all the ones to remove.
    $request = db_query("
        SELECT ID_SUBSCRIBE, ID_MEMBER
        FROM {$db_prefix}log_subscribed
        WHERE status = 2
        AND endTime < " . time(), __FILE__, __LINE__);

    while ($row = mysql_fetch_assoc($request))
        removeSubscription($row['ID_SUBSCRIBE'], $row['ID_MEMBER']);
    mysql_free_result($request);

    // Store the next expire time.
    updateNextCheck();
}


This is incredible. Could this be used for 1.x version? What about the confirmation email receipt, once the person orders?
For top-notch server quality and expertise, visit CoreISP.net

vbgamer45

The code above looks ok to use for SMF 1.1.x
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

stylusss

Quote from: vbgamer45 on February 04, 2013, 06:33:40 PM
The code above looks ok to use for SMF 1.1.x

Thanks!

I have narrowed down the code to fix the email confirmation to the subscriber. Strangely, the confirmation message is being sent to the admin and not the subscriber :s

in ... /ipn.php

// Email the user?
        if (strlen($emaildata > 10) && strpos($emaildata, "\n") !== false)
        {
                $subject = substr($emaildata, 0, strpos($emaildata, "\n") - 1);
                $body = substr($emaildata, strpos($emaildata, "\n") + 1);

                $search = array('{NAME}', '{FORUM}');
                $replace = array($name, $mbname);

                $subject = str_replace($search, $replace, $subject);
                $body = str_replace($search, $replace, $body);

                require_once($sourcedir . '/Subs-Post.php');
                sendmail($email, $subject, $body);
        }


Not sure what's a matter with it
For top-notch server quality and expertise, visit CoreISP.net

Lord Anubis

Found something interesting in PhpMyAdmin...

Under smf_settings there is a value called paidNextExpire with a value of 1293840000

This corresponds to an epoch time of GMT: Sat, 01 Jan 2011 00:00:00 GMT

So I ended up changing this setting to 1420070400

Which is GMT: Thu, 01 Jan 2015 00:00:00 GMT

Gonna see if that fixes the auto-approve function :)

Biology Forums

What "auto-approve function" are you referring to?

Lord Anubis

so that members are automatically changed into a particular member group upon the paypal receipt instead of having to do it manually (which used to work lol)

Biology Forums

Quote from: Lord Anubis on March 14, 2013, 09:14:10 PM
so that members are automatically changed into a particular member group upon the paypal receipt instead of having to do it manually (which used to work lol)

I've never had to do mine manually :s Are you sure you install went as planned? However, I member I had to before switching back default. In other words, the theme I was using wasn't working properly with the modification for some reason.

Lord Anubis

it has been a bit since it auto approved, looking at your site I believe your running SMF2

EDIT: My SMF2 test sites, the Paid Subs built in function works flawless

Biology Forums

Quote from: Lord Anubis on March 14, 2013, 09:21:56 PM
it has been a bit since it auto approved, looking at your site I believe your running SMF2

EDIT: My SMF2 test sites, the Paid Subs built in function works flawless

I'm using 1.x actually lol Try to revert to the default theme, believe me, it will work :D

Lord Anubis

wow nice look/speed on your site (very impressed)... I dunno what happened but it hasn't worked since 2010, I got my fingers crossed with finding this

Will update if this "fix" works for me lol

I just had a few ppl waiting for subs this month, and well I was a bit embarrassed because it didn't start for them :(

So I wanted to figure out why lol

Arantor

Also note there was a change to PayPal's API with respect to the notifications setup. SMF 2.0.x got the fix (it's the 2.0.3 patch, amongst other things) but I don't believe the mod got updated.
Holder of controversial views, all of which my own.

Biology Forums

Quote from: Arantor on March 14, 2013, 11:27:44 PM
Also note there was a change to PayPal's API with respect to the notifications setup. SMF 2.0.x got the fix (it's the 2.0.3 patch, amongst other things) but I don't believe the mod got updated.

True, I manually changed mine before the month of February.

Quote from: Lord Anubis on March 14, 2013, 10:41:14 PM
wow nice look/speed on your site (very impressed)... I dunno what happened but it hasn't worked since 2010, I got my fingers crossed with finding this

Will update if this "fix" works for me lol

I just had a few ppl waiting for subs this month, and well I was a bit embarrassed because it didn't start for them :(

So I wanted to figure out why lol

Prior to switching back to default, it never worked for me. I think it's the way the mod is written. You could try to change the directory name of your theme to default ;)

Lord Anubis

Quote from: Arantor on March 14, 2013, 11:27:44 PM
Also note there was a change to PayPal's API with respect to the notifications setup. SMF 2.0.x got the fix (it's the 2.0.3 patch, amongst other things) but I don't believe the mod got updated.

I wish, but I know the SMF rule is not to update unless the author consents (which makes sense)... kinda like the SMF Chess which was another golden mod imho

Advertisement: