Plugin Directory

Changeset 188270


Ignore:
Timestamp:
12/30/2009 09:12:20 PM (16 years ago)
Author:
jonbyrd
Message:
 
Location:
membership-subscription-management/trunk/byrd_rolessubscriptions
Files:
1 added
18 edited

Legend:

Unmodified
Added
Removed
  • membership-subscription-management/trunk/byrd_rolessubscriptions/byrd_properties.php

    r186690 r188270  
    7979   
    8080    //paypage
     81    public $submit_button_text = 'Buy Now';
    8182    public $page_style = null;
    8283    public $image_url = null;
  • membership-subscription-management/trunk/byrd_rolessubscriptions/byrd_rolessubscriptions.php

    r186690 r188270  
    99Author URI: http://www.jonathonbyrd.com
    1010*/
     11
     12ini_set('memory_limit', '200M');
    1113
    1214//loading resources
     
    2527    'byrd_rolessubscriptions/byrd_rolessubscriptions_config.php',
    2628    '');}
     29   
    2730
    2831//loading resources
     
    3942        //binding the options to this class
    4043        $this->getOptions();
     44    }
     45   
     46    /**
     47     *
     48     * @param $content
     49     * @return unknown_type
     50     */
     51    function addContent($content = '') {
     52        $content = str_replace("<!-- byrd subscription -->", $this->getSubscriptions(), $content);
     53        $content = str_replace("<!-- byrd login -->", $this->getLogin(), $content);
     54       
     55        return $content;
    4156    }
    4257   
     
    8398        {
    8499            foreach ($properties as $k => $v) {
    85                 $this->$k = $v;
     100                $this->$k = stripslashes($v);
    86101            }
    87102
     
    158173
    159174$byrdRoles = new byrdRoles();
     175
     176if (!function_exists('byrd_subscription')){ function byrd_subscription(){
     177    global $byrdRoles;
     178    $byrdRoles->getSubscriptions();
     179}}
     180if (!function_exists('byrd_login')){ function byrd_login(){
     181    global $byrdRoles;
     182    $byrdRoles->getLogin();
     183}}
     184
     185add_filter('the_content', array(&$byrdRoles, 'addContent'));
     186
     187
    160188?>
  • membership-subscription-management/trunk/byrd_rolessubscriptions/byrd_rolessubscriptions_config.php

    r186690 r188270  
    128128        {
    129129            foreach ($properties as $k => $v) {
    130                 $this->$k = $v;
     130                $this->$k = stripslashes($v);
    131131            }
    132132
  • membership-subscription-management/trunk/byrd_rolessubscriptions/config.php

    r186690 r188270  
    2222</style>
    2323
    24 <div class="byrdtabs">
    25     <ul id="sidemenu">
    26         <li><a id="subscriptionlink" class="current">Subscription</a></li>
    27         <li><a id="configurationslink">Configurations</a></li>
    28         <li><a id="notificationslink">Notifications</a></li>
    29         <li><a id="installationlink" >Documentation</a></li>
    30         <li><a id="jonathonbyrdlink" >Support Forum</a></li>
    31        
    32     </ul>
     24<div class="byrdtabs">
     25  <ul id="sidemenu">
     26    <li><a id="subscriptionlink" class="current">Subscription</a></li>
     27    <li><a id="configurationslink">Configurations</a></li>
     28    <li><a id="notificationslink">Notifications</a></li>
     29    <li><a id="installationlink" >Documentation</a></li>
     30    <li><a id="jonathonbyrdlink" >Support Forum</a></li>
     31  </ul>
    3332</div>
    3433   
     
    6766            </tr><tr><td colspan="2" class="paypalinfo">
    6867            How much are you going to charge?
     68            </td>
     69        </tr>
     70        <tr>
     71            <td width="200"><label for="submit_button_text">Submit Button</label></td>
     72            <td><input id="submit_button_text" name="submit_button_text" type="text" size="20" value="<?php echo $this->submit_button_text; ?>" /></td>
     73            </tr><tr><td colspan="2" class="paypalinfo">
     74            This number is not used by our system, set it to anything that you would like.
    6975            </td>
    7076        </tr>
     
    497503   
    498504    <h2>Installation</h2>
     505    <ol>
     506        <li>Upload the files directly from the zip archive into your wordpress plugins directory</li>
     507        <li>Activate the Byrd Roles Subscription plugin from your wordpress administration area</li>
     508        <li>Define your Subscription within the Membership Subscriptions Configurations area.</li>
     509        <li>From your wordpress admin area, click Settings -> General and then uncheck the "Membership" checkbox</li>
     510        <li>Paste the subscription code into your .php file</li>
     511    </ol>
     512   
    499513    <p><b>This plugin does one thing and one thing only, it is designed to create user accounts
    500514    for new subscribers and delete user accounts of expired subscribers.</b> This plugin does not manage
     
    520534        Or if you have the widget manager installed, you can paste this code into the php field.</p>
    521535        <pre>
    522         &lt;?php global $byrdRoles;$byrdRoles-&gt;getLogin(); ?&gt;
     536        &lt;?php byrd_login(); ?&gt;
    523537        </pre>
    524538        </li>
     
    529543        around your website. Just use the code below.</p>
    530544        <pre>
    531         &lt;?php global $byrdRoles;$byrdRoles-&gt;getSubscriptions(); ?&gt;
     545        &lt;?php byrd_subscription(); ?&gt;
    532546        </pre>
    533547        </li>
  • membership-subscription-management/trunk/byrd_rolessubscriptions/database/database.php

    r186690 r188270  
    1313*/
    1414
     15
    1516// Check to ensure this file is within the rest of the framework
    16 defined('_BYRDROLES') or die();
     17defined('_EXEC') or die();
    1718
    1819/**
     
    2425 * @since       1.0
    2526 */
    26 class rDatabase
    27 {
     27if (!class_exists('bDatabase')){ class bDatabase {
    2828    /**
    2929     * The database driver name
     
    189189     *
    190190     * @param array Parameters to be passed to the database driver
    191      * @return rDatabase A database object
     191     * @return bDatabase A database object
    192192     * @since 1.5
    193193    */
     
    218218            }
    219219
    220             $adapter    = 'rDatabase'.$driver;
     220            $adapter    = 'bDatabase'.$driver;
    221221            $instance   = new $adapter($options);
    222222
     
    262262        {
    263263            $name = substr($handler, 0, strrpos($handler, '.'));
    264             $class = 'rDatabase'.ucfirst($name);
     264            $class = 'bDatabase'.ucfirst($name);
    265265
    266266            if(!class_exists($class)) {
     
    10861086        return '0';
    10871087    }
    1088 }
     1088   
     1089}}
  • membership-subscription-management/trunk/byrd_rolessubscriptions/database/database/mssql.php

    r186690 r188270  
    1414
    1515// Check to ensure this file is within the rest of the framework
    16 defined('EPATH_BASE') or die();
     16defined('_EXEC') or die();
    1717
    1818/**
     
    2323 * @since       1.0
    2424 */
    25 class eDatabaseMSSQL extends eDatabase
     25if (!class_exists('bDatabaseMSSQL')){ class bDatabaseMSSQL extends bDatabase
    2626{
    2727    /** @var string The database driver name */
     
    242242
    243243            if ($this->_debug) {
    244                 JError::raiseError('joomla.database:'.$this->_errorNum, 'eDatabaseMSSQL::query: '.$this->_errorMsg );
     244                trigger_error('joomla.database:'.$this->_errorNum. ' bDatabaseMSSQL::query: '.$this->_errorMsg );
    245245            }
    246246            return false;
     
    631631        return $result;
    632632    }
    633 }?>
     633}}
  • membership-subscription-management/trunk/byrd_rolessubscriptions/database/database/mysql.php

    r186690 r188270  
    1414
    1515// Check to ensure this file is within the rest of the framework
    16 defined('_BYRDROLES') or die();
     16defined('_EXEC') or die();
    1717
    1818/**
     
    2323 * @since       1.0
    2424 */
    25 class rDatabaseMySQL extends rDatabase
     25if (!class_exists('bDatabaseMySQL')){ class bDatabaseMySQL extends bDatabase
    2626{
    2727    /**
     
    5252    * @param    array   List of options used to configure the connection
    5353    * @since    1.5
    54     * @see      rDatabase
     54    * @see      bDatabase
    5555    */
    5656    function __construct( $options )
     
    229229
    230230            if ($this->_debug) {
    231                 JError::raiseError(500, 'rDatabaseMySQL::query: '.$this->_errorNum.' - '.$this->_errorMsg );
     231                trigger_error('bDatabaseMySQL::query: '.$this->_errorNum.' - '.$this->_errorMsg );
    232232            }
    233233            return false;
     
    690690        return $result;
    691691    }
    692 }
     692}}
  • membership-subscription-management/trunk/byrd_rolessubscriptions/database/database/mysqli.php

    r186690 r188270  
    1010
    1111// Check to ensure this file is within the rest of the framework
    12 defined('EPATH_BASE') or die();
     12defined('_EXEC') or die();
    1313
    1414/**
     
    1919 * @since       1.0
    2020 */
    21 class eDatabaseMySQLi extends eDatabase
     21if (!class_exists('bDatabaseMySQLi')){ class bDatabaseMySQLi extends bDatabase
    2222{
    2323    /**
     
    4848    * @param    array   List of options used to configure the connection
    4949    * @since    1.5
    50     * @see      eDatabase
     50    * @see      bDatabase
    5151    */
    5252    function __construct( $options )
     
    241241
    242242            if ($this->_debug) {
    243                 JError::raiseError(500, 'eDatabaseMySQL::query: '.$this->_errorNum.' - '.$this->_errorMsg );
     243                trigger_error('bDatabaseMySQL::query: '.$this->_errorNum.' - '.$this->_errorMsg );
    244244            }
    245245            return false;
     
    703703        return $result;
    704704    }
    705 }
     705}}
  • membership-subscription-management/trunk/byrd_rolessubscriptions/database/database/odbc.php

    r186690 r188270  
    1414
    1515// Check to ensure this file is within the rest of the framework
    16 defined('EPATH_BASE') or die();
     16defined('_EXEC') or die();
    1717
    1818/**
     
    2323 * @since       1.0
    2424 */
    25 class eDatabaseODBC extends eDatabase
     25if (!class_exists('bDatabaseODBC')){ class bDatabaseODBC extends bDatabase
    2626{
    2727    /**
     
    5252    * @param    array   List of options used to configure the connection
    5353    * @since    1.5
    54     * @see      eDatabase
     54    * @see      bDatabase
    5555    */
    5656    function __construct( $options )
     
    263263
    264264            if ($this->_debug) {
    265                 JError::raiseError(500, 'eDatabaseMySQL::query: '.$this->_errorNum.' - '.$this->_errorMsg );
     265                trigger_error('bDatabaseMySQL::query: '.$this->_errorNum.' - '.$this->_errorMsg );
    266266            }
    267267            return false;
     
    723723        return $result;
    724724    }
    725 }
     725}}
  • membership-subscription-management/trunk/byrd_rolessubscriptions/database/table.php

    r186690 r188270  
    1313 */
    1414
     15
    1516// Check to ensure this file is within the rest of the framework
    16 defined('_BYRDROLES') or die();
     17defined('_EXEC') or die();
    1718
    1819/**
     
    2526 * @subpackage  Table
    2627 * @since       1.0
    27  * @tutorial    Joomla.Framework/rTable.cls
     28 * @tutorial    Joomla.Framework/bTable.cls
    2829 */
    29 class rTable
    30 {
     30if (!class_exists('bTable')){ class bTable {
     31   
    3132    /**
    3233     * Name of the table in the db schema relating to child class
     
    4849     * Database connector
    4950     *
    50      * @var     rDatabase
     51     * @var     bDatabase
    5152     * @access  protected
    5253     */
     
    6162     * @param string $table name of the table in the db schema relating to child class
    6263     * @param string $key name of the primary key field in the table
    63      * @param object $db rDatabase object
     64     * @param object $db bDatabase object
    6465     */
    6566    function __construct( $table, $key, &$db )
     
    7980     * @since 1.5
    8081    */
    81     function &getInstance( $type, $prefix = 'rTable', $config = array() )
     82    function &getInstance( $type, $prefix = 'bTable', $config = array() )
    8283    {
    8384        $false = false;
     
    8889        if (!class_exists( $tableClass ))
    8990        {
    90             //require_once 'libraries.elven.filesystem.path';
    91             if($path = ROLES_TABLES.DS.strtolower($type).'.php')
     91            $file = DS.strtolower($type).'.php';
     92            $path = false;
     93            foreach (bTable::addIncludePath() as $path){
     94                if (is_file($path.$file)){
     95                    $path = $path.$file;
     96                    break;
     97                }
     98            }
     99           
     100            if($path) // = dirname(__FILE__).DS.'tables'.DS.strtolower($type).'.php'
    92101            {
    93102                require_once $path;
     
    122131     * Get the internal database object
    123132     *
    124      * @return object A rDatabase based object
     133     * @return object A bDatabase based object
    125134     */
    126135    function &getDBO()
     
    132141     * Set the internal database object
    133142     *
    134      * @param   object  $db A rDatabase based object
     143     * @param   object  $db A bDatabase based object
    135144     * @return  void
    136145     */
     
    689698    function isCheckedOut( $with = 0, $against = null)
    690699    {
    691         if(isset($this) && is_a($this, 'rTable') && is_null($against)) {
     700        if(isset($this) && is_a($this, 'bTable') && is_null($against)) {
    692701            $against = $this->get( 'checked_out' );
    693702        }
     
    698707        }
    699708
    700         $session =& rTable::getInstance('session');
     709        $session =& bTable::getInstance('session');
    701710        return $session->exists($against);
    702711    }
     
    826835
    827836    /**
    828      * Add a directory where rTable should search for table types. You may
     837     * Add a directory where bTable should search for table types. You may
    829838     * either pass a string or an array of directories.
    830839     *
     
    926935
    927936   
    928 }
     937}}
  • membership-subscription-management/trunk/byrd_rolessubscriptions/database/tables/ipn.php

    r186690 r188270  
    1818*
    1919*/
    20 class TableIpn extends rTable {
     20if (!class_exists('TableIpn')){ class TableIpn extends bTable {
    2121
    2222    /**
     
    403403   
    404404   
    405 }
     405}}
    406406?>
  • membership-subscription-management/trunk/byrd_rolessubscriptions/database/tables/users.php

    r186690 r188270  
    1818*
    1919*/
    20 class TableUsers extends rTable {
     20if (!class_exists('TableUsers')){ class TableUsers extends bTable {
    2121
    2222    /**
     
    222222   
    223223   
    224 }
     224}}
    225225?>
  • membership-subscription-management/trunk/byrd_rolessubscriptions/includes/factory.php

    r186690 r188270  
    6868        $options    = array ( 'driver' => $driver, 'host' => $host, 'user' => $user, 'password' => $password, 'database' => $database, 'prefix' => $prefix );
    6969
    70         $db =& rDatabase::getInstance( $options );
     70        $db =& bDatabase::getInstance( $options );
    7171
    7272       
  • membership-subscription-management/trunk/byrd_rolessubscriptions/includes/framework.php

    r186690 r188270  
    1212
    1313//will be requiring this
    14 define('_BYRDROLES', true);
     14if (!defined('_BYRDROLES')) define('_BYRDROLES', true);
     15if (!defined('_EXEC')) define('_EXEC', true);
     16
     17if ( !isset($wp_did_header) ) {
     18    $wp_did_header = true;
     19    require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' );
     20    require_once( ABSPATH . WPINC . '/template-loader.php' );
     21}
     22
     23
    1524
    1625//loading resources
     
    2231require_once ROLES_DB.DS.'table.php';
    2332
     33//make sure to add the db tables include path
     34bTable::addIncludePath( ROLES_TABLES );
    2435
    2536?>
  • membership-subscription-management/trunk/byrd_rolessubscriptions/includes/object.php

    r186690 r188270  
    1313// Check to ensure this file is within the rest of the framework
    1414defined('_BYRDROLES') or die();
    15 
     15global $byrd_default_user_level;
     16$byrd_default_user_level = 0;
    1617
    1718class rObject {
     
    3940     */
    4041    function deleteUser(){
    41         $_tbl =& rTable::getInstance('users', 'Table');
     42        $_tbl =& bTable::getInstance('users', 'Table');
    4243        $_tbl->delete( $this->payer_email );
    4344    }
     
    4950     */
    5051    function newUser(){
    51         $_tbl =& rTable::getInstance('users', 'Table');
     52        global $byrd_default_user_level;
     53        $_tbl =& bTable::getInstance('users', 'Table');
    5254       
    5355        $i='';
     
    5961                $this->password = $this->wp_generate_password( 12, false );
    6062                $user_id = $this->wp_create_user( $this->user_name, $this->password, $this->payer_email );
     63               
     64                $usermeta =& bTable::getInstance('usermeta', 'Table');
     65                $usermeta->bind( array(
     66                    'user_id' => $user_id,
     67                    'meta_key' => 'word_user_level',
     68                    'meta_value' => $byrd_default_user_level
     69                ) );
     70                $usermeta->store();
     71               
    6172                break;
    6273            }
     
    6879    function wp_create_user( $username, $password, $email ){
    6980        //save this to the database
    70         $_tbl =& rTable::getInstance('users', 'Table');
     81        $_tbl =& bTable::getInstance('users', 'Table');
    7182        $_tbl->bind( array(
    7283            'user_login' => $username,
     
    8091        ) );
    8192        $_tbl->store();
    82        
     93        return $_tbl->ID;
    8394    }
    8495       
  • membership-subscription-management/trunk/byrd_rolessubscriptions/ipn.php

    r186690 r188270  
    476476        if (!$this->postback()) return false;
    477477        if ($this->payment_status != 'Completed') return false;
    478         if ($this->test_ipn) return false;
     478        //if ($this->test_ipn) return false;
    479479       
    480480       
  • membership-subscription-management/trunk/byrd_rolessubscriptions/readme.txt

    r186690 r188270  
    33Donate link: http://www.jonathonbyrd.com/
    44Tags: membership, members, subscription, paypal, subscriptions, users
    5 Requires at least: 2.8
    6 Tested up to: 2.9
     5Requires at least: 2.0
     6Tested up to: 3.0
    77Stable tag: 1.0
    88
     
    4949**Features Walkthrough**
    5050
    51 1. **Login Widget
    52 I've provided a snippet of Code that will allow you to display a small login form on your pages. This snippet of code will require that you open your template files and paste the code into your .php pages. Or if you have the widget manager installed, you can paste this code into the php field.
     511. **Subscription Widget
     52There are two ways to paste your subscription information into your pages or posts. The first is the PHP method. I suggest that you only use this if you are comfortable with PHP coding.
    5353
    54 &lt;?php global $byrdRoles;$byrdRoles-&gt;getLogin(); ?&gt;
     54&lt;?php byrd_subscription(); ?&gt;
     55
     56The second method is to paste this HTML comment directly into the html editor in the wordpress admin area. Simply edit your page or post, then change the editor to HTML and paste this code.
     57
     58&lt;!-- byrd subscription --&gt
    5559       
    56 1. **Subscription Page**
    57 If designed this to be an insertable block so that you can paste your subscription information anywhere around your website. Just use the code below.
     601. **Login Widget**
     61The same rules apply to the two following snippets. The first is for php developers, the second is for the wordpress editable pages.
    5862
    59 &lt;?php global $byrdRoles;$byrdRoles-&gt;getSubscriptions(); ?&gt;
    60        
     63&lt;?php byrd_login(); ?&gt;
     64&lt;!-- byrd login --&gt
    6165       
    62661. **Confirmation Page**
     
    121125
    1221261. I've screenshotted all of the pages and how they display on my website. I hope this helps.
     1272. Page
     1283. Page
     1294. Page
     1305. Page
     1316. Page
     1327. Page
     1338. Page
    123134
    124135== Changelog ==
     
    127138* Let there be Light!
    128139
    129 == Arbitrary section ==
     140= 1.0.1 =
     141User input has suggested the following changes
    130142
     143* Changed the getSubscriptions code to byrd_subscription(); instead of the complicated code that was first posted. Although the first code is still valid.
     144* Changed the original code for calling the login for to byrd_login(); the old code is still valid.
     145* Added support to change the submit buttons text.
     146* Added ini_set memory limit to ensure that enough memory is set aside for the support page to run properly.
     147* Added subscription level support so that you may change the default role that a user subscribes to.
     148
     149
     150
     151
     152
  • membership-subscription-management/trunk/byrd_rolessubscriptions/subscriptions.php

    r186690 r188270  
    1717<li>
    1818    <h3><?php echo $this->item_name; ?></h3>
    19     <div class="left width75"><?php echo $this->item_description; ?></div>
     19    <div class="left width75"><?php echo stripslashes($this->item_description); ?></div>
    2020    <div class="left width25">$<?php echo $this->a3; ?></div>
    2121    <div class="clear"></div>
    22     <div style="position:relative;float:right;">
    23         <form action="<?php echo $action; ?>" method="post">
    24         <input type="hidden" name="cmd" value="_xclick-subscriptions">
    25        
    26         <?php foreach ($this->getProperties() as $property => $value) {
     22    <div style="position:relative;float:right;">
     23      <form action="<?php echo $action; ?>" method="post">
     24        <input type="hidden" name="cmd" value="_xclick-subscriptions">
     25        <?php foreach ($this->getProperties() as $property => $value) {
    2726            if (is_null($this->$property) || !$this->$property) continue;
    2827            ?>
    29             <input type="hidden" name="<?php echo $property; ?>" value="<?php echo $value; ?>">
    30         <?php } ?>
    31        
    32         <input type="submit" name="submit" border="0" alt="PayPal - The safer, easier way to pay online">
    33         </form>
    34     </div>
     28        <input type="hidden" name="<?php echo $property; ?>" value="<?php echo $value; ?>">
     29        <?php } ?>
     30        <input type="submit" name="submit" border="0" value="<?php echo $this->submit_button_text; ?>" alt="PayPal - The safer, easier way to pay online">
     31      </form>
     32    </div>
    3533</li>
    3634
Note: See TracChangeset for help on using the changeset viewer.