Archive for the ‘php’ Category

Joomla Last Database Query     Joomla last database query.As we all know it is a bit difficult to find last executed query in CMS. because there are lots of internal trigger and threads are running. But there is a simple way to find last database query in joomla.     The Query Joomla’s database […]

Php backtrace with proper information.   Php backtrace with proper information. we can use debug_backtrace. But debug_backtrace provide a lots of data which might be not use full for one. So for fetching more accurate information we can use the below code. $e = new Exception; var_dump($e->getTraceAsString());  

remove svn files folder using php

Posted: 9th January 2014 by urfusion in php
Tags: , , , ,

remove svn files folder using php some time we forget to export a project on svn and upload that on main server. Result , our main server now have svn file and folders folders. if we want to delete them we have to delete them one by one (if your svn version is old) or […]

update product quantity on check out page magento you can do it by editing item.phtml (template/checkout/onepage/review/item.phtml) and these lines after line no #47 <td class=”a-center”><?php echo $_item->getQty() ?></td> <td class=”a-center”> <input name=”cart[<?php echo $_item->getId() ?>][qty]” value=”<?php echo $this->getQty() ?>” size=”4″ name=”update_cart_action” id=”cup_<?php echo $_item->getId() ?>” class=”input-text qty” maxlength=”12″ /> </td> <td> <button type=”submit” name=”update_cart_action” value=”update_qty” […]

magento on maintenance mode open only on your ip

Posted: 11th December 2013 by urfusion in magento, php
Tags: , , ,

magento on maintenance mode open only on your ip Hello All   Today I am going to explain you how to put magento on maintenance mode. That maintenance mode will show to all other user user beside you. So can can work on a live environment if there is any issue which is very useful. […]

unzip folder files using php code some time you want to extract files from a zip on a website but you didn’t have sufficient rights or cpanel to extract that , you have on;y ftp details only in that case you need a code to extract that zip. following can help you to do that. […]

set permission for magento – magento-cleaning If you are facing issue of permissions or internal server error then try to set permission to magento folder that might help you. set 777 for media , var and app/etc folder and for rest of file and folders create a file with name “magento-cleaning.php” and paste the blow […]

recursive function getting parent child A recursive function is a function that calls itself during its execution. This enables the function to repeat itself several times, outputting the result and the end of each iteration. function categoryChild($id) { $s = “SELECT ID FROM PLD_CATEGORY WHERE PARENT_ID = $id”; $r = mysql_query($s); $children = array(); if(mysql_num_rows($r) […]

countdown timer in php $dateFormat = “d F Y — g:i a”; $targetDate = $futureDate;//Change the 25 to however many minutes you want to countdown change date in strtotime $actualDate = $date1; $secondsDiff = $targetDate – $actualDate; $remainingDay = floor($secondsDiff/60/60/24); $remainingHour = floor(($secondsDiff-($remainingDay*60*60*24))/60/60); $remainingMinutes = floor(($secondsDiff-($remainingDay*60*60*24)-($remainingHour*60*60))/60); $remainingSeconds = floor(($secondsDiff-($remainingDay*60*60*24)-($remainingHour*60*60))-($remainingMinutes*60)); $actualDateDisplay = date($dateFormat,$actualDate); $targetDateDisplay = date($dateFormat,$targetDate); […]

get product thumb images on view.phtml <?php $_images = Mage::getModel(‘catalog/product’)->load($_product->getId())->getMediaGalleryImages(); ?> <?php if($_images){?> <?php $i=0; foreach($_images as $_image){ $i++; ?> <a href=”#” onclick=”ig_lightbox_show(-1)”> <img src=”<?php echo $this->helper(‘catalog/image’)->init($_product, ‘thumbnail’, $_image->getFile())->resize(108,90); ?>” alt=”<?php echo $this->htmlEscape($_image->getLabel());?>” title=”<?php $this->htmlEscape($_image->getLabel());?>” /> </a><?php } ?> <?php } ?>