function cs_contentload($file) { global $account, $cs_main; if (empty($cs_main['public']) and $account['access_clansphere'] < $cs_main['maintenance_access']) { $file = 'mods/users/login.php'; } $content = str_replace(array('{', '}'), array('{', '}'), cs_filecontent($file)); $content = preg_replace_callback('/<script([^>]*?)>(.*?)<\\/script>/is', 'cs_revert_script_braces', $content); return cs_content_append($content); }
function cs_templatefile($matches) { $return = ''; $file = 'mods/' . $matches[0] . '/' . $matches[1] . '.php'; if (!file_exists($file)) { cs_error($file, 'cs_templatefile - File not found'); $match_count = count($matches); for ($i = 0; $i < $match_count; $i++) { $return .= 'm[' . $i . '] ' . $matches[$i] . ' - '; } return $return; } # only one get parameter is allowed $param = NULL; $value = NULL; if (!empty($matches[2])) { if (empty($matches[3]) and $pos = strpos($matches[2], '=')) { $matches[3] = substr($matches[2], $pos + 1); $matches[2] = substr($matches[2], 0, $pos); } $param = $matches[2]; $value = $matches[3]; } return cs_filecontent($file, $param, $value); }