Sunday 9 September 2012

Joomla 2.5 versions issues while upgrade. Joomla include/framework.php line 42 or line 35 error.


2.5.1 Installation Parse error: syntax error .. on line 35
Had the same error after using jUpgrade to move a 1.5.x site to 2.5.1. which is hosted by 1and1. Everything tested fine after the install and when I moved the jUpgrade folder to the correct folder to make the site live I got a similar error.

Fixed it by changing the htaccess.txt file to .htaccess and adding the following line
//Code:
# Line added to force register_globals OFF
AddType x-mapp-php5 .php
Source: Read More

Thursday 6 September 2012

PHP Function To List Months Names and Years


/**
 * Return the List of all the 12 months name as per requested.
 * @param char $monthType The month format type you want month to be display.
 * @return array:string Return the list of months.
 */
function get_all_months($monthType = 'F')
{
 $months = array();
 
 for ( $m=1; $m<=12; $m++ )
 {
  $months[$m] = date($monthType, mktime(0,0,0,$m,1,2000));;
 }
 
 return $months;
}

/**
 * Return the List of all the year name as per requested.
 * @param char $yearType The Year format type you want year to be display.
 * @return array:string Return the list of month for upto 2020 years which you can change as per your needs.
 */
function get_all_years($yearType = 'Y')
{
 $months = array();
 $yearLength = 20; // This is the limit for year to be display for next 20 years.
 
 for ( $y=11; $y<=$yearLength; $y++ )
 {
  $months[$y] = date($yearType, mktime(0,0,0,1,1,$y));;
 }

 return $months;
}

Wednesday 5 September 2012

Set variables which could cause the TCPDF to generate PDF correctly


// These below are variables which could cause the TCPDF to generate PDF correctly. // So, please check the tcpdf configuration and set the below variables if necessary.
/* Increase the memory limit for the PDF. */
ini_set('memory_limit', '256M'); 
ini_set('safe_mode', 0);
ini_set('allow_url_fopen', 1);