Categories
PHP

How to Fix WARNING: Creating default object from empty value

You may encounter this “warning” message when using PHP 5.4 or above

E_WARNING: Creating default object from empty value

Here is how to fix this 🙂

Categories
CSS

CSS Media Query

Here is a simple example of CSS media query 🙂

http://pastebin.com/dkdfAvGF

Categories
PHP Programming Wordpress

Change WooCommerce Items Per Page

To change displayed WooCommerce Items Per Page, add this code to any PHP file (end of “woocommerce.php” / your theme functions.php, etc)

// Woo commerce 9 items per page
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 9;' ), 20 );
Categories
PHP Programming

vBulletin Reputation Per Usergroup Plugin

I actually coded this vbulletin plugin long time ago, and have published it on VB.org long time ago. But now i want to write on my blog 🙂

This plugin will allow each usergroup to have reputation setting (including reputation power, daily reputation limit, reputation spread limit).

To download it, you can open this link :
http://www.vbulletin.org/forum/showthread.php?t=266604

Categories
PHP Programming

PHP HtmlEntities for UTF-8 Characters

If you just use simple PHP htmlentities function with one argument, you will notice that when you pass string that contains UTF-8 characters, the result is incorrect leaving you with some incorrect characters on the result.

To use it correctly, use this code 🙂

htmlentities($your_string, ENT_COMPAT, 'UTF-8');