Skip to content

Instantly share code, notes, and snippets.

@smithweb
smithweb / httpBL.class.php
Last active September 10, 2022 09:08
Project Honeypot httpBL PHP class
<?php
define( 'httpBL_KEY', '[YOUR API KEY HERE]' );
class httpBL {
private static $_visitor_type = array(
0 => 'Search Engine Bot',
1 => 'Suspicious',
2 => 'Harvester',
@smithweb
smithweb / Package.php
Last active December 9, 2016 18:07
Magento CSS Auto Versioning
<?php
// app/code/local/SW/Core/Model/Design/Package.php
class SW_Core_Model_Design_Package extends Mage_Core_Model_Design_Package
{
/**
* Get the timestamp of the newest file
*
* @param array $files
* @return int $timeStamp
@smithweb
smithweb / View.php
Created October 5, 2012 16:56
SW/Catalog/Helper/Product/View.php
<?php
class SW_Catalog_Helper_Product_View extends Mage_Catalog_Helper_Product_View
{
public function initProductLayout($product, $controller)
{
$design = Mage::getSingleton('catalog/design');
$settings = $design->getDesignSettings($product);
@smithweb
smithweb / config.xml
Created October 5, 2012 16:53
SW/Catalog/etc/config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<SW_Catalog>
<version>0.1.0</version>
</SW_Catalog>
</modules>
<global>
<helpers>
<catalog>
@smithweb
smithweb / config.xml
Created September 30, 2012 23:14
Magento Multi-site Module config.xml
<?xml version="1.0"?>
<config>
<modules>
<SW_SiteSkin>
<version>0.1.0</version>
</SW_SiteSkin>
</modules>
<frontend>
<layout>
<updates>