This seems like a great time to subscribe my RSS !

How to create Private (and moderated) Forums BuddyPress and BBPress

If you develop on BuddyPress, you're likely to get stuck while trying to get per-forum permissions. Indeed, it seems there's not yet a way to make BBPress read the BuddyPress groups and hide the froums belonging to private  groups I had to develop a way myself. Furthermore, I needed to give forum moderation rights to the moderators...
Read more

5 tips to make your PHP code beautiful (3)

Avoid unnecessary control structures. Brackets everywhere. Try to get rid of those as much as you can. Unnecessary brackets add visual complexity and make your code much longer. In real world situation, when you need to quickly browse through your code, they just add clutter
//prints out the structure of a table
function describe( $table )
{
	$query = "SHOW... 			
			
Read more

5 tips to make your PHP code beautiful (2)

Thoughtful minimalism Think about the most concise, clear and readable way to write the code your writing. Assume you were writing a function to get a file extension (.gif, .doc, etc.). You could be tempted to use string manipulation functions.
$filename = 'file.doc';
$dot_position = strpos( $filename, '.' );
if ( $dot_position !== false )
{
	$extension = substr( $filename, $dot_position... 			
			
Read more

5 tips to make your PHP code beautiful (1)

Get your brackets right ..and indent your code properly, always. Always give to each of your curly brackets their very own line. I am taking a snippet from Kohana to demonstrate this. (bad) What do you think of this code ?
if ( ! is_array($data)){
if (strpos($data, '[') !== FALSE)
{$data = preg_replace('/\[.*\]/', '', $data);
}$data = empty($data) ? array() :... 			
			
Read more