当前位置: 首页>>代码示例>>PHP>>正文


PHP cot_radiobox函数代码示例

本文整理汇总了PHP中cot_radiobox函数的典型用法代码示例。如果您正苦于以下问题:PHP cot_radiobox函数的具体用法?PHP cot_radiobox怎么用?PHP cot_radiobox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cot_radiobox函数的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');
开发者ID:ASDAFF,项目名称:cot-freelance,代码行数:31,代码来源:folio.edit.php

示例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');
开发者ID:ASDAFF,项目名称:cot-freelance,代码行数:31,代码来源:projects.edit.php

示例3: foreach

        $t->parse('MAIN.PAGES_OPTIONS');
    }
}
if (($tab == 'frm' || empty($tab)) && cot_module_active('forums') && $cfg['plugin']['search']['forumsearch']) {
    $forum_cat_list['all'] = $L['plu_allsections'];
    foreach ($structure['forums'] as $key => $val) {
        if (cot_auth('forums', $key, 'R')) {
            $forum_cat_list[$key] = $val['tpath'];
            $frm_catauth[] = $db->prep($key);
        }
    }
    if ($rs['frmsub'][0] == 'all' || !$rs['frmsub']) {
        $rs['frmsub'] = array();
        $rs['frmsub'][] = 'all';
    }
    $t->assign(array('PLUGIN_FORUM_SEC_LIST' => cot_selectbox($rs['frmsub'], 'rs[frmsub][]', array_keys($forum_cat_list), array_values($forum_cat_list), false, 'multiple="multiple" style="width:50%"'), 'PLUGIN_FORUM_RES_SORT' => cot_selectbox($rs['frmsort'], 'rs[frmsort]', array('updated', 'creationdate', 'title', 'postcount', 'viewcount', 'sectionid'), array($L['plu_frm_res_sort1'], $L['plu_frm_res_sort2'], $L['plu_frm_res_sort3'], $L['plu_frm_res_sort4'], $L['plu_frm_res_sort5'], $L['plu_frm_res_sort6']), false), 'PLUGIN_FORUM_RES_SORT_WAY' => cot_radiobox($rs['frmsort2'], 'rs[frmsort2]', array('DESC', 'ASC'), array($L['plu_sort_desc'], $L['plu_sort_asc'])), 'PLUGIN_FORUM_SEARCH_NAMES' => cot_checkbox($rs['frmtitle'] == 1 || count($rs['frmsub']) == 0, 'rs[frmtitle]', $L['plu_frm_search_names']), 'PLUGIN_FORUM_SEARCH_POST' => cot_checkbox($rs['frmtext'] == 1 || count($rs['frmsub']) == 0, 'rs[frmtext]', $L['plu_frm_search_post']), 'PLUGIN_FORUM_SEARCH_ANSW' => cot_checkbox($rs['frmreply'] == 1 || count($rs['frmsub']) == 0, 'rs[frmreply]', $L['plu_frm_search_answ']), 'PLUGIN_FORUM_SEARCH_SUBCAT' => cot_checkbox($rs['frmsubcat'], 'rs[frmsubcat]', $L['plu_frm_set_subsec'])));
    if ($tab == 'frm' || empty($tab) && $cfg['plugin']['search']['extrafilters']) {
        $t->parse('MAIN.FORUMS_OPTIONS');
    }
}
if (!empty($sq)) {
    $words = explode(' ', preg_replace("'\\s+'", " ", $sq));
    $sqlsearch = '%' . implode('%', $words) . '%';
    if (mb_strlen($sq) < $cfg['plugin']['search']['minsigns']) {
        cot_error($L['plu_querytooshort'] . $R['code_error_separator'], '');
    }
    if (count($words) > $cfg['plugin']['search']['maxwords']) {
        cot_error($L['plu_toomanywords'] . ' ' . $cfg['plugin']['search']['maxwords'] . $R['code_error_separator']);
    }
    // Users LIST
    $rs['setuser'] = trim($rs['setuser']);
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:search.php

示例4: defined

 * @license BSD
 *  */
defined('COT_CODE') or die('Wrong URL.');
require_once cot_langfile('usergroupselector', 'plug');
$prfx = 'USERS_REGISTER_';
if ($m == 'edit') {
    $prfx = 'USERS_EDIT_';
} elseif ($m == 'profile') {
    $prfx = 'USERS_PROFILE_';
}
if (($cfg['plugin']['usergroupselector']['allowchange'] || $cfg['plugin']['usergroupselector']['required']) && $urr['user_maingrp'] != COT_GROUP_SUPERADMINS && $urr['user_maingrp'] != COT_GROUP_MODERATORS) {
    $options = explode(',', $cfg['plugin']['usergroupselector']['groups']);
    $groups_values = array();
    $groups_titles = array();
    foreach ($options as $v) {
        $groups_values[] = $v;
        $groups_titles[] = $cot_groups[$v]['title'];
        if ($usergroup == $cot_groups[$v]['alias']) {
            $usergroupid = $v;
        }
        $t->assign(array('USERGROUP_ROW_ID' => $v, 'USERGROUP_ROW_TITLE' => $cot_groups[$v]['title'], 'USERGROUP_ROW_ALIAS' => $cot_groups[$v]['alias'], 'USERGROUP_ROW_ACTIVEID' => $usergroup == $cot_groups[$v]['alias'] ? true : false));
        $t->parse('MAIN.USERGROUP_ROW');
    }
    if (count($groups_values) == 1) {
        $user_f_group = cot_checkbox($urr['user_usergroup'], 'ruserusergroup', $groups_titles[0], '', $groups_values[0]);
    } else {
        $user_f_group = cot_radiobox($urr['user_usergroup'], 'ruserusergroup', $groups_values, $groups_titles, '', '<br />');
    }
    $t->assign($prfx . 'GROUPSELECT', $user_f_group);
    $t->assign($prfx . 'GROUPSELECTBOX', cot_selectbox($urr['user_usergroup'], 'ruserusergroup', $groups_values, $groups_titles));
}
开发者ID:Andreyjktl,项目名称:cot-freelance,代码行数:31,代码来源:usergroupselector.edit.tags.php

示例5: array

$title_params = array('EDIT' => $L['Edit'], 'NAME' => $urr['user_name']);
$out['subtitle'] = cot_title('{EDIT} - {NAME}', $title_params);
$out['head'] .= $R['code_noindex'];
$mskin = cot_tplfile(array('users', 'edit', $usr['maingrp']), 'module');
/* === Hook === */
foreach (cot_getextplugins('users.edit.main') as $pl) {
    include $pl;
}
/* ===== */
require_once $cfg['system_dir'] . '/header.php';
$t = new XTemplate($mskin);
require_once cot_incfile('forms');
$protected = $sys['protecttopadmin'] ? array('disabled' => 'disabled') : array();
$editor_class = $cfg['users']['usertextimg'] ? 'minieditor' : '';
$delete_pfs = cot_module_active('pfs') ? cot_checkbox(false, 'ruserdelpfs', $L['PFS']) : '';
$t->assign(array('USERS_EDIT_TITLE' => cot_breadcrumbs(array(array(cot_url('users'), $L['Users']), array(cot_url('users', 'm=details&id=' . $urr['user_id'] . '&u=' . $urr['user_name']), $urr['user_name']), array(cot_url('users', 'm=edit&id=' . $urr['user_id']), $L['Edit'])), $cfg['homebreadcrumb']), 'USERS_EDIT_DETAILSLINK' => cot_url('users', 'm=details&id=' . $urr['user_id']), 'USERS_EDIT_EDITLINK' => cot_url('users', 'm=edit&id=' . $urr['user_id']), 'USERS_EDIT_SUBTITLE' => $L['useed_subtitle'], 'USERS_EDIT_SEND' => cot_url('users', 'm=edit&a=update&' . cot_xg() . '&id=' . $urr['user_id']), 'USERS_EDIT_ID' => $urr['user_id'], 'USERS_EDIT_NAME' => cot_inputbox('text', 'rusername', $urr['user_name'], array('size' => 32, 'maxlength' => 100) + $protected), 'USERS_EDIT_ACTIVE' => $user_form_active, 'USERS_EDIT_BANNED' => $user_form_banned, 'USERS_EDIT_THEME' => cot_inputbox('text', 'rusertheme', $urr['user_theme'], array('size' => 32, 'maxlength' => 32)), 'USERS_EDIT_LANG' => cot_inputbox('text', 'ruserlang', $urr['user_lang'], array('size' => 32, 'maxlength' => 32)), 'USERS_EDIT_NEWPASS' => cot_inputbox('password', 'rusernewpass', '', array('size' => 12, 'maxlength' => 32, 'autocomplete' => 'off') + $protected), 'USERS_EDIT_MAINGRP' => cot_build_group($urr['user_maingrp']), 'USERS_EDIT_GROUPS' => cot_build_groupsms($urr['user_id'], $usr['isadmin'], $urr['user_maingrp']), 'USERS_EDIT_COUNTRY' => cot_selectbox_countries($urr['user_country'], 'rusercountry'), 'USERS_EDIT_EMAIL' => cot_inputbox('text', 'ruseremail', $urr['user_email'], array('size' => 32, 'maxlength' => 64)), 'USERS_EDIT_HIDEEMAIL' => cot_radiobox($urr['user_hideemail'], 'ruserhideemail', array(1, 0), array($L['Yes'], $L['No'])), 'USERS_EDIT_TEXT' => cot_textarea('rusertext', $urr['user_text'], 4, 56, array('class' => $editor_class)), 'USERS_EDIT_GENDER' => cot_selectbox_gender($urr['user_gender'], 'rusergender'), 'USERS_EDIT_BIRTHDATE' => cot_selectbox_date(cot_date2stamp($urr['user_birthdate']), 'short', 'ruserbirthdate', cot_date('Y', $sys['now']), cot_date('Y', $sys['now']) - 100, false), 'USERS_EDIT_TIMEZONE' => cot_selectbox_timezone($urr['user_timezone'], 'rusertimezone'), 'USERS_EDIT_REGDATE' => cot_date('datetime_medium', $urr['user_regdate']), 'USERS_EDIT_REGDATE_STAMP' => $urr['user_regdate'], 'USERS_EDIT_LASTLOG' => cot_date('datetime_medium', $urr['user_lastlog']), 'USERS_EDIT_LASTLOG_STAMP' => $urr['user_lastlog'], 'USERS_EDIT_LOGCOUNT' => $urr['user_logcount'], 'USERS_EDIT_LASTIP' => cot_build_ipsearch($urr['user_lastip']), 'USERS_EDIT_DELETE' => $sys['user_istopadmin'] ? cot_radiobox(0, 'ruserdelete', array(1, 0), array($L['Yes'], $L['No'])) . $delete_pfs : $L['na']));
// Extra fields
foreach ($cot_extrafields[$db_users] as $exfld) {
    $tag = strtoupper($exfld['field_name']);
    $t->assign(array('USERS_EDIT_' . $tag => cot_build_extrafields('ruser' . $exfld['field_name'], $exfld, $urr['user_' . $exfld['field_name']]), 'USERS_EDIT_' . $tag . '_TITLE' => isset($L['user_' . $exfld['field_name'] . '_title']) ? $L['user_' . $exfld['field_name'] . '_title'] : $exfld['field_description']));
}
// Error and message reporting
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('users.edit.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
$t->out('MAIN');
require_once $cfg['system_dir'] . '/footer.php';
开发者ID:ASDAFF,项目名称:Cotonti,代码行数:31,代码来源:users.edit.php

示例6: defined

<?php

/* ====================
[BEGIN_COT_EXT]
Hooks=admin.users.edit.tags
[END_COT_EXT]
==================== */
/**
 * Hidden groups
 *
 * @package HiddenGroups
 * @copyright (c) Cotonti Team
 * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
 */
defined('COT_CODE') && defined('COT_ADMIN') or die('Wrong URL.');
$hidden_groups = true;
$t->assign('ADMIN_USERS_EDITFORM_GRP_HIDDEN', cot_radiobox($row['grp_hidden'], 'rhidden', array(1, 0), array($L['Yes'], $L['No'])));
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:17,代码来源:hiddengroups.admin.users.edit.tags.php

示例7: cot_page_status

}
$pag = $row_page;
$pag['page_status'] = cot_page_status($pag['page_state'], $pag['page_begin'], $pag['page_expire']);
cot_block($usr['isadmin'] || $usr['auth_write'] && $usr['id'] == $pag['page_ownerid']);
$out['subtitle'] = $L['page_edittitle'];
$out['head'] .= $R['code_noindex'];
$sys['sublocation'] = $structure['page'][$pag['page_cat']]['title'];
$mskin = cot_tplfile(array('page', 'edit', $structure['page'][$pag['page_cat']]['tpl']));
/* === Hook === */
foreach (cot_getextplugins('page.edit.main') as $pl) {
    include $pl;
}
/* ===== */
require_once $cfg['system_dir'] . '/header.php';
$t = new XTemplate($mskin);
$pageedit_array = array('PAGEEDIT_PAGETITLE' => $L['page_edittitle'], 'PAGEEDIT_SUBTITLE' => $L['page_editsubtitle'], 'PAGEEDIT_FORM_SEND' => cot_url('page', "m=edit&a=update&id=" . $pag['page_id']), 'PAGEEDIT_FORM_ID' => $pag['page_id'], 'PAGEEDIT_FORM_STATE' => $pag['page_state'], 'PAGEEDIT_FORM_STATUS' => $pag['page_status'], 'PAGEEDIT_FORM_LOCALSTATUS' => $L['page_status_' . $pag['page_status']], 'PAGEEDIT_FORM_CAT' => cot_selectbox_structure('page', $pag['page_cat'], 'rpagecat'), 'PAGEEDIT_FORM_CAT_SHORT' => cot_selectbox_structure('page', $pag['page_cat'], 'rpagecat', $c), 'PAGEEDIT_FORM_KEYWORDS' => cot_inputbox('text', 'rpagekeywords', $pag['page_keywords'], array('size' => '32', 'maxlength' => '255')), 'PAGEEDIT_FORM_METATITLE' => cot_inputbox('text', 'rpagemetatitle', $pag['page_metatitle'], array('size' => '64', 'maxlength' => '255')), 'PAGEEDIT_FORM_METADESC' => cot_textarea('rpagemetadesc', $pag['page_metadesc'], 2, 64, array('maxlength' => '255')), 'PAGEEDIT_FORM_ALIAS' => cot_inputbox('text', 'rpagealias', $pag['page_alias'], array('size' => '32', 'maxlength' => '255')), 'PAGEEDIT_FORM_TITLE' => cot_inputbox('text', 'rpagetitle', $pag['page_title'], array('size' => '64', 'maxlength' => '255')), 'PAGEEDIT_FORM_DESC' => cot_textarea('rpagedesc', $pag['page_desc'], 2, 64, array('maxlength' => '255')), 'PAGEEDIT_FORM_AUTHOR' => cot_inputbox('text', 'rpageauthor', $pag['page_author'], array('size' => '24', 'maxlength' => '100')), 'PAGEEDIT_FORM_DATE' => cot_selectbox_date($pag['page_date'], 'long', 'rpagedate') . ' ' . $usr['timetext'], 'PAGEEDIT_FORM_DATENOW' => cot_checkbox(0, 'rpagedatenow'), 'PAGEEDIT_FORM_BEGIN' => cot_selectbox_date($pag['page_begin'], 'long', 'rpagebegin') . ' ' . $usr['timetext'], 'PAGEEDIT_FORM_EXPIRE' => cot_selectbox_date($pag['page_expire'], 'long', 'rpageexpire') . ' ' . $usr['timetext'], 'PAGEEDIT_FORM_UPDATED' => cot_date('datetime_full', $pag['page_updated']) . ' ' . $usr['timetext'], 'PAGEEDIT_FORM_FILE' => cot_selectbox($pag['page_file'], 'rpagefile', range(0, 2), array($L['No'], $L['Yes'], $L['Members_only']), false), 'PAGEEDIT_FORM_URL' => cot_inputbox('text', 'rpageurl', $pag['page_url'], array('size' => '56', 'maxlength' => '255')), 'PAGEEDIT_FORM_SIZE' => cot_inputbox('text', 'rpagesize', $pag['page_size'], array('size' => '56', 'maxlength' => '255')), 'PAGEEDIT_FORM_TEXT' => cot_textarea('rpagetext', $pag['page_text'], 24, 120, '', 'input_textarea_editor'), 'PAGEEDIT_FORM_DELETE' => cot_radiobox(0, 'rpagedelete', array(1, 0), array($L['Yes'], $L['No'])), 'PAGEEDIT_FORM_PARSER' => cot_selectbox($pag['page_parser'], 'rpageparser', cot_get_parsers(), cot_get_parsers(), false));
if ($usr['isadmin']) {
    $pageedit_array += array('PAGEEDIT_FORM_OWNERID' => cot_inputbox('text', 'rpageownerid', $pag['page_ownerid'], array('size' => '24', 'maxlength' => '24')), 'PAGEEDIT_FORM_PAGECOUNT' => cot_inputbox('text', 'rpagecount', $pag['page_count'], array('size' => '8', 'maxlength' => '8')), 'PAGEEDIT_FORM_FILECOUNT' => cot_inputbox('text', 'rpagefilecount', $pag['page_filecount'], array('size' => '8', 'maxlength' => '8')));
}
$t->assign($pageedit_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, $pag['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('PAGEEDIT_FORM_' . $uname => $exfld_val, 'PAGEEDIT_FORM_' . $uname . '_TITLE' => $exfld_title, 'PAGEEDIT_FORM_EXTRAFLD' => $exfld_val, 'PAGEEDIT_FORM_EXTRAFLD_TITLE' => $exfld_title));
    $t->parse('MAIN.EXTRAFLD');
}
// Error and message handling
cot_display_messages($t);
/* === Hook === */
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:page.edit.php

示例8: cot_config_input

/**
 * Returns config input
 * @param array $cfg_var Array with config Variable parameters
 * @return string
 */
function cot_config_input($cfg_var)
{
    $name = $cfg_var['config_name'];
    $type = $cfg_var['config_type'];
    $value = $cfg_var['config_value'];
    $options = $cfg_var['config_variants'];
    $config_input = '';
    switch ($type) {
        case COT_CONFIG_TYPE_STRING:
            $config_input = cot_inputbox('text', $name, $value);
            break;
        case COT_CONFIG_TYPE_SELECT:
            if (!empty($options)) {
                $params = explode(',', $options);
                $params_titles = cot_config_selecttitles($name, $params);
            }
            $config_input = is_array($params) ? cot_selectbox($value, $name, $params, $params_titles, false) : cot_inputbox('text', $name, $value);
            break;
        case COT_CONFIG_TYPE_RADIO:
            global $L;
            if (!empty($options)) {
                $params = explode(',', $options);
                $params_titles = cot_config_selecttitles($name, $params);
                if (empty($value)) {
                    $value = $cfg_var['config_default'];
                }
            } else {
                $params = array(1, 0);
                $params_titles = array($L['Yes'], $L['No']);
            }
            $config_input = cot_radiobox($value, $name, $params, $params_titles, '', ' ');
            break;
        case COT_CONFIG_TYPE_RANGE:
            $range = preg_split('#\\s*,\\s*#', $options);
            $params = range($range[0], $range[1], empty($range[2]) ? 1 : $range[2]);
            $config_input = cot_selectbox($value, $name, $params, $params, false);
            break;
        case COT_CONFIG_TYPE_CUSTOM:
            if (preg_match('#^(\\w+)\\((.*?)\\)$#', $options, $mt) && function_exists($mt[1])) {
                $callback_params = preg_split('#\\s*,\\s*#', $mt[2]);
                if (count($callback_params) > 0 && !empty($callback_params[0])) {
                    for ($i = 0; $i < count($callback_params); $i++) {
                        $callback_params[$i] = str_replace(array("'", '"'), array('', ''), $callback_params[$i]);
                    }
                }
                $config_input = call_user_func_array($mt[1], array_merge(array($cfg_var), $callback_params));
            } else {
                $config_input = cot_inputbox('text', $name, $value);
            }
            break;
        case COT_CONFIG_TYPE_CALLBACK:
            if (preg_match('#^(\\w+)\\((.*?)\\)$#', $options, $mt) && function_exists($mt[1])) {
                $callback_params = preg_split('#\\s*,\\s*#', $mt[2]);
                if (count($callback_params) > 0 && !empty($callback_params[0])) {
                    for ($i = 0; $i < count($callback_params); $i++) {
                        $callback_params[$i] = str_replace("'", '', $callback_params[$i]);
                        $callback_params[$i] = str_replace('"', '', $callback_params[$i]);
                    }
                    $params = call_user_func_array($mt[1], $callback_params);
                } else {
                    $params = call_user_func($mt[1]);
                }
                // assume associative array as value=>title
                $assoc = range(0, count($params) - 1) != array_keys($params);
                if ($assoc) {
                    $assoc_titles = array_values($params);
                    $params = array_keys($params);
                }
                $params_titles = cot_config_selecttitles($name, $params);
                if ($assoc && $params_titles == $params) {
                    $params_titles = $assoc_titles;
                }
                $config_input = cot_selectbox($value, $name, $params, $params_titles, false);
            }
            break;
        case COT_CONFIG_TYPE_HIDDEN:
        case COT_CONFIG_TYPE_SEPARATOR:
            break;
        default:
            $config_input = cot_textarea($name, $value, 8, 56);
            break;
    }
    return $config_input;
}
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:89,代码来源:configuration.php

示例9: cot_import

    $rs['marketsub'] = cot_import($rs['marketsub'], 'D', 'ARR');
    $rs['marketsubcat'] = cot_import($rs['marketsubcat'], 'D', 'BOL') ? 1 : 0;
    if ($rs['markettitle'] < 1 && $rs['markettext'] < 1) {
        $rs['markettitle'] = 1;
        $rs['markettext'] = 1;
    }
    if (($tab == 'market' || empty($tab)) && cot_module_active('market')) {
        require_once cot_incfile('market', 'module');
        // Making the category list
        $market_cat_list['all'] = $L['plu_allcategories'];
        foreach ($structure['market'] as $cat => $x) {
            if ($cat != 'all' && $cat != 'system' && cot_auth('market', $cat, 'R') && $x['group'] == 0) {
                $market_cat_list[$cat] = $x['tpath'];
                $market_catauth[] = $db->prep($cat);
            }
        }
        if ($rs['marketsub'][0] == 'all' || !is_array($rs['marketsub'])) {
            $rs['marketsub'] = array();
            $rs['marketsub'][] = 'all';
        }
        /* === Hook === */
        foreach (cot_getextplugins('market.search.catlist') as $pl) {
            include $pl;
        }
        /* ===== */
        $t->assign(array('PLUGIN_MARKET_SEC_LIST' => cot_selectbox($rs['marketsub'], 'rs[marketsub][]', array_keys($market_cat_list), array_values($market_cat_list), false, 'multiple="multiple" style="width:50%"'), 'PLUGIN_MARKET_RES_SORT' => cot_selectbox($rs['marketsort'], 'rs[marketsort]', array('date', 'title', 'count', 'cat'), array($L['plu_market_res_sort1'], $L['plu_market_res_sort2'], $L['plu_market_res_sort3'], $L['plu_market_res_sort4']), false), 'PLUGIN_MARKET_RES_SORT_WAY' => cot_radiobox($rs['marketsort2'], 'rs[marketsort2]', array('DESC', 'ASC'), array($L['plu_sort_desc'], $L['plu_sort_asc'])), 'PLUGIN_MARKET_SEARCH_NAMES' => cot_checkbox($rs['markettitle'] == 1 || count($rs['marketsub']) == 0, 'rs[markettitle]', $L['plu_market_search_names']), 'PLUGIN_MARKET_SEARCH_TEXT' => cot_checkbox($rs['markettext'] == 1 || count($rs['marketsub']) == 0, 'rs[markettext]', $L['plu_market_search_text']), 'PLUGIN_MARKET_SEARCH_SUBCAT' => cot_checkbox($rs['marketsubcat'], 'rs[marketsubcat]', $L['plu_market_set_subsec'])));
        if ($tab == 'market' || empty($tab) && $cfg['plugin']['search']['extrafilters']) {
            $t->parse('MAIN.MARKET_OPTIONS');
        }
    }
}
开发者ID:Andreyjktl,项目名称:cot-freelance,代码行数:31,代码来源:market.search.first.php

示例10: implode

}
/* ===== */
$where = $where ? 'WHERE ' . implode(' AND ', $where) : '';
$order = $order ? 'ORDER BY ' . implode(', ', $order) : '';
$totalitems = $db->query("SELECT COUNT(*) FROM {$db_projects} \n\t" . $where . "")->fetchColumn();
$sqllist = $db->query("SELECT * FROM {$db_projects} AS p LEFT JOIN {$db_users} AS u ON u.user_id=p.item_userid\n\t" . $where . " \n\t" . $order . " \n\tLIMIT {$d}, " . $cfg['maxrowsperpage']);
$pagenav = cot_pagenav('admin', $list_url_path, $d, $totalitems, $cfg['maxrowsperpage']);
if (is_array($projects_types)) {
    foreach ($projects_types as $i => $pr_type) {
        $t->assign(array("TYPE_ROW_TITLE" => $pr_type, "TYPE_ROW_URL" => cot_url('admin', 'm=projects&c=' . $c . '&type=' . $i), "TYPE_ROW_ACT" => $type == $i ? 'act' : ''));
        $t->parse("MAIN.TYPES.TYPES_ROWS");
    }
}
$t->assign(array('TYPE_ALL_URL' => cot_url('admin', 'm=projects&c=' . $c), 'TYPE_ALL_ACT' => empty($type) ? 'act' : ''));
$t->parse('MAIN.TYPES');
$t->assign(array("SEARCH_ACTION_URL" => cot_url('admin', "m=projects&c=" . $c . "&type=" . $type, '', true), "SEARCH_SQ" => cot_inputbox('text', 'sq', $sq, 'class="schstring"'), "SEARCH_STATE" => cot_radiobox($state, 'state', array(0, 1, 2), array('опубликованные', 'скрытые', 'на проверке')), "SEARCH_CAT" => cot_projects_selectcat($c, 'c'), "SEARCH_SORTER" => cot_selectbox($sort, "sort", array('', 'costasc', 'costdesc'), array($L['projects_mostrelevant'], $L['projects_costasc'], $L['projects_costdesc']), false), 'TYPES_EDIT' => cot_url('admin', 'm=projects&p=types'), 'PAGENAV_PAGES' => $pagenav['main'], 'PAGENAV_PREV' => $pagenav['prev'], 'PAGENAV_NEXT' => $pagenav['next'], 'CATALOG' => cot_build_structure_projects_tree('', array($c)), 'CATTITLE' => !empty($c) ? ' / ' . !empty($c) ? ' / ' . htmlspecialchars($structure['projects'][$c]['title']) : '' : ''));
$sqllist_rowset = $sqllist->fetchAll();
$sqllist_idset = array();
foreach ($sqllist_rowset as $item) {
    $sqllist_idset[$item['item_id']] = $item['item_alias'];
}
/* === Hook === */
$extp = cot_getextplugins('projects.admin.list.loop');
/* ===== */
foreach ($sqllist_rowset as $item) {
    $jj++;
    $t->assign(cot_generate_usertags($item, 'PRJ_ROW_OWNER_'));
    $t->assign(cot_generate_projecttags($item, 'PRJ_ROW_', $cfg['projects']['shorttextlen'], $usr['isadmin'], $cfg['homebreadcrumb']));
    $t->assign(array('PRJ_ROW_ODDEVEN' => cot_build_oddeven($jj), 'PRJ_ROW_EDIT_URL' => cot_url('projects', 'm=edit&id=' . $item['item_id']), 'PRJ_ROW_VALIDATE_URL' => cot_url('admin', 'm=projects&p=default&a=validate&id=' . $item['item_id']), 'PRJ_ROW_DELETE_URL' => cot_url('admin', 'm=projects&p=default&a=delete&id=' . $item['item_id'])));
    /* === Hook - Part2 : Include === */
    foreach ($extp as $pl) {
开发者ID:Andreyjktl,项目名称:cot-freelance,代码行数:31,代码来源:projects.admin.default.php

示例11: cot_getextplugins

        $extp = cot_getextplugins('admin.users.row.tags');
        /* ===== */
        foreach ($sql->fetchAll() as $row) {
            $members[$row['grp_id']] = empty($members[$row['grp_id']]) ? '0' : $members[$row['grp_id']];
            $grp_title = isset($L['users_grp_' . $row['grp_id'] . '_title']) ? $L['users_grp_' . $row['grp_id'] . '_title'] : htmlspecialchars($row['grp_title']);
            $grp_desc = isset($L['users_grp_' . $row['grp_id'] . '_desc']) ? $L['users_grp_' . $row['grp_id'] . '_desc'] : htmlspecialchars($row['grp_desc']);
            $t->assign(array('ADMIN_USERS_ROW_GRP_TITLE_URL' => cot_url('admin', 'm=users&n=edit&g=' . $row['grp_id']), 'ADMIN_USERS_ROW_GRP_NAME' => htmlspecialchars($row['grp_name']), 'ADMIN_USERS_ROW_GRP_TITLE' => $grp_title, 'ADMIN_USERS_ROW_GRP_DESC' => $grp_desc, 'ADMIN_USERS_ROW_GRP_ID' => $row['grp_id'], 'ADMIN_USERS_ROW_GRP_COUNT_MEMBERS' => $members[$row['grp_id']], 'ADMIN_USERS_ROW_GRP_DISABLED' => $cot_yesno[!$row['grp_disabled']], 'ADMIN_USERS_ROW_GRP_SKIPRIGHTS' => $row['grp_skiprights'], 'ADMIN_USERS_ROW_GRP_RIGHTS_URL' => cot_url('admin', 'm=rights&g=' . $row['grp_id']), 'ADMIN_USERS_ROW_GRP_JUMPTO_URL' => cot_url('users', 'g=' . $row['grp_id'])));
            /* === Hook - Part2 : Include === */
            foreach ($extp as $pl) {
                include $pl;
            }
            /* ===== */
            $t->parse('MAIN.ADMIN_USERS_DEFAULT.USERS_ROW');
        }
    }
    $t->assign(array('ADMIN_USERS_FORM_URL' => cot_url('admin', 'm=users&n=add'), 'ADMIN_USERS_NGRP_NAME' => cot_inputbox('text', 'rname', '', 'size="40" maxlength="64"'), 'ADMIN_USERS_NGRP_TITLE' => cot_inputbox('text', 'rtitle', '', 'size="40" maxlength="64"'), 'ADMIN_USERS_NGRP_DESC' => cot_inputbox('text', 'rdesc', '', 'size="40" maxlength="64"'), 'ADMIN_USERS_NGRP_ICON' => cot_inputbox('text', 'ricon', '', 'size="40" maxlength="128"'), 'ADMIN_USERS_NGRP_ALIAS' => cot_inputbox('text', 'ralias', '', 'size="40" maxlength="24"'), 'ADMIN_USERS_NGRP_DISABLED' => cot_radiobox(0, 'rdisabled', array(1, 0), array($L['Yes'], $L['No'])), 'ADMIN_USERS_NGRP_MAINTENANCE' => cot_radiobox(0, 'rmtmode', array(1, 0), array($L['Yes'], $L['No'])), 'ADMIN_USERS_NGRP_SKIPRIGHTS' => cot_radiobox(0, 'rskiprights', array(1, 0), array($L['Yes'], $L['No'])), 'ADMIN_USERS_NGRP_RLEVEL' => cot_selectbox(50, 'rlevel', range(0, 99), range(0, 99), false), 'ADMIN_USERS_FORM_SELECTBOX_GROUPS' => cot_selectbox_groups(4, 'rcopyrightsfrom', array('5'))));
    /* === Hook === */
    foreach (cot_getextplugins('admin.users.add.tags') as $pl) {
        include $pl;
    }
    /* ===== */
    $t->parse('MAIN.ADMIN_USERS_DEFAULT');
}
$t->assign(array('ADMIN_USERS_URL' => cot_url('admin', 'm=config&n=edit&o=module&p=users'), 'ADMIN_USERS_EXTRAFIELDS_URL' => cot_url('admin', 'm=extrafields&n=' . $db_users)));
cot_display_messages($t);
/* === Hook  === */
foreach (cot_getextplugins('admin.users.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:admin.users.php

示例12: defined

<?php

/* ====================
[BEGIN_COT_EXT]
Hooks=users.edit.tags,users.profile.tags
[END_COT_EXT]
==================== */
/**
 * PM user edit profile tags
 *
 * @package PM
 * @copyright (c) Cotonti Team
 * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
 */
defined('COT_CODE') or die('Wrong URL.');
$t->assign($m == 'edit' ? 'USERS_EDIT_PMNOTIFY' : 'USERS_PROFILE_PMNOTIFY', cot_radiobox($urr['user_pmnotify'], 'ruserpmnotify', array(1, 0), array($L['Yes'], $L['No'])));
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:16,代码来源:pm.useredit.tags.php

示例13: defined

<?php

/* ====================
[BEGIN_COT_EXT]
Hooks=admin.users.add.tags
[END_COT_EXT]
==================== */
/**
 * Hidden groups
 *
 * @package HiddenGroups
 * @copyright (c) Cotonti Team
 * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
 */
defined('COT_CODE') && defined('COT_ADMIN') or die('Wrong URL.');
$hidden_groups = true;
$t->assign('ADMIN_USERS_NGRP_HIDDEN', cot_radiobox(0, 'rhidden', array(1, 0), array($L['Yes'], $L['No'])));
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:17,代码来源:hiddengroups.admin.users.add.tags.php

示例14: cot_build_extrafields

/**
 * Returns Extra fields edit fields
 *
 * @param string $name Variable name
 * @param array $extrafields Extra fields data
 * @param string $data Existing data for fields
 * @return string
 */
function cot_build_extrafields($name, $extrafield, $data)
{
    global $L, $R, $cfg, $pl;
    $data = $data == null ? $extrafield['field_default'] : $data;
    switch ($extrafield['field_type']) {
        case 'input':
        case 'inputint':
        case 'currency':
        case 'double':
            $result = cot_inputbox('text', $name, $data, '', $extrafield['field_html']);
            break;
        case 'textarea':
            $result = cot_textarea($name, $data, 4, 56, '', $extrafield['field_html']);
            break;
        case 'select':
            $extrafield['field_variants'] = str_replace(array(' , ', ', ', ' ,'), ',', $extrafield['field_variants']);
            $opt_array = explode(",", $extrafield['field_variants']);
            $ii = 0;
            $options_titles = $options_values = array();
            foreach ($opt_array as $var) {
                $ii++;
                $var = trim($var);
                $options_titles[$ii] = !empty($L[$extrafield['field_name'] . '_' . $var]) ? $L[$extrafield['field_name'] . '_' . $var] : $var;
                $options_values[$ii] = $var;
            }
            $result = cot_selectbox(trim($data), $name, $options_values, $options_titles, false, '', $extrafield['field_html']);
            break;
        case 'radio':
            $extrafield['field_variants'] = str_replace(array(' , ', ', ', ' ,'), ',', $extrafield['field_variants']);
            $opt_array = explode(",", $extrafield['field_variants']);
            $options_titles = $options_values = array();
            if (count($opt_array) > 0) {
                $ii = 0;
                foreach ($opt_array as $var) {
                    $ii++;
                    $var = trim($var);
                    $options_titles[$ii] = !empty($L[$extrafield['field_name'] . '_' . $var]) ? $L[$extrafield['field_name'] . '_' . $var] : $var;
                    $options_values[$ii] = $var;
                }
            }
            $result = cot_radiobox(trim($data), $name, $options_values, $options_titles, '', '', $extrafield['field_html']);
            break;
        case 'checkbox':
            $result = cot_checkbox($data, $name, $extrafield['field_description'], '', '1', $extrafield['field_html']);
            break;
        case 'datetime':
            global $sys;
            $extrafield['field_params'] = str_replace(array(' , ', ', ', ' ,'), ',', $extrafield['field_params']);
            list($min, $max, $format) = explode(",", $extrafield['field_params'], 3);
            $max = (int) $max > 0 ? $max : 2030;
            $min = (int) $min > 0 ? $min : 2000;
            $data = mb_substr($data, 0, 1) == "+" ? $sys['now'] + (int) mb_substr($data, 1) : $data;
            $data = mb_substr($data, 0, 1) == "-" ? $sys['now'] - (int) mb_substr($data, 1) : $data;
            $result = cot_selectbox_date((int) $data, 'long', $name, (int) $max, (int) $min, true, $extrafield['field_html']);
            break;
        case 'country':
            global $cot_countries;
            $result = cot_selectbox_countries(trim($data), $name, true, '', $extrafield['field_html']);
            break;
        case 'range':
            $extrafield['field_params'] = str_replace(array(' , ', ', ', ' ,'), ',', $extrafield['field_params']);
            list($min, $max) = explode(',', $extrafield['field_params'], 2);
            $result = cot_selectbox(trim($data), $name, range((int) $min, (int) $max), range((int) $min, (int) $max), true, '', $extrafield['field_html']);
            break;
        case 'checklistbox':
            $extrafield['field_variants'] = str_replace(array(' , ', ', ', ' ,'), ',', $extrafield['field_variants']);
            $opt_array = explode(",", $extrafield['field_variants']);
            $options_titles = $options_values = array();
            if (count($opt_array) > 0) {
                $ii = 0;
                foreach ($opt_array as $var) {
                    $ii++;
                    $var = trim($var);
                    $options_titles[$ii] = !empty($L[$extrafield['field_name'] . '_' . $var]) ? $L[$extrafield['field_name'] . '_' . $var] : $var;
                    $options_values[$ii] = $var;
                }
            }
            if (!is_array($data)) {
                $data = trim(str_replace(array(' , ', ', ', ' ,'), ',', $data));
                $data = explode(',', $data);
            }
            $result = cot_checklistbox($data, $name, $options_values, $options_titles, '', '', true, $extrafield['field_html']);
            break;
        case 'file':
            $extrafield['field_params'] = !empty($extrafield['field_params']) ? $extrafield['field_params'] : $cfg['extrafield_files_dir'];
            $extrafield['field_params'] .= mb_substr($extrafield['field_params'], -1) == '/' ? '' : '/';
            $data_filepath = $extrafield['field_params'] . htmlspecialchars($data);
            /* === Hook === */
            foreach (cot_getextplugins('extrafields.build.file') as $pl) {
                include $pl;
            }
            /* ===== */
//.........这里部分代码省略.........
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:101,代码来源:extrafields.php

示例15: 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 '';
}
开发者ID:cotemplate,项目名称:cot-freelance,代码行数:84,代码来源:reviews.functions.php


注:本文中的cot_radiobox函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。