Skip to content

Instantly share code, notes, and snippets.

@litzinger
litzinger / matrix.diff
Created February 16, 2012 13:25
Matrix and Playa diffs for hooks
diff -rupN /Users/litzinger/Dropbox/add-ons/_others/Matrix2.2.4/ee2/third_party/matrix/ft.matrix.php matrix/ft.matrix.php
--- /Users/litzinger/Dropbox/add-ons/_others/Matrix2.2.4/ee2/third_party/matrix/ft.matrix.php 2012-01-24 11:17:48.000000000 -0600
+++ matrix/ft.matrix.php 2012-02-15 21:11:48.000000000 -0600
@@ -1494,7 +1494,20 @@ class Matrix_ft extends EE_Fieldtype {
$this->EE->db->limit($max_rows);
}
- $query = $this->EE->db->get('matrix_data')->result_array();
+ // -------------------------------------------
+ // 'matrix_display_query' hook
@litzinger
litzinger / clone.php
Created March 1, 2012 21:54
Clone publish layouts
<?php
$field_display = array(
'visible' => TRUE,
'collapse' => FALSE,
'html_buttons' => TRUE,
'is_hidden' => FALSE,
'width' => '100%'
);
$data = array(
@litzinger
litzinger / date.js
Created March 8, 2012 02:29
Cross Domain XML to JSON
/*
* JavaScript Pretty Date
* Copyright (c) 2011 John Resig (ejohn.org)
* Licensed under the MIT and GPL licenses.
*/
// Takes an ISO time and returns a string representing how
// long ago the date represents.
function prettyDate(time){
var date = new Date((time || "").replace(/-/g,"/").replace(/[TZ]/g," ")),
@litzinger
litzinger / advanced.html
Created March 16, 2012 16:24
Simple EE template example
{!-- Redirect to the registration page if logged out and trying to access the account page --}
{if segment_1 == "account" AND logged_out == TRUE}
{redirect="account/register-full"}
{/if}
{exp:channel:entries status="{global:default_status}" disable="{global:disabled_params}"}
{snippet:_header}
<div class="main-wrapper">
@litzinger
litzinger / plugin-tag-example.php
Last active October 2, 2015 17:47
Example of how to create a plugin tag with nested loops and prefixed variables.
<?php
/* Usage
{exp:kaplan:categories
products="55,56,52,53,54,65"
state="{url:segment_2_category_id}"
variable_prefix="category:"}
{if no_results}{/if}
@litzinger
litzinger / ft.structure.php
Created April 6, 2012 15:40
Custom StructureFrame
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Structure Fieldtype
*
* This file must be in your /system/third_party/structure directory of your ExpressionEngine installation
*
* @package StructureFrame for EE2
* @author Jack McDade (jack@jackmcdade.com)
* @copyright Copyright (c) 2012 Travis Schmeisser
@litzinger
litzinger / php.ini
Created October 3, 2015 11:55
MAMP php.ini extra settings
[xdebug]
zend_extension="/Applications/MAMP/bin/php/php5.4.33/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/Users/blitzing/Documents/vhosts/_logs/webgrind"
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_name = cachegrind.out.%t.%p
@litzinger
litzinger / ext.hook_example.php
Created April 25, 2012 14:36
Example of an EE extension hook to replace an {exp:channel:entries} custom field variable.
<?php
/*
Replace any template tags as needed
*/
function channel_entries_tagdata($tagdata, $row, &$channel)
{
// has this hook already been called?
if (isset($this->EE->extensions->last_call) && $this->EE->extensions->last_call)
{
$tagdata = $this->EE->extensions->last_call;
@litzinger
litzinger / file.diff
Created May 31, 2012 17:54
Taxonomy tweak
Index: /trunk/third_party/taxonomy/mod.taxonomy.php
===================================================================
--- /trunk/third_party/taxonomy/mod.taxonomy.php (revision 131)
+++ /trunk/third_party/taxonomy/mod.taxonomy.php (revision 132)
@@ -209,5 +209,5 @@
$r = ($tree_array != array(0)) ? $this->EE->ttree->build_list($tree_array, $str, $options) : '';
-
+
if($options['style'] == "nested")
@litzinger
litzinger / example.html
Created June 6, 2012 13:09
Wyvern Video Module Tags
<!--
Simple tags to query each service by username and/or keyword and return most information about the video,
including a full iframe embed tag. Each query is cached as well for quicker load times.
-->
{exp:wyvern_video:youtube username="someone" limit="3" query="kittens"}
{video_id}
{title}
{content} or {description}
{url}