Skip to content

Instantly share code, notes, and snippets.

@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.php
Last active November 9, 2017 05:20
How to use Assets or EE's File Manager anywhere in the CP
<?php
if ( array_key_exists('assets', $this->EE->addons->get_installed()) )
{
// Load Assets' assets
if ( ! isset($this->EE->session->cache['assets']['included_sheet_resources']))
{
if (! class_exists('Assets_helper'))
{
require PATH_THIRD.'assets/helper.php';
@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}
@litzinger
litzinger / want.html
Created June 6, 2012 16:15
Stash side effects
{!-- START page --}
{exp:channel:entries
channel="pages"
disable="{global:disabled_params}"
{global:transcribe}
{global:cache_tag}}
{exp:stash:set name="content"}
content....
@litzinger
litzinger / librariesEE_Email.php
Last active October 6, 2015 03:27
Use hidden config, and actual CP setting in Email Configuration to send emails as whatever format the config value is set as. Ideal for sending notification emails as HTML.
function EE_initialize()
{
$config = array(
'protocol' => ( ! in_array( $this->EE->config->item('mail_protocol'), $this->_protocols)) ? 'mail' : $this->EE->config->item('mail_protocol'),
'charset' => ($this->EE->config->item('email_charset') == '') ? 'utf-8' : $this->EE->config->item('email_charset'),
'smtp_host' => $this->EE->config->item('smtp_server'),
'smtp_user' => $this->EE->config->item('smtp_username'),
'smtp_pass' => $this->EE->config->item('smtp_password'),
'mailtype' => $this->EE->config->item('mail_format')
);
@litzinger
litzinger / addon.php
Created June 29, 2012 20:21
ExpressionEngine file upload paths swapping method
<?php
/*
Usage
$mystring = $this->swap_file_tokens('{filedir_3}path/to/image.jpg');
echo $mystring;
returns: 'http://mysite.com/images/path/to/image.jpg';
$mystring = $this->swap_file_tokens('{filedir_3}path/to/image.jpg', 'server_path');
@litzinger
litzinger / gist:3086050
Created July 10, 2012 20:29
ProForm file download
<?php
// Call this in the sessions_end() hook in ext.ariba.php
private function _check_for_file_download()
{
$file = $this->EE->input->get('file_download');
$this->EE->config->_global_vars['global:download_file_url'] = FALSE;
if ($file AND $this->EE->input->get('file_step') == '1' /* Key to preventing redirect loop */)
@litzinger
litzinger / mod.tag.php.diff
Created July 10, 2012 21:03
Allow multiple entry ids to be used in the Tag tags method
*** Tag_4.1.1/EE2/system/expressionengine/third_party/tag/mod.tag.php 2012-04-16 12:50:20.000000000 -0500
--- www/third_party/tag/mod.tag.php 2012-07-10 15:58:15.000000000 -0500
***************
*** 818,824 ****
// Entry id
// ----------------------------------------
! if ( ctype_digit( ee()->TMPL->fetch_param('entry_id') ))
{
$this->entry_id = ee()->TMPL->fetch_param('entry_id');
@litzinger
litzinger / translations.html
Created July 13, 2012 14:48
MotionPoint example
<!-- mp_trans_remove_start="dk" --><h2>Only Ariba Combines the Best Spend Analysis with D&amp;B&rsquo;s Global Insights</h2>
<p>Controlling costs and risks would be easier if you had an insightful analysis of company-wide spending available on demand. But when all you have is a set of spreadsheets, trying to make sense of data cobbled together from here and there across your organization? Not so much.</p>
<p>Get Ariba Spend Visibility with D&amp;B. You&rsquo;ll have a clear, consolidated, and classified view of all your suppliers and spend, enriched by insights from D&amp;B&rsquo;s global database of more than 206 million suppliers. You&rsquo;ll make better buying decisions, negotiating from a well-informed position, because you&rsquo;ll know:</p>
<ul>
<li>
Your best savings opportunities</li>
<li>
The greatest risks in your supply chain</li>
<li>
How your spend compares to industry peers</li>
<?php
$this->EE->addon_settings = array(
1 => array( // site_id
'addon_name' => [json object]
),
2 => array(
'addon_name' => [json object]
)