Skip to content

Instantly share code, notes, and snippets.

View aboutwout's full-sized avatar

Wouter Vervloet aboutwout

View GitHub Profile
<a href="http://www.cloudvps.com" target="_blank" ><img height="33" src="http://www.cloudvps.com/files/styleguide/badge_availability.png" width="323" border="0" /></a>
@aboutwout
aboutwout / gist:1107954
Created July 26, 2011 20:40
Super secret EE conditional
{if in_group('1|7|8')}
<p><q>You shall not p... oh, you passed.</q></p>
{/if}
@aboutwout
aboutwout / gist:1107952
Created July 26, 2011 20:39
Super secret EE code
// /system/expressionengine/libraries/Template.php (line 3030)
// Member Group in_group('1') function, Super Secret! Shhhhh!
if (preg_match_all("/in_group\(([^\)]+)\)/", $str, $matches))
{
$groups = (is_array($this->EE->session->userdata['group_id'])) ? $this->EE->session->userdata['group_id'] : array($this->EE->session->userdata['group_id']);
for($i=0, $s=count($matches[0]); $i < $s; ++$i)
{
$check = explode('|', str_replace(array('"', "'"), '', $matches[1][$i]));
@aboutwout
aboutwout / gist:1107949
Created July 26, 2011 20:38
Simple EE conditional
{if logged_in_member_group == 1}
// Show something super secret only VIP member are allowed to see.
{/if}
@aboutwout
aboutwout / gist:1073112
Created July 9, 2011 00:11
Adding a hook in ExpressionEngine
<?php
if ($this->EE->extensions->active_hook('your_module_hook') === TRUE)
{
$edata = $this->EE->extensions->universal_call('your_module_hook', $this, $param1, $param2);
if ($this->EE->extensions->end_script === TRUE) return;
}
var shortName, version, displayName, maxSize;
$(function() {
init();
alert(shortName);
});
function init() {
var shortName, version, displayName, maxSize;
$(function() {
shortName = 'bla';
version = '1.0';
displayName = 'Bla';
maxSize = 5000;
move_on();
var shortName = '';
var version = '0';
var displayName = '';
var maxSize = 0;
$(function() {
shortName = 'bla';
version = 5;
displayName = 'Bla';