Changeset 188270
- Timestamp:
- 12/30/2009 09:12:20 PM (16 years ago)
- Location:
- membership-subscription-management/trunk/byrd_rolessubscriptions
- Files:
-
- 1 added
- 18 edited
-
byrd_properties.php (modified) (1 diff)
-
byrd_rolessubscriptions.php (modified) (5 diffs)
-
byrd_rolessubscriptions_config.php (modified) (1 diff)
-
config.php (modified) (5 diffs)
-
database/database.php (modified) (6 diffs)
-
database/database/mssql.php (modified) (4 diffs)
-
database/database/mysql.php (modified) (5 diffs)
-
database/database/mysqli.php (modified) (5 diffs)
-
database/database/odbc.php (modified) (5 diffs)
-
database/table.php (modified) (12 diffs)
-
database/tables/ipn.php (modified) (2 diffs)
-
database/tables/usermeta.php (added)
-
database/tables/users.php (modified) (2 diffs)
-
includes/factory.php (modified) (1 diff)
-
includes/framework.php (modified) (2 diffs)
-
includes/object.php (modified) (6 diffs)
-
ipn.php (modified) (1 diff)
-
readme.txt (modified) (4 diffs)
-
subscriptions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
membership-subscription-management/trunk/byrd_rolessubscriptions/byrd_properties.php
r186690 r188270 79 79 80 80 //paypage 81 public $submit_button_text = 'Buy Now'; 81 82 public $page_style = null; 82 83 public $image_url = null; -
membership-subscription-management/trunk/byrd_rolessubscriptions/byrd_rolessubscriptions.php
r186690 r188270 9 9 Author URI: http://www.jonathonbyrd.com 10 10 */ 11 12 ini_set('memory_limit', '200M'); 11 13 12 14 //loading resources … … 25 27 'byrd_rolessubscriptions/byrd_rolessubscriptions_config.php', 26 28 '');} 29 27 30 28 31 //loading resources … … 39 42 //binding the options to this class 40 43 $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; 41 56 } 42 57 … … 83 98 { 84 99 foreach ($properties as $k => $v) { 85 $this->$k = $v;100 $this->$k = stripslashes($v); 86 101 } 87 102 … … 158 173 159 174 $byrdRoles = new byrdRoles(); 175 176 if (!function_exists('byrd_subscription')){ function byrd_subscription(){ 177 global $byrdRoles; 178 $byrdRoles->getSubscriptions(); 179 }} 180 if (!function_exists('byrd_login')){ function byrd_login(){ 181 global $byrdRoles; 182 $byrdRoles->getLogin(); 183 }} 184 185 add_filter('the_content', array(&$byrdRoles, 'addContent')); 186 187 160 188 ?> -
membership-subscription-management/trunk/byrd_rolessubscriptions/byrd_rolessubscriptions_config.php
r186690 r188270 128 128 { 129 129 foreach ($properties as $k => $v) { 130 $this->$k = $v;130 $this->$k = stripslashes($v); 131 131 } 132 132 -
membership-subscription-management/trunk/byrd_rolessubscriptions/config.php
r186690 r188270 22 22 </style> 23 23 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> 33 32 </div> 34 33 … … 67 66 </tr><tr><td colspan="2" class="paypalinfo"> 68 67 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. 69 75 </td> 70 76 </tr> … … 497 503 498 504 <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 499 513 <p><b>This plugin does one thing and one thing only, it is designed to create user accounts 500 514 for new subscribers and delete user accounts of expired subscribers.</b> This plugin does not manage … … 520 534 Or if you have the widget manager installed, you can paste this code into the php field.</p> 521 535 <pre> 522 <?php global $byrdRoles;$byrdRoles->getLogin(); ?>536 <?php byrd_login(); ?> 523 537 </pre> 524 538 </li> … … 529 543 around your website. Just use the code below.</p> 530 544 <pre> 531 <?php global $byrdRoles;$byrdRoles->getSubscriptions(); ?>545 <?php byrd_subscription(); ?> 532 546 </pre> 533 547 </li> -
membership-subscription-management/trunk/byrd_rolessubscriptions/database/database.php
r186690 r188270 13 13 */ 14 14 15 15 16 // Check to ensure this file is within the rest of the framework 16 defined('_ BYRDROLES') or die();17 defined('_EXEC') or die(); 17 18 18 19 /** … … 24 25 * @since 1.0 25 26 */ 26 class rDatabase 27 { 27 if (!class_exists('bDatabase')){ class bDatabase { 28 28 /** 29 29 * The database driver name … … 189 189 * 190 190 * @param array Parameters to be passed to the database driver 191 * @return rDatabase A database object191 * @return bDatabase A database object 192 192 * @since 1.5 193 193 */ … … 218 218 } 219 219 220 $adapter = ' rDatabase'.$driver;220 $adapter = 'bDatabase'.$driver; 221 221 $instance = new $adapter($options); 222 222 … … 262 262 { 263 263 $name = substr($handler, 0, strrpos($handler, '.')); 264 $class = ' rDatabase'.ucfirst($name);264 $class = 'bDatabase'.ucfirst($name); 265 265 266 266 if(!class_exists($class)) { … … 1086 1086 return '0'; 1087 1087 } 1088 } 1088 1089 }} -
membership-subscription-management/trunk/byrd_rolessubscriptions/database/database/mssql.php
r186690 r188270 14 14 15 15 // Check to ensure this file is within the rest of the framework 16 defined(' EPATH_BASE') or die();16 defined('_EXEC') or die(); 17 17 18 18 /** … … 23 23 * @since 1.0 24 24 */ 25 class eDatabaseMSSQL extends eDatabase25 if (!class_exists('bDatabaseMSSQL')){ class bDatabaseMSSQL extends bDatabase 26 26 { 27 27 /** @var string The database driver name */ … … 242 242 243 243 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 ); 245 245 } 246 246 return false; … … 631 631 return $result; 632 632 } 633 } ?>633 }} -
membership-subscription-management/trunk/byrd_rolessubscriptions/database/database/mysql.php
r186690 r188270 14 14 15 15 // Check to ensure this file is within the rest of the framework 16 defined('_ BYRDROLES') or die();16 defined('_EXEC') or die(); 17 17 18 18 /** … … 23 23 * @since 1.0 24 24 */ 25 class rDatabaseMySQL extends rDatabase25 if (!class_exists('bDatabaseMySQL')){ class bDatabaseMySQL extends bDatabase 26 26 { 27 27 /** … … 52 52 * @param array List of options used to configure the connection 53 53 * @since 1.5 54 * @see rDatabase54 * @see bDatabase 55 55 */ 56 56 function __construct( $options ) … … 229 229 230 230 if ($this->_debug) { 231 JError::raiseError(500, 'rDatabaseMySQL::query: '.$this->_errorNum.' - '.$this->_errorMsg );231 trigger_error('bDatabaseMySQL::query: '.$this->_errorNum.' - '.$this->_errorMsg ); 232 232 } 233 233 return false; … … 690 690 return $result; 691 691 } 692 } 692 }} -
membership-subscription-management/trunk/byrd_rolessubscriptions/database/database/mysqli.php
r186690 r188270 10 10 11 11 // Check to ensure this file is within the rest of the framework 12 defined(' EPATH_BASE') or die();12 defined('_EXEC') or die(); 13 13 14 14 /** … … 19 19 * @since 1.0 20 20 */ 21 class eDatabaseMySQLi extends eDatabase21 if (!class_exists('bDatabaseMySQLi')){ class bDatabaseMySQLi extends bDatabase 22 22 { 23 23 /** … … 48 48 * @param array List of options used to configure the connection 49 49 * @since 1.5 50 * @see eDatabase50 * @see bDatabase 51 51 */ 52 52 function __construct( $options ) … … 241 241 242 242 if ($this->_debug) { 243 JError::raiseError(500, 'eDatabaseMySQL::query: '.$this->_errorNum.' - '.$this->_errorMsg );243 trigger_error('bDatabaseMySQL::query: '.$this->_errorNum.' - '.$this->_errorMsg ); 244 244 } 245 245 return false; … … 703 703 return $result; 704 704 } 705 } 705 }} -
membership-subscription-management/trunk/byrd_rolessubscriptions/database/database/odbc.php
r186690 r188270 14 14 15 15 // Check to ensure this file is within the rest of the framework 16 defined(' EPATH_BASE') or die();16 defined('_EXEC') or die(); 17 17 18 18 /** … … 23 23 * @since 1.0 24 24 */ 25 class eDatabaseODBC extends eDatabase25 if (!class_exists('bDatabaseODBC')){ class bDatabaseODBC extends bDatabase 26 26 { 27 27 /** … … 52 52 * @param array List of options used to configure the connection 53 53 * @since 1.5 54 * @see eDatabase54 * @see bDatabase 55 55 */ 56 56 function __construct( $options ) … … 263 263 264 264 if ($this->_debug) { 265 JError::raiseError(500, 'eDatabaseMySQL::query: '.$this->_errorNum.' - '.$this->_errorMsg );265 trigger_error('bDatabaseMySQL::query: '.$this->_errorNum.' - '.$this->_errorMsg ); 266 266 } 267 267 return false; … … 723 723 return $result; 724 724 } 725 } 725 }} -
membership-subscription-management/trunk/byrd_rolessubscriptions/database/table.php
r186690 r188270 13 13 */ 14 14 15 15 16 // Check to ensure this file is within the rest of the framework 16 defined('_ BYRDROLES') or die();17 defined('_EXEC') or die(); 17 18 18 19 /** … … 25 26 * @subpackage Table 26 27 * @since 1.0 27 * @tutorial Joomla.Framework/ rTable.cls28 * @tutorial Joomla.Framework/bTable.cls 28 29 */ 29 class rTable 30 { 30 if (!class_exists('bTable')){ class bTable { 31 31 32 /** 32 33 * Name of the table in the db schema relating to child class … … 48 49 * Database connector 49 50 * 50 * @var rDatabase51 * @var bDatabase 51 52 * @access protected 52 53 */ … … 61 62 * @param string $table name of the table in the db schema relating to child class 62 63 * @param string $key name of the primary key field in the table 63 * @param object $db rDatabase object64 * @param object $db bDatabase object 64 65 */ 65 66 function __construct( $table, $key, &$db ) … … 79 80 * @since 1.5 80 81 */ 81 function &getInstance( $type, $prefix = ' rTable', $config = array() )82 function &getInstance( $type, $prefix = 'bTable', $config = array() ) 82 83 { 83 84 $false = false; … … 88 89 if (!class_exists( $tableClass )) 89 90 { 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' 92 101 { 93 102 require_once $path; … … 122 131 * Get the internal database object 123 132 * 124 * @return object A rDatabase based object133 * @return object A bDatabase based object 125 134 */ 126 135 function &getDBO() … … 132 141 * Set the internal database object 133 142 * 134 * @param object $db A rDatabase based object143 * @param object $db A bDatabase based object 135 144 * @return void 136 145 */ … … 689 698 function isCheckedOut( $with = 0, $against = null) 690 699 { 691 if(isset($this) && is_a($this, ' rTable') && is_null($against)) {700 if(isset($this) && is_a($this, 'bTable') && is_null($against)) { 692 701 $against = $this->get( 'checked_out' ); 693 702 } … … 698 707 } 699 708 700 $session =& rTable::getInstance('session');709 $session =& bTable::getInstance('session'); 701 710 return $session->exists($against); 702 711 } … … 826 835 827 836 /** 828 * Add a directory where rTable should search for table types. You may837 * Add a directory where bTable should search for table types. You may 829 838 * either pass a string or an array of directories. 830 839 * … … 926 935 927 936 928 } 937 }} -
membership-subscription-management/trunk/byrd_rolessubscriptions/database/tables/ipn.php
r186690 r188270 18 18 * 19 19 */ 20 class TableIpn extends rTable {20 if (!class_exists('TableIpn')){ class TableIpn extends bTable { 21 21 22 22 /** … … 403 403 404 404 405 } 405 }} 406 406 ?> -
membership-subscription-management/trunk/byrd_rolessubscriptions/database/tables/users.php
r186690 r188270 18 18 * 19 19 */ 20 class TableUsers extends rTable {20 if (!class_exists('TableUsers')){ class TableUsers extends bTable { 21 21 22 22 /** … … 222 222 223 223 224 } 224 }} 225 225 ?> -
membership-subscription-management/trunk/byrd_rolessubscriptions/includes/factory.php
r186690 r188270 68 68 $options = array ( 'driver' => $driver, 'host' => $host, 'user' => $user, 'password' => $password, 'database' => $database, 'prefix' => $prefix ); 69 69 70 $db =& rDatabase::getInstance( $options );70 $db =& bDatabase::getInstance( $options ); 71 71 72 72 -
membership-subscription-management/trunk/byrd_rolessubscriptions/includes/framework.php
r186690 r188270 12 12 13 13 //will be requiring this 14 define('_BYRDROLES', true); 14 if (!defined('_BYRDROLES')) define('_BYRDROLES', true); 15 if (!defined('_EXEC')) define('_EXEC', true); 16 17 if ( !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 15 24 16 25 //loading resources … … 22 31 require_once ROLES_DB.DS.'table.php'; 23 32 33 //make sure to add the db tables include path 34 bTable::addIncludePath( ROLES_TABLES ); 24 35 25 36 ?> -
membership-subscription-management/trunk/byrd_rolessubscriptions/includes/object.php
r186690 r188270 13 13 // Check to ensure this file is within the rest of the framework 14 14 defined('_BYRDROLES') or die(); 15 15 global $byrd_default_user_level; 16 $byrd_default_user_level = 0; 16 17 17 18 class rObject { … … 39 40 */ 40 41 function deleteUser(){ 41 $_tbl =& rTable::getInstance('users', 'Table');42 $_tbl =& bTable::getInstance('users', 'Table'); 42 43 $_tbl->delete( $this->payer_email ); 43 44 } … … 49 50 */ 50 51 function newUser(){ 51 $_tbl =& rTable::getInstance('users', 'Table'); 52 global $byrd_default_user_level; 53 $_tbl =& bTable::getInstance('users', 'Table'); 52 54 53 55 $i=''; … … 59 61 $this->password = $this->wp_generate_password( 12, false ); 60 62 $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 61 72 break; 62 73 } … … 68 79 function wp_create_user( $username, $password, $email ){ 69 80 //save this to the database 70 $_tbl =& rTable::getInstance('users', 'Table');81 $_tbl =& bTable::getInstance('users', 'Table'); 71 82 $_tbl->bind( array( 72 83 'user_login' => $username, … … 80 91 ) ); 81 92 $_tbl->store(); 82 93 return $_tbl->ID; 83 94 } 84 95 -
membership-subscription-management/trunk/byrd_rolessubscriptions/ipn.php
r186690 r188270 476 476 if (!$this->postback()) return false; 477 477 if ($this->payment_status != 'Completed') return false; 478 if ($this->test_ipn) return false;478 //if ($this->test_ipn) return false; 479 479 480 480 -
membership-subscription-management/trunk/byrd_rolessubscriptions/readme.txt
r186690 r188270 3 3 Donate link: http://www.jonathonbyrd.com/ 4 4 Tags: membership, members, subscription, paypal, subscriptions, users 5 Requires at least: 2. 86 Tested up to: 2.95 Requires at least: 2.0 6 Tested up to: 3.0 7 7 Stable tag: 1.0 8 8 … … 49 49 **Features Walkthrough** 50 50 51 1. ** Login Widget52 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.51 1. **Subscription Widget 52 There 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. 53 53 54 <?php global $byrdRoles;$byrdRoles->getLogin(); ?> 54 <?php byrd_subscription(); ?> 55 56 The 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 <!-- byrd subscription --> 55 59 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.60 1. **Login Widget** 61 The same rules apply to the two following snippets. The first is for php developers, the second is for the wordpress editable pages. 58 62 59 <?php global $byrdRoles;$byrdRoles->getSubscriptions(); ?>60 63 <?php byrd_login(); ?> 64 <!-- byrd login --> 61 65 62 66 1. **Confirmation Page** … … 121 125 122 126 1. I've screenshotted all of the pages and how they display on my website. I hope this helps. 127 2. Page 128 3. Page 129 4. Page 130 5. Page 131 6. Page 132 7. Page 133 8. Page 123 134 124 135 == Changelog == … … 127 138 * Let there be Light! 128 139 129 == Arbitrary section == 140 = 1.0.1 = 141 User input has suggested the following changes 130 142 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 17 17 <li> 18 18 <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> 20 20 <div class="left width25">$<?php echo $this->a3; ?></div> 21 21 <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) { 27 26 if (is_null($this->$property) || !$this->$property) continue; 28 27 ?> 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> 35 33 </li> 36 34
Note: See TracChangeset
for help on using the changeset viewer.