Paid Subscriptions

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

Previous topic - Next topic

Paracelsus

Quote from: qtime on January 25, 2010, 04:15:58 AM
Quote from: Shaliza on January 25, 2010, 04:12:49 AM
You don't need this if you're using 2.0 right?
it's a standard feature in smf 2.0 and have more options, like sending a PM before X days end of subscription

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.

Arantor

The PM functionality also relies on the scheduled tasks feature of 2.0...

vipmoney

Is it simple to upgrade from 1.1.11 to 2.0 having already this mod installed?

I mean, having hundreds of subscribers already inside this mod, it would be a problem to migrate and mantain all these subscriptions working with no trouble?

thanks for any feedback ;)
VipMoney

Arantor

I believe the subscriptions should just drop into the 2.0 system since AFAIK the same person who wrote the mod was the one who added the feature to 2.0...

joehark

#884
Trying to install on 1.1.x

instruction says go to PP > Profile > IPN > Merchant Tools
Here's what is on that page. Note that the words IPN and Merchant Tools do not appear anywhere.  So, what is wrong here? Am i on the wong page or are these directions out of date?

Account Information

    * Email
    * Street Address
    * Phones and Mobile Payments
    * Password
    * Notifications
    * Language Preference
    * Time Zone
    * Manage User
    * API Access
    * PayPal Security Key
    * Getting Started Steps
    * Business Information
    * Close Account
    * Identification Preference

Financial Information

    * Credit/Debit Cards
    * Bank Accounts
    * Currency Balances
    * Money Market Fund
    * PayPal Debit Card
    * PayPal Plug-In
    * Balance Manager
    * Gifts and Discounts
    * Recurring Payments
    * Monthly Account Statements
    * Pay List
    * Preapproved Payments

Selling Preferences

    * Auctions
    * Sales Tax
    * Set Up Shipping Calculations
    * Shipping Preferences
    * My Saved Buttons
    * Payment Receiving Preferences
    * Instant Payment Notification Preferences
    * PayPal Shops
    * Reputation
    * Customer Service Message
    * Website Payment Preferences
    * Encrypted Payment Settings
    * Custom Payment Pages
    * Invoice Templates
    * Language Encoding




WhiteEagle

Quote from: qtime on January 25, 2010, 04:15:58 AM
Quote from: Shaliza on January 25, 2010, 04:12:49 AM
You don't need this if you're using 2.0 right?
it's a standard feature in smf 2.0 and have more options, like sending a PM before X days end of subscription

Too bad some of the other mods I use don't support 2.0 RC2 yet, or I'd have my sites running it!
I fold for team 52482. Do you Fold@Home?
SMF powered sites: Leet Link LeetSpace.com

Arantor

index.template.php by the looks of things.

Viresh12

Even i suggest the same think the package you tried to upload either is not a valid package or has become corrupted,,,

Paracelsus

Quote from: SperaToivo on March 09, 2010, 12:52:17 AM
Quote from: Arantor on March 07, 2010, 05:29:32 PM
index.template.php by the looks of things.

O.k., here's what I've got in index.template.php. 

// If the user is a guest, also show [register] button.
   if ($context['user']['is_guest'])
   echo '<li', $current_action == 'register' ? ' id="active"' : '', '><a href="', $scripturl, '?action=register">' , $txt[97] , '</a></li>';

        // If the user is a guest, also show [subscribe] button.
   if ($context['user']['is_guest'])
   echo '<li', $current_action == 'subscribe' ? ' id="active"' : '', '><a href="', $scripturl, '?action=profile, u=', $ID_MEMBER, 'sa=subscriptions">' , $txt[subscribe] , '</a></li>';


I'm using the Sonbahar theme, and I tried to use the code for the register button as well as the code I quoted in reply 887 to try to figure out what to put in there.  I substituted "subscribe" for every instance of "donation".  I added $modSettings; to function template_menu()
{
   global $context, $settings, $options, $scripturl, $txt,


because it wasn't in there to begin with, and then I just pasted global $ID_MEMBER; after it.

I've now got the subscribe button on my page:

http://www.creekflows.com/forum/index.php

but it doesn't go anywhere.  The few times I was able to get it to point somewhere (and I'm not really sure how I did that) it just gave me an error stating the user profile I was trying to view didn't exist.  Eventually I want to remove the register button and only allow guests to subscribe, but I really don't know what I'm doing.  Could someone help me out?

Thank you.

You seem to have screwed things up. This link construction is wrong:

   echo '<li', $current_action == 'subscribe' ? ' id="active"' : '', '><a href="', $scripturl, '?action=profile, u=', $ID_MEMBER, 'sa=subscriptions">' , $txt[subscribe] , '</a></li>';

Try to go as a guest and click in the Subscribe button on your forum and then look at the url bar to see what link you get. ???


I don't get why do you put this either:
        // If the user is a guest, also show [subscribe] button.
   if ($context['user']['is_guest'])


And then you have an $ID_MEMBER string after... guest are not members, so the profile (u=', $ID_MEMBER, ') will always be zero. So I think you messed up this part. If people subscribe they have to be members, there's no way several guests can subscribe something.


szinski

#889
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();
}

Arantor

Quote from: SperaToivo on March 09, 2010, 01:46:04 PM
Does the subscription feature in 2.0 also require that guests register before they can purchase a subscription?

Yes. But you don't have to actually open any boards to them, you could hide all boards, have them only accessible to a 'donator' group or similar, and have the paid subscription move them to that group on payment.

Paracelsus

Quote from: szinski 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_member_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();
}


I'll try it out. I think I will add something more beside $txt[paid_reminder_body], since in the language file there is also $txt[paid_reminder_name], $txt[paid_reminder_date] and one more. I'll let you know later if it works. ;)

sattninja

hi i have this installed on RC2 and think i have set everything up right however when  i get to the point of logging into paypal to pay for the subscription i get this

The link you have used to enter the PayPal system is invalid. Please review the link and try again.

i have used the link provided in the mod settings like i said everything works till then
Running Rc4

kizer

This isn't needed since Subscription is part of the 2.0 release. Check under core and its listed there.
Own a Jeep? Links4Jeeps.com

sattninja

wow you are correct as a matter of fact that is what i am using wow what a blonde moment ok but my ??? still stands cause it is the core one that is doing it however i got it to work with a different paypal acct i think it has something to do with the paypal acct not being verified it doesn't seem to work on accts that are not verified can anyone confirm this?
Running Rc4

Arantor

That's not an SMF issue but a PayPal one. Get the account verified and it should work.

dumpster1979

shary2007:[/b] paste this into your "Modifications.english.php" (or whatever language you use)

// Paid Subscriptions Mod
$txt['paid_subscriptions'] = 'Paid Subscriptions';
$txt['subscriptions'] = 'Subscriptions';
$txt['subscription'] = 'Subscription';
$txt['paid_subs_desc'] = 'Below is a list of all the subscriptions which are available on this forum.';
$txt['paid_subs_none'] = 'There are currently no paid subscriptions available!';

$txt['paid_current'] = 'Existing Subscriptions';

// Some errors for subscription mod.
$txt['paypal_could_not_connect'] = 'Could not connect to paypal server';
$txt['paypal_unverified_subject'] = 'Unverified Paypal Transaction';
$txt['paypal_unverified_body'] = 'A user attempted to add a paid subscription to your forum, but the transaction was unverified.';
$txt['paid_sub_not_active'] = 'That subscription is not taking any new users!';
$txt['paid_disabled'] = 'Paid subscriptions are currently disabled!';
$txt['worldpay_password_wrong'] = 'Payment ignored as WorldPay password is incorrect - please ensure you have the correct callback password set.';
$txt['2co_password_wrong'] = 'Payment ignored as 2co.com secret word is incorrect - please ensure you have the correct secret word and 2co.com ID set.';
$txt['paid_unknown_transaction_type'] = 'Unknown transaction type in ipn.php';
$txt['paid_missing_transaction_type'] = 'Cannot find transaction file %s.php';
$txt['paid_empty_member'] = 'Paid subscription handler could not recover member ID';
$txt['paid_could_not_find_member'] = 'Paid subscription handler could not find member with ID: %d';
$txt['paid_count_not_find_subscription'] = 'Paid subscription handler could not find subscription for member ID: %1$s, subscription ID: %2$s';
$txt['nochex_could_not_connect'] = 'Could not connect to nochex server';
$txt['nochex_unauthorised_subject'] = 'Unauthorised nochex Transaction';
$txt['nochex_unauthorised_body'] = 'A user attempted to add a paid subscription to your forum, but the transaction was rejected.';

[/quote]


the same thang is happening to me just like shary2007 and i dont no ware Modifications.english.php to past this code

gibsongk55

Hi,

Is there any plan to update this mod to work on SMF 1.1.11 ?

Or will this mod install with this version?  I never used this mod before and just found it.  This is what I've been looking for.  I'd appreciate a response.

Thanks,

Gibs

Arantor

Most 1.1.x mods install on any 1.1.x version, give it a try.

gibsongk55

#899
Hi,

I am trying to install the package.  I am using SMF 1.1.11 and I get this install error.

Fatal error: require() [function.require]: Failed opening required   /Packages/temp/subscription/paidsubsdb.php   (include_path='.:/usr/lib64/php') in /Sources/Packages.php  on line 556

Thanks for any help.

Gibs

Advertisement: