本文整理汇总了PHP中cot_textarea函数的典型用法代码示例。如果您正苦于以下问题:PHP cot_textarea函数的具体用法?PHP cot_textarea怎么用?PHP cot_textarea使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cot_textarea函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
示例2: 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');
示例3: XTemplate
}
/* ===== */
$t = new XTemplate($mskin);
if (!empty($uid)) {
$t->assign(cot_generate_usertags($uid, 'SBR_PERFORMER_'));
} else {
$t->assign('SBRADD_FORM_PERFORMER', cot_inputbox('text', 'rsbrperformer', $rsbrperformer, 'placeholder="' . $L['sbr_performer_placeholder'] . '"'));
}
if (!empty($pid)) {
$t->assign(cot_generate_projecttags($pid, 'SBR_PROJECT_'));
}
$patharray[] = array(cot_url('sbr'), $L['sbr']);
$patharray[] = array(cot_url('sbr', 'm=add&pid=' . $pid . '&uip=' . $uid), $L['sbr_addtitle']);
$t->assign(array('SBRADD_TITLE' => cot_breadcrumbs($patharray, $cfg['homebreadcrumb'], true), 'SBRADD_SUBTITLE' => $L['sbr_addtitle'], 'SBRADD_ADMINEMAIL' => "mailto:" . $cfg['adminemail'], 'SBRADD_FORM_SEND' => cot_url('sbr', 'm=add&pid=' . $pid . '&uid=' . $uid . '&a=add'), 'SBRADD_FORM_OWNER' => cot_build_user($usr['id'], htmlspecialchars($usr['name'])), 'SBRADD_FORM_OWNERID' => $usr['id'], 'SBRADD_FORM_MAINTITLE' => cot_inputbox('text', 'rsbrtitle', $rsbr['sbr_title'])));
for ($i = 1; $i <= $stagescount; $i++) {
$t->assign(array('STAGEADD_FORM_NUM' => $i, 'STAGEADD_FORM_TITLE' => cot_inputbox('text', 'rstagetitle[' . $i . ']', $rstagetitle[$i]), 'STAGEADD_FORM_TEXT' => cot_textarea('rstagetext[' . $i . ']', $rstagetext[$i], 10, 120, '', 'input_textarea'), 'STAGEADD_FORM_COST' => cot_inputbox('text', 'rstagecost[' . $i . ']', $rstagecost[$i], array('class' => 'stagecost', 'size' => '10', 'maxlength' => '100')), 'STAGEADD_FORM_DAYS' => cot_inputbox('text', 'rstagedays[' . $i . ']', $rstagedays[$i], array('size' => '10', 'maxlength' => '100'))));
/* === Hook === */
foreach (cot_getextplugins('sbr.add.stages.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.STAGE_ROW');
}
// Extra fields
foreach ($cot_extrafields[$db_sbr] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('rsbr' . $exfld['field_name'], $exfld, $rsbr['sbr_' . $exfld['field_name']]);
$exfld_title = isset($L['sbr_' . $exfld['field_name'] . '_title']) ? $L['sbr_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$t->assign(array('SBRADD_FORM_' . $uname => $exfld_val, 'SBRADD_FORM_' . $uname . '_TITLE' => $exfld_title, 'SBRADD_FORM_EXTRAFLD' => $exfld_val, 'SBRADD_FORM_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.EXTRAFLD');
}
示例4: foreach
// Extrafields
if (!empty(cot::$extrafields[cot::$db->contact])) {
foreach (cot::$extrafields[cot::$db->contact] as $exfld) {
$tag = mb_strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields_data('contact', $exfld, $row['contact_' . $exfld['field_name']]);
$exfld_title = cot_extrafield_title($exfld, 'contact_');
$tuman->assign(array('CONTACT_' . $tag . '_TITLE' => $exfld_title, 'CONTACT_' . $tag => $exfld_val, 'CONTACT_' . $tag . '_VALUE' => $row['contact_' . $exfld['field_name']], 'CONTACT_EXTRAFLD_TITLE' => $exfld_title, 'CONTACT_EXTRAFLD' => $exfld['field_type'] == 'file' ? cot_rc_link($cfg['extrafield_files_dir'] . '/' . $exfld_val, $exfld_val) : $exfld_val, 'CONTACT_EXTRAFLD_VALUE' => $row['contact_' . $exfld['field_name']]));
$tuman->parse('MAIN.DATA.EXTRAFLD');
}
}
$tuman->parse('MAIN.DATA');
}
$sql->closeCursor();
if ($a == '' && !empty($id)) {
$row = $db->query("SELECT * FROM " . cot::$db->contact . " WHERE contact_id = {$id}")->fetch();
$tuman->assign(array('CONTACT_DATE' => cot_date('date_full', $row['contact_date']), 'CONTACT_DATE_STAMP' => $row['contact_date'], 'CONTACT_USER' => $row['contact_authorid'] > 0 ? cot_build_user($row['contact_authorid'], $row['contact_author']) : $row['contact_author'], 'CONTACT_EMAIL' => $row['contact_email'], 'CONTACT_ID' => $row['contact_id'], 'CONTACT_DELLINK' => cot_url('admin', 'm=other&p=contact&a=del&id=' . $row['contact_id']), 'CONTACT_VAL' => $row['contact_val'] == 1 ? 'unval' : 'val', 'CONTACT_VALLINK' => cot_url('admin', 'm=other&p=contact&a=' . $val . '&id=' . $row['contact_id']), 'CONTACT_READLINK' => cot_url('admin', 'm=other&p=contact&a=val&id=' . $row['contact_id']), 'CONTACT_UNREADLINK' => cot_url('admin', 'm=other&p=contact&a=unval&id=' . $row['contact_id']), 'CONTACT_SUBJECT' => $row['contact_subject'], 'CONTACT_TEXT' => $row['contact_text'], 'CONTACT_REPLY' => $row['contact_reply'], 'CONTACT_FORM_SEND' => cot_url("admin", 'm=other&p=contact&a=send&id=' . $row['contact_id']), 'CONTACT_FORM_TEXT' => cot_textarea('rtext', $rtext, 8, 64)));
// Extrafields
if (!empty(cot::$extrafields[cot::$db->contact])) {
foreach (cot::$extrafields[cot::$db->contact] as $exfld) {
$tag = mb_strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields_data('contact', $exfld, $row['contact_' . $exfld['field_name']]);
$exfld_title = cot_extrafield_title($exfld, 'contact_');
$tuman->assign(array('CONTACT_' . $tag . '_TITLE' => $exfld_title, 'CONTACT_' . $tag => $exfld_val, 'CONTACT_' . $tag . '_VALUE' => $row['contact_' . $exfld['field_name']], 'CONTACT_EXTRAFLD_TITLE' => $exfld_title, 'CONTACT_EXTRAFLD' => $exfld['field_type'] == 'file' ? cot_rc_link($cfg['extrafield_files_dir'] . '/' . $exfld_val, $exfld_val) : $exfld_val, 'CONTACT_EXTRAFLD_VALUE' => $row['contact_' . $exfld['field_name']]));
$tuman->parse('MAIN.VIEW.EXTRAFLD');
}
}
$tuman->parse('MAIN.VIEW');
}
cot_display_messages($tuman);
$tuman->assign(array('CONTACT_PAGINATION' => $pagnav['main'], 'CONTACT_PREV' => $pagenav['prev'], 'CONTACT_NEXT' => $pagenav['next']));
$tuman->parse('MAIN');
示例5: cot_tplfile
if (empty($ritem['item_type']) && !empty($type)) {
$ritem['item_type'] = $type;
}
$out['subtitle'] = $L['projects_add_project_title'];
$out['head'] .= $R['code_noindex'];
$sys['sublocation'] = $structure['projects'][$c]['title'];
$mskin = cot_tplfile(array('projects', 'add', $structure['projects'][$ritem['item_cat']]['tpl']));
/* === Hook === */
foreach (cot_getextplugins('projects.add.main') as $pl) {
include $pl;
}
/* ===== */
$t = new XTemplate($mskin);
// Error and message handling
cot_display_messages($t);
$t->assign(array("PRJADD_FORM_SEND" => cot_url('projects', 'm=add&c=' . $c . '&type=' . $type . '&a=add'), "PRJADD_FORM_CAT" => cot_selectbox_structure('projects', $ritem['item_cat'], 'rcat'), "PRJADD_FORM_CATTITLE" => !empty($c) ? $structure['projects'][$c]['title'] : '', "PRJADD_FORM_TYPE" => is_array($projects_types) ? cot_selectbox($ritem['item_type'] ? $ritem['item_type'] : $cfg['projects']['default_type'], 'rtype', array_keys($projects_types), array_values($projects_types)) : 'empty', "PRJADD_FORM_TYPETITLE" => is_array($projects_types) && !empty($type) ? $projects_types[$type] : '', "PRJADD_FORM_TITLE" => cot_inputbox('text', 'rtitle', $ritem['item_title'], 'size="56"'), "PRJADD_FORM_ALIAS" => cot_inputbox('text', 'ralias', $ritem['item_alias'], array('size' => '32', 'maxlength' => '255')), "PRJADD_FORM_TEXT" => cot_textarea('rtext', $ritem['item_text'], 10, 60, 'id="formtext"', $prjeditor ? 'input_textarea_' . $prjeditor : ''), "PRJADD_FORM_COST" => cot_inputbox('text', 'rcost', $ritem['item_cost'], 'size="10"'), "PRJADD_FORM_PARSER" => cot_selectbox($cfg['projects']['parser'], 'rparser', $parser_list, $parser_list, false)));
// Extra fields
foreach ($cot_extrafields[$db_projects] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('ritem' . $exfld['field_name'], $exfld, $ritem['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('PRJADD_FORM_' . $uname => $exfld_val, 'PRJADD_FORM_' . $uname . '_TITLE' => $exfld_title, 'PRJADD_FORM_EXTRAFLD' => $exfld_val, 'PRJADD_FORM_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.EXTRAFLD');
}
/* === Hook === */
foreach (cot_getextplugins('projects.add.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN');
$module_body = $t->text('MAIN');
示例6: cot_tplfile
$mskin = cot_tplfile(array('forums', 'editpost', $structure['forums'][$s]['tpl']));
$t = new XTemplate($mskin);
cot_display_messages($t);
if ($db->query("SELECT fp_id FROM {$db_forum_posts} WHERE fp_topicid = {$q} ORDER BY fp_id ASC LIMIT 1")->fetchColumn() == $p) {
$t->assign(array('FORUMS_EDITPOST_TOPICTITTLE' => cot_inputbox('text', 'rtopictitle', $rowt['ft_title'], array('size' => 56, 'maxlength' => 255)), 'FORUMS_EDITPOST_TOPICDESCRIPTION' => cot_inputbox('text', 'rtopicdesc', $rowt['ft_desc'], array('size' => 56, 'maxlength' => 255))));
// Extra fields
foreach ($cot_extrafields[$db_forum_topics] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('rtopic' . $exfld['field_name'], $exfld, $rowt['ft_' . $exfld['field_name']]);
$exfld_title = isset($L['forums_topics_' . $exfld['field_name'] . '_title']) ? $L['forums_topics_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$t->assign(array('FORUMS_EDITPOST_TOPIC_' . $uname => $exfld_val, 'FORUMS_EDITPOST_TOPIC_' . $uname . '_TITLE' => $exfld_title, 'FORUMS_EDITPOST_TOPIC_EXTRAFLD' => $exfld_val, 'FORUMS_EDITPOST_TOPIC_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.FORUMS_EDITPOST_FIRSTPOST.TOPIC_EXTRAFLD');
}
$t->parse('MAIN.FORUMS_EDITPOST_FIRSTPOST');
}
$t->assign(array('FORUMS_EDITPOST_PAGETITLE' => $toptitle, 'FORUMS_EDITPOST_SUBTITLE' => $L['forums_postedby'] . ": <a href=\"users.php?m=details&id=" . $rowpost['fp_posterid'] . "\">" . $rowpost['fp_postername'] . "</a> @ " . cot_date('datetime_medium', $rowpost['fp_updated']), 'FORUMS_EDITPOST_UPDATED' => cot_date('datetime_medium', $rowpost['fp_updated']), 'FORUMS_EDITPOST_UPDATED_STAMP' => $rowpost['fp_updated'], 'FORUMS_EDITPOST_SEND' => cot_url('forums', "m=editpost&a=update&s=" . $s . "&q=" . $q . "&p=" . $p . '&d=' . $durl . "&" . cot_xg()), 'FORUMS_EDITPOST_TEXT' => cot_textarea('rmsgtext', $rowpost['fp_text'], 20, 56, '', 'input_textarea_' . $minimaxieditor), 'FORUMS_EDITPOST_EDITTIMEOUT' => cot_build_timegap(0, $cfg['forums']['edittimeout'] * 3600)));
// Extra fields
foreach ($cot_extrafields[$db_forum_posts] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('rmsg' . $exfld['field_name'], $exfld, $rowpost['fp_' . $exfld['field_name']]);
$exfld_title = isset($L['forums_posts_' . $exfld['field_name'] . '_title']) ? $L['forums_posts_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$t->assign(array('FORUMS_EDITPOST_' . $uname => $exfld_val, 'FORUMS_EDITPOST_' . $uname . '_TITLE' => $exfld_title, 'FORUMS_EDITPOST_EXTRAFLD' => $exfld_val, 'FORUMS_EDITPOST_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.EXTRAFLD');
}
/* === Hook === */
foreach (cot_getextplugins('forums.editpost.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN');
$t->out('MAIN');
示例7: cot_breadcrumbs
}
$toptitle = cot_breadcrumbs(cot_forums_buildpath($s), $cfg['homebreadcrumb']);
$toptitle .= $usr['isadmin'] ? $R['forums_code_admin_mark'] : '';
$sys['sublocation'] = $structure['forums'][$s]['title'];
$out['subtitle'] = $L['forums_newtopic'];
$out['head'] .= $R['code_noindex'];
/* === Hook === */
foreach (cot_getextplugins('forums.newtopic.main') as $pl) {
include $pl;
}
/* ===== */
require_once cot_incfile('forms');
require_once $cfg['system_dir'] . '/header.php';
$mskin = cot_tplfile(array('forums', 'newtopic', $structure['forums'][$s]['tpl']));
$t = new XTemplate($mskin);
$t->assign(array('FORUMS_NEWTOPIC_PAGETITLE' => $toptitle, 'FORUMS_NEWTOPIC_SUBTITLE' => htmlspecialchars(cot_parse_autourls($structure['forums'][$s]['desc'])), 'FORUMS_NEWTOPIC_SEND' => cot_url('forums', "m=newtopic&a=newtopic&s=" . $s), 'FORUMS_NEWTOPIC_TITLE' => cot_inputbox('text', 'rtopictitle', $rtopic['ft_title'], array('size' => 56, 'maxlength' => 255)), 'FORUMS_NEWTOPIC_DESC' => cot_inputbox('text', 'rtopicdesc', $rtopic['ft_desc'], array('size' => 56, 'maxlength' => 255)), 'FORUMS_NEWTOPIC_TEXT' => cot_textarea('rmsgtext', $rmsg['fp_text'], 20, 56, '', 'input_textarea_' . $minimaxieditor), 'FORUMS_NEWTOPIC_EDITTIMEOUT' => cot_build_timegap(0, $cfg['forums']['edittimeout'] * 3600)));
// Extra fields
foreach ($cot_extrafields[$db_forum_posts] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('rmsg' . $exfld['field_name'], $exfld, $rmsg['fp_' . $exfld['field_name']]);
$exfld_title = isset($L['forums_posts_' . $exfld['field_name'] . '_title']) ? $L['forums_posts_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$t->assign(array('FORUMS_NEWTOPIC_' . $uname => $exfld_val, 'FORUMS_NEWTOPIC_' . $uname . '_TITLE' => $exfld_title, 'FORUMS_NEWTOPIC_EXTRAFLD' => $exfld_val, 'FORUMS_NEWTOPIC_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.EXTRAFLD');
}
// Extra fields
foreach ($cot_extrafields[$db_forum_topics] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('rtopic' . $exfld['field_name'], $exfld, $rtopic['ft_' . $exfld['field_name']]);
$exfld_title = isset($L['forums_topics_' . $exfld['field_name'] . '_title']) ? $L['forums_topics_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$t->assign(array('FORUMS_NEWTOPIC_TOPIC_' . $uname => $exfld_val, 'FORUMS_NEWTOPIC_TOPIC_' . $uname . '_TITLE' => $exfld_title, 'FORUMS_NEWTOPIC_TOPIC_EXTRAFLD' => $exfld_val, 'FORUMS_NEWTOPIC_TOPIC_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.TOPIC_EXTRAFLD');
示例8: editAction
//.........这里部分代码省略.........
}
}
// Сохранение
if ($act == 'save') {
unset($_POST['id'], $_POST['user'], $_POST['x'], $_POST['act']);
/* === Hook === */
foreach (cot_getextplugins('subscribe.admin.save.first') as $pl) {
include $pl;
}
/* ===== */
$data = $_POST;
$data['next_run'] = cot_import_date('next_run');
if (!empty($data['next_run'])) {
$data['next_run'] = date('Y-m-d H:i:s', $data['next_run']);
}
$item->setData($data);
/* === Hook === */
foreach (cot_getextplugins('subscribe.admin.save.validate') as $pl) {
include $pl;
}
/* ===== */
// There is some errors
if (!$item->validate() || cot_error_found()) {
$urlParams = array('m' => 'subscribe', 'a' => 'edit');
if ($item->id > 0) {
$urlParams['id'] = $item->id;
}
cot_redirect(cot_url('admin', $urlParams, '', true));
}
$isNew = $item->id == 0;
// Перерасчет времени следующего запуска
// Делать это в админке при редактировании рассылки и при выполнении рассылки
// А то могут быть коллизии
$recalculate = true;
if (!empty($item->next_run)) {
$tmp = strtotime($item->next_run);
if ($tmp > cot::$sys['now']) {
$recalculate = false;
}
}
if ($recalculate) {
$item->next_run = $item->getNextRunDate();
}
// Сохранение
if ($item->save()) {
cot_message(cot::$L['Saved']);
$urlParams = array('m' => 'subscribe', 'a' => 'edit', 'id' => $item->id);
$redirectUrl = cot_url('admin', $urlParams, '', true);
/* === Hook === */
foreach (cot_getextplugins('subscribe.admin.save.done') as $pl) {
include $pl;
}
/* ===== */
// Редирект на станицу рассылки
cot_redirect($redirectUrl);
}
}
// 'input_textarea_editor', 'input_textarea_medieditor', 'input_textarea_minieditor', ''
$editor = 'input_textarea_editor';
/* === Hook === */
foreach (cot_getextplugins('subscribe.admin.edit.main') as $pl) {
include $pl;
}
/* ===== */
$nextRun = 0;
if (!empty($item->next_run)) {
$nextRun = strtotime($item->next_run);
}
$formElements = array('hidden' => array('element' => cot_inputbox('hidden', 'act', 'save')), 'title' => array('element' => cot_inputbox('text', 'title', $item->rawValue('title')), 'required' => true, 'label' => subscribe_model_Subscribe::fieldLabel('title')), 'alias' => array('element' => cot_inputbox('text', 'alias', $item->rawValue('alias')), 'label' => subscribe_model_Subscribe::fieldLabel('alias')), 'admin_note' => array('element' => cot_textarea('admin_note', $item->rawValue('admin_note'), 5, 120, ''), 'label' => subscribe_model_Subscribe::fieldLabel('admin_note')), 'from_mail' => array('element' => cot_inputbox('text', 'from_mail', $item->rawValue('from_mail')), 'label' => subscribe_model_Subscribe::fieldLabel('from_mail'), 'hint' => cot::$L['subscribe_from_mail_hint']), 'from_title' => array('element' => cot_inputbox('text', 'from_title', $item->rawValue('from_title')), 'label' => subscribe_model_Subscribe::fieldLabel('from_title')), 'subject' => array('element' => cot_inputbox('text', 'subject', $item->rawValue('subject')), 'label' => subscribe_model_Subscribe::fieldLabel('subject')), 'description' => array('element' => cot_textarea('description', $item->rawValue('description'), 5, 120, '', $editor), 'label' => subscribe_model_Subscribe::fieldLabel('description')), 'content_url' => array('element' => cot_inputbox('text', 'content_url', $item->rawValue('content_url')), 'label' => subscribe_model_Subscribe::fieldLabel('content_url'), 'hint' => cot::$L['subscribe_content_url_hint']), 'text' => array('element' => cot_textarea('text', $item->rawValue('text'), 5, 120, '', $editor), 'label' => subscribe_model_Subscribe::fieldLabel('text'), 'hint' => cot::$L['subscribe_text_hint']), 'next_run' => array('element' => cot_selectbox_date($nextRun, 'long', 'next_run'), 'label' => subscribe_model_Subscribe::fieldLabel('next_run'), 'hint' => cot::$L['subscribe_next_run_hint'] . " " . cot::$usr['timetext']), 'sched_mday' => array('element' => cot_inputbox('text', 'sched_mday', $item->rawValue('sched_mday')), 'label' => subscribe_model_Subscribe::fieldLabel('sched_mday'), 'hint' => cot::$L['subscribe_sched_mday_hint']), 'sched_wday' => array('element' => cot_inputbox('text', 'sched_wday', $item->rawValue('sched_wday')), 'label' => subscribe_model_Subscribe::fieldLabel('sched_wday'), 'hint' => cot::$L['subscribe_sched_wday_hint']), 'sched_time' => array('element' => cot_inputbox('text', 'sched_time', $item->rawValue('sched_time')), 'label' => subscribe_model_Subscribe::fieldLabel('sched_time'), 'hint' => cot::$L['subscribe_sched_time_hint']), 'active' => array('element' => cot_checkbox($item->rawValue('active'), 'active', subscribe_model_Subscribe::fieldLabel('active'))), 'periodical' => array('element' => cot_checkbox($item->rawValue('periodical'), 'periodical', subscribe_model_Subscribe::fieldLabel('periodical'))), 'sort' => array('element' => cot_inputbox('text', 'sort', $item->rawValue('sort')), 'label' => subscribe_model_Subscribe::fieldLabel('sort')));
if (!empty($cot_extrafields[cot::$db->subscribe])) {
// Extra fields for subscribe
foreach ($cot_extrafields[cot::$db->subscribe] as $exfld) {
$fName = $exfld['field_name'];
$formElements[$fName] = array('element' => cot_build_extrafields($fName, $exfld, $item->rawValue($fName)));
if ($exfld['field_type'] !== 'checkbox') {
isset(cot::$L['subscribe_' . $exfld['field_name'] . '_title']) ? cot::$L['subscribe_' . $exfld['field_name'] . '_title'] : subscribe_model_Subscribe::fieldLabel($fName);
}
}
}
$subscribers = subscribe_model_Subscriber::count(array(array('subscribe', $item->id)));
$activeSubscribers = subscribe_model_Subscriber::count(array(array('subscribe', $item->id), array('active', 1)));
$actionParams = array('m' => 'subscribe', 'a' => 'edit');
if ($item->id > 0) {
$actionParams['id'] = $item->id;
}
$template = array('subscribe', 'admin', 'edit');
$view = new View();
$view->page_title = $admintitle;
$view->item = $item;
$view->subscribers = $subscribers;
$view->activeSubscribers = $activeSubscribers;
$view->formElements = $formElements;
$view->formAction = cot_url('admin', $actionParams);
/* === Hook === */
foreach (cot_getextplugins('subscribe.admin.edit.view') as $pl) {
include $pl;
}
/* ===== */
return $view->render($template);
}
示例9: array
if (($cfg['forums']['enablereplyform'] || $lastpage) && !$rowt['ft_state'] && $usr['id'] > 0 && $allowreplybox && $usr['auth_write']) {
if ($quote > 0) {
$sql_forums_quote = $db->query("SELECT fp_id, fp_text, fp_postername, fp_posterid, fp_creation FROM {$db_forum_posts}\n\t\t\tWHERE fp_topicid = ? AND fp_cat = ? AND fp_id = ? LIMIT 1", array($q, $s, $quote));
if ($row4 = $sql_forums_quote->fetch()) {
$rmsg['fp_text'] = cot_rc('forums_code_quote', array('url' => cot_url('forums', 'm=posts&q=' . $q . '&d=' . $durl, '#' . $row4['fp_id'], $forums_quote_htmlspecialchars_bypass), 'id' => $row4['fp_id'], 'date' => cot_date('datetime_medium', $row4['fp_creation']), 'postername' => $row4['fp_postername'], 'text' => $row4['fp_text']));
}
}
// Extra fields
foreach ($cot_extrafields[$db_forum_posts] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('rmsg' . $exfld['field_name'], $exfld, $rmsg[$exfld['field_name']]);
$exfld_title = isset($L['forums_posts_' . $exfld['field_name'] . '_title']) ? $L['forums_posts_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$t->assign(array('FORUMS_POSTS_NEWPOST_' . $uname => $exfld_val, 'FORUMS_POSTS_NEWPOST_' . $uname . '_TITLE' => $exfld_title, 'FORUMS_POSTS_NEWPOST_EXTRAFLD' => $exfld_val, 'FORUMS_POSTS_NEWPOST_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.FORUMS_POSTS_NEWPOST.EXTRAFLD');
}
$t->assign(array('FORUMS_POSTS_NEWPOST_SEND' => cot_url('forums', "m=posts&a=newpost&s=" . $s . "&q=" . $q), 'FORUMS_POSTS_NEWPOST_TEXT' => $R['forums_code_newpost_mark'] . cot_textarea('rmsgtext', $rmsg['fp_text'], 16, 56, '', 'input_textarea_' . $minimaxieditor), 'FORUMS_POSTS_NEWPOST_EDITTIMEOUT' => cot_build_timegap(0, $cfg['forums']['edittimeout'] * 3600)));
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('forums.posts.newpost.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.FORUMS_POSTS_NEWPOST');
} elseif ($rowt['ft_state']) {
$t->assign('FORUMS_POSTS_TOPICLOCKED_BODY', $L['forums_topiclocked']);
$t->parse('MAIN.FORUMS_POSTS_TOPICLOCKED');
} elseif (!$allowreplybox && ($cfg['forums']['enablereplyform'] || $lastpage) && !$rowt['ft_state'] && $usr['id'] > 0) {
$t->assign('FORUMS_POSTS_ANTIBUMP_BODY', $L['forums_antibump']);
$t->parse('MAIN.FORUMS_POSTS_ANTIBUMP');
}
if ($rowt['ft_mode'] == 1) {
示例10: cot_reviews_list
/**
* Форма просмара отзывов /добавление отзыва
*
* @param int $userid id пользователя
* @param string $area модуль/плагин
* @param string $code код
* @param string $name URL Module or script name
* @param mixed $params URL parameters as array or parameter string
* @param string $tail URL postfix, e.g. anchor
* @param bool $showall show all reviews
* @return string
*/
function cot_reviews_list($userid, $area, $code = '', $name = '', $params = '', $tail = '', $showall = false)
{
global $db_reviews, $db_users, $db, $L, $usr, $cfg;
list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = cot_auth('plug', 'reviews', 'RWA');
if ($usr['auth_read']) {
$t1 = new XTemplate(cot_tplfile(array('reviews', $area), 'plug'));
require_once cot_langfile('reviews', 'plug');
if (!$showall) {
$sqlcode = !empty($code) ? " AND item_code='" . $db->prep($code) . "'" : '';
$sqlarea = " AND item_area='" . $db->prep($area) . "'";
}
$sql = $db->query("SELECT * FROM {$db_reviews} as r LEFT JOIN {$db_users} as u ON u.user_id=r.item_userid \n\t\t\tWHERE item_touserid=" . (int) $userid . $sqlarea . $sqlcode . " ORDER BY item_date ASC");
if (is_array($params)) {
$params2 = array();
foreach ($array as $key => $value) {
$params2[$key] = str_replace(array('$userid', '$area', '$code'), array('$userid', $area, $code), $value);
}
$params = $params2;
} else {
$params = str_replace(array('$userid', '$area', '$code'), array('$userid', $area, $code), $params);
}
$redirect = cot_url($name, $params, $tail, true);
$redirect = base64_encode($redirect);
while ($item = $sql->fetch()) {
if ($usr['id'] == $item['item_userid'] || $usr['isadmin']) {
$t1->assign(array('REVIEW_FORM_ID' => $item['item_id'], 'REVIEW_FORM_SEND' => cot_url('plug', 'r=reviews&a=update&area=' . $area . '&code=' . $code . '&touser=' . $userid . '&redirect=' . $redirect . '&itemid=' . $item['item_id']), 'REVIEW_FORM_TEXT' => cot_textarea('rtext', $item['item_text'], 5, 50), 'REVIEW_FORM_SCORE' => cot_radiobox($item['item_score'], 'rscore', $L['review_score_values'], $L['review_score_titles']), 'REVIEW_FORM_USERID' => $item['item_userid'], 'REVIEW_FORM_DELETE_URL' => cot_url('plug', 'r=reviews&a=delete&area=' . $area . '&code=' . $code . '&touser=' . $userid . '&redirect=' . $redirect . '&itemid=' . $item['item_id'])));
$t1->parse('MAIN.REVIEWS_ROWS.EDITFORM');
}
$t1->assign(cot_generate_usertags($item, 'REVIEW_ROW_'));
$t1->assign(array('REVIEW_ROW_ID' => $item['item_id'], 'REVIEW_ROW_TEXT' => $item['item_text'], 'REVIEW_ROW_TOUSER' => $item['item_touser'], 'REVIEW_ROW_OWNERID' => $item['item_userid'], 'REVIEW_ROW_OWNER' => cot_build_user($item['item_userid'], htmlspecialchars($item['user_name'])), 'REVIEW_ROW_SCORE' => $item['item_score'] > 0 ? '+' . $item['item_score'] : $item['item_score'], 'REVIEW_ROW_AREA' => $item['item_area'], 'REVIEW_ROW_CODE' => $item['item_code'], 'REVIEW_ROW_DATE' => $item['item_date'], 'REVIEW_ROW_DELETE_URL' => $usr['id'] == $item['item_userid'] || $usr['isadmin'] ? cot_url('plug', 'r=reviews&a=delete&area=' . $area . '&code=' . $code . '&itemid=' . $item['item_id'] . '&redirect=' . $redirect) : ''));
if ($item['item_area'] == 'projects' && !empty($item['item_code'])) {
require_once cot_incfile('projects', 'module');
global $db_projects;
$prj = $db->query("SELECT * FROM {$db_projects} WHERE item_id=" . $item['item_code'])->fetch();
$t1->assign(cot_generate_projecttags($prj, 'REVIEW_ROW_PRJ_'));
}
$t1->parse('MAIN.REVIEWS_ROWS');
}
if ($cfg['plugin']['reviews']['checkprojects'] && cot_module_active('projects') && $usr['id'] > 0 && $usr['auth_write'] && $usr['id'] != $userid) {
require_once cot_incfile('projects', 'module');
global $db_projects_offers, $db_projects;
$prj_reviews_sql = $db->query("SELECT item_code FROM {$db_reviews} WHERE item_area='projects' AND item_userid=" . $usr['id']);
while ($row = $prj_reviews_sql->fetch()) {
$prjreviews[] = $row['item_code'];
}
$prjreviews_string = count($prjreviews) > 0 ? "AND o.offer_pid NOT IN (" . implode(",", $prjreviews) . ")" : '';
$bothprj_count = $db->query("SELECT COUNT(*) FROM {$db_projects_offers} AS o\n\t\t\t\tLEFT JOIN {$db_projects} AS p ON p.item_id=o.offer_pid\n\t\t\t\tWHERE ((p.item_userid = '" . $userid . "' AND o.offer_userid='" . $usr['id'] . "')\n\t\t\t\t\tOR (p.item_userid = '" . $usr['id'] . "' AND o.offer_userid='" . $userid . "')) \n\t\t\t\t\tAND o.offer_choise='performer' \n\t\t\t\t\t{$prjreviews_string}\n\t\t\t\t\t")->fetchColumn();
if ($bothprj_count > 0) {
$bothprj_sql = $db->query("SELECT * FROM {$db_projects_offers} AS o\n\t\t\t\tLEFT JOIN {$db_projects} AS p ON p.item_id=o.offer_pid\n\t\t\t\tWHERE ((p.item_userid = '" . $userid . "' AND o.offer_userid='" . $usr['id'] . "')\n\t\t\t\t\tOR (p.item_userid = '" . $usr['id'] . "' AND o.offer_userid='" . $userid . "')) \n\t\t\t\t\tAND o.offer_choise='performer' \n\t\t\t\t\t{$prjreviews_string}\n\t\t\t\t\t");
while ($bprj = $bothprj_sql->fetch()) {
$prj_ids[] = $bprj['offer_pid'];
$prj_titles[] = $bprj['item_title'];
}
}
$area = 'projects';
$usr['auth_write'] = (int) $bothprj_count == 0 ? false : $usr['auth_write'];
} else {
$sqlcode = !empty($code) ? " AND item_code='" . $db->prep($code) . "'" : '';
$sqlarea = " AND item_area='" . $db->prep($area) . "'";
$reviews_count = $db->query("SELECT COUNT(*) FROM {$db_reviews} \n\t\t\t\tWHERE item_userid=" . (int) $usr['id'] . "\n\t\t\t\t\tAND item_touserid=" . (int) $userid . $sqlarea . $sqlcode)->fetchColumn();
$usr['auth_write'] = $reviews_count > 0 ? false : $usr['auth_write'];
}
if ($usr['auth_write'] && $usr['id'] != $userid) {
cot_display_messages($t1);
$t1->assign(array('REVIEW_FORM_SEND' => cot_url('plug', 'r=reviews&a=add&area=' . $area . '&touser=' . $userid . '&redirect=' . $redirect), 'REVIEW_FORM_TEXT' => cot_textarea('rtext', $ritem['item_text'], 5, 50), 'REVIEW_FORM_SCORE' => cot_radiobox($ritem['item_score'], 'rscore', $L['reviews_score_values'], $L['reviews_score_titles']), 'REVIEW_FORM_PROJECTS' => $cfg['plugin']['reviews']['checkprojects'] && cot_module_active('projects') && $bothprj_count > 0 ? cot_selectbox($pid, 'code', $prj_ids, $prj_titles, false) : '', 'REVIEW_FORM_ACTION' => 'ADD'));
$t1->parse('MAIN.FORM');
}
$t1->parse('MAIN');
return $t1->text('MAIN');
}
return '';
}
示例11: cot_tplfile
$urr = $sql->fetch();
$out['subtitle'] = $L['Profile'];
$out['head'] .= $R['code_noindex'];
$mskin = cot_tplfile(array('users', 'profile'), 'module');
/* === Hook === */
foreach (cot_getextplugins('users.profile.main') as $pl) {
include $pl;
}
/* ===== */
require_once $cfg['system_dir'] . '/header.php';
$t = new XTemplate($mskin);
require_once cot_incfile('forms');
$protected = !$cfg['users']['useremailchange'] ? array('disabled' => 'disabled') : array();
$profile_form_email = cot_inputbox('text', 'ruseremail', $urr['user_email'], array('size' => 32, 'maxlength' => 64) + $protected);
$editor_class = $cfg['users']['usertextimg'] ? 'minieditor' : '';
$t->assign(array('USERS_PROFILE_TITLE' => cot_rc_link(cot_url('users', 'm=profile'), $L['pro_title']), 'USERS_PROFILE_SUBTITLE' => $L['pro_subtitle'], 'USERS_PROFILE_DETAILSLINK' => cot_url('users', 'm=details&id=' . $urr['user_id']), 'USERS_PROFILE_EDITLINK' => cot_url('users', 'm=edit&id=' . $urr['user_id']), 'USERS_PROFILE_FORM_SEND' => cot_url('users', "m=profile&a=update&" . cot_xg()), 'USERS_PROFILE_ID' => $urr['user_id'], 'USERS_PROFILE_NAME' => htmlspecialchars($urr['user_name']), 'USERS_PROFILE_MAINGRP' => cot_build_group($urr['user_maingrp']), 'USERS_PROFILE_GROUPS' => cot_build_groupsms($urr['user_id'], FALSE, $urr['user_maingrp']), 'USERS_PROFILE_COUNTRY' => cot_selectbox_countries($urr['user_country'], 'rusercountry'), 'USERS_PROFILE_TEXT' => cot_textarea('rusertext', $urr['user_text'], 8, 56, array('class' => $editor_class)), 'USERS_PROFILE_EMAIL' => $profile_form_email, 'USERS_PROFILE_EMAILPASS' => cot_inputbox('password', 'rmailpass', '', array('size' => 12, 'maxlength' => 32, 'autocomplete' => 'off')), 'USERS_PROFILE_HIDEEMAIL' => cot_radiobox($urr['user_hideemail'], 'ruserhideemail', array(1, 0), array($L['Yes'], $L['No'])), 'USERS_PROFILE_THEME' => cot_selectbox_theme($urr['user_theme'], $urr['user_scheme'], 'rusertheme'), 'USERS_PROFILE_LANG' => cot_selectbox_lang($urr['user_lang'], 'ruserlang'), 'USERS_PROFILE_GENDER' => cot_selectbox_gender($urr['user_gender'], 'rusergender'), 'USERS_PROFILE_BIRTHDATE' => cot_selectbox_date(cot_date2stamp($urr['user_birthdate']), 'short', 'ruserbirthdate', cot_date('Y', $sys['now']), cot_date('Y', $sys['now']) - 100, false), 'USERS_PROFILE_TIMEZONE' => cot_selectbox_timezone($urr['user_timezone'], 'rusertimezone'), 'USERS_PROFILE_REGDATE' => cot_date('datetime_medium', $urr['user_regdate']), 'USERS_PROFILE_REGDATE_STAMP' => $urr['user_regdate'], 'USERS_PROFILE_LASTLOG' => cot_date('datetime_medium', $urr['user_lastlog']), 'USERS_PROFILE_LASTLOG_STAMP' => $urr['user_lastlog'], 'USERS_PROFILE_LOGCOUNT' => $urr['user_logcount'], 'USERS_PROFILE_ADMINRIGHTS' => '', 'USERS_PROFILE_OLDPASS' => cot_inputbox('password', 'roldpass', '', array('size' => 12, 'maxlength' => 32)), 'USERS_PROFILE_NEWPASS1' => cot_inputbox('password', 'rnewpass1', '', array('size' => 12, 'maxlength' => 32, 'autocomplete' => 'off')), 'USERS_PROFILE_NEWPASS2' => cot_inputbox('password', 'rnewpass2', '', array('size' => 12, 'maxlength' => 32, 'autocomplete' => 'off'))));
// 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, $urr['user_' . $exfld['field_name']]);
$exfld_title = cot_extrafield_title($exfld, 'user_');
$t->assign(array('USERS_PROFILE_' . $uname => $exfld_val, 'USERS_PROFILE_' . $uname . '_TITLE' => $exfld_title, 'USERS_PROFILE_EXTRAFLD' => $exfld_val, 'USERS_PROFILE_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.EXTRAFLD');
}
}
/* === Hook === */
foreach (cot_getextplugins('users.profile.tags') as $pl) {
include $pl;
}
/* ===== */
示例12: editAction
//.........这里部分代码省略.........
$placeHolder_Phone = '';
$placeHolder_Email = '';
$placeHolder_City = '';
//if($advboard->user == cot::$usr['id'] && cot::$usr['id'] > 0) {
if (!empty($user)) {
// Контакное лицо
$placeHolder_Person = cot_user_full_name($user);
// Телефон
if (!empty($user['user_phone'])) {
$placeHolder_Phone = $user['user_phone'];
}
// email
if (!$user['user_hideemail']) {
$placeHolder_Email = $user['user_email'];
}
// город
if (!empty($user['user_city_name'])) {
$placeHolder_City = $user['user_city_name'];
}
}
// 'input_textarea_editor', 'input_textarea_medieditor', 'input_textarea_minieditor', ''
$editor = 'input_textarea_editor';
/* === Hook === */
foreach (cot_getextplugins('advboard.edit.main') as $pl) {
include $pl;
}
/* ===== */
$minYear = date('Y');
$maxYear = $minYear + 30;
$price = $advert->rawValue('price');
if ($price <= 0) {
$price = '';
}
$formElements = array('hidden' => array('element' => cot_inputbox('hidden', 'act', 'save')), 'category' => array('element' => cot_selectbox_structure('advboard', $advert->category, 'category'), 'label' => advboard_model_Advert::fieldLabel('category')), 'price' => array('element' => cot_inputbox('text', 'price', $price), 'label' => advboard_model_Advert::fieldLabel('price'), 'hint' => cot::$L['advboard_price_hint']), 'title' => array('element' => cot_inputbox('text', 'title', $advert->rawValue('title')), 'required' => true, 'label' => advboard_model_Advert::fieldLabel('title')), 'description' => array('element' => cot_inputbox('text', 'description', $advert->rawValue('description')), 'label' => advboard_model_Advert::fieldLabel('description')), 'text' => array('element' => cot_textarea('text', $advert->rawValue('text'), 5, 120, '', $editor), 'label' => advboard_model_Advert::fieldLabel('text')), 'person' => array('element' => cot_inputbox('text', 'person', $advert->rawValue('person'), array('class' => 'form-control', 'placeholder' => $placeHolder_Person)), 'label' => advboard_model_Advert::fieldLabel('person'), 'required' => cot::$usr['id'] == 0), 'email' => array('element' => cot_inputbox('text', 'email', $advert->rawValue('email'), array('class' => 'form-control', 'placeholder' => $placeHolder_Email)), 'label' => advboard_model_Advert::fieldLabel('email')), 'city' => array('element' => cot_inputbox('text', 'city_name', $advert->rawValue('city_name'), array('class' => 'form-control', 'placeholder' => $placeHolder_City)), 'label' => advboard_model_Advert::fieldLabel('city_name'), 'required' => $category['config']['city_require']), 'phone' => array('element' => cot_inputbox('text', 'phone', $advert->rawValue('phone'), array('class' => 'form-control', 'placeholder' => $placeHolder_Phone)), 'label' => advboard_model_Advert::fieldLabel('phone'), 'required' => $category['config']['phone_require']), 'sticky' => array('element' => cot_checkbox($advert->sticky, 'sticky', advboard_model_Advert::fieldLabel('sticky')), 'label' => advboard_model_Advert::fieldLabel('sticky')), 'published' => array('element' => cot_checkbox($published, 'published', cot::$L['advboard_published'] . '?'), 'label' => cot::$L['advboard_published'] . '?'), 'begin' => array('element' => cot_selectbox_date($advert->begin, 'long', 'begin', $maxYear, $minYear), 'label' => advboard_model_Advert::fieldLabel('begin')), 'expire' => array('element' => cot_selectbox_date($advert->expire, 'long', 'expire', $maxYear, $minYear), 'label' => advboard_model_Advert::fieldLabel('expire')), 'sort' => array('element' => cot_selectbox_date($advert->sort, 'long', 'sort', $maxYear, $minYear), 'label' => advboard_model_Advert::fieldLabel('sort')), 'period' => array('element' => cot_selectbox('', 'period', $periodItems, array(), false), 'label' => cot::$L['advboard_period']));
if (!empty($cot_extrafields[cot::$db->advboard])) {
// Extra fields for ads
foreach ($cot_extrafields[cot::$db->advboard] as $exfld) {
$fName = $exfld['field_name'];
$formElements[$fName] = array('element' => cot_build_extrafields($fName, $exfld, $advert->rawValue($fName)));
if ($exfld['field_type'] !== 'checkbox') {
$formElements[$fName]['label'] = isset(cot::$L['advboard_' . $exfld['field_name'] . '_title']) ? cot::$L['advboard_' . $exfld['field_name'] . '_title'] : advboard_model_Advert::fieldLabel($fName);
}
}
}
if (cot_plugin_active('regioncity')) {
$formElements['city']['element'] = rec_select2_city('city', $advert->rawValue('city'), true, array('class' => 'form-control', 'placeholder' => $placeHolder_City));
}
if ($category['config']['city_require']) {
$formElements['city']['required'] = true;
}
if ($category['config']['phone_require']) {
$formElements['phone']['required'] = true;
}
// Hints
if (!empty($user)) {
// Контакное лицо
$formElements['person']['hint'] = cot::$L['advboard_leave_empty_to_use'] . ": " . cot_user_full_name($user);
// Телефон
if (!empty($user['user_phone'])) {
$formElements['phone']['hint'] = cot::$L['advboard_leave_empty_to_use'] . ": " . $user['user_phone'];
}
// email
if (!$user['user_hideemail']) {
$formElements['email']['hint'] = cot::$L['advboard_leave_empty_to_use'] . ": " . $user['user_email'];
}
// город
示例13: cot_getextplugins
$extp = cot_getextplugins('payments.balance.transfers.loop');
/* ===== */
foreach ($transfers as $transfer) {
$t->assign(array('TRANSFER_ROW_ID' => $transfer['trn_id'], 'TRANSFER_ROW_SUMM' => $transfer['trn_summ'], 'TRANSFER_ROW_DATE' => $transfer['trn_date'], 'TRANSFER_ROW_DONE' => $transfer['trn_done'], 'TRANSFER_ROW_COMMENT' => $transfer['trn_comment'], 'TRANSFER_ROW_STATUS' => $transfer['trn_status'], 'TRANSFER_ROW_LOCALSTATUS' => $L['payments_balance_transfer_status_' . $transfer['trn_status']]));
$t->assign(cot_generate_usertags($transfer['trn_to'], 'TRANSFER_ROW_FOR_'));
/* === Hook - Part2 : Include === */
foreach ($extp as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.TRANSFERS.TRANSFER_ROW');
}
}
$t->parse('MAIN.TRANSFERS');
} else {
$t->assign(array('TRANSFER_FORM_ACTION_URL' => cot_url('payments', 'm=balance&n=transfers&a=send'), 'TRANSFER_FORM_SUMM' => cot_inputbox('text', 'summ', $summ), 'TRANSFER_FORM_TAX' => !empty($taxsumm) ? $taxsumm : 0, 'TRANSFER_FORM_TOTAL' => !empty($sendersumm) ? $sendersumm : 0, 'TRANSFER_FORM_COMMENT' => cot_textarea('comment', $comment, 5, 40, '', ''), 'TRANSFER_FORM_USERNAME' => cot_inputbox('text', 'username', $username)));
/* === Hook === */
foreach (cot_getextplugins('payments.balance.transfers.form') as $pl) {
include $pl;
}
/* ===== */
cot_display_messages($t, 'MAIN.TRANSFERFORM');
$t->parse('MAIN.TRANSFERFORM');
}
}
if ($n == 'history') {
list($pg, $d, $durl) = cot_import_pagenav('d', $cfg['maxrowsperpage']);
$totallines = $db->query("SELECT COUNT(*) FROM {$db_payments} \n\t\tWHERE pay_userid=" . $usr['id'] . " AND pay_status='done' AND pay_summ>0")->fetchColumn();
$pays = $db->query("SELECT * FROM {$db_payments} \n\t\tWHERE pay_userid=" . $usr['id'] . " AND pay_status='done' AND pay_summ>0\n\t\tORDER BY pay_pdate DESC LIMIT {$d}, " . $cfg['maxrowsperpage'])->fetchAll();
$pagenav = cot_pagenav('payments', 'm=balance', $d, $totallines, $cfg['maxrowsperpage']);
$t->assign(array('HISTORY_COUNT' => $totallines, 'PAGENAV_PAGES' => $pagenav['main'], 'PAGENAV_PREV' => $pagenav['prev'], 'PAGENAV_NEXT' => $pagenav['next'], 'PAGENAV_CURRENTPAGE' => $pagenav['current']));
示例14: cot_redirect
if (!empty($rinput['city_name'])) {
$db->update($db_ls_cities, $rinput, "city_id=" . (int) $rid);
} else {
$db->delete($db_ls_cities, "city_id=" . (int) $rid);
}
}
$cache && $cache->clear();
cot_redirect(cot_url('admin', 'm=other&p=locationselector&n=city&id=' . $id, '', true));
exit;
}
$t = new XTemplate(cot_tplfile('locationselector.city', 'plug'));
$totalitems = $db->query("SELECT COUNT(*) FROM {$db_ls_cities} WHERE city_region=" . $id)->fetchColumn();
$sql = $db->query("SELECT * FROM {$db_ls_cities} WHERE city_region=" . $id . " ORDER by city_name ASC LIMIT {$d}, " . $cfg['maxrowsperpage']);
$pagenav = cot_pagenav('admin', "m=other&p=locationselector&n=city&id=" . $id, $d, $totalitems, $cfg['maxrowsperpage']);
$region = $db->query("SELECT * FROM {$db_ls_regions} WHERE region_id=" . (int) $id)->fetch();
$jj = 0;
while ($item = $sql->fetch()) {
$jj++;
$t->assign(array("CITY_ROW_NAME" => cot_inputbox('text', 'rname[' . $item['city_id'] . ']', $item['city_name']), "CITY_ROW_DEL_URL" => cot_url('admin', 'm=other&p=locationselector&n=city&id=' . $id . '&a=del&cid=' . $item['city_id'])));
$t->parse("MAIN.ROWS");
}
if ($jj == 0) {
$t->parse("MAIN.NOROWS");
}
$t->assign(array("ADD_FORM_NAME" => cot_textarea('rname', '', 10, 60), "ADD_FORM_ACTION_URL" => cot_url('admin', 'm=other&p=locationselector&n=city&id=' . $id . '&a=add', '', true), "ADD_FORM_TITLE" => $title));
$t->parse("MAIN.ADDFORM");
$t->assign(array("EDIT_FORM_ACTION_URL" => cot_url('admin', 'm=other&p=locationselector&n=city&id=' . $id . '&a=edit&d=' . $d_url, '', true), "PAGENAV_PAGES" => $pagenav['main'], "PAGENAV_PREV" => $pagenav['prev'], "PAGENAV_NEXT" => $pagenav['next'], "COUNTRY_NAME" => $cot_countries[$region['region_country']], "REGION_NAME" => $region['region_name']));
$adminpath[] = array(cot_url('admin', 'm=other&p=locationselector&n=region&country=' . $region['region_country']), $cot_countries[$region['region_country']]);
$adminpath[] = array(cot_url('admin', 'm=other&p=locationselector&n=city&id=' . $region['region_name']), $region['region_name']);
$t->parse("MAIN");
$plugin_body .= $t->text("MAIN");
示例15: 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) {
//.........这里部分代码省略.........