Skip to main content

Posts

How to add Google fonts to select in TinyMCE editor in Joomla backend

There was a requirement from one of our customers to select Google fonts which we were using in front end pages in Tiny mice editors in Joomla 2.5 back end. I couldn't find a plug-in which provides this functionality from the back end. There are few plug-ins which can be used to enable Google fonts or font.com fonts by selectors (like class or ids).   Then I went through the source code of tiny mice editor plug-in found a way add new fonts. It was a bad thing when we think about joomla updates. But with client perspective it was a good solution I think. You are welcome to discuss with regards pros and cons.  Add new fonts here Edit editor_template.js file in  media\editors\ tinymce\ jscripts\ tiny_mce\ themes\ advanced\ editor_template.js Search for 'theme_advanced_fonts' or 'Arial' or 'georgia'. There are few places of 'theme_advanced_fonts'. You need to find correct place.  theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=aria

How to create tar by excluding directories in centos Linux

I had a problem to compress files in my webserver. Because my images and backup folders were too large. Then I thought to exclude those directories and create a tar file. I have used --exclude option which matches patterns. First I have used following command to exclude images and backup folder. tar -cvf "new_tar_cha_2013-11-26.tar.gz" .  --exclude "path/to/backup/backup/*" --exclude "images/*" > error_tar_cha.log It excluded backup folder correctly. But It excluded all the images folders inside my directory. Because it matches the pattern . My solution was, I renamed to root images folder to different name - "images-cha1" and excluded it. It fixed my problem. tar -cvf "new_tar_cha_2013-11-26.tar.gz" .  --exclude "path/to/backup/backup/*" --exclude "images-cha1/*" > error_tar_cha.log I think this will be helpful for others also. Thanks

PHP :: How to request Webservice using PHP CURL

I had a problem when requesting webservice. My solution as follows.         $url = " https://path_to_service.asp " ; //setting the curl parameters.   $headers = array ( "Content-type: text/xml;charset=\"utf-8\"" ,     "Accept: text/xml" , "Cache-Control: no-cache" ,   "Pragma: no-cache" ,   "SOAPAction: \"run\""   );   try { $ch = curl_init ();   curl_setopt ( $ch , CURLOPT_URL , $url ); curl_setopt ( $ch , CURLOPT_POST , 1 );     // send xml request to a server   curl_setopt ( $ch , CURLOPT_SSL_VERIFYHOST , 0 );   curl_setopt ( $ch , CURLOPT_SSL_VERIFYPEER , 0 ); curl_setopt ( $ch , CURLOPT_POSTFIELDS , $xmlRequest );   curl_setopt ( $ch , CURLOPT_RETURNTRANSFER , 1 ); c

Joomla 2.5 :: Redirects Error 500 (Internal server Error) page when loging with invalid username and password

I faced this issue when migrating my local joomla 2.5 installation to test server. It works fine when logging with correct username and passwords. Then I have checked in error_log and found issue. PHP Warning:  fopen(path_to_log/logs/error.php): failed to open stream: No such file or directory in  new_server_path/libraries/joomla/log/loggers/formattedtext.php on line 248 Then I have checked in back end and changed path to log folder as follows.

Magento :: Fatal error: Declaration of Zend_Pdf_FileParserDataSource_File::__construct() must be compatible with Zend_Pdf_FileParserDataSource::__construct()

I got this fatal error when I'm going to print shipment. There are two solutions given by community. First Solution: Comment out __construct and __destruct methods in lib/Zend/Pdf/FileParserDataSource.php as follows //    abstract public function __construct();     /**      * Object destructor. Closes the data source.      *      * May also perform cleanup tasks such as deleting temporary files.      */ //    abstract public function __destruct(); Second Solution: simply change the constructor function of lib/Zend/Pdf/FileParserDataSource.php         abstract public function __construct(); TO     abstract public function __construct($filePath);

Magento :: How to update products' attributes correctly without affecting tier prices

I use following code to update magento products without effecting tier prices. Because my earlier code cleared all tier prices after run code. Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);     $id = Mage::getModel('catalog/product')->getIdBySku($prod_sku);     $product = Mage::getModel('catalog/product')->load($id);     if ($product) {       $product->setBarcode($bar_code);       if(! $product->save()){                 $productId = $product->getId();                 echo "product_Id :: ".$productId." - Product sku :: ".$product->getSku()."<br />";             }else{                 echo "not saved";             }      }

Magento :: Inline Translations - How to edit text field using in line translations

To enable inline translations, go to System -> Configurations Go to Advanced section Enable inline translation for front end Refresh page and see dashed boxes to change text as follows Click on the highlighted icon in above images. Following window will appear. Change and submit.