public function process(&$row, $published, $params) { eFactory::getElxis()->user()->gid; if (eFactory::getElxis()->user()->gid == 7) { $regex = "#{plugin1}(.*?){/plugin1}#s"; if (!$published) { $row->text = preg_replace($regex, '', $row->text); return true; } preg_match_all($regex, $row->text, $matches, PREG_PATTERN_ORDER); if (!$matches) { return true; } foreach ($matches[0] as $i => $match) { $contents = $matches[1][$i]; $html = $contents; $row->text = preg_replace("#".$match."#", $html, $row->text); } return true; } else { $row->text = preg_replace($regex, '', $row->text); return; } }
public function process(&$row, $published, $params) { eFactory::getElxis()->user()->gid; if (eFactory::getElxis()->user()->gid <> 7) { $regex = "#{plugin2}(.*?){/plugin2}#s"; if (!$published) { $row->text = preg_replace($regex, '', $row->text); return true; } preg_match_all($regex, $row->text, $matches, PREG_PATTERN_ORDER); if (!$matches) { return true; } foreach ($matches[0] as $i => $match) { $contents = $matches[1][$i]; $html = $contents; $row->text = preg_replace("#".$match."#", $html, $row->text); } return true; } else { $row->text = preg_replace($regex, '', $row->text); return; } }
if (eFactory::getURI()->getUriString() == eFactory::getElxis()->getConfig('DEFAULT_ROUTE')) { // show a module in frontpage only to visitorsif ($elxis->user()->gid == 7) { $eDoc->modules('user5'); }}