Skip to content

Instantly share code, notes, and snippets.

@faishal
faishal / bp_latest_update_fix.php
Created September 2, 2013 06:36
User latest update Fix. add this code in theme/plugin and then call yoursite.com/?bp_latest_update_fix=true
if( ! function_exists ("bp_latest_update_fix" )){
function bp_latest_update_fix () {
global $wpdb;
$sql = "select * from $wpdb->usermeta where meta_key like 'bp_latest_update'";
$results = $wpdb->get_results ( $sql );
foreach ( $results as $row ) {
if ( $meta_value = maybe_unserialize ( $row->meta_value ) ) {
if ( is_array ( $meta_value ) ) {
if ( isset ( $meta_value[ "content" ] ) && strpos ( $meta_value[ "content" ], "update_txt" ) !== false ) {
$data_up = json_decode ( $meta_value[ "content" ] );
@faishal
faishal / rtMedia_fix_broken_media_path
Created August 12, 2013 10:36
rtMedia fix broken media path . add function in plugin/theme and call yoursite.com/?fix_broken_media=true
function check_broken_media () {
global $wpdb;
$media_model = new RTMediaModel();
$ob_migration = new RTMediaMigration();
$sql = "select * from wp_postmeta m join wp_posts p on p.ID = m.post_id where meta_value like '%rtMedia%'";
$results = $wpdb->get_results ( $sql );
$upload_path = trim ( get_option ( 'upload_path' ) );
if ( empty ( $upload_path ) || 'wp-content/uploads' == $upload_path ) {
$dir = WP_CONTENT_DIR . '/uploads';
@faishal
faishal / gist:6102452
Last active December 20, 2015 08:39
List all event bind to element
$._data( $("#foo")[0], "events" );
@faishal
faishal / hook.php
Created June 11, 2013 06:06
Web hook php sample code for activeCollab
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
$repos= array();