Skip to content

Instantly share code, notes, and snippets.

@aboutwout
Created July 26, 2011 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aboutwout/1107952 to your computer and use it in GitHub Desktop.
Save aboutwout/1107952 to your computer and use it in GitHub Desktop.
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]));
$str = str_replace($matches[0][$i], (count(array_intersect($check, $groups)) > 0) ? 'TRUE' : 'FALSE', $str);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment