本文整理汇总了PHP中cot_display_messages函数的典型用法代码示例。如果您正苦于以下问题:PHP cot_display_messages函数的具体用法?PHP cot_display_messages怎么用?PHP cot_display_messages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cot_display_messages函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
exit;
}
$db->update($db_i18n_pages, $pag_i18n, "ipage_id = ? AND ipage_locale = ?", array($id, $i18n_locale));
/* === Hook === */
foreach (cot_getextplugins('i18n.page.edit.update') as $pl) {
include $pl;
}
/* =============*/
cot_message('Updated');
$page_urlp = empty($pag['page_alias']) ? 'c=' . $pag['page_cat'] . "&id={$id}&l={$i18n_locale}" : 'c=' . $pag['page_cat'] . '&al=' . $pag['page_alias'] . '&l=' . $i18n_locale;
cot_redirect(cot_url('page', $page_urlp, '', true, false, true));
}
$out['subtitle'] = $L['i18n_editing'];
$t = new XTemplate(cot_tplfile('i18n.page', 'plug'));
$t->assign(array('I18N_ACTION' => cot_url('plug', "e=i18n&m=page&a=edit&id={$id}&l={$i18n_locale}"), 'I18N_TITLE' => $L['i18n_editing'], 'I18N_ORIGINAL_LANG' => $i18n_locales[$cfg['defaultlang']], 'I18N_LOCALIZED_LANG' => $i18n_locales[$i18n_locale], 'I18N_PAGE_TITLE' => htmlspecialchars($pag['page_title']), 'I18N_PAGE_DESC' => htmlspecialchars($pag['page_desc']), 'I18N_PAGE_TEXT' => cot_parse($pag['page_text'], $cfg['page']['markup']), 'I18N_IPAGE_TITLE' => htmlspecialchars($pag_i18n['ipage_title']), 'I18N_IPAGE_DESC' => htmlspecialchars($pag_i18n['ipage_desc']), 'I18N_IPAGE_TEXT' => cot_textarea('translate_text', $pag_i18n['ipage_text'], 32, 80, '', 'input_textarea_editor')));
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('i18n.page.edit.tags') as $pl) {
include $pl;
}
/* =============*/
} elseif ($a == 'delete' && ($i18n_admin || $usr['id'] == $pag['ipage_translatorid'])) {
// Send to trashcan if available
if ($cfg['plugin']['trashcan']['trash_page']) {
require_once cot_incfile('trashcan', 'plug');
$row = $db->query("SELECT * FROM {$db_i18n_pages}\n\t\t\t\tWHERE ipage_id = {$id} AND ipage_locale = '{$i18n_locale}'")->fetch();
cot_trash_put('i18n_page', $L['i18n_translation'] . " #{$id} ({$i18n_locale}) " . $row['ipage_title'], $id, $row);
}
$db->delete($db_i18n_pages, "ipage_id = {$id} AND ipage_locale = '{$i18n_locale}'");
/* === Hook === */
foreach (cot_getextplugins('i18n.page.delete.done') as $pl) {
示例2: foreach
/* ===== */
$t_o->parse("MAIN.ROWS");
}
$addoffer_enabled = true;
/* === Hook === */
foreach (cot_getextplugins('projects.addofferform.main') as $pl) {
include $pl;
}
/* ===== */
$sql = $db->query("SELECT * FROM {$db_projects_offers} WHERE offer_pid=" . $id . " AND offer_userid=" . $usr['id'] . "");
if ($sql->fetchColumn() == 0 && $addoffer_enabled && $usr['auth_offers'] && $usr['id'] != $item['item_userid'] && empty($performer)) {
$t_o->assign(array("OFFER_FORM_COSTMIN" => cot_inputbox('text', 'costmin', $roffer['offer_cost_min'], 'size="7"'), "OFFER_FORM_COSTMAX" => cot_inputbox('text', 'costmax', $roffer['offer_cost_max'], 'size="7"'), "OFFER_FORM_TIMEMIN" => cot_inputbox('text', 'timemin', $roffer['offer_time_min'], 'size="7"'), "OFFER_FORM_TIMEMAX" => cot_inputbox('text', 'timemax', $roffer['offer_time_max'], 'size="7"'), "OFFER_FORM_TEXT" => cot_textarea('offertext', $roffer['offer_text'], 7, 40), "OFFER_FORM_HIDDEN" => cot_checkbox(0, 'hidden', $L['offers_hide_offer']), "OFFER_FORM_ACTION_URL" => cot_url('projects', 'id=' . $id . '&a=addoffer'), "OFFER_FORM_TIMETYPE" => cot_selectbox($timetype, 'timetype', array_keys($L['offers_timetype']), array_values($L['offers_timetype']), false)));
// Extra fields
foreach ($cot_extrafields[$db_projects_offers] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('roffer' . $exfld['field_name'], $exfld, $roffer['offer_' . $exfld['field_name']]);
$exfld_title = isset($L['offers_' . $exfld['field_name'] . '_title']) ? $L['offers_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$t_o->assign(array('OFFER_FORM_' . $uname => $exfld_val, 'OFFER_FORM_' . $uname . '_TITLE' => $exfld_title, 'OFFER_FORM_EXTRAFLD' => $exfld_val, 'OFFER_FORM_EXTRAFLD_TITLE' => $exfld_title));
$t_o->parse('MAIN.EXTRAFLD');
}
/* === Hook === */
foreach (cot_getextplugins('projects.addofferform.tags') as $pl) {
include $pl;
}
/* ===== */
$t_o->parse("MAIN.ADDOFFERFORM");
}
// Error and message handling
cot_display_messages($t_o);
$t_o->parse("MAIN");
$t->assign('OFFERS', $t_o->text('MAIN'));
示例3: foreach
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');
$plugin_body .= $tuman->text('MAIN');
示例4: sprintf
$payinfo['pay_adate'] = $sys['now'];
$payinfo['pay_status'] = 'done';
$payinfo['pay_desc'] = sprintf($L['payments_balance_transfer_desc'], $usr['name'], $recipient['user_name'], $comment);
$db->insert($db_payments, $payinfo);
$pid = $db->lastInsertId();
// Отправка уведомления админу о переводе между пользователями
$subject = $L['payments_balance_transfer_admin_subject'];
$body = sprintf($L['payments_balance_transfer_admin_body'], $usr['name'], $recipient['user_name'], $summ, $taxsumm, $sendersumm, $recipientsumm, $cfg['payments']['valuta'], cot_date('d.m.Y в H:i', $sys['now']), $comment);
cot_mail($cfg['adminemail'], $subject, $body);
// Отправка уведомления админу о переводе между пользователями
$subject = $L['payments_balance_transfer_recipient_subject'];
$body = sprintf($L['payments_balance_transfer_recipient_body'], $usr['name'], $recipient['user_name'], $summ, $taxsumm, $sendersumm, $recipientsumm, $cfg['payments']['valuta'], cot_date('d.m.Y в H:i', $sys['now']), $comment);
cot_mail($recipient['user_email'], $subject, $body);
cot_redirect(cot_url('payments', 'm=balance&n=history', '', true));
}
cot_redirect(cot_url('payments', 'm=balance&n=transfer', '', true));
}
cot_display_messages($t, 'MAIN.TRANSFERFORM');
$t->assign(array('TRANSFER_FORM_ACTION_URL' => cot_url('payments', 'm=balance&n=transfer&a=add'), 'TRANSFER_FORM_SUMM' => cot_inputbox('text', 'summ', $summ), 'TRANSFER_FORM_TAX' => $taxsumm, 'TRANSFER_FORM_TOTAL' => !empty($sendersumm) ? $sendersumm : 0, 'TRANSFER_FORM_COMMENT' => $comment, 'TRANSFER_FORM_USERNAME' => $username));
$t->parse('MAIN.TRANSFERFORM');
}
if ($n == 'history') {
$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")->fetchAll();
foreach ($pays as $pay) {
$t->assign(cot_generate_paytags($pay, 'HIST_ROW_'));
$t->parse('MAIN.HISTORY.HIST_ROW');
}
$t->parse('MAIN.HISTORY');
}
$t->parse('MAIN');
$module_body = $t->text('MAIN');
示例5: 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) {
//.........这里部分代码省略.........
示例6: cot_url
$t->assign(array('POST_FORM_ACTION' => cot_url('sbr', 'id=' . $id . '&num=' . $num . '&a=addpost'), 'POST_FORM_TO' => cot_selectbox($to, 'to', $R['sbr_posts_to_values'], $R['sbr_posts_to_titles'])));
cot_display_messages($t, 'MAIN.SBR.POSTS.POSTFORM');
$t->parse('MAIN.SBR.POSTS.POSTFORM');
$t->parse('MAIN.SBR.POSTS');
/* === Hook === */
foreach (cot_getextplugins('sbr.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.SBR');
}
if ($action == 'done') {
// Действие доступно только для заказчика
cot_block($role == 'employer');
$t->assign(array('STAGEDONE_FORM_ACTION' => cot_url('sbr', 'id=' . $id . '&num=' . $num . '&a=done'), 'STAGEDONE_FORM_TEXT' => cot_textarea('rtext', $rtext, 5, 80)));
cot_display_messages($t, 'MAIN.STAGEDONE');
$t->parse('MAIN.STAGEDONE');
}
if ($action == 'claim') {
$stage = $db->query("SELECT * FROM {$db_sbr_stages} WHERE stage_sid=" . $id . " AND stage_num=" . $num)->fetch();
cot_block(!empty($role) && $sbr['sbr_status'] == 'process' && $stage['stage_status'] == 'process');
$t->assign(array('CLAIM_FORM_ACTION' => cot_url('sbr', 'id=' . $id . '&num=' . $num . '&a=claim'), 'CLAIM_FORM_TEXT' => cot_textarea('rtext', $rtext, 5, 80)));
cot_display_messages($t, 'MAIN.CLAIM');
$t->parse('MAIN.CLAIM');
}
if ($action == 'decision') {
cot_block($usr['isadmin'] && $sbr['sbr_status'] == 'claim');
$t->assign(array('DECISION_FORM_ACTION' => cot_url('sbr', 'id=' . $id . '&num=' . $num . '&a=decision'), 'DECISION_FORM_TEXT' => cot_textarea('rdecisiontext', $rtext, 5, 80), 'DECISION_FORM_PAYPERFORMER' => cot_inputbox('text', 'payperformer', $payperformer), 'DECISION_FORM_PAYEMPLOYER' => cot_inputbox('text', 'payemployer', $payemployer)));
cot_display_messages($t, 'MAIN.DECISION');
$t->parse('MAIN.DECISION');
}
示例7: 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 '';
}
示例8: cot_url
$bb_t->assign(array('ADMIN_BBCODE_PAGINATION_PREV' => $pagenav['prev'], 'ADMIN_BBCODE_PAGNAV' => $pagenav['main'], 'ADMIN_BBCODE_PAGINATION_NEXT' => $pagenav['next'], 'ADMIN_BBCODE_TOTALITEMS' => $totalitems, 'ADMIN_BBCODE_COUNTER_ROW' => $ii, 'ADMIN_BBCODE_FORM_ACTION' => cot_url('admin', 'm=other&p=bbcode&a=add&d=' . $durl), 'ADMIN_BBCODE_NAME' => cot_inputbox('text', 'bbc_name', $bbc['name']), 'ADMIN_BBCODE_ENABLED' => cot_checkbox($bbc['enabled'], 'bbc_enabled'), 'ADMIN_BBCODE_CONTAINER' => cot_checkbox($bbc['container'], 'bbc_container'), 'ADMIN_BBCODE_PATTERN' => cot_textarea('bbc_pattern', $bbc['pattern'], 2, 20), 'ADMIN_BBCODE_REPLACEMENT' => cot_textarea('bbc_replacement', $bbc['replacement'], 2, 20), 'ADMIN_BBCODE_MODE' => cot_selectbox(!empty($bbc['mode']) ? $bbc['mode'] : 'pcre', 'bbc_mode', $bbc_modes, $bbc_modes, false), 'ADMIN_BBCODE_PRIO' => cot_selectbox(is_numeric($bbc['priority']) ? $bbc['priority'] : '128', 'bbc_priority', range(1, 256), range(1, 256), false), 'ADMIN_BBCODE_POSTRENDER' => cot_checkbox($bbc['postrender'], 'bbc_postrender'), 'ADMIN_BBCODE_URL_CLEAR_CACHE' => cot_url('admin', 'm=other&p=bbcode&a=clearcache&d=' . $durl), 'ADMIN_BBCODE_UPDATE_URL' => cot_url('admin', 'm=other&p=bbcode&a=upd&d=' . $durl)));
// HTML conversion links
if (cot_module_active('page')) {
$bb_t->assign(array('ADMIN_BBCODE_CONVERT_URL' => cot_url('admin', 'm=other&p=bbcode&a=convert&b=page'), 'ADMIN_BBCODE_CONVERT_TITLE' => $L['adm_bbcodes_convert_page']));
$bb_t->parse('MAIN.ADMIN_BBCODE_CONVERT');
}
if (cot_module_active('forums')) {
$bb_t->assign(array('ADMIN_BBCODE_CONVERT_URL' => cot_url('admin', 'm=other&p=bbcode&a=convert&b=forums'), 'ADMIN_BBCODE_CONVERT_TITLE' => $L['adm_bbcodes_convert_forums']));
$bb_t->parse('MAIN.ADMIN_BBCODE_CONVERT');
}
if (cot_plugin_active('comments')) {
$bb_t->assign(array('ADMIN_BBCODE_CONVERT_URL' => cot_url('admin', 'm=other&p=bbcode&a=convert&b=comments'), 'ADMIN_BBCODE_CONVERT_TITLE' => $L['adm_bbcodes_convert_comments']));
$bb_t->parse('MAIN.ADMIN_BBCODE_CONVERT');
}
if (cot_module_active('pm')) {
$bb_t->assign(array('ADMIN_BBCODE_CONVERT_URL' => cot_url('admin', 'm=other&p=bbcode&a=convert&b=pm'), 'ADMIN_BBCODE_CONVERT_TITLE' => $L['adm_bbcodes_convert_pm']));
$bb_t->parse('MAIN.ADMIN_BBCODE_CONVERT');
}
//if (cot_module_active('users'))
//{
$bb_t->assign(array('ADMIN_BBCODE_CONVERT_URL' => cot_url('admin', 'm=other&p=bbcode&a=convert&b=users'), 'ADMIN_BBCODE_CONVERT_TITLE' => $L['adm_bbcodes_convert_users']));
$bb_t->parse('MAIN.ADMIN_BBCODE_CONVERT');
//}
cot_display_messages($bb_t);
/* === Hook === */
foreach (cot_getextplugins('bbcode.admin.tags') as $pl) {
include $pl;
}
/* ===== */
$bb_t->parse('MAIN');
$plugin_body = $bb_t->text('MAIN');