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