本文整理汇总了PHP中cs_subtemplate函数的典型用法代码示例。如果您正苦于以下问题:PHP cs_subtemplate函数的具体用法?PHP cs_subtemplate怎么用?PHP cs_subtemplate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cs_subtemplate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cs_themebar
function cs_themebar($source, $string, $mod, $action)
{
global $cs_main, $account;
// themebar has some side-effects, so it is forbidden in a few mod/action combinations
$forbidden = array('abcode/sourcebox', 'errors/500', 'pictures/select', 'clansphere/debug', 'clansphere/navmeta', 'clansphere/themebar', 'clansphere/themebar_light');
if (!in_array($mod . '/' . $action, $forbidden)) {
// prevent from double inserting the xsrf protection key
$xsrf = $cs_main['xsrf_protection'];
$cs_main['xsrf_protection'] = false;
$data = array();
$data['data']['content'] = $string;
$data['raw']['target'] = 'themes/' . $cs_main['def_theme'] . '/' . $mod . '/' . $action . '.tpl';
$data['raw']['langfile'] = 'lang/' . $account['users_lang'] . '/' . $mod . '.php';
$phpsource = str_ireplace($cs_main['def_path'], '', $source);
$phpsource = str_replace('\\', '/', $phpsource);
$data['raw']['phpsource'] = ltrim($phpsource, '/');
// use lightweight version if explorer is not available
if (empty($account['access_explorer'])) {
$string = cs_subtemplate(__FILE__, $data, 'clansphere', 'themebar_light');
} else {
include_once 'mods/explorer/functions.php';
$data['link']['target'] = cs_explorer_path($data['raw']['target'], 'escape');
$data['link']['langfile'] = cs_explorer_path($data['raw']['langfile'], 'escape');
$data['link']['phpsource'] = cs_explorer_path($data['raw']['phpsource'], 'escape');
$string = cs_subtemplate(__FILE__, $data, 'clansphere', 'themebar');
}
// reset the xsrf protection option
$cs_main['xsrf_protection'] = $xsrf;
}
return $string;
}
示例2: cs_search
function cs_search($mod)
{
$cs_lang = cs_translate('search');
$data = array();
$data['search']['mod'] = $mod;
echo cs_subtemplate(__FILE__, $data, 'search', 'search_function');
}
示例3: cs_manage
function cs_manage($mod, $action, $def_mod, $def_action, $merge = array(), $head = array())
{
global $account, $cs_lang;
$merge = is_array($merge) ? $merge : array();
$show = $mod . '/' . $action;
if (empty($head['message'])) {
$head['message'] = '';
}
$data = array('head' => $head);
$data['content'] = array();
$options = array('info' => 0, 'size' => 48, 'theme' => '');
$options['theme'] = empty($account['users_view']) ? 'manage' : 'manage_' . $account['users_view'];
if ($account['users_view'] == 'list') {
$options['size'] = 16;
if ($show == 'clansphere/admin') {
$options['theme'] = 'manage_admin';
$options['info'] = 1;
}
}
$mod_array = cs_checkdirs('mods', $show);
$content = array_merge($merge, $mod_array);
ksort($content);
$loop = 0;
foreach ($content as $mod) {
if (!array_key_exists('dir', $mod)) {
$mod['dir'] = $def_mod;
}
if (!array_key_exists('file', $mod)) {
$mod['file'] = $def_action;
}
$acc_dir = 'access_' . $mod['dir'];
if (array_key_exists($acc_dir, $account) and $account[$acc_dir] >= $mod['show'][$show]) {
$cs_lap = cs_icon($mod['icon'], $options['size'], 0, 0);
$data['content'][$loop]['img_1'] = $cs_lap;
$data['content'][$loop]['txt_1'] = $mod['name'];
$data['content'][$loop]['link_1'] = cs_url($mod['dir'], $mod['file']);
if (!empty($options['info'])) {
if (file_exists('mods/' . $mod['dir'] . '/create.php')) {
$data['content'][$loop]['create_1'] = cs_link(cs_icon('editpaste', 16, $cs_lang['create']), $mod['dir'], 'create');
} else {
$data['content'][$loop]['create_1'] = '';
}
if (file_exists('mods/' . $mod['dir'] . '/manage.php')) {
$data['content'][$loop]['manage_1'] = cs_link(cs_icon('kfm', 16, $cs_lang['manage']), $mod['dir'], 'manage');
} else {
$data['content'][$loop]['manage_1'] = '';
}
if (file_exists('mods/' . $mod['dir'] . '/options.php')) {
$data['content'][$loop]['options_1'] = cs_link(cs_icon('package_settings', 16, $cs_lang['options']), $mod['dir'], 'options');
} else {
$data['content'][$loop]['options_1'] = '';
}
}
$loop++;
}
}
$data['head']['total'] = $loop;
return cs_subtemplate(__FILE__, $data, 'clansphere', $options['theme']);
}
示例4: cs_admin_menu
function cs_admin_menu()
{
global $cs_main, $account;
$cs_lang = cs_translate('clansphere');
$data = array();
$recent_mod = $cs_main['mod'];
$recent_action = $cs_main['action'];
$link_count = 0;
if (file_exists('mods/' . $recent_mod . '/manage.php') && $account['access_' . $recent_mod] >= 3) {
include $cs_main['def_path'] . '/mods/' . $recent_mod . '/info.php';
# look for sql table named like mod, else use first sql table given
$mod_tables = is_array($mod_info['tables']) ? $mod_info['tables'] : array();
if (in_array($recent_mod, $mod_tables)) {
$sql_table = $recent_mod;
} elseif (isset($mod_tables[0])) {
$sql_table = $mod_tables[0];
} else {
$sql_table = false;
}
$sql_count = empty($sql_table) ? '' : ' (' . cs_sql_count(__FILE__, $sql_table) . ')';
$link_count++;
$data['menu']['manage'] = $recent_action == 'manage' ? $cs_lang['manage'] : cs_link($cs_lang['manage'], $recent_mod, 'manage') . $sql_count;
$data['if']['manage'] = true;
} else {
$data['menu']['manage'] = '';
$data['if']['manage'] = false;
}
if (file_exists('mods/' . $recent_mod . '/create.php') && $account['access_' . $recent_mod] >= 3 && $recent_mod != 'shoutbox') {
$link_count++;
$data['menu']['create'] = $recent_action == 'create' ? $cs_lang['create'] : cs_link($cs_lang['create'], $recent_mod, 'create');
$data['if']['create'] = true;
} else {
$data['menu']['create'] = '';
$data['if']['create'] = false;
}
if (file_exists('mods/' . $recent_mod . '/options.php') && $account['access_' . $recent_mod] >= 5) {
$link_count++;
$data['menu']['options'] = $recent_action == 'options' ? $cs_lang['options'] : cs_link($cs_lang['options'], $recent_mod, 'options');
$data['if']['options'] = true;
} else {
$data['menu']['options'] = '';
$data['if']['options'] = false;
}
if ($link_count > 1) {
$data['links']['count'] = $link_count;
return cs_subtemplate(__FILE__, $data, 'clansphere', 'admin_menu');
}
}
示例5: cs_pictures_select
function cs_pictures_select($mod, $fid = 0)
{
settype($fid, 'integer');
$cs_lang = cs_translate('pictures');
$data = array();
if (empty($fid)) {
$data['if']['already'] = false;
} else {
$where = "pictures_mod = '" . $mod . "' AND pictures_fid = " . $fid;
$picture = cs_sql_select(__FILE__, 'pictures', 'pictures_file', $where);
if (empty($picture)) {
$data['if']['already'] = false;
} else {
$data['if']['already'] = true;
$data['picture']['file'] = $picture['pictures_file'];
}
}
$string = cs_subtemplate(__FILE__, $data, 'pictures', 'select');
return $string;
}
示例6: cs_categories_dropdown2
function cs_categories_dropdown2($mod, $categories_id = 0, $new = 1, $name = 'categories_id')
{
global $account;
$data = array();
$cells = 'categories_id, categories_name, categories_subid';
$categories = cs_sql_select(__FILE__, 'categories', $cells, "categories_mod = '" . $mod . "' AND categories_access <= '" . $account['access_news'] . "'", 'categories_subid ASC, categories_name', 0, 0);
$categories = cs_catsort($categories);
$data['categories']['options'] = '';
if (!empty($categories)) {
foreach ($categories as $cat) {
$blank = '';
if (!empty($cat['layer'])) {
for ($i = 0; $i < $cat['layer']; $i++) {
$blank .= ' ';
}
$blank .= '»';
}
$data['categories']['options'] .= cs_html_option($blank . $cat['categories_name'], $cat['categories_id'], $cat['categories_id'] == $categories_id);
}
}
$data['if']['new'] = !empty($new) ? TRUE : FALSE;
$data['dropdown']['name'] = $name;
return cs_subtemplate(__FILE__, $data, 'categories', 'cat_dropdown2');
}
示例7: cs_url
$data['maps']['action'] = cs_url('maps', 'edit');
$data['games'] = cs_sql_select(__FILE__, 'games', 'games_name,games_id', 0, 'games_name', 0, 0);
$data['games'] = cs_dropdownsel($data['games'], $data['maps']['games_id'], 'games_id');
$data['maps']['picture'] = empty($data['maps']['maps_picture']) ? '-' : cs_html_img('uploads/maps/' . $data['maps']['maps_picture']);
$matches[1] = $cs_lang['pic_infos'];
$return_types = '';
foreach ($img_filetypes as $add) {
$return_types .= empty($return_types) ? $add : ', ' . $add;
}
$matches[2] = $cs_lang['max_width'] . $options['max_width'] . ' px' . cs_html_br(1);
$matches[2] .= $cs_lang['max_height'] . $options['max_height'] . ' px' . cs_html_br(1);
$matches[2] .= $cs_lang['max_size'] . cs_filesize($options['max_size']) . cs_html_br(1);
$matches[2] .= $cs_lang['filetypes'] . $return_types;
$data['maps']['matches'] = cs_abcode_clip($matches);
$data['if']['picture_remove'] = !empty($data['maps']['maps_picture']) ? TRUE : FALSE;
echo cs_subtemplate(__FILE__, $data, 'maps', 'edit');
} else {
$cs_maps['games_id'] = (int) $_POST['games_id'];
$cs_maps['maps_name'] = $_POST['maps_name'];
$cs_maps['server_name'] = $_POST['server_name'];
$cs_maps['maps_text'] = $_POST['maps_text'];
$maps_id = (int) $_POST['maps_id'];
if (empty($_POST['pic_del']) and empty($files_gl['picture']['tmp_name'])) {
$cells = array_keys($cs_maps);
$values = array_values($cs_maps);
cs_sql_update(__FILE__, 'maps', $cells, $values, $maps_id);
} elseif (isset($_POST['pic_del']) and empty($files_gl['picture']['tmp_name'])) {
$select = cs_sql_select(__FILE__, 'maps', 'maps_picture', 'maps_id = \'' . $maps_id . '\'');
cs_unlink('maps', $select['maps_picture']);
$cs_maps['maps_picture'] = '';
$cells = array_keys($cs_maps);
示例8: cs_datereal
// ClanSphere 2010 - www.clansphere.net
// $Id$
$thisday = cs_datereal('m-d');
$output = array();
$data = array();
$data = cs_cache_load('navbirth');
$cs_lang = cs_translate('users');
$options = cs_sql_option(__FILE__, 'users');
if ($data['day'] != $thisday) {
$data['day'] = $thisday;
$select = 'users_id, users_nick, users_age';
$where = "users_age LIKE '%-" . $data['day'] . "' AND users_hidden NOT LIKE '%users_age%' AND users_active = 1";
$order = 'users_nick ASC';
$data['users'] = cs_sql_select(__FILE__, 'users', $select, $where, $order, 0, 0);
cs_cache_save('navbirth', $data);
}
if (empty($data['users'])) {
echo $cs_lang['no_data'];
} else {
$count = empty($options['navbirth_max_users']) ? count($data['users']) : min(count($data['users']), $options['navbirth_max_users']);
for ($run = 0; $run < $count; $run++) {
$birth = explode('-', $data['users'][$run]['users_age']);
$output['users'][$run]['age'] = cs_datereal('Y') - $birth[0];
$output['users'][$run]['day'] = $birth[2];
$output['users'][$run]['month'] = $birth[1];
$output['users'][$run]['year'] = $birth[0];
$output['users'][$run]['user'] = cs_user($data['users'][$run]['users_id'], $data['users'][$run]['users_nick']);
$output['users'][$run]['messageurl'] = cs_url('messages', 'create', 'to_id=' . $data['users'][$run]['users_id']);
}
echo cs_subtemplate(__FILE__, $output, 'users', 'navbirth');
}
示例9: cs_sql_select
}
if (cs_datereal('d') >= $birth[2] and cs_datereal('m') == $birth[1]) {
$age++;
}
$content .= ' (' . $age . ')';
$data['clans']['since'] = $content;
} else {
$data['clans']['since'] = '-';
}
$select = 'squads_name, games_id, squads_id';
$where = "clans_id = '" . $cs_clans_id . "'";
$cs_squads = cs_sql_select(__FILE__, 'squads', $select, $where, 'squads_order, squads_name', 0, 0);
$squads_loop = count($cs_squads);
$data['lang']['game'] = $cs_lang['game'];
$data['lang']['squads'] = $cs_lang[$op_squads['label']];
$data['lang']['members'] = $cs_lang[$op_members['label']];
if (empty($squads_loop)) {
$data['squads'] = '';
}
for ($run = 0; $run < $squads_loop; $run++) {
if (!empty($cs_squads[$run]['games_id'])) {
$data['squads'][$run]['game'] = cs_html_img('uploads/games/' . $cs_squads[$run]['games_id'] . '.gif');
} else {
$data['squads'][$run]['game'] = '';
}
$data['squads'][$run]['squads'] = cs_link(cs_secure($cs_squads[$run]['squads_name']), 'squads', 'view', 'id=' . $cs_squads[$run]['squads_id']);
$where = "squads_id='" . $cs_squads[$run]['squads_id'] . "'";
$data['squads'][$run]['members'] = cs_sql_count(__FILE__, 'members', $where);
}
echo cs_subtemplate(__FILE__, $data, 'clans', 'view');
示例10: elseif
} elseif (!empty($error)) {
$data['head']['body'] = $error;
} elseif (isset($_POST['preview'])) {
$data['head']['body'] = $cs_lang['preview'];
}
if (isset($_POST['preview']) and empty($error)) {
$data['if']['preview'] = TRUE;
$data['preview']['date'] = cs_date('unix', $history['history_time'], 1);
$cs_user = cs_sql_select(__FILE__, 'users', 'users_nick, users_active', "users_id = '" . $history['users_id'] . "'");
$data['preview']['user'] = cs_user($history['users_id'], $cs_user['users_nick'], $cs_user['users_active']);
$data['preview']['text'] = cs_secure($history['history_text'], 1, 1, 1, 1);
}
if (!empty($error) or !isset($_POST['submit']) or isset($_POST['preview'])) {
if (empty($cs_main['rte_html'])) {
$data['if']['no_rte_html'] = 1;
$data['history']['abcode_smileys'] = cs_abcode_smileys('history_text', 1);
$data['history']['abcode_features'] = cs_abcode_features('history_text', 1, 1);
$data['history']['text'] = $history['history_text'];
$data['if']['rte_html'] = 0;
} else {
$data['if']['rte_html'] = 1;
$data['if']['no_rte_html'] = 0;
$data['history']['rte_html'] = cs_rte_html('history_text', $history['history_text']);
}
echo cs_subtemplate(__FILE__, $data, 'history', 'create');
} else {
$history_cells = array_keys($history);
$history_save = array_values($history);
cs_sql_insert(__FILE__, 'history', $history_cells, $history_save);
cs_redirect($cs_lang['create_done'], 'history');
}
示例11: cs_translate
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('computers');
if (isset($_POST['submit'])) {
$save = array();
$save['max_width'] = (int) $_POST['max_width'];
$save['max_height'] = (int) $_POST['max_height'];
$save['max_size'] = (int) $_POST['max_size'];
require_once 'mods/clansphere/func_options.php';
cs_optionsave('computers', $save);
cs_redirect($cs_lang['changes_done'], 'options', 'roots');
} else {
$data = array();
$data['com'] = cs_sql_option(__FILE__, 'computers');
echo cs_subtemplate(__FILE__, $data, 'computers', 'options');
}
示例12: isset
$cs_gallery_pic['gallery_status'] = isset($_POST['gallery_status']) ? $_POST['gallery_status'] : 0;
$cs_gallery_pic['gallery_access'] = isset($_POST['gallery_access']) ? $_POST['gallery_access'] : 0;
$cs_gallery_pic['gallery_watermark'] = $_POST['gallery_watermark'];
if (!empty($_POST['gallery_watermark'])) {
$watermark_pos = $_POST['watermark_pos'];
$watermark_trans = $_POST['gallery_watermark_trans'];
$cs_gallery_pic['gallery_watermark_pos'] = $watermark_pos . '|--@--|' . $watermark_trans;
}
$extension = strlen(strrchr($name, "."));
$file = strlen($name);
$filename = substr($name, 0, $file - $extension);
$cs_gallery_pic['gallery_titel'] = $filename;
$cs_gallery_pic['gallery_time'] = cs_time();
$gallery_cells = array_keys($cs_gallery_pic);
$gallery_save = array_values($cs_gallery_pic);
cs_sql_insert(__FILE__, 'gallery', $gallery_cells, $gallery_save);
}
$data['pics'][$run]['img'] = cs_html_img('mods/gallery/image.php?picname=' . $name);
$data['pics'][$run]['name'] = $name;
}
}
}
cs_redirect($cs_lang['create_done'], 'gallery');
}
if (!isset($_POST['submit_1'])) {
if (!isset($_POST['submit']) or !empty($error)) {
$data['if']['start'] = TRUE;
}
}
echo cs_subtemplate(__FILE__, $data, 'gallery', 'manage_advanced');
示例13: cs_translate
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('count');
$start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start'];
$cs_sort[1] = 'count_time DESC';
$cs_sort[2] = 'count_time ASC';
$cs_sort[3] = 'count_id DESC';
$cs_sort[4] = 'count_id ASC';
$sort = empty($_REQUEST['sort']) ? 1 : $_REQUEST['sort'];
$order = $cs_sort[$sort];
$counter_count = cs_sql_count(__FILE__, 'count');
$data = array();
$data['head']['counter_count'] = $counter_count;
$data['head']['counter_pages'] = cs_pages('count', 'manage', $counter_count, $start);
$data['head']['message'] = cs_getmsg();
$data['sort']['count_time'] = cs_sort('count', 'manage', $start, 0, 1, $sort);
$data['sort']['count_id'] = cs_sort('count', 'manage', $start, 0, 3, $sort);
$cs_counter = cs_sql_select(__FILE__, 'count', '*', 0, $order, $start, $account['users_limit']);
$count_loop = count($cs_counter);
$data['count'] = array();
for ($run = 0; $run < $count_loop; $run++) {
$data['count'][$run]['count_id'] = $cs_counter[$run]['count_id'];
$data['count'][$run]['count_ip'] = $cs_counter[$run]['count_ip'];
$data['count'][$run]['count_locate'] = $cs_counter[$run]['count_location'];
$data['count'][$run]['count_time'] = cs_date('unix', $cs_counter[$run]['count_time'], 1);
}
echo cs_subtemplate(__FILE__, $data, 'count', 'manage');
示例14: make_folders_select
$data['folders']['select'] = make_folders_select('folders_id', $edit['folders_id'], $account['users_id'], 'usersgallery');
$data['access']['options'] = '';
$levels = 0;
while ($levels < 6) {
$edit['usersgallery_access'] == $levels ? $sel = 1 : ($sel = 0);
$data['access']['options'] .= cs_html_option($levels . ' - ' . $cs_lang['lev_' . $levels], $levels, $sel);
$levels++;
}
$data['status']['options'] = '';
$levels = 0;
while ($levels < 2) {
$edit['usersgallery_status'] == $levels ? $sel = 1 : ($sel = 0);
$data['status']['options'] .= cs_html_option($cs_lang['show_' . $levels], $levels, $sel);
$levels++;
}
$data['abcode']['smileys'] = cs_abcode_smileys('gallery_description');
$data['abcode']['features'] = cs_abcode_features('gallery_description');
$checked = 'checked="checked"';
$data['check']['newtime'] = empty($new_time) ? '' : $checked;
$data['check']['count'] = empty($gallery_count_reset) ? '' : $checked;
$data['hidden']['id'] = $gallery_id;
$data['data']['usersgallery_name'] = cs_secure($data['data']['usersgallery_name']);
$data['data']['usersgallery_titel'] = cs_secure($data['data']['usersgallery_titel']);
$data['data']['usersgallery_description'] = cs_secure($data['data']['usersgallery_description']);
echo cs_subtemplate(__FILE__, $data, 'usersgallery', 'users_edit');
} else {
$cells = array_keys($edit);
$save = array_values($edit);
cs_sql_update(__FILE__, 'usersgallery', $cells, $save, $gallery_id);
cs_redirect($cs_lang['changes_done'], 'usersgallery', 'center');
}
示例15: cs_html_select
}
$data['clans']['country'] .= cs_html_select(0) . ' ' . cs_html_img('symbols/countries/' . $cs_clans['clans_country'] . '.png', 11, 16, 'id="' . $el_id . '"');
$data['clans']['url'] = cs_secure($cs_clans['clans_url']);
$data['clans']['since'] = cs_dateselect('since', 'date', $cs_clans['clans_since']);
$data['clans']['password'] = cs_secure($cs_clans['clans_pwd']);
$data['users']['nick'] = $users_nick;
if (empty($cs_clans['clans_picture'])) {
$data['clans']['pic'] = $cs_lang['nopic'];
} else {
$place = 'uploads/clans/' . $cs_clans['clans_picture'];
$size = getimagesize($cs_main['def_path'] . '/' . $place);
$data['clans']['pic'] = cs_html_img($place, $size[1], $size[0]);
}
$matches[1] = $cs_lang['pic_infos'];
$return_types = '';
foreach ($img_filetypes as $add) {
$return_types .= empty($return_types) ? $add : ', ' . $add;
}
$matches[2] = $cs_lang['max_width'] . $op_clans['max_width'] . ' px' . cs_html_br(1);
$matches[2] .= $cs_lang['max_height'] . $op_clans['max_height'] . ' px' . cs_html_br(1);
$matches[2] .= $cs_lang['max_size'] . cs_filesize($op_clans['max_size']) . cs_html_br(1);
$matches[2] .= $cs_lang['filetypes'] . $return_types;
$data['clans']['clip'] = cs_abcode_clip($matches);
$data['data']['id'] = $clans_id;
echo cs_subtemplate(__FILE__, $data, 'clans', 'edit');
} else {
$clans_cells = array_keys($cs_clans);
$clans_save = array_values($cs_clans);
cs_sql_update(__FILE__, 'clans', $clans_cells, $clans_save, $clans_id);
cs_redirect($cs_lang['changes_done'], 'clans');
}