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 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, '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 | |
| Am_Di::getInstance()->hook->add(Am_Event::USER_MENU, function(Am_Event $e) { | |
| $menu = $e->getMenu(); | |
| [$config, $items] = Am_Navigation_User::getNavigation(); | |
| $url = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | |
| foreach ($config as $item) { |
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 Soft File to License Scheme | |
| * @path application/default/plugins/misc/softsalefile-to-license.php | |
| */ | |
| class Am_Plugin_SoftsalefileToLicense extends Am_Plugin | |
| { | |
| const PLUGIN_STATUS = self::STATUS_PRODUCTION; |
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
| <style type="text/css">#row-product_id_page-0-0 .am-element-title { | |
| float: none; | |
| width:auto; | |
| text-align:center; | |
| padding: 1em; | |
| } | |
| #row-product_id_page-0-0 .am-element { | |
| padding: 1em; | |
| margin:0; | |
| display: grid; |
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 | |
| $di = Am_Di::getInstance(); | |
| if ($di->auth->getUser() | |
| && ($videos = $di->resourceAccessTable->getAllowedResources($di->auth->getUser(), ResourceAccess::VIDEO)) | |
| ) { | |
| $di->view->headStyle() | |
| ->appendStyle("#member-main-resources li {display: block;}"); |
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 Widget Foo Bar | |
| * @path application/default/plugins/misc/widget-foobar.php | |
| */ | |
| class Am_Plugin_WidgetFoobar 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('helpdesk/ticket/top', new Am_Block_Base(null, 'helpdesk-action-link', null, function(Am_View $v) { | |
| if ($v->strategy instanceof Am_Helpdesk_Strategy_Admin) { | |
| /** @var HelpdeskTicket $ticket */ | |
| $ticket = $v->ticket; | |
| /** @var User $user */ | |
| $user = $ticket->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 | |
| Am_Di::getInstance()->hook->add('gridAffPayoutDetailInitGrid', function(Am_Event_Grid $e) { | |
| $e->getGrid()->getDataSource() | |
| ->leftJoin('?_data', 'd', "d.`table`='user' AND d.`key` = 'aff_paypal_email' AND u.user_id = d.`id`") | |
| ->addField('d.value', 'aff_paypal_email'); | |
| $e->getGrid()->addFieldBefore('name_f', 'aff_paypal_email', 'PayPal Email'); | |
| }); |