This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function sendCustomMail($CustomerName, $email, $increment_id, $template) { | |
// Load from magento config.. | |
$sender = Array('name' => Mage::getStoreConfig('trans_email/ident_sales/name'), 'email' => Mage::getStoreConfig('trans_email/ident_sales/email') ); | |
$storeId = Mage::app()->getStore()->getId(); | |
$translate = Mage::getSingleton('core/translate'); | |
$datetime = new DateTime(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule pagespeed_module> | |
ModPagespeed on | |
ModPagespeedRespectVary on | |
ModPagespeedXHeaderValue "Powered By mod_pagespeed" | |
ModPagespeedEnableFilters add_instrumentation | |
ModPagespeedEnableFilters extend_cache | |
ModPagespeedForceCaching on | |
ModPagespeedDisallow *timthumb.php* | |
ModPagespeedDomain http://thecustomizewindows.com | |
ModPagespeedDomain http://*.google.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
## Function to set file permissions to 0644 and folder permissions to 0755 | |
function AllDirChmod( $dir = "./", $dirModes = 0755, $fileModes = 0644 ){ | |
$d = new RecursiveDirectoryIterator( $dir ); | |
foreach( new RecursiveIteratorIterator( $d, 1 ) as $path ){ | |
if( $path->isDir() ) chmod( $path, $dirModes ); | |
else if( is_file( $path ) ) chmod( $path, $fileModes ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$xml = simplexml_load_file("./app/etc/local.xml", NULL, LIBXML_NOCDATA); | |
$db["host"] = $xml->global->resources->default_setup->connection->host; | |
$db["name"] = $xml->global->resources->default_setup->connection->dbname; | |
$db["user"] = $xml->global->resources->default_setup->connection->username; | |
$db["pass"] = $xml->global->resources->default_setup->connection->password; | |
$db["pref"] = $xml->global->resources->db->table_prefix; | |
if($_GET["clean"] == "log") clean_log_tables(); | |
if($_GET["clean"] == "var") clean_var_directory(); | |
function clean_log_tables() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Filter settings | |
pagespeed RewriteLevel CoreFilters; | |
pagespeed EnableFilters combine_css,rewrite_css,sprite_images,combine_javascript,recompress_images,resize_images,collapse_whitespace,remove_comments,extend_cache,combine_heads,move_css_above_scripts,make_google_analytics_async,insert_image_dimensions,rewrite_javascript; | |
#pagespeed EnableFilters add_head,convert_meta_tags,fallback_rewrite_css_urls,flatten_css_imports,inline_css,inline_import_to_link,inline_javascript,rewrite_images,rewrite_style_attributes_with_url; | |
#pagespeed EnableFilters lazyload_images; | |
pagespeed UrlValuedAttribute span src hyperlink; | |
pagespeed UrlValuedAttribute div background image; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
public function _getOrderIncrementPrefix ($order_store_id) | |
{ | |
$order_entity_type = Mage::getModel('eav/entity_type')->loadByCode ('order'); | |
$order_entity_type_id = $order_entity_type->getId (); | |
$order_entity_type_increment_per_store = $order_entity_type->getIncrementPerStore (); | |
if ($order_entity_type_increment_per_store) | |
{ | |
$order_entity_type_pad_length = $order_entity_type->getIncrementPadLength (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var YY = 2012; | |
var MM = 12; | |
var DD = 3; | |
var HH = 14; | |
var MI = 5; | |
var SS = 0; | |
function atualizaContador() { | |
var hoje = new Date(); | |
var futuro = new Date(YY,MM-1,DD,HH,MI,SS); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (!strcmp ($cc_type, 'BOL_ITAU') || !strcmp ($cc_type, 'TEF_ITAU')): ?> | |
<form id="print-billet-form" method="get" target="_blank" action="https://shopline.itau.com.br/shopline/shopline.asp"> | |
<?php | |
$sql = " SELECT acquirer_transaction_id FROM payment_return WHERE order_id = " . $_order->getId (); | |
$resource = Mage::getSingleton ('core/resource'); | |
$connection = $resource->getConnection ('core_read'); | |
$store = $connection->query ($sql); | |
$children = $store->fetchAll (PDO::FETCH_ASSOC); | |
?> | |
<input type="hidden" name="DC" value="?DC=<?=$children[0]['acquirer_transaction_id'];?>" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install libs | |
sudo apt-get install gifsicle | |
sudo apt-get install imagemagick | |
sudo apt-get install pngcrush | |
sudo apt-get install libjpeg-progs | |
sudo apt-get install pkg-config | |
sudo apt-get install libpng-dev | |
# get smush.py | |
cd /var/apps/macarthur_cms_env/bin/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Table names and table prefixes | |
$tableName = Mage::getSingleton('core/resource') | |
getTableName('catalog_product_entity'); | |
// if prefix was 'mage_' then the below statement | |
// would print out mage_catalog_product_entity | |
echo $tableName; | |
//Accessing the database connection resource |