Archive for the ‘Programming’ Category

Simple PHP error handling

Tagged: PHP, Programming Date: 28th, November 2008

Here is a very simple way of custom handling php errors.
To use code below, apart from including it in your functions file, you will need to call function display_debug(); at the end of every page (assuming you wish to display debug on every page).
Nifty feature is that you don’t have to worry about turning off [...]

  • Leave Comment
  • Read Comments (0)

Sort multi dimensional array

Tagged: PHP, Programming Date: 18th, November 2008

/*
* Sort multi dimensional array
*
* @author Vladimir Cvetic < vladimir[ at ]ferdinand.rs >
* @param $a array Array you wish to sort
* @param $index mixed Value of the key by wich you wish to sort
* @param $order string Sort direction
* @param $natsort bool Natural sorting true or false
* [...]

  • Leave Comment
  • Read Comments (0)

Smarty plugin: module

Tagged: PHP, Programming Date: 7th, November 2008

Some time ago I wrote this useful smarty plugin wich will enable you to call method of any php class from smarty html template.
It’s very simple and it goes:

/**
* @author Vladimir Cvetic < vladimir[at]ferdinand.rs >
*/
function smarty_function_module($params, &$smarty)
{
/* Check if required params are valid */
if (!isset($params['class']))
{
$smarty->trigger_error(’Module name is not defined!’);
return false;
}
if (!isset($params['method']))
{
$smarty->trigger_error(’Method name is [...]

  • Leave Comment
  • Read Comments (0)

JLoader PHP Class

Tagged: JavaScript, PHP Date: 6th, October 2008

So here is one very simple php class. In past it has proven to be very useful in cases where you need to load multiple javascript files or on large project with a lot of modules (especially if those modules are developed by different persons).
It will help you to avoid double js file loads, it [...]

  • Leave Comment
  • Read Comments (5)

Wordbook: Wordpress and Facebook integration

Tagged: Wordpress Plugins Date: 8th, September 2008

I have just finished first public release of Wordpress plugin “Wordbook“.

Wordbook is Wordpress plugin desinged to integrate Facebook in your blog and your blog in Facebook.
Some of the features include Facebook gallery on your blog, both as a widged and full featured gallery, blog posts appear on Facebook Mini-Feed, display almost anything from your Facebook [...]

  • Leave Comment
  • Read Comments (5)