Skip to content

Instantly share code, notes, and snippets.

View FranciscoHV's full-sized avatar

Francisco FranciscoHV

  • Stgo. Chile
View GitHub Profile
@FranciscoHV
FranciscoHV / bp-groups-deprecated.php
Created February 23, 2016 13:04
This file contains functions that are deprecated. * You should not under any circumstance use these functions as they are * either no longer valid, or have been replaced with something much more awesome.
<?php
/***
* Deprecated Groups Functionality
*
* This file contains functions that are deprecated.
* You should not under any circumstance use these functions as they are
* either no longer valid, or have been replaced with something much more awesome.
*
* If you are using functions in this file you should slap the back of your head
* and then use the functions or solutions that have replaced them.
@FranciscoHV
FranciscoHV / Query.php
Last active February 23, 2016 15:57
Possible Query for get data in bp
$sql = array();
$total_sql = array();
$sql['select'] = "SELECT g.*, gm1.meta_value AS total_member_count, gm2.meta_value AS last_activity";
$sql['select'] = "SELECT DISTINCT g.id as not_used, g.*, gm1.meta_value AS total_member_count, gm2.meta_value AS last_activity";
$sql['from'] = " FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2,";
if ( ! empty( $r['user_id'] ) ) {
… …
// See #5099
@FranciscoHV
FranciscoHV / custom_bp_widgets.php
Created March 1, 2016 20:04
Backup Login sobre reestablecer contraseña
<?php
add_action( 'widgets_init', 'vibe_bp_widgets' );
function vibe_bp_widgets() {
register_widget('vibe_bp_login');
register_widget('vibe_course_categories');
register_widget('vibecertificatecode');
}
---------------------bp-course-functions.php
global $post;
$val=5839;
$return ='<div class="course_details">
<ul>';
// $product_id = $post->ID;
?><div align=\"center\"><? $return .= do_shortcode('[product_sale id = "'.$val.'"]'); ?></div><?
global $wp_query, $post;
$post = get_post(5839);
@FranciscoHV
FranciscoHV / course_product.php
Created April 15, 2016 14:21 — forked from MrVibe/course_product.php
Course product shortcode
/*-----------------------------------------------------------------------------------*/
/* Course Product
/*
/* USAGE : xx is course id
/* [course_product id="xx" details="price"]
/* [course_product id="xx" details="sku"]
/* [course_product id="xx" details="sales"]
/* [course_product id="xx" details="note"]
/* Above shortcode can also be used on certificate pages and remove the id field:
@FranciscoHV
FranciscoHV / bp-course-functions.php
Last active April 15, 2016 15:15
Contador Curso Producto
<?php
/**
* The -functions.php file is a good place to store miscellaneous functions needed by your plugin.
*
* @package BuddyPress_Course_Component
* @since 1.6
*/
/**
@FranciscoHV
FranciscoHV / php-example.php
Created May 4, 2016 12:51 — forked from freyr/php-example.php
GetResponse APIv2 example
<?php
# Demonstrates how to add new contact to campaign.
# JSON::RPC module is required
# available at http://github.com/GetResponse/DevZone/blob/master/API/lib/jsonRPCClient.php
require_once 'jsonRPCClient.php';
# your API key is available at
# https://app.getresponse.com/my_api_key.html
@FranciscoHV
FranciscoHV / getresponse.php
Created June 6, 2016 20:41
APIGetResponse
<?php
# Demonstrates how to add new contact to campaign.
# JSON::RPC module is required
# available at http://github.com/GetResponse/DevZone/blob/master/API/lib/jsonRPCClient.php
require_once 'jsonRPCClient.php';
# your API key is available at
# https://app.getresponse.com/my_api_key.html
$api_key = 'Your_API';
# API 2.x URL
$api_url = 'http://api2.getresponse.com';
This simple code work fine using libcurl versions before 7.18.x.
<?php
$ch = curl_init("www.example.com/curl.php?option=test");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
@FranciscoHV
FranciscoHV / header.php
Last active October 19, 2016 12:46
Header MC Wordpress
<?php
//Header File
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<title>
<?php echo wp_title('|',true,'right'); ?>
</title>