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
{% if entry.drinkAttributes.contains('alcoholic') %} | |
Alcoholic! | |
{% else %} | |
Not alcoholic | |
{% endif %} | |
<h2>Selected Attributes</h2> | |
<table> | |
{% for attr in entry.drinkAttributes %} | |
<tr> |
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
<input type="file" name="fieldname"> | |
<input type="hidden" name="fieldname_filedir" value="1"> |
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 (! defined('BASEPATH')) exit('No direct script access allowed'); | |
require_once PATH_THIRD.'matrix/config.php'; | |
/** | |
* Wygwam Custom Toolbar Button | |
* | |
* This is a sample extension that would add a plugin to Wygwam’s extraPlugins setting, |
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
In system/expressionengine/third_party/wygwam/ft.wygwam.php, find this in the beginning of the save() function: | |
// Clear out if just whitespace | |
if (! $data || preg_match('/^\s*(<\w+>\s*( )*\s*<\/\w+>|<br \/>)?\s*$/s', $data)) | |
{ | |
return ''; | |
} | |
And replace it with this: |
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
// Remove any <script> tags | |
// Go backwards to factor in nested script tags, e.g. <script>document.write('<script></script>')</script> | |
$offset = strlen($html) - 9; // Minimum match length is 9 chars (<script/>) | |
for ($offset; $offset >= 0; $offset--) | |
{ | |
$substr = substr($html, $offset); | |
if (preg_match('/^<script[^>]+?\/>|^<script(?:.|\s)*?\/script>/im', $substr, $match)) | |
{ | |
$html = substr($html, 0, $offset).substr($html, $offset+strlen($match[0])); | |
} |
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 | |
/** | |
* Get Upload Preferences (Cross-compatible between ExpressionEngine 2.0 and 2.4) | |
* @param int $group_id Member group ID specified when returning allowed upload directories only for that member group | |
* @param int $id Specific ID of upload destination to return | |
* @return array Result array of DB object, possibly merged with custom file upload settings (if on EE 2.4+) | |
*/ | |
function get_upload_preferences($group_id = NULL, $id = NULL) | |
{ |
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
// ------------------------------------------- | |
// Include the Sheet resources in PHP | |
// ------------------------------------------- | |
if (! class_exists('Assets_helper')) | |
{ | |
require PATH_THIRD.'assets/helper.php'; | |
} | |
$assets_helper = new Assets_helper; |
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
After clicking Changes > Install Terminal Utility…, add this to ~/.gitconfig: | |
[diff] | |
tool = changes-app | |
[difftool "changes-app"] | |
cmd = /usr/bin/chdiff $LOCAL $REMOTE | |
[difftool] |
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
/** | |
* tabfocus event plugin for jQuery | |
* | |
* Mimics the focus() event, except it's only | |
* called when focus wasn't assigned via a click | |
* | |
* ------------------------------------------- | |
* Usage | |
* ------------------------------------------- | |
* |
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
A Guide to Fieldtype Settings in EE2 | |
display_global_settings() | |
- $this->settings | |
- fieldtype's global settings | |
display_settings($data) | |
- $this->settings | |
- fieldtype's global settings |