Tuesday, 10 December 2013

Buddypress show date and time of post instead of elapsed days and hours

In the themes functions.php add this (the 19800 is 5:30 hours in seconds for IST) :

function format_activity_date() 
{
    $activityDate=bp_get_activity_date_recorded();
    return date("M j, Y G:i", strtotime($activityDate)+19800);
}
add_filter('bp_activity_time_since', 'format_activity_date');


Note: This does not affect comments

Friday, 6 December 2013

Wordpress - Create a plugin to override a pluggable function

http://sltaylor.co.uk/blog/customizing-new-user-email-pluggable-function/

http://codex.wordpress.org/Pluggable_Functions

Thursday, 5 December 2013

Change the version of a wordpress javascript file

Search for wp_enqueue_script and change the version number in the argument.

http://codex.wordpress.org/Function_Reference/wp_enqueue_script

Using at and crontab

http://www.cyberciti.biz/tips/howto-shutdown-linux-box-automatically.html

List of all users and groups

To view all users:

cat /etc/passwd | cut -d: -f1


To view all groups:

cat /etc/group |cut -d: -f1

Saturday, 30 November 2013

Low-level PHP Mail Script

How to send an email with PHP without using the built-in mail() function

http://www.stringcat.com/company_blog/2012/10/13/complete-php-low-level-mailer-script-with-to-replyto-cc-bcc-and-attachments/

Tuesday, 26 November 2013

Buddypress Message Auto-complete, inclusion of Non-friends

You have to edit the file wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php

on line 92

change

        $this->autocomplete_all = defined( 'BP_MESSAGES_AUTOCOMPLETE_ALL');

to

        $this->autocomplete_all = define( 'BP_MESSAGES_AUTOCOMPLETE_ALL','true' );