Unzip File Using PHP
// assuming file.zip is in the same directory as the executing script. $file = 'filename.zip'; // get the absolute path to $file $path = pathinfo(realpath($file), PATHINFO_DIRNAME); $zip = new ZipArchive;…
// assuming file.zip is in the same directory as the executing script. $file = 'filename.zip'; // get the absolute path to $file $path = pathinfo(realpath($file), PATHINFO_DIRNAME); $zip = new ZipArchive;…
// assuming file.zip is in the same directory as the executing script. $file = 'file.zip'; // get the absolute path to $file $path = pathinfo(realpath($file), PATHINFO_DIRNAME); $zip = new ZipArchive;…
<?php // Previous and Next product links in product page $_product = $this->getProduct(); if(!$_product->getCategoryIds()) return; // Don't show Previous and Next if product is not in any category $cat_ids =…
AW Blog is a Magento extension from aheadWorks that is reckoned among the best buzz and word of mouth marketing tips. It not only provides your regular customers with up-to-date…
<?php error_reporting(E_ALL); ini_set('display_errors', '1'); // Load Up Magento Core define('MAGENTO', realpath('')); require_once(MAGENTO . '/app/Mage.php'); $app = Mage::app(); $categories = Mage::getModel('catalog/category') ->getCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('is_anchor', 0) ->addAttributeToFilter('entity_id', array("gt" => 1)) ->setOrder('entity_id') ;…
Weekly : select * from dt_table where `date` >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) Monthly : select * from dt_table where `date` >= DATE_SUB(CURDATE(), INTERVAL 1 MONTH) Yearly : select *…
$(function() { $('a:not()').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $(''); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top…
For Import Product Pragmatically In Magento (Simple CSV) 2 <?php set_time_limit(0); ini_set('max_execution_time', 0); ini_set('memory_limit', '-1'); include_once "app/Mage.php"; //include_once "downloader/Mage/Controller.php"; Mage::init(); $app = Mage::app('default'); $row = 0; if (($handle = fopen("products/bakery-dairy/test.csv", "r"))…
<?php // Name of the file $filename = 'DBNAME.sql'; // MySQL host $mysql_host = 'localhost'; // MySQL username $mysql_username = 'root'; // MySQL password $mysql_password = ''; // Database name…
A PHP Class for Interacting with cPanel's XML-API https://github.com/CpanelInc/xmlapi-php <?php include("xmlapi.php"); $db_host = "localhost"; $cpaneluser = "cpaneluser"; $databasename = 'mydatabasename';//do not prepend with username $databaseuser = 'databaseuser';//api will do that…