Skip to content

Instantly share code, notes, and snippets.

View scottopolis's full-sized avatar

Scott Bolinger scottopolis

View GitHub Profile
@scottopolis
scottopolis / appcommunity-user-profile-data.php
Last active January 27, 2021 18:45
Add User Profile Data in AppCommunity
<?php
// add this code to a custom plugin
add_filter('appcommunity_prepare_user', function( $data, $request ) {
// $data['id'] is the user_id. With that, you can look up user meta like this
// $data['appp']['below_content'] = '<p>Welcome back ' . get_user_meta( $data['id'], 'nickname', 1 ) . '!</p>';
// you can also show xprofile fields like this
$data['appp']['user_actions'] = '<div class="custom-profile-fields"><p><strong>' . xprofile_get_field( 1, $data['id'] )->name . '</strong><br/>' . xprofile_get_field_data( 1, $data['id'] ) . '</p><p><strong>' . xprofile_get_field( 2, $data['id'] )->name . '</strong><br/>' . xprofile_get_field_data( 2, $data['id'] ) . '</p></div>';
@scottopolis
scottopolis / apppresser-iap-memberpress.php
Last active April 13, 2022 17:12
Add user to MemberPress after in app purchase, and cancel for AppPresser
<?php
/*
Plugin Name: In App Purchases for MemberPress
Plugin URI: https://apppresser.com
Description: This plugin listens for in app purchases or cancellations and adds/removes members from a membership level.
Version: 2.0.0
Author: Scott Bolinger
Author URI: https://apppresser.com
License: GPLv2
*/
@scottopolis
scottopolis / events-calendar-pro-wp-api.php
Last active January 17, 2019 18:48
Events Calendar Pro to WP-API Post Format
<?php
/*
* Plugin Name: ECP to WP-API (Posts Controller)
* Plugin URI: http://scottbolinger.com
* Description: Add tribe_events post type to WP-API using the posts controller.
* Version: 0.1
* Author: Scott Bolinger
* Author URI: http://scottbolinger.com
*
* @author Scott Bolinger
@scottopolis
scottopolis / apppresser-iap.html
Last active April 15, 2020 17:17
AppPresser In App Purchase Page
<!-- add this code to a custom HTML page to create a form that allows your users to purchase -->
<div padding>
<h2>Purchase</h2>
<p>For just $.99 per month, get access to premium content. Your subscription will automatically renew, cancel any time.</p>
<p>Enter your information below and click subscribe. By subscribing, you agree to the <a href="https://mysite.com/terms" target="_blank">terms of service.</a></p>
<p>Existing users, enter your username and password. New users, make up a username and password you will use to login.</p>
@scottopolis
scottopolis / apppresser-event-detail.html
Created December 15, 2018 19:09
AppPresser Event Detail HTML Markup
<ion-grid>
<ion-row>
<ion-col col-12>
<img src="https://myapppresser.com/wp-content/uploads/2017/08/pixabay.com/salad-2204502_640.jpg"/>
</ion-col>
</ion-row>
<ion-row>
<ion-list>
@scottopolis
scottopolis / apppresser-image-cards.html
Last active October 21, 2019 17:11
AppPresser Image Cards Sample HTML Markup
<div class="card-background-page">
<ion-card (click)="pushPage('destinations-1')">
<img src="https://myapppresser.com/wp-content/uploads/2017/08/pixabay.com/panorama-2154194_640.jpg"/>
<div class="card-title">San Francisco</div>
<div class="card-subtitle">22 Spots</div>
<div class="card-desc">Diam tibique accommodare vis te.</div>
</ion-card>
<ion-card (click)="pushPage('destinations-2')">
@scottopolis
scottopolis / apppresser-intro-page.html
Created December 15, 2018 19:02
AppPresser Intro Slide
<ion-slides pager [dir]="platform.isRTL?'rtl':'ltr'">
<ion-slide>
<div class="icon-hero"><ion-icon name="aperture"></ion-icon></div>
<h2 class="slide-title">Learn</h2>
<p>Learn from our library of educational materials, and share with your friends.</p>
</ion-slide>
<ion-slide>
<div class="icon-hero"><ion-icon name="people"></ion-icon></div>
@scottopolis
scottopolis / apppresser-business-page.html
Created December 15, 2018 18:55
AppPresser Business Page HTML Sample Markup
<!-- this code can be copied/pasted directly into an AppPresser custom HTML page. Edit as necessary. -->
<ion-card class="homepage-demo">
<iframe width="560" height="315" src="https://www.youtube.com/embed/J5mX7RJGj2M?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>
<ion-card-content>
<ion-card-title>
Welcome to our Church!
</ion-card-title>
@scottopolis
scottopolis / promise-for.js
Last active October 23, 2018 18:04
Using a promise inside a for loop
// If you want to do a for loop but you are executing a promise inside it, you have to do something like this
// It's tricky because you have to wait for the promise to resolve before you go to the next iteration
var item = { 1:'$2.00', 3:'$4.00', 5:'$6.00' };
(async function loop() {
for ( var id in item ) {
await runPromise( id );
}
})();
@scottopolis
scottopolis / appcommunity-buddyboss-media.php
Last active October 18, 2018 15:18
BuddyBoss Media for AppCommunity
<?php
// add this code to a plugin
add_filter('appcommunity_activity_content', function( $content, $id ) {
if( !function_exists('buddyboss_media_compat_get_meta') ) {
return $content;
}