This file contains 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 ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
$plugin_info = array( | |
'pi_name' => 'Log Me', | |
'pi_version' => '1.0.0', | |
'pi_author' => 'Erik Reagan', | |
'pi_author_url' => 'http://focuslabllc.com', | |
'pi_description' => 'Sample template logging', | |
'pi_usage' => '' | |
); |
This file contains 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 ($this->_EE->extensions->active_hook('deployment_hooks_'.$which.'_deploy') === TRUE) | |
{ | |
$ext_response = $this->_EE->extensions->call('deployment_hooks_'.$which.'_deploy'); | |
$this->response = is_array($ext_response) ? array_merge($this->response,$ext_response) : $this->response ; | |
} | |
?> |
This file contains 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 | |
class Haddaway extends Songs_in_code { | |
public $love; | |
private $beat; | |
private $girl; | |
public function __construct() | |
{ |
This file contains 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 | |
// There is a possiblity that there will be three extensions for a given | |
// hook and that two of them will call the same class but different methods | |
// while the third will have a priority that places it between those two. | |
// The chance is pretty remote and I cannot think offhand why someone | |
// would do this, but I have learned that our users and developers are | |
// a crazy bunch so I should make shite like this work initially and not | |
// just fix it later. |
This file contains 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 ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
// sample code for thread http://expressionengine.com/forums/viewthread/174318/ | |
class Accessory_test_acc | |
{ | |
public $name = 'Test Accessory'; | |
public $id = 'accessory_test_acc'; | |
public $version = '1.0.0'; | |
public $description = 'Test bed for accessories'; | |
This file contains 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
{!-- | |
/** | |
* This is a template loader for our multi-lingual / multi-regional site | |
* It takes pieces of parameters and assembles them into template_group/template format | |
* Then checks the DB to see if such a template exists. If it does then it returns the TRUE stuff | |
* If the template does NOT exist it returns the FALSE stuff | |
* It can be run as a single template tag to return "y" or "n" on if it exists OR | |
* it can be run as a tag pair to return other data based on the result | |
* | |
* A small custom plugin was written for this functionality |
This file contains 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
// Why would example 1 work, but example 2 not work? (only difference is the opacity property) | |
// jQuery 1.4.2 in use | |
// Example 1 | |
$("ul.pagination li a").hover( | |
function(){ | |
$(this).siblings('.thumb').animate({ | |
top: "-80px", | |
opacity: 'toggle' | |
},500); |
This file contains 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 | |
// The function strlen() returns the interger value of the string length within the parentheses | |
// We can string multiple together with math operators for equations | |
// PHP enabled in template | |
// Parsing Stage: Output | |
// Simple conditional here | |
// We group the strlen values in parentheses to get their value |
This file contains 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
#!/usr/bin/env php | |
<?php | |
// this is a TextMate command that converts { and } characters to the HTML entities so they don't get parsed in docs | |
$matches = array('{','}'); | |
$replacements = array('{','}'); | |
echo str_replace($matches,$replacements,$_ENV['TM_SELECTED_TEXT']); |
This file contains 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
#!/usr/bin/env php | |
<?php | |
// This command simply prints out the serialized data in a readable printed array format | |
// Found on a blog via a google search | |
// @see http://top-frog.com/2009/08/28/quickly-unserialize-data-in-textmate/ | |
$data = unserialize(file_get_contents('php://stdin')); | |
print_r($data); |