It is currently Sun Jul 05, 2009 7:21 pm (All times are UTC )

 




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
Posted: Mon Feb 13, 2006 5:35 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Tue Aug 23, 2005 9:45 am
Posts: 629
Location: La Grande, Oregon
FAQ:  Paid Memberships or Subscriptions in Joomla!

So when Joomla! first started as the no-named CMS, I started a thread asking anyone if there was any good open-source or inexpensive solutions for paid memberships within Joomla!  I did not know at the time that my thread would become one of the most read threads in the forums and have as much feedback as it did. 

This thread has spawned many good hacks for other components to try to fit the bill, and other developers have also started their own ‘add-ons’ to try to fill the void of a paid memberships solution for our favorite CMS.  Unfortunately, there is still much to do before we have a good open-source solution.  This only leaves us to turn to commercial components to help us get paid memberships on our own Web sites.  If you would like to take your chance with hacking and setting up some of the open-source components that our Joomla! community has offered, then that information will be listed here too. 

Contents:

Section 1: Open Source Components/Add-ons and Hacks
a: Components & Add-ons
b: Hacks
Section 2: Commercial Components

So let us get started...

1. Open Source Components and Hacks

It seems that since our community is so in need of paid memberships or subscriptions on their Web site, we would have already been presented with a good, stable component that would do the trick.  Now I am only a web designer, not a coder, but since we do not, it has lead me to believe that messing with Joomla! ACL’s, or moving users to the correct tables in the database must be a hard thing to do.  But than I began to understand from the many, many posts that no one has the same needs.  There are many of us in the community that only want simple paid membership options, while others want integration with Community Builder, VirtueMart, other bridges, and the list goes on.  Some of us would be willing to use PayPal, others want a payment module for every company that offers a merchant account.  No one wants the same thing.  Some people still want to offer free memberships, while others want their Web site to have only paid memberships.  The list goes on.  So now I have come to the conclusion that anyone who would be brave enough to code a solution for our paid membership wishes would have to make it a full-time job, which in turn would keep many people from picking this project up and offering it back to the community for free. 

What do we have now? 
a. Components and Add-ons

Account Expiration Control Component
Automatically expires user accounts after a certain time period.

Found at:
http://mamboforge.net/frs/?group_id=425 or
http://mamboforge.net/projects/accountexp/  (You can find earlier versions for hacking here.)

Also found at:
http://forge.joomla.org/sf/projects/accountexp New Version 0.6 - Does not seem to work with Joomla 1.0.7.  Works fine with 1.0.4.  I am not sure if any hacks were ever added to this version.  Does not seem to be CB RC2 compatible.
http://www.sounerd.com.br/index.php?opt ... &Itemid=46
(The developer does not seem to be active at SouNerd anymore)

Pros:
Has the PayPal IPN already integrated into the component.  With a little knowledge of PHP, you could probably customize this into any paid-membership solution that you need as long as you want to use PayPal.  However I don’t have PHP knowledge.  The developer has also released a newer version than what will be discussed in this FAQ, showing that it is not a dead project. 

Cons:
Works well for a members-only site.  There have been a couple hacks made to allow for a two-day trial period, but for the most part, without customization, you cannot have free memberships and paid memberships.  In fact, there have been a lot of hacks posted, of which a few will be included in this FAQ, to get this component working for our basic needs.  You also have to still do a lot of manual moving of users to different tables.  For a fully automated solution, this is not it.  For a well monitored Web site, this may work well with simple subscriptions.

JBridge
This is one of the Joomla! add-ons created because of the communities high demand for a paid membership solution.  However, it is not a component yet and integrates other components as well, such as VirtueMart, Community Builder 1.0 RC2, JACLPlus, Docman, and for some reason, User Home Pages.

Found at:
http://www.joomlapalooza.com/

Pros:
A new project dedicated to making paid memberships possible.  It integrates VirtueMart and Community Builder, which many users have requested.  The documentation at this point is better written than most other components out there (most do not even have documentation).  The developer also seems very knowledgeable about PHP and knows what he is doing.

Cons:
You must have VirtueMart installed.  I believe all the other components are optional, but ViruteMart is a must.  If you didn’t want to use a shop for your Web site, this could be a problem.  The Jbridge ‘package’ is for manual installation; that means it is not distributed as a component and cannot be installed using the Joomla! installer. Also, the developer seems to be very busy, so if you have support questions that need an answer and if you are waiting for new releases, then you will need patience.  Of course, like all other developers that create free components for Joomla!, he has a day job!  But he seems to be unavailable most of the time.

That’s it?  Yep, sorry to tell you, that is all we have regarding free add-ons specifically for paid subscriptions.

b. Hacks

Here are some account expiration hacks that have come to my attention.  Other members of the community created these hacks.  Some of these hacks are old, and many components have been updated since then.  The Account Expiration Control Component has been updated to version 0.6.  I am unsure of whether any of these hacks were added.  Also, for those trying to integrate Community Builder, these hacks are for CB RC1.  As far as I know, they will not work with CB RC2.  Try at your own risk.

Account Expiration Control Component v0.3 Hacks

Community Builder Integration
The hack can be found here: http://www.mambojoe.com/index.php?optio ... =2&id=6719

Exclusion List Issue
The Acct Exp Component has had issues with putting users in an exclusion list keeping users blocked even after payment.  This fixes that issue.  This was mentioned to be fixed in the 0.6 version.

This is for the acctexp.php file found by going to components/com_acctexp/acctexp.php

Find the following information:
Code:
   }
   $row->checking();

   $name = $row->name;
   $email = $row->email;
   $username = $row->username;
   $userid = $row->id;
   $registerDate = $row->registerDate; // For use on expiration date

and add:
Code:
// funkymunky hack**************************************
    $database->setQuery( "INSERT INTO #__acctexp SET userid=$userid, expiration=DATE_ADD('$registerDate', INTERVAL $cfg->initialexp DAY)" );
      $database->query();
     
//end of funkymunky hack ************************************************


Renew Link

funkymunky wrote:

Your gona need to change 3 files

login.validate.php can be found in the administrator/components/com_acctexp/includes
acctexp.php can be found in /components/com_acctexp
acctexp.html.php can be found in /components/com_acctexp

in login.validate.php
replace the mosredirect line with
Code:
mosRedirect( "index.php?option=com_acctexp&item_number=".$usr->id."&user=" . $username . "&expiration=" . strftime(_ACCT_DATE_FORMAT, $expstamp));

this is adding a user id to the link so it can be used within the paypal payment function

in acctexp.html.php

add $userid to the function
Code:
function expired($option, $user, $expiration,$userid)

under the following table row
Code:
<tr>
   <td align="center">
   <?php echo _EXPIRED . $expiration; ?>
   </td>
        </tr>

add this row
Code:
<tr>
<td align="center">
<a href="index.php?option=com_acctexp&user=<?php echo $user;?>&item_number=<?php echo $userid;?>&task=updatesub">Renew Subscription</a>
</td>
</tr>

The userid is required in the function in order for it be placed into the link in the table row

The above hack creates the renew subscription link.

The link contains a item number which is the user id and Ive added  to the task variable a updatesub value.
This task variable will tell the next page to display the payment function.
Also i have added the user name. this will be required in the paypal function

in acctexp.php

below the following line

Code:
$expiration = trim( mosGetParam( $_REQUEST, 'expiration', '' ) );

add this
Code:
$idfromlogin = trim( mosGetParam( $_REQUEST, 'item_number', '' ) );
if (empty($idfromlogin ))
{
global $my;
$userid = ($my->id);
}
else
{
$userid =$idfromlogin;
$name=$user;
}

bit further on down is a case statement add this any where in it
Code:
case "updatesub":
   payForm( $option,$userid, $username, $name);
   break;


just before the case statement finishes

replace the default
Code:
default:
expired($option, $user, $expiration);
break;

with
Code:
default:
expired($option, $user, $expiration,$userid);
break;

just under the case statement is function called expired
Code:
function expired($option, $user, $expiration) {
HTML_frontEnd::expired($option, $user, $expiration);
}

replace this with
Code:
function expired($option, $user, $expiration,$userid) {
HTML_frontEnd::expired($option, $user, $expiration,$userid);
}

You are just adding in the userid


Upgrade Option

To allow users to upgrade, Scubaguy posted this hack:
scubaguy wrote:
To give my users the upgrade option I modified the "function expired" in acctexp.html.php and included the payForm function.  I also added membership status messages based on the user's Group ID (gid) and for those members that have been excluded.  Everyone else will have their current expiration date displayed or the Expired message.  I then linked to the the page using "index.php?option=com_acctexp&Itemid=167"
Code:
   function expired($option, $user, $expiration) {
global $database, $my;

         $query2 = "SELECT expiration FROM #__acctexp WHERE userid=$my->id";
         $expiration2 = null;
         $database->setQuery( $query2 );
         $expiration2 = $database->loadResult();

         $query3 = "SELECT gid FROM #__users WHERE id=$my->id";
         $expiration3 = null;
         $database->setQuery( $query3 );
         $gid = $database->loadResult();

      ?>
      <table width="590" cellspacing="0" cellpadding="0" border="0">
      <tr>
      <td><br><br>
      </td>
      </tr>
      <tr>
      <td align="center">
      <strong>
      <?php if ($expiration2=='' && $gid >= 20) {
         echo _EXPIRED_TITLE2;
      }
if ($expiration) {
      echo _EXPIRED_TITLE;
      } ?>
      </strong>
      </td>
      </tr>
      <tr>
      <td><br><br>
      </td>
      </tr>
      <tr>
      <td align="center">
      <?php if ($expiration2=='' && $gid >= 20) {
    echo _DEAR . $my->username . ",";
      }
if ($expiration) {
      echo _DEAR . $user . ",";
      } ?>
      </td>
      </tr>
      <tr>
      <td align="center">
      <?php if ($expiration2=='' && $gid >= 20) {
      echo _EXPIRED2 . _EXCLUDED;
      }
if ($expiration) {
      echo _EXPIRED . $expiration;
      } ?>
      </td>
      </tr>
<tr><td>
<?php payForm($option, $userid, $username, $name); ?>
</td></tr>
      </table>
      <?php
   }




There is also some random code posted here by Scubaguy to try to get Free Memberships to work.  There were some issues here with it not automatically setting the expiration date for the users.  I am posting this for some technically endowed individuals to take a look at to see if they can fix it for whatever use they may need.
http://forum.joomla.org/index.php/topic ... l#msg30700

And this list of instructions was posted by Ty2u.com, with the files to download at the bottom of this FAQ.
Ty2u.com wrote:
What to do to get a basic free Joomla paypal subscriptions going

This should be right but if I have made any errors please let me know. 

Download the files attached and then perform the following steps:

1. You should be able to install the com_acctexp.zip as a Joomla component and disregard the hacks it tells you to do.

2. Install the mod_acctexp.zip as a module and publish it instead of your other login module.

3. Backup your joomla.php in your includes dir and rename joomla-acctexp.php.txt to joomla.php and overwrite your old joomla.php.

4. Go to your components menu and into the account expiration -> settings and make sure to enable it and set your options.

I successfully tested this in the paypal sandbox but I have not yet had an expired account until tomorrow so I can see how it works and if it actually disables it.  But it worked when signing up, didnt enable the user until it came back from paypal and they clicked their activation link in their email.  Thats enough to make money :)

So it is a basic setup that should work.  I dont think it gives you the ability to change them to authors or anything like that.

Thanks for all your wonderful work everyone!!!!!


VirtueMart Hacks
These hacks were submitted by users, mainly ChuckTrukk, to allow for membership integration to work with VirtueMart.  I have not tested these hacks and I am not sure if they are completed in their entirety.  You will have to PM ChuckTrukk if you have any questions.

ChuckTrukk wrote:
How I modified VirtueMart to update a user to "Author" upon payment completion

1. A user signs up through Community Builder (regular membership)
2. They are redirected to VirtueMart and see a button that says "Upgrade"
3. I did some the VirtueMart registration read the Community Builder fields - user pays
4. Upon completion, I put this code in home\administrator\com_virtuemart\html\checkout.thankyou.php:

( somewhere after _PHPSHOP_THANKYOU_SUCCESS?> )
Code:
   // GET USER INFORMATION
   $q1 = "UPDATE #__users SET usertype='Author', gid='19' WHERE id='$my->id' ";
   $database->setQuery($q1);
   $database->query();
   
   //GET ARO ID
   $q2 = "SELECT aro_id FROM #__core_acl_aro WHERE value='$my->id' ";
   $database->setQuery($q2);
   $database->query();
   $aro = $database->loadResult();
   //$aro = $db->p("aro_id");
      //echo "<p>The aro id: -> ";
      //echo $aro;
      //echo " <-</p>";
   
   //UPDATE ARO ID
   $q3 = "UPDATE #__core_acl_groups_aro_map SET group_id='19' WHERE group_id='18' AND aro_id='$aro' ";
   $database->setQuery($q3);
   $database->query();
      //echo "<p>The aro id: -> ";
      //echo $aro;
      //echo " <-</p>";

   //UPDATE USERTYPE IN SESSION
   $q4 = "UPDATE #__session SET usertype='Author' WHERE username='$my->username' ";
   $database->setQuery($q4);
   $database->query();


If you are using Paypal, I believe you can put this in home\administrator\com_virtuemart\notify.php ( around line 585?) This code below.

Code:
        if (eregi ( "VERIFIED", $res)) {

            //----------------------------------------------------------------------

            // If the payment_status is Completed... Get the password for the product

            // from the DB and email it to the customer.

            //----------------------------------------------------------------------

            if (eregi ("Completed", $payment_status) || eregi ("Pending", $payment_status)) {


Again, my code is probably horrible! I am not a coder, just trying to make due with what our Devs have given us. If there are any coders who can clean this up, please do. This is how I upgraded users to 'Author' (then I used mosif=Member -> show intro. mosif=Author -> show all).

I hope this helps,
Chuck


And last, but not lease, a code to make sure the information added to VirtueMart is created in Community Builder RC1
ChuckTrukk wrote:
This is the code I created to pull info into CB. I expect the coding / implementation to be bad. So if anyone has any code-clean up, please let us know. I have not ported this to VirtueMart yet- so it may need tweaking.

Code:
<!--   This is going to pull the users "first_name" from CB into VirtueMart's "first_name" field-->
<div style="float:left;width:60%;padding-left:10px;">
        <input type="text" id="first_name" name="first_name" size="40"
      value="<?php

      // Query the CB database and assign variable to $firstname
      $q = "SELECT * FROM #__comprofiler WHERE id='$my->id' ";
      $db->query($q);
      $firstname = $db->p("firstname");

      // Echo "cb_firstname"
      echo $firstname;
      ?>" class="inputbox" />
</div>



You do not have the required permissions to view the files attached to this post.

_________________
From the beginning...


Last edited by charlwillia6 on Thu Mar 09, 2006 11:04 am, edited 1 time in total.

Top
   
 
Posted: Thu Mar 09, 2006 10:59 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Tue Aug 23, 2005 9:45 am
Posts: 629
Location: La Grande, Oregon
2. Commercial Components

This section will list the available components that have been listed by other members of the community.  Many users have an opinion on the quality and service of each.  Any additional information that is listed will not be connected to my opinion, because honestly, I have not tried any of these components.  Feedback, however, is always welcome.

JoomlaPal - http://www.joomlapal.com
PayPal integration.  They also offer a CB RC2 compatible version and claim that they will have a SMF compatible version soon. 

Members Opinions - Mixed reviews have been reported about JoomlaPal's service.  Some love it, some don't.  Seems that it depends on the amount of work involved if they have to help with installation.  I have emailed the developers and they seem friendly and knowledgeable.  The only other complaint is that PayPal is the standard payment gateway.  I believe this is the only payment gateway they offer at this time.

Mambo-Charge Plus (Joomlaware) - http://www.joomlaware.com
PalPal integration.  I don't know a lot about Mambo-Charge Plus, but the features can be found here.  I believe that PayPal is the only option that they have at this time, but it seems as though other payment API's would be possible with some knowledge of payment processors. 

Members Opinions - So far I have only heard good things about the quality and service of this product.  I have heard that it is loaded with features and is sometimes more than the user needs or wants.  It is more expensive than JoomlaPal, but offers many more options.  It seems to very stable, but I haven't heard much about new releases.  Compatible with Mosets Hot Property Agents, Phil Taylor's mosDirectory, Mosets Tree listings, and MamboMatch.

Amember Prohttp://www.amember.com
Multiple Payment Systems.  This is a stand alone script that has an optional plug-in or integration for Joomla! and Mambo.  This one is a little spendy, but support is said to be great and they will help with installation. 

Members Opinions - Only good things have been said.  Only con:  Price.

MosLock - http://www.phil-taylor.com/
PayPal Integration - Very simple component for taking PayPal payments and charging users for entry into your Web site.  There is not a lot of features, but if you only need to charge users for registration with no frills or other options, this may work for you.  Fairly inexpensive.  Contact Phil-Taylor ahead of time to see if MosLock is for you.

Members Opinions - I actually have not heard any opinions regarding this component.  I am not sure if anyone has really tried it.

I am not aware of any other commercial components at this time.  If there is one that you think should be added, PM me and I will look into it.  The biggest problem right now is that a lot of people do not want to use PayPal for the payment gateway.  Heck, I just want a good solution to this problem for now, the payment gateways can come later.  It would be nice to have an open source solution that could use different payment IPN's like VirtueMart, or one of the other shops, but I guess we are far from it.  I think it would be nice to have just one solution that would work with Joomla! without integrating Virtuemart and every other componet out there to get to work.  JACLPlus might be a must, however, it sounds as though Joomla! 1.1 will have a lot of ACL options that may make JACLPlus void in the future. 

If there is anything you would like to add to this FAQ, let me know.  And especially those that have integrated subscriptions or paid registration options into your Web site, let us know how you did it.  We are all looking for the best option here and any feedback to this on going issue would be great.  Hope this helps!

_________________
From the beginning...


Top
   
 
Posted: Thu Mar 09, 2006 12:06 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso
Offline

Joined: Thu Aug 18, 2005 10:27 am
Posts: 3905
Location: Sunny City Cebu, Philippines!
DISCUSSIONS ON THE THREAD CAN BE DONE HERE: http://forum.joomla.org/index.php/topic,1111.0.html

_________________
"I was one of those who wondered why people would pay so much $$$$ to do something that was so much fun!" -R. Harkrider, Fortran Code Engr.
^If u cant read that, you clearly missed the HIGHLIGHTS!
www.backspace.ph | www.joomlaconsultancy.net


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group