Ideal way to define directory separator in PHP // Directory separator if(!defined(‘DIRECTORY_SEPARATOR’)) { define(‘DIRECTORY_SEPARATOR’, strtoupper(substr(PHP_OS, 0, 3) == ‘WIN’) ? ‘\\’ : ‘/’); } // if
Creating a module in ActiveCollab3
One page guide on creating a new modules to create home screen widget in ActiveCollab3 application. First we need to create a directory for our module. We are going to create it under a /path/to/activecollab/custom/modules directory (where /path/to/activecollab is full…
Creating and Parsing JSON data with PHP
What is JSON? JSON is ultra-weight data interchange data format used over the internet for transferring the data. While XML is a dominant data interchange format over the internet but JSON is less complex and light-weight data.
Caching large menus or header/footer links in WordPress
Even if you are not using some robust caching plugin or tool in wordpress you can cache small chunks of data using basic caching techniques of PHP. In my example i had been creating a few dozens of links in…
Creating a portfolio or gallery using WordPress media files
One of the cool things one can do in wordpress is to create a gallery or portfolio of images using files directly from Media Library. In general after been uploaded, files in wordpress become “Attachments”. I will show you how…
Showing Next-gen gallery inside the template file
I wanted to show the nggallery images in my web page using a php template tag in the theme template file. What i mean i wanted to use [nggallery id=6] in my template to show a particular gallery after matching…
How to represent weighted score average calculation in sigma notation?
I have 20 questions and they are further divided in to a set of 4 questions in each which means there are total 5 sets A, B, C, D and E. Each question has 5 marks so in a set…
Security issues created to WordPress installation
Received this warning in Google Chrome last night when i tried to open my website jogindernagar.com built in WordPress. Warning: Something’s Not Right Here! www.jogindernagar.com contains malware. Your computer might catch a virus if you visit this site.
Skipping plugin update request from WordPress Installation – Just A Hack
Sometimes, you may want your WordPress installation to not to ask you for upgrading a certain plugin you might have edited or extended in order to meet your requirements. Though this is not a good practice to modify a certain…
ANZ-egate payment method for WP-Commerce Plugin
ANZ-egate payment method for WP-E-commerce plugin. I hope it works for you. Bug-fixing or improvements are welcomed. How to install: Create a new file (plugins/wp-e-commerce/wpsc-merchants/anz-egate.merchant.php) and place this code into this file. Once saved check the Payment Method section of…