This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Am_Di::getInstance()->blocks->add('member/main/bottom', new Am_Block_Base(null, 'item-qty', null, function(Am_View $v) { | |
$di = Am_Di::getInstance(); | |
$user = $di->user; | |
$_ = $user->getActiveProductIds(); | |
$out = []; | |
foreach ($_ as $pid) { | |
$qty = $di->db->selectCell(<<<CUT | |
SELECT SUM(qty) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @title Add All Profile Forms as Available bricks for Signup Forms | |
* | |
* If you have aMember version 6.1.7 or below then it is necessary to apply diff (x.diff) | |
* to file library/Am/Model/SavedForm.php in order to this code snippet work | |
* @path application/configs/site.php | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Am_Di::getInstance()->blocks->add('member/main/bottom', new Am_Block_Base(null, 'future-dates', null, function(Am_View $v) { | |
$user = Am_Di::getInstance()->user; | |
$_ = $user->getFutureProductsBeginning(); | |
$out = []; | |
foreach ($_ as $pid => $begin) { | |
$period = json_encode($user->getExpire($pid) == Am_Period::MAX_SQL_DATE ? | |
sprintf("begins %s", amDate($begin)) : | |
sprintf("%s–%s", amDate($begin), amDate($user->getExpire($pid)))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @title User can choose access start date during signup | |
* | |
* Add new Product option with type Date and Label "Start Date" | |
* http://www.amember.com/docs/Product_Options | |
* then put the following code to | |
* @path application/configs/site.php | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Am_Di::getInstance()->front->registerPlugin(new class extends Zend_Controller_Plugin_Abstract { | |
public function preDispatch(Zend_Controller_Request_Abstract $request) | |
{ | |
if ($request->getModuleName() == 'default' && | |
$request->getControllerName() == 'direct' && | |
$request->getParam('plugin_id') == 'avatar') { | |
if (Am_Di::getInstance()->authAdmin->getUser()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @title Admin Widget Users of Product | |
* @desc widget display list of recent users of product | |
* @path application/default/plugins/misc/admin-widget-user-product.php | |
*/ | |
class Am_Plugin_AdminWidgetUserProduct extends Am_Plugin | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Am_Di::getInstance()->viewPath = array_merge( | |
Am_Di::getInstance()->viewPath, | |
[APPLICATION_PATH . '/default/themes-admin/yourtheme'] | |
); | |
$view = Am_Di::getInstance()->view; | |
$css = $view->_scriptCss('theme.css'); | |
$view->placeholder('head-finish-admin')->append(<<<CUT | |
<link href="{$css}" media="screen" rel="stylesheet" type="text/css" > |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @title PayPal Payout with SSN | |
* @desc add new payout method | |
* @path application/default/plugins/misc/aff-payout-paypalssn.php | |
*/ | |
class Am_Plugin_AffPayoutPaypalssn extends Am_Plugin | |
{ | |
const PLUGIN_STATUS = self::STATUS_BETA; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Am_Di::getInstance()->blocks->add('thanks/success', new Am_Block_Base(null, 'thanks-popup', null, function (Am_View $v) { | |
/* @var Invoice $invoice */ | |
$invoice = $v->invoice; | |
/* @var User $user */ | |
$user = $invoice->getUser(); | |
return <<<CUT | |
<div id="thanks-popup">Any Content within Popup</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* You need to create custom user field within Xenforo admin interface | |
* Users -> Custom user Fields | |
* | |
* Then you can use the following code to sync some data from aMember to Xenforo fields | |
* | |
* Then you can use the following syntax within Xenforo template to display this information: | |
* |