本文整理汇总了PHP中cot_inputbox函数的典型用法代码示例。如果您正苦于以下问题:PHP cot_inputbox函数的具体用法?PHP cot_inputbox怎么用?PHP cot_inputbox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cot_inputbox函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cot_redirect
cot_redirect($r_url);
exit;
}
$out['subtitle'] = $L['projects_edit_project_title'];
$out['head'] .= $R['code_noindex'];
$sys['sublocation'] = $structure['projects'][$item['item_cat']]['title'];
$mskin = cot_tplfile(array('projects', 'edit', $structure['projects'][$item['item_cat']]['tpl']));
/* === Hook === */
foreach (cot_getextplugins('projects.edit.main') as $pl) {
include $pl;
}
/* ===== */
$t = new XTemplate($mskin);
// Error and message handling
cot_display_messages($t);
$t->assign(array("PRJEDIT_FORM_SEND" => cot_url('projects', "m=edit&a=update&id=" . $item['item_id'] . "&r=" . $r), "PRJEDIT_FORM_ID" => $item['item_id'], "PRJEDIT_FORM_CAT" => cot_selectbox_structure('projects', $item['item_cat'], 'rcat'), "PRJEDIT_FORM_CATTITLE" => $structure['projects'][$item['item_cat']]['title'], "PRJEDIT_FORM_TYPETITLE" => is_array($projects_types) && !empty($item['item_type']) ? $projects_types[$item['item_type']] : '', "PRJEDIT_FORM_TYPE" => is_array($projects_types) ? cot_selectbox($item['item_type'] ? $item['item_type'] : $cfg['projects']['default_type'], 'rtype', array_keys($projects_types), array_values($projects_types)) : 'empty', "PRJEDIT_FORM_TITLE" => cot_inputbox('text', 'rtitle', $item['item_title'], 'size="56"'), "PRJEDIT_FORM_ALIAS" => cot_inputbox('text', 'ralias', $item['item_alias'], array('size' => '32', 'maxlength' => '255')), "PRJEDIT_FORM_TEXT" => cot_textarea('rtext', $item['item_text'], 10, 60, 'id="formtext"', $prjeditor ? 'input_textarea_' . $prjeditor : ''), "PRJEDIT_FORM_COST" => cot_inputbox('text', 'rcost', $item['item_cost'], 'size="10"'), "PRJEDIT_FORM_STATE" => $item['item_state'], "PRJEDIT_FORM_PARSER" => cot_selectbox($item['item_parser'], 'rparser', cot_get_parsers(), cot_get_parsers(), false), "PRJEDIT_FORM_DELETE" => cot_radiobox(0, 'rdelete', array(1, 0), array($L['Yes'], $L['No']))));
// Extra fields
foreach ($cot_extrafields[$db_projects] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('ritem' . $exfld['field_name'], $exfld, $item['item_' . $exfld['field_name']]);
$exfld_title = isset($L['projects_' . $exfld['field_name'] . '_title']) ? $L['projects_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$t->assign(array('PRJEDIT_FORM_' . $uname => $exfld_val, 'PRJEDIT_FORM_' . $uname . '_TITLE' => $exfld_title, 'PRJEDIT_FORM_EXTRAFLD' => $exfld_val, 'PRJEDIT_FORM_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.EXTRAFLD');
}
/* === Hook === */
foreach (cot_getextplugins('projects.edit.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN');
$module_body = $t->text('MAIN');
示例2: cot_redirect
cot_redirect($r_url);
exit;
}
$out['subtitle'] = $L['folio_edit_product_title'];
$out['head'] .= $R['code_noindex'];
$sys['sublocation'] = $structure['folio'][$item['item_cat']]['title'];
$mskin = cot_tplfile(array('folio', 'edit', $structure['folio'][$item['item_cat']]['tpl']));
/* === Hook === */
foreach (cot_getextplugins('folio.edit.main') as $pl) {
include $pl;
}
/* ===== */
$t = new XTemplate($mskin);
// Error and message handling
cot_display_messages($t);
$t->assign(array("PRDEDIT_FORM_SEND" => cot_url('folio', "m=edit&a=update&id=" . $item['item_id'] . "&r=" . $r), "PRDEDIT_FORM_ID" => $item['item_id'], "PRDEDIT_FORM_CAT" => cot_selectbox_structure('folio', $item['item_cat'], 'rcat'), "PRDEDIT_FORM_CATTITLE" => $structure['folio'][$item['item_cat']]['title'], "PRDEDIT_FORM_TITLE" => cot_inputbox('text', 'rtitle', $item['item_title'], 'size="56"'), "PRDEDIT_FORM_ALIAS" => cot_inputbox('text', 'ralias', $item['item_alias'], array('size' => '32', 'maxlength' => '255')), "PRDEDIT_FORM_TEXT" => cot_textarea('rtext', $item['item_text'], 10, 60, 'id="formtext"', $folioeditor ? 'input_textarea_' . $folioeditor : ''), "PRDEDIT_FORM_COST" => cot_inputbox('text', 'rcost', $item['item_cost'], 'size="10"'), "PRDEDIT_FORM_STATE" => $item['item_state'], "PRDEDIT_FORM_PARSER" => cot_selectbox($item['item_parser'], 'rparser', cot_get_parsers(), cot_get_parsers(), false), "PRDEDIT_FORM_DELETE" => cot_radiobox(0, 'rdelete', array(1, 0), array($L['Yes'], $L['No']))));
// Extra fields
foreach ($cot_extrafields[$db_folio] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('ritem' . $exfld['field_name'], $exfld, $item['item_' . $exfld['field_name']]);
$exfld_title = isset($L['folio_' . $exfld['field_name'] . '_title']) ? $L['folio_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$t->assign(array('PRDEDIT_FORM_' . $uname => $exfld_val, 'PRDEDIT_FORM_' . $uname . '_TITLE' => $exfld_title, 'PRDEDIT_FORM_EXTRAFLD' => $exfld_val, 'PRDEDIT_FORM_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.EXTRAFLD');
}
/* === Hook === */
foreach (cot_getextplugins('folio.edit.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN');
$module_body = $t->text('MAIN');
示例3: cot_poll_edit_form
/**
* Adds form for create/edit Poll
*
* @param int $id Poll ID or Poll Code if $type is not epmty or new for new Poll
* @param XTemplate $t Template
* @param string $block Poll block in Template
* @param string $type Poll type
* @return bool
* @global CotDB $db
*/
function cot_poll_edit_form($id, $t = '', $block = 'MAIN', $type = '')
{
$id = (int) $id;
global $db, $cfg, $db_polls, $db_polls_options, $poll_id, $R, $L, $poll_options, $poll_multiple, $poll_state, $poll_text;
if (gettype($t) != 'object') {
$t = new XTemplate(cot_tplfile('polls'));
$block = 'EDIT_POLL_FORM';
$poll_full_template = true;
}
$counter = 0;
$multiple = !empty($poll_multiple) ? true : false;
if (cot_error_found() && !empty($poll_options)) {
$id = (int) $poll_id;
foreach ($poll_options as $key => $val) {
if ($val != '') {
$counter++;
$t->assign('EDIT_POLL_OPTION_TEXT', cot_inputbox('text', 'poll_option[]', htmlspecialchars($val), 'size="40" maxlength="128"'));
$t->parse($block . ".OPTIONS");
}
}
} elseif ((int) $id > 0) {
$where = !$type ? "poll_id = " . (int) $id : "poll_type = '" . $db->prep($type) . "' AND poll_code = '{$id}'";
$sql = $db->query("SELECT * FROM {$db_polls} WHERE {$where} LIMIT 1");
if ($row = $sql->fetch()) {
$id = $row["poll_id"];
$poll_text = htmlspecialchars($row["poll_text"]);
$multiple = (bool) $row['poll_multiple'];
$sql1 = $db->query("SELECT * FROM {$db_polls_options} WHERE po_pollid = {$id} ORDER by po_id ASC");
while ($row1 = $sql1->fetch()) {
$counter++;
$t->assign('EDIT_POLL_OPTION_TEXT', cot_inputbox('text', 'poll_option[id' . $row1['po_id'] . ']', $row1['po_text'], 'size="40" maxlength="128"'));
$t->parse($block . ".OPTIONS");
}
$sql1->closeCursor();
}
}
while ($counter < 2) {
$counter++;
$t->assign('EDIT_POLL_OPTION_TEXT', cot_inputbox('text', 'poll_option[]', '', 'size="40" maxlength="128"'));
$t->parse($block . ".OPTIONS");
}
if ($counter < $cfg['polls']['max_options_polls']) {
$counter++;
$t->assign('EDIT_POLL_OPTION_TEXT', cot_inputbox('text', 'poll_option[]', '', 'size="40" maxlength="128"'));
$t->parse($block . ".OPTIONS");
}
if ((int) $id > 0) {
$t->assign(array('EDIT_POLL_LOCKED' => cot_checkbox($poll_state, 'poll_state', $L['Locked']), 'EDIT_POLL_RESET' => cot_checkbox(0, 'poll_reset', $L['Reset']), 'EDIT_POLL_DELETE' => cot_checkbox(0, 'poll_delete', $L['Delete']), 'EDIT_POLL_EDIT' => true));
$t->parse($block . ".EDIT");
}
$t->assign(array('EDIT_POLL_TEXT' => cot_inputbox('text', 'poll_text', $poll_text, 'size="64" maxlength="255"'), 'EDIT_POLL_IDFIELD' => cot_inputbox('hidden', 'poll_id', $id), 'EDIT_POLL_OPTIONSCOUNT' => $counter, 'EDIT_POLL_ID' => $id, 'EDIT_POLL_MULTIPLE' => cot_checkbox($multiple, 'poll_multiple', $L['polls_multiple'])));
if ($poll_full_template == true) {
$t->parse($block);
return $t->text($block);
}
return true;
}
示例4: cfg_password
function cfg_password($cfg_var, $minlength = 4)
{
if (!$minlength) {
$minlength = 4;
}
$value = $cfg_var['config_value'];
$var_name = $cfg_var['config_name'];
$type = 'password';
$attr = array('pattern' => '[^\\s]{' . $minlength . ',}');
$input_code = cot_inputbox($type, $var_name . '[0]', $value, $attr) . ' <br>Repeat password to change it:<br>' . cot_inputbox($type, $var_name . '[1]', '', $attr);
return $input_code;
}
示例5: form_structure_editor
function form_structure_editor($id)
{
global $cot_structure, $cot_extrafields, $db_structure, $structure, $L, $R;
$row = $cot_structure->category($id);
if (empty($row)) {
return null;
}
$ii++;
$structure_id = $row['structure_id'];
$structure_code = $row['structure_code'];
$n = $row['structure_area'];
$dozvil = $row['structure_count'] > 0 ? false : true;
$is_module = cot_module_active($n);
$t = new XTemplate(cot_tplfile('cateditor.admin.edit', 'plug'));
$t->assign(array('ADMIN_STRUCTURE_HEADER' => $row['structure_title'], 'ADMIN_STRUCTURE_DEL_URL' => $dozvil ? cot_confirm_url(cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&a=delete&id=' . $row['structure_id'] . '&' . cot_xg()), 'admin') : '', 'ADMIN_STRUCTURE_UPDATE_FORM_URL' => cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&id=' . $structure_id . '&a=update'), 'ADMIN_STRUCTURE_ID' => $row['structure_id'], 'ADMIN_STRUCTURE_CODE' => cot_inputbox('text', 'rstructurecode', $structure_code, 'size="10" maxlength="255"'), 'ADMIN_STRUCTURE_PATHFIELDIMG' => mb_strpos($row['structure_path'], '.') == 0 ? $R['admin_icon_join1'] : $R['admin_icon_join2'], 'ADMIN_STRUCTURE_PATH' => cot_inputbox('text', 'rstructurepath', $row['structure_path'], 'size="12" maxlength="255"'), 'ADMIN_STRUCTURE_TPL' => cot_inputbox('text', 'rstructuretpl', $row['structure_tpl'], 'size="10" maxlength="255"'), 'ADMIN_STRUCTURE_TITLE' => cot_inputbox('text', 'rstructuretitle', $row['structure_title'], 'size="32" maxlength="255"'), 'ADMIN_STRUCTURE_DESC' => cot_inputbox('text', 'rstructuredesc', $row['structure_desc'], 'size="64" maxlength="255"'), 'ADMIN_STRUCTURE_ICON' => cot_inputbox('text', 'rstructureicon', $row['structure_icon'], 'size="64" maxlength="128"'), 'ADMIN_STRUCTURE_LOCKED' => cot_checkbox($row['structure_locked'], 'rstructurelocked'), 'ADMIN_STRUCTURE_COUNT' => $row['structure_count'], 'ADMIN_STRUCTURE_PARENT' => $cot_structure->select($cot_structure->get_parent($id), 'rstructureparent', true, 'disabled="disabled"'), 'ADMIN_STRUCTURE_JUMPTO_URL' => cot_url($n, 'c=' . $structure_code), 'ADMIN_STRUCTURE_RIGHTS_URL' => $is_module ? cot_url('admin', 'm=rightsbyitem&ic=' . $n . '&io=' . $structure_code) : '', 'ADMIN_STRUCTURE_ODDEVEN' => cot_build_oddeven($ii)));
foreach ($cot_extrafields[$db_structure] as $exfld) {
$exfld_val = cot_build_extrafields('rstructure' . $exfld['field_name'], $exfld, $row['structure_' . $exfld['field_name']]);
$exfld_title = isset($L['structure_' . $exfld['field_name'] . '_title']) ? $L['structure_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$t->assign(array('ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) => $exfld_val, 'ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) . '_TITLE' => $exfld_title, 'ADMIN_STRUCTURE_EXTRAFLD' => $exfld_val, 'ADMIN_STRUCTURE_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.EXTRAFLD');
}
require_once cot_incfile('configuration');
$optionslist = cot_config_list($is_module ? 'module' : 'plug', $n, $structure_code);
/* === Hook - Part1 : Set === */
$extp = cot_getextplugins('admin.config.edit.loop');
/* ===== */
foreach ($optionslist as $row_c) {
list($title, $hint) = cot_config_titles($row_c['config_name'], $row_c['config_text']);
if ($row_c['config_type'] == COT_CONFIG_TYPE_SEPARATOR) {
$t->assign('ADMIN_CONFIG_FIELDSET_TITLE', $title);
$t->parse('MAIN.OPTIONS.CONFIG.ADMIN_CONFIG_ROW.ADMIN_CONFIG_FIELDSET_BEGIN');
} else {
$t->assign(array('ADMIN_CONFIG_ROW_CONFIG' => cot_config_input($row_c['config_name'], $row_c['config_type'], $row_c['config_value'], $row_c['config_variants']), 'ADMIN_CONFIG_ROW_CONFIG_TITLE' => $title, 'ADMIN_CONFIG_ROW_CONFIG_MORE_URL' => cot_url('admin', 'm=structure&n=' . $n . '&d=' . $durl . '&id=' . $structure_id . '&al=' . $structure_code . '&a=reset&v=' . $row_c['config_name'] . '&' . cot_xg()), 'ADMIN_CONFIG_ROW_CONFIG_MORE' => $hint));
/* === Hook - Part2 : Include === */
foreach ($extp as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.CONFIG.ADMIN_CONFIG_ROW.ADMIN_CONFIG_ROW_OPTION');
}
$t->parse('MAIN.CONFIG.ADMIN_CONFIG_ROW');
}
/* === Hook === */
foreach (cot_getextplugins('admin.config.edit.tags') as $pl) {
include $pl;
}
/* ===== */
$t->assign('CONFIG_HIDDEN', cot_inputbox('hidden', 'editconfig', $structure_code));
$t->parse('MAIN.CONFIG');
$t->parse('MAIN');
return $t->text('MAIN');
}
示例6: form_structure_new
function form_structure_new($parentid = '')
{
global $cot_structure, $cot_extrafields, $db_structure, $structure, $L, $R;
$t = new XTemplate(cot_tplfile('cateditor.admin.new', 'plug'));
$t->assign(array('ADMIN_STRUCTURE_URL_FORM_ADD' => cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&a=add'), 'ADMIN_STRUCTURE_CODE' => cot_inputbox('text', 'rstructurecode', null, 'size="16"'), 'ADMIN_STRUCTURE_PARENT' => $cot_structure->select($parentid, 'rstructureparent'), 'ADMIN_STRUCTURE_TITLE' => cot_inputbox('text', 'rstructuretitle', null, 'size="64" maxlength="100"'), 'ADMIN_STRUCTURE_DESC' => cot_inputbox('text', 'rstructuredesc', null, 'size="64" maxlength="255"'), 'ADMIN_STRUCTURE_ICON' => cot_inputbox('text', 'rstructureicon', null, 'size="64" maxlength="128"'), 'ADMIN_STRUCTURE_LOCKED' => cot_checkbox(null, 'rstructurelocked'), 'ADMIN_STRUCTURE_TPL' => cot_inputbox('text', 'rstructuretpl', null, 'size="10" maxlength="255"')));
// Extra fields
foreach ($cot_extrafields[$db_structure] as $exfld) {
$exfld_val = cot_build_extrafields('rstructure' . $exfld['field_name'], $exfld, null);
$exfld_title = isset($L['structure_' . $exfld['field_name'] . '_title']) ? $L['structure_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$t->assign(array('ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) => $exfld_val, 'ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) . '_TITLE' => $exfld_title, 'ADMIN_STRUCTURE_EXTRAFLD' => $exfld_val, 'ADMIN_STRUCTURE_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.EXTRAFLD');
}
$t->parse('MAIN');
return $t->text('MAIN');
}
示例7: cot_install_step2_tags
function cot_install_step2_tags()
{
global $t, $db_name;
$db_x = "flance_";
$t->assign(array('INSTALL_DB_X' => $db_x, 'INSTALL_DB_X_INPUT' => cot_inputbox('text', 'db_x', $db_x, 'size="32"'), 'INSTALL_DB_NAME_INPUT' => cot_inputbox('text', 'db_name', is_null($db_name) ? 'freelance' : $db_name, 'size="32"')));
}
示例8: cot_import
$rinput['type_title'] = cot_import($rtitle, 'D', 'TXT');
if (!empty($rinput['type_title'])) {
$db->update($db_projects_types, $rinput, "type_id=" . (int) $rid);
} else {
$db->delete($db_projects_types, "type_id=" . (int) $rid);
}
}
if (!empty($rdefault)) {
$db->update($db_config, array('config_value' => $rdefault), "config_name = ? \n\t\t\tAND config_cat = ?", array('default_type', 'projects'));
}
$cache && $cache->clear();
cot_redirect(cot_url('admin', 'm=projects&p=types&d=' . $d_url, '#footer', true));
exit;
}
$totalitems = $db->query("SELECT COUNT(*) FROM {$db_projects_types}")->fetchColumn();
$sql = $db->query("SELECT * FROM {$db_projects_types} ORDER by type_title ASC LIMIT {$d}, " . $cfg['maxrowsperpage']);
$pagenav = cot_pagenav('admin', 'm=projects&p=types', $d, $totalitems, $cfg['maxrowsperpage']);
$t = new XTemplate(cot_tplfile('projects.admin.types', 'module'));
$jj = 0;
while ($item = $sql->fetch()) {
$jj++;
$t->assign(array('TYPE_ROW_ID' => cot_inputbox('text', 'rtitle[' . $item['type_id'] . ']', $item['type_title']), 'TYPE_ROW_TITLE' => cot_inputbox('text', 'rtitle[' . $item['type_id'] . ']', $item['type_title']), 'TYPE_ROW_DEFAULT' => cot_radiobox($cfg['projects']['default_type'], 'rdefault', $item['type_id']), 'TYPE_ROW_DEL_URL' => cot_url('admin', 'm=projects&p=types&id=' . $item['type_id'] . '&a=delete'), 'TYPE_ROW_NUM' => $jj, 'TYPE_ROW_ODDEVEN' => cot_build_oddeven($jj)));
$t->parse("MAIN.ROWS");
}
if ($jj == 0) {
$t->parse("MAIN.NOROWS");
}
$t->assign(array("EDITFORM_ACTION_URL" => cot_url('admin', 'm=projects&p=types&a=edit&d=' . $d_url), "ADDFORM_ACTION_URL" => cot_url('admin', 'm=projects&p=types&a=add'), "PAGENAV_PAGES" => $pagenav['main'], "PAGENAV_PREV" => $pagenav['prev'], "PAGENAV_NEXT" => $pagenav['next'], "ADDFORM_TITLE" => cot_inputbox('text', 'rtitle', ''), "ADDFORM_DEFAULT" => cot_inputbox('checkbox', 'rdefault', 1)));
$t->parse("MAIN.ADDFORM");
$t->parse("MAIN");
$adminmain = $t->text("MAIN");
示例9: extension_loaded
$status['mysql'] = extension_loaded('pdo_mysql') ? $R['install_code_available'] : $R['install_code_not_available'];
$t->assign(array('INSTALL_AV_DIR' => $status['avatars_dir'], 'INSTALL_CACHE_DIR' => $status['cache_dir'], 'INSTALL_PFS_DIR' => $status['pfs_dir'], 'INSTALL_EXFLDS_DIR' => $status['exflds_dir'], 'INSTALL_PHOTOS_DIR' => $status['photos_dir'], 'INSTALL_THUMBS_DIR' => $status['thumbs_dir'], 'INSTALL_CONFIG' => $status['config'], 'INSTALL_CONFIG_SAMPLE' => $status['config_sample'], 'INSTALL_SQL_FILE' => $status['sql_file'], 'INSTALL_PHP_VER' => $status['php_ver'], 'INSTALL_MBSTRING' => $status['mbstring'], 'INSTALL_HASH' => $status['hash'], 'INSTALL_MYSQL' => $status['mysql']));
break;
case 2:
// Database form
$t->assign(array('INSTALL_DB_HOST' => is_null($db_host) ? $cfg['mysqlhost'] : $db_host, 'INSTALL_DB_PORT' => is_null($db_port) ? $cfg['mysqlport'] : $db_port, 'INSTALL_DB_USER' => is_null($db_user) ? $cfg['mysqluser'] : $db_user, 'INSTALL_DB_NAME' => is_null($db_name) ? $cfg['mysqldb'] : $db_name, 'INSTALL_DB_X' => $db_x, 'INSTALL_DB_HOST_INPUT' => cot_inputbox('text', 'db_host', is_null($db_host) ? $cfg['mysqlhost'] : $db_host, 'size="32"'), 'INSTALL_DB_PORT_INPUT' => cot_inputbox('text', 'db_port', is_null($db_port) ? $cfg['mysqlport'] : $db_port, 'size="32"'), 'INSTALL_DB_USER_INPUT' => cot_inputbox('text', 'db_user', is_null($db_user) ? $cfg['mysqluser'] : $db_user, 'size="32"'), 'INSTALL_DB_NAME_INPUT' => cot_inputbox('text', 'db_name', is_null($db_name) ? $cfg['mysqldb'] : $db_name, 'size="32"'), 'INSTALL_DB_PASS_INPUT' => cot_inputbox('password', 'db_pass', '', 'size="32"'), 'INSTALL_DB_X_INPUT' => cot_inputbox('text', 'db_x', $db_x, 'size="32"')));
break;
case 3:
// Settings
if ($_POST['step'] != 3 && !cot_check_messages()) {
$rtheme = $theme;
$rscheme = $scheme;
$rlang = $cfg['defaultlang'];
$cfg['mainurl'] = $site_url;
}
$t->assign(array('INSTALL_THEME_SELECT' => cot_selectbox_theme($rtheme, $rscheme, 'theme'), 'INSTALL_LANG_SELECT' => cot_selectbox_lang($rlang, 'lang'), 'INSTALL_COUNTRY_SELECT' => cot_selectbox_countries($user['country'], 'user_country'), 'INSTALL_MAINURL' => cot_inputbox('text', 'mainurl', $cfg['mainurl'], 'size="32"'), 'INSTALL_USERNAME' => cot_inputbox('text', 'user_name', $user['name'], 'size="32"'), 'INSTALL_PASS1' => cot_inputbox('password', 'user_pass', '', 'size="32"'), 'INSTALL_PASS2' => cot_inputbox('password', 'user_pass2', '', 'size="32"'), 'INSTALL_EMAIL' => cot_inputbox('text', 'user_email', $user['email'], 'size="32"')));
case 4:
// Extensions
cot_install_parse_extensions('Module', $default_modules, $selected_modules);
cot_install_parse_extensions('Plugin', $default_plugins, $selected_plugins);
// robots.txt
$robotsTxtFilePath = './robots.txt';
if (file_exists($robotsTxtFilePath) && is_writable($robotsTxtFilePath)) {
$robotsTxtFile = file_get_contents($robotsTxtFilePath);
$tmp = 'Host: ' . str_replace(array('http://', 'https://'), '', $cfg['mainurl']);
$robotsTxtFile = str_replace('# Host: http://your-domain.com', $tmp, $robotsTxtFile);
file_put_contents($robotsTxtFilePath, $robotsTxtFile);
}
break;
case 5:
// End credits
示例10: foreach
foreach (cot_getextplugins('market.list.query') as $pl) {
include $pl;
}
/* ===== */
$t = new XTemplate($mskin);
$where = $where ? 'WHERE ' . implode(' AND ', $where) : '';
$order = $order ? 'ORDER BY ' . implode(', ', $order) : '';
$totalitems = $db->query("SELECT COUNT(*) FROM {$db_market} AS m {$join_condition} \n\tLEFT JOIN {$db_users} AS u ON u.user_id=m.item_userid\n\t" . $where . "")->fetchColumn();
$sqllist = $db->query("SELECT m.*, u.* {$join_columns} \n\tFROM {$db_market} AS m {$join_condition}\n\tLEFT JOIN {$db_users} AS u ON u.user_id=m.item_userid \n\t" . $where . "\n\t" . $order . "\n\tLIMIT {$d}, " . $maxrowsperpage);
$pagenav = cot_pagenav('market', $list_url_path, $d, $totalitems, $maxrowsperpage);
$catpatharray[] = array(cot_url('market'), $L['market']);
if (!empty($c)) {
$catpatharray = array_merge($catpatharray, cot_structure_buildpath('market', $c));
}
$catpath = cot_breadcrumbs($catpatharray, $cfg['homebreadcrumb'], true);
$t->assign(array("SEARCH_ACTION_URL" => cot_url('market', '', '', true), "SEARCH_SQ" => cot_inputbox('text', 'sq', htmlspecialchars($sq), 'class="schstring"'), "SEARCH_CAT" => cot_market_selectcat($c, 'c'), "SEARCH_SORTER" => cot_selectbox($sort, "sort", array('', 'costasc', 'costdesc'), array($L['market_mostrelevant'], $L['market_costasc'], $L['market_costdesc']), false), "PAGENAV_PAGES" => $pagenav['main'], "PAGENAV_PREV" => $pagenav['prev'], "PAGENAV_NEXT" => $pagenav['next'], "PAGENAV_COUNT" => $totalitems, "CATALOG" => cot_build_structure_market_tree('', array($c), 0), "BREADCRUMBS" => $catpath, "CATTITLE" => !empty($c) ? $structure['market'][$c]['title'] : '', "CATDESC" => !empty($c) ? $structure['market'][$c]['desc'] : ''));
foreach ($cot_extrafields[$db_market] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields($exfld['field_name'], $exfld, $shfld[$exfld['field_name']]);
$exfld_title = isset($L['projects_' . $exfld['field_name'] . '_title']) ? $L['projects_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$t->assign(array('SEARCH_' . $uname => $exfld_val, 'SEARCH_' . $uname . '_TITLE' => $exfld_title));
}
/* === Hook === */
foreach (cot_getextplugins('market.list.search.tags') as $pl) {
include $pl;
}
/* ===== */
$sqllist_rowset = $sqllist->fetchAll();
$sqllist_idset = array();
foreach ($sqllist_rowset as $item) {
$sqllist_idset[$item['item_id']] = $item['item_alias'];
示例11: cot_comments_display
/**
* Generates comments display for a given item
*
* @param string $ext_name Module or plugin code
* @param string $code Item identifier
* @param string $cat Item category code (optional)
* @param bool $force_admin Enforces user to be administrator of comments for this item.
* E.g. to moderate his wall even if he is not a moderator
* @return string Rendered HTML output for comments
* @global CotDB $db
*/
function cot_comments_display($ext_name, $code, $cat = '', $force_admin = false)
{
global $db, $db_com, $db_users, $cfg, $usr, $L, $sys, $R, $env, $pg, $cot_extrafields, $cache, $structure;
// Check permissions and enablement
list($auth_read, $auth_write, $auth_admin) = cot_auth('plug', 'comments');
if ($auth_read && $auth_write && $force_admin) {
$auth_admin = true;
$_SESSION['cot_comments_force_admin'][$ext_name][$code] = true;
}
$enabled = cot_comments_enabled($ext_name, $cat, $code);
if (!$auth_read || !$enabled && !$auth_admin) {
return '';
}
$comments_join_columns = $comments_join_tables = $comments_join_where = '';
// Get the URL and parameters
$link_area = $env['ext'];
$link_params = $_GET;
if (defined('COT_PLUG')) {
$link_area = 'plug';
$link_params['e'] = $env['ext'];
}
if (isset($_GET['rwr'])) {
unset($link_params['rwr'], $link_params['e']);
}
$cot_com_back = array($link_area, $link_params);
$_SESSION['cot_com_back'][$ext_name][$cat][$code] = $cot_com_back;
$d_var = 'dcm';
list($pg, $d, $durl) = cot_import_pagenav($d_var, $cfg['plugin']['comments']['maxcommentsperpage']);
$d = empty($d) ? 0 : (int) $d;
if ($auth_write && $enabled) {
require_once cot_incfile('forms');
}
$t = new XTemplate(cot_tplfile('comments', 'plug'));
/* == Hook == */
foreach (cot_getextplugins('comments.main') as $pl) {
include $pl;
}
/* ===== */
$editor = cot::$cfg['plugin']['comments']['markup'] ? 'input_textarea_minieditor' : '';
$t->assign(array('COMMENTS_CODE' => $code, 'COMMENTS_FORM_SEND' => cot_url('plug', "e=comments&a=send&area={$ext_name}&cat={$cat}&item={$code}"), 'COMMENTS_FORM_AUTHOR' => $usr['id'] > 0 ? $usr['name'] : cot_inputbox('text', 'rname'), 'COMMENTS_FORM_AUTHORID' => $usr['id'], 'COMMENTS_FORM_TEXT' => $auth_write && $enabled ? cot_textarea('rtext', $rtext, 7, 120, '', $editor) . cot_inputbox('hidden', 'cb', base64_encode(serialize($cot_com_back))) : '', 'COMMENTS_DISPLAY' => $cfg['plugin']['comments']['expand_comments'] ? '' : 'none'));
if ($auth_write && $enabled) {
// Extra fields
if (!empty(cot::$extrafields[cot::$db->com])) {
foreach (cot::$extrafields[cot::$db->com] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('rcomments' . $exfld['field_name'], $exfld, $rcomments[$exfld['field_name']]);
$exfld_title = cot_extrafield_title($exfld, 'comments_');
$t->assign(array('COMMENTS_FORM_' . $uname => $exfld_val, 'COMMENTS_FORM_' . $uname . '_TITLE' => $exfld_title, 'COMMENTS_FORM_EXTRAFLD' => $exfld_val, 'COMMENTS_FORM_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('COMMENTS.COMMENTS_NEWCOMMENT.EXTRAFLD');
}
}
$allowed_time = cot_build_timegap($sys['now'] - $cfg['plugin']['comments']['time'] * 60, $sys['now']);
$com_hint = cot_rc('com_edithint', array('time' => $allowed_time));
/* == Hook == */
foreach (cot_getextplugins('comments.newcomment.tags') as $pl) {
include $pl;
}
/* ===== */
$usr['id'] == 0 && $t->parse('COMMENTS.COMMENTS_NEWCOMMENT.GUEST');
if ($usr['id'] == 0 && cot_check_messages() && $cache) {
if ($ext_name == 'page' && $cfg['cache_page']) {
$cache->page->clear('page/' . str_replace('.', '/', $structure['page'][$cat]['path']));
$cfg['cache_page'] = false;
}
}
cot_display_messages($t, 'COMMENTS.COMMENTS_NEWCOMMENT');
$t->assign('COMMENTS_FORM_HINT', $com_hint);
$t->parse('COMMENTS.COMMENTS_NEWCOMMENT');
} else {
$warning = $enabled ? $L['com_regonly'] : $L['com_closed'];
$t->assign('COMMENTS_CLOSED', $warning);
$t->parse('COMMENTS.COMMENTS_CLOSED');
}
$order = $cfg['plugin']['comments']['order'] == 'Chronological' ? 'ASC' : 'DESC';
$comments_order = "com_id {$order}";
/* == Hook == */
foreach (cot_getextplugins('comments.query') as $pl) {
include $pl;
}
/* ===== */
$sql = $db->query("SELECT c.*, u.* {$comments_join_columns}\n\t\tFROM {$db_com} AS c LEFT JOIN {$db_users} AS u ON u.user_id = c.com_authorid {$comments_join_tables}\n\t\tWHERE com_area = ? AND com_code = ? {$comments_join_where} ORDER BY {$comments_order} LIMIT ?, ?", array($ext_name, $code, (int) $d, (int) $cfg['plugin']['comments']['maxcommentsperpage']));
if ($sql->rowCount() > 0 && $enabled) {
$i = $d;
$kk = 0;
$totalitems = cot_comments_count($ext_name, $code);
/* === Hook - Part1 : Set === */
$extp = cot_getextplugins('comments.loop');
/* ===== */
foreach ($sql->fetchAll() as $row) {
//.........这里部分代码省略.........
示例12: cot_log
cot_log("Wrong validation URL", 'sec');
cot_redirect(cot_url('message', 'msg=157', '', true));
}
}
$mskin = cot_tplfile('users.register', 'module');
/* === Hook === */
foreach (cot_getextplugins('users.register.main') as $pl) {
include $pl;
}
/* ===== */
$out['subtitle'] = $L['aut_registertitle'];
$out['head'] .= $R['code_noindex'];
require_once $cfg['system_dir'] . '/header.php';
$t = new XTemplate($mskin);
require_once cot_incfile('forms');
$t->assign(array('USERS_REGISTER_TITLE' => $L['aut_registertitle'], 'USERS_REGISTER_SUBTITLE' => $L['aut_registersubtitle'], 'USERS_REGISTER_ADMINEMAIL' => $cot_adminemail, 'USERS_REGISTER_SEND' => cot_url('users', 'm=register&a=add'), 'USERS_REGISTER_USER' => cot_inputbox('text', 'rusername', $ruser['user_name'], array('size' => 24, 'maxlength' => 100)), 'USERS_REGISTER_EMAIL' => cot_inputbox('text', 'ruseremail', $ruser['user_email'], array('size' => 24, 'maxlength' => 64)), 'USERS_REGISTER_PASSWORD' => cot_inputbox('password', 'rpassword1', '', array('size' => 12, 'maxlength' => 32)), 'USERS_REGISTER_PASSWORDREPEAT' => cot_inputbox('password', 'rpassword2', '', array('size' => 12, 'maxlength' => 32)), 'USERS_REGISTER_COUNTRY' => cot_selectbox_countries($ruser['user_country'], 'rcountry'), 'USERS_REGISTER_TIMEZONE' => cot_selectbox_timezone($ruser['user_timezone'], 'rusertimezone'), 'USERS_REGISTER_GENDER' => cot_selectbox_gender($ruser['user_gender'], 'rusergender'), 'USERS_REGISTER_BIRTHDATE' => cot_selectbox_date(0, 'short', 'ruserbirthdate', cot_date('Y', $sys['now']), cot_date('Y', $sys['now']) - 100, false)));
// Extra fields
if (!empty(cot::$extrafields[cot::$db->users])) {
foreach (cot::$extrafields[cot::$db->users] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('ruser' . $exfld['field_name'], $exfld, $ruser['user_' . $exfld['field_name']]);
$exfld_title = cot_extrafield_title($exfld, 'user_');
$t->assign(array('USERS_REGISTER_' . $uname => $exfld_val, 'USERS_REGISTER_' . $uname . '_TITLE' => $exfld_title, 'USERS_REGISTER_EXTRAFLD' => $exfld_val, 'USERS_REGISTER_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.EXTRAFLD');
}
}
/* === Hook === */
foreach (cot_getextplugins('users.register.tags') as $pl) {
include $pl;
}
/* ===== */
示例13: cot_url
$t->assign(array('POST_FORM_ACTION' => cot_url('sbr', 'id=' . $id . '&num=' . $num . '&a=addpost'), 'POST_FORM_TO' => cot_selectbox($to, 'to', $R['sbr_posts_to_values'], $R['sbr_posts_to_titles'])));
cot_display_messages($t, 'MAIN.SBR.POSTS.POSTFORM');
$t->parse('MAIN.SBR.POSTS.POSTFORM');
$t->parse('MAIN.SBR.POSTS');
/* === Hook === */
foreach (cot_getextplugins('sbr.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.SBR');
}
if ($action == 'done') {
// Действие доступно только для заказчика
cot_block($role == 'employer');
$t->assign(array('STAGEDONE_FORM_ACTION' => cot_url('sbr', 'id=' . $id . '&num=' . $num . '&a=done'), 'STAGEDONE_FORM_TEXT' => cot_textarea('rtext', $rtext, 5, 80)));
cot_display_messages($t, 'MAIN.STAGEDONE');
$t->parse('MAIN.STAGEDONE');
}
if ($action == 'claim') {
$stage = $db->query("SELECT * FROM {$db_sbr_stages} WHERE stage_sid=" . $id . " AND stage_num=" . $num)->fetch();
cot_block(!empty($role) && $sbr['sbr_status'] == 'process' && $stage['stage_status'] == 'process');
$t->assign(array('CLAIM_FORM_ACTION' => cot_url('sbr', 'id=' . $id . '&num=' . $num . '&a=claim'), 'CLAIM_FORM_TEXT' => cot_textarea('rtext', $rtext, 5, 80)));
cot_display_messages($t, 'MAIN.CLAIM');
$t->parse('MAIN.CLAIM');
}
if ($action == 'decision') {
cot_block($usr['isadmin'] && $sbr['sbr_status'] == 'claim');
$t->assign(array('DECISION_FORM_ACTION' => cot_url('sbr', 'id=' . $id . '&num=' . $num . '&a=decision'), 'DECISION_FORM_TEXT' => cot_textarea('rdecisiontext', $rtext, 5, 80), 'DECISION_FORM_PAYPERFORMER' => cot_inputbox('text', 'payperformer', $payperformer), 'DECISION_FORM_PAYEMPLOYER' => cot_inputbox('text', 'payemployer', $payemployer)));
cot_display_messages($t, 'MAIN.DECISION');
$t->parse('MAIN.DECISION');
}
示例14: array
}
if (!cot_error_found()) {
$t->parse('MAIN.RESULTS');
}
$rs_url_path = array();
foreach ($rs as $k => $v) {
if (is_array($v)) {
foreach ($v as $sk => $sv) {
$rs_url_path['rs[' . $k . '][' . $sk . ']'] = $sv;
}
} else {
$rs_url_path['rs[' . $k . ']'] = $v;
}
}
$pagenav = cot_pagenav('plug', array('e' => 'search', 'sq' => $sq, 'tab' => $tab) + $rs_url_path, $d, array_sum($totalitems), $cfg_maxitems);
}
// Search title
$crumbs = array(array(cot_url('plug', 'e=search'), $L['plu_search']));
if (!empty($tab)) {
$crumbs[] = array(cot_url('plug', 'e=search&tab=' . $tab), $L['plu_tabs_' . $tab]);
}
$out['head'] .= $R['code_noindex'];
$search_subtitle = empty($tab) ? $L['plu_search'] : $L['plu_tabs_' . $tab] . ' - ' . $L['plu_search'];
$out['subtitle'] = empty($sq) ? $search_subtitle : htmlspecialchars(strip_tags($sq)) . ' - ' . $L['plu_result'];
$t->assign(array('PLUGIN_TITLE' => cot_breadcrumbs($crumbs, $cfg['breadcrumb'], true), 'PLUGIN_SEARCH_ACTION' => cot_url('plug', 'e=search&tab=' . $tab), 'PLUGIN_SEARCH_TEXT' => cot_inputbox('text', 'sq', htmlspecialchars($sq), 'size="32" maxlength="' . $cfg['plugin']['search']['maxsigns'] . '"'), 'PLUGIN_SEARCH_USER' => cot_inputbox('text', 'rs[setuser]', htmlspecialchars($rs['setuser']), 'class="userinput" size="32"'), 'PLUGIN_SEARCH_DATE_SELECT' => cot_selectbox($rs['setlimit'], 'rs[setlimit]', range(0, 5), array($L['plu_any_date'], $L['plu_last_2_weeks'], $L['plu_last_1_month'], $L['plu_last_3_month'], $L['plu_last_1_year'], $L['plu_need_datas']), false), 'PLUGIN_SEARCH_DATE_FROM' => cot_selectbox_date($rs['setfrom'], 'short', 'rfrom', cot_date('Y', $sys['now']) + 1), 'PLUGIN_SEARCH_DATE_TO' => cot_selectbox_date($rs['setto'], 'short', 'rto', cot_date('Y', $sys['now']) + 1), 'PLUGIN_SEARCH_FOUND' => array_sum($totalitems) > 0 ? array_sum($totalitems) : '', 'PLUGIN_PAGEPREV' => $pagenav['prev'], 'PLUGIN_PAGENEXT' => $pagenav['next'], 'PLUGIN_PAGENAV' => $pagenav['main']));
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('search.tags') as $pl) {
include $pl;
}
/* ===== */
示例15: cot_auth
if (empty($rpage['page_cat']) && !empty($c)) {
$rpage['page_cat'] = $c;
$usr['isadmin'] = cot_auth('page', $rpage['page_cat'], 'A');
}
$out['subtitle'] = $L['page_addsubtitle'];
$out['head'] .= $R['code_noindex'];
$sys['sublocation'] = $structure['page'][$c]['title'];
$mskin = cot_tplfile(array('page', 'add', $structure['page'][$rpage['page_cat']]['tpl']));
/* === Hook === */
foreach (cot_getextplugins('page.add.main') as $pl) {
include $pl;
}
/* ===== */
require_once $cfg['system_dir'] . '/header.php';
$t = new XTemplate($mskin);
$pageadd_array = array('PAGEADD_PAGETITLE' => $L['page_addtitle'], 'PAGEADD_SUBTITLE' => $L['page_addsubtitle'], 'PAGEADD_ADMINEMAIL' => "mailto:" . $cfg['adminemail'], 'PAGEADD_FORM_SEND' => cot_url('page', 'm=add&a=add&c=' . $c), 'PAGEADD_FORM_CAT' => cot_selectbox_structure('page', $rpage['page_cat'], 'rpagecat'), 'PAGEADD_FORM_CAT_SHORT' => cot_selectbox_structure('page', $rpage['page_cat'], 'rpagecat', $c), 'PAGEADD_FORM_KEYWORDS' => cot_inputbox('text', 'rpagekeywords', $rpage['page_keywords'], array('size' => '32', 'maxlength' => '255')), 'PAGEADD_FORM_METATITLE' => cot_inputbox('text', 'rpagemetatitle', $rpage['page_metatitle'], array('size' => '64', 'maxlength' => '255')), 'PAGEADD_FORM_METADESC' => cot_textarea('rpagemetadesc', $rpage['page_metadesc'], 2, 64, array('maxlength' => '255')), 'PAGEADD_FORM_ALIAS' => cot_inputbox('text', 'rpagealias', $rpage['page_alias'], array('size' => '32', 'maxlength' => '255')), 'PAGEADD_FORM_TITLE' => cot_inputbox('text', 'rpagetitle', $rpage['page_title'], array('size' => '64', 'maxlength' => '255')), 'PAGEADD_FORM_DESC' => cot_textarea('rpagedesc', $rpage['page_desc'], 2, 64, array('maxlength' => '255')), 'PAGEADD_FORM_AUTHOR' => cot_inputbox('text', 'rpageauthor', $rpage['page_author'], array('size' => '24', 'maxlength' => '100')), 'PAGEADD_FORM_OWNER' => cot_build_user($usr['id'], htmlspecialchars($usr['name'])), 'PAGEADD_FORM_OWNERID' => $usr['id'], 'PAGEADD_FORM_DATE' => cot_selectbox_date($sys['now'], 'long', 'rpagedate'), 'PAGEADD_FORM_BEGIN' => cot_selectbox_date($sys['now'], 'long', 'rpagebegin'), 'PAGEADD_FORM_EXPIRE' => cot_selectbox_date(0, 'long', 'rpageexpire'), 'PAGEADD_FORM_FILE' => cot_selectbox($rpage['page_file'], 'rpagefile', range(0, 2), array($L['No'], $L['Yes'], $L['Members_only']), false), 'PAGEADD_FORM_URL' => cot_inputbox('text', 'rpageurl', $rpage['page_url'], array('size' => '56', 'maxlength' => '255')), 'PAGEADD_FORM_SIZE' => cot_inputbox('text', 'rpagesize', $rpage['page_size'], array('size' => '56', 'maxlength' => '255')), 'PAGEADD_FORM_TEXT' => cot_textarea('rpagetext', $rpage['page_text'], 24, 120, '', 'input_textarea_editor'), 'PAGEADD_FORM_PARSER' => cot_selectbox($cfg['page']['parser'], 'rpageparser', $parser_list, $parser_list, false));
$t->assign($pageadd_array);
// Extra fields
foreach ($cot_extrafields[$db_pages] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('rpage' . $exfld['field_name'], $exfld, $rpage['page_' . $exfld['field_name']]);
$exfld_title = isset($L['page_' . $exfld['field_name'] . '_title']) ? $L['page_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$t->assign(array('PAGEADD_FORM_' . $uname => $exfld_val, 'PAGEADD_FORM_' . $uname . '_TITLE' => $exfld_title, 'PAGEADD_FORM_EXTRAFLD' => $exfld_val, 'PAGEADD_FORM_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.EXTRAFLD');
}
// Error and message handling
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('page.add.tags') as $pl) {
include $pl;
}