本文整理汇总了PHP中cot_xg函数的典型用法代码示例。如果您正苦于以下问题:PHP cot_xg函数的具体用法?PHP cot_xg怎么用?PHP cot_xg使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cot_xg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: form_structure_editor
function form_structure_editor($id)
{
global $cot_structure, $cot_extrafields, $db_structure, $structure, $L, $R;
$row = $cot_structure->category($id);
if (empty($row)) {
return null;
}
$ii++;
$structure_id = $row['structure_id'];
$structure_code = $row['structure_code'];
$n = $row['structure_area'];
$dozvil = $row['structure_count'] > 0 ? false : true;
$is_module = cot_module_active($n);
$t = new XTemplate(cot_tplfile('cateditor.admin.edit', 'plug'));
$t->assign(array('ADMIN_STRUCTURE_HEADER' => $row['structure_title'], 'ADMIN_STRUCTURE_DEL_URL' => $dozvil ? cot_confirm_url(cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&a=delete&id=' . $row['structure_id'] . '&' . cot_xg()), 'admin') : '', 'ADMIN_STRUCTURE_UPDATE_FORM_URL' => cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&id=' . $structure_id . '&a=update'), 'ADMIN_STRUCTURE_ID' => $row['structure_id'], 'ADMIN_STRUCTURE_CODE' => cot_inputbox('text', 'rstructurecode', $structure_code, 'size="10" maxlength="255"'), 'ADMIN_STRUCTURE_PATHFIELDIMG' => mb_strpos($row['structure_path'], '.') == 0 ? $R['admin_icon_join1'] : $R['admin_icon_join2'], 'ADMIN_STRUCTURE_PATH' => cot_inputbox('text', 'rstructurepath', $row['structure_path'], 'size="12" maxlength="255"'), 'ADMIN_STRUCTURE_TPL' => cot_inputbox('text', 'rstructuretpl', $row['structure_tpl'], 'size="10" maxlength="255"'), 'ADMIN_STRUCTURE_TITLE' => cot_inputbox('text', 'rstructuretitle', $row['structure_title'], 'size="32" maxlength="255"'), 'ADMIN_STRUCTURE_DESC' => cot_inputbox('text', 'rstructuredesc', $row['structure_desc'], 'size="64" maxlength="255"'), 'ADMIN_STRUCTURE_ICON' => cot_inputbox('text', 'rstructureicon', $row['structure_icon'], 'size="64" maxlength="128"'), 'ADMIN_STRUCTURE_LOCKED' => cot_checkbox($row['structure_locked'], 'rstructurelocked'), 'ADMIN_STRUCTURE_COUNT' => $row['structure_count'], 'ADMIN_STRUCTURE_PARENT' => $cot_structure->select($cot_structure->get_parent($id), 'rstructureparent', true, 'disabled="disabled"'), 'ADMIN_STRUCTURE_JUMPTO_URL' => cot_url($n, 'c=' . $structure_code), 'ADMIN_STRUCTURE_RIGHTS_URL' => $is_module ? cot_url('admin', 'm=rightsbyitem&ic=' . $n . '&io=' . $structure_code) : '', 'ADMIN_STRUCTURE_ODDEVEN' => cot_build_oddeven($ii)));
foreach ($cot_extrafields[$db_structure] as $exfld) {
$exfld_val = cot_build_extrafields('rstructure' . $exfld['field_name'], $exfld, $row['structure_' . $exfld['field_name']]);
$exfld_title = isset($L['structure_' . $exfld['field_name'] . '_title']) ? $L['structure_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$t->assign(array('ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) => $exfld_val, 'ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) . '_TITLE' => $exfld_title, 'ADMIN_STRUCTURE_EXTRAFLD' => $exfld_val, 'ADMIN_STRUCTURE_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.EXTRAFLD');
}
require_once cot_incfile('configuration');
$optionslist = cot_config_list($is_module ? 'module' : 'plug', $n, $structure_code);
/* === Hook - Part1 : Set === */
$extp = cot_getextplugins('admin.config.edit.loop');
/* ===== */
foreach ($optionslist as $row_c) {
list($title, $hint) = cot_config_titles($row_c['config_name'], $row_c['config_text']);
if ($row_c['config_type'] == COT_CONFIG_TYPE_SEPARATOR) {
$t->assign('ADMIN_CONFIG_FIELDSET_TITLE', $title);
$t->parse('MAIN.OPTIONS.CONFIG.ADMIN_CONFIG_ROW.ADMIN_CONFIG_FIELDSET_BEGIN');
} else {
$t->assign(array('ADMIN_CONFIG_ROW_CONFIG' => cot_config_input($row_c['config_name'], $row_c['config_type'], $row_c['config_value'], $row_c['config_variants']), 'ADMIN_CONFIG_ROW_CONFIG_TITLE' => $title, 'ADMIN_CONFIG_ROW_CONFIG_MORE_URL' => cot_url('admin', 'm=structure&n=' . $n . '&d=' . $durl . '&id=' . $structure_id . '&al=' . $structure_code . '&a=reset&v=' . $row_c['config_name'] . '&' . cot_xg()), 'ADMIN_CONFIG_ROW_CONFIG_MORE' => $hint));
/* === Hook - Part2 : Include === */
foreach ($extp as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.CONFIG.ADMIN_CONFIG_ROW.ADMIN_CONFIG_ROW_OPTION');
}
$t->parse('MAIN.CONFIG.ADMIN_CONFIG_ROW');
}
/* === Hook === */
foreach (cot_getextplugins('admin.config.edit.tags') as $pl) {
include $pl;
}
/* ===== */
$t->assign('CONFIG_HIDDEN', cot_inputbox('hidden', 'editconfig', $structure_code));
$t->parse('MAIN.CONFIG');
$t->parse('MAIN');
return $t->text('MAIN');
}
示例2: foreach
/* ===== */
foreach ($sql->fetchAll() as $row) {
$id2 = $row['rating_code'];
$sql1 = $db->query("SELECT COUNT(*) FROM {$db_rated} WHERE rated_code=" . $db->quote($id2));
$votes = $sql1->fetchColumn();
$rat_type = mb_substr($row['rating_code'], 0, 1);
$rat_value = mb_substr($row['rating_code'], 1);
switch ($rat_type) {
case 'p':
$rat_url = cot_url('page', 'id=' . $rat_value);
break;
default:
$rat_url = '';
break;
}
$t->assign(array('ADMIN_RATINGS_ROW_URL_DEL' => cot_url('admin', 'm=other&p=ratings&a=delete&id=' . $row['rating_code'] . '&d=' . $durl . '&' . cot_xg()), 'ADMIN_RATINGS_ROW_RATING_CODE' => $row['rating_code'], 'ADMIN_RATINGS_ROW_RATING_AREA' => $row['rating_area'], 'ADMIN_RATINGS_ROW_CREATIONDATE' => cot_date('datetime_medium', $row['rating_creationdate']), 'ADMIN_RATINGS_ROW_CREATIONDATE_STAMP' => $row['rating_creationdate'], 'ADMIN_RATINGS_ROW_VOTES' => $votes, 'ADMIN_RATINGS_ROW_RATING_AVERAGE' => $row['rating_average'], 'ADMIN_RATINGS_ROW_RAT_URL' => $rat_url, 'ADMIN_RATINGS_ROW_ODDEVEN' => cot_build_oddeven($ii)));
/* === Hook - Part2 : Include === */
foreach ($extp as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.RATINGS_ROW');
$ii++;
$jj = $jj + $votes;
}
$t->assign(array('ADMIN_RATINGS_URL_CONFIG' => cot_url('admin', 'm=config&n=edit&o=plug&p=ratings'), 'ADMIN_RATINGS_PAGINATION_PREV' => $pagenav['prev'], 'ADMIN_RATINGS_PAGNAV' => $pagenav['main'], 'ADMIN_RATINGS_PAGINATION_NEXT' => $pagenav['next'], 'ADMIN_RATINGS_TOTALITEMS' => $totalitems, 'ADMIN_RATINGS_ON_PAGE' => $ii, 'ADMIN_RATINGS_TOTALVOTES' => $jj));
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('admin.ratings.tags') as $pl) {
include $pl;
}
示例3: cot_incfile
include $pl;
}
/* ===== */
if ($id || !empty($al)) {
require_once cot_incfile('configuration');
$optionslist = cot_config_list($is_module ? 'module' : 'plug', $n, $structure_code);
/* === Hook - Part1 : Set === */
$extp = cot_getextplugins('admin.config.edit.loop');
/* ===== */
foreach ($optionslist as $row_c) {
list($title, $hint) = cot_config_titles($row_c['config_name'], $row_c['config_text']);
if ($row_c['config_type'] == COT_CONFIG_TYPE_SEPARATOR) {
$t->assign('ADMIN_CONFIG_FIELDSET_TITLE', $title);
$t->parse('MAIN.OPTIONS.CONFIG.ADMIN_CONFIG_ROW.ADMIN_CONFIG_FIELDSET_BEGIN');
} else {
$t->assign(array('ADMIN_CONFIG_ROW_CONFIG' => cot_config_input($row_c['config_name'], $row_c['config_type'], $row_c['config_value'], $row_c['config_variants']), 'ADMIN_CONFIG_ROW_CONFIG_TITLE' => $title, 'ADMIN_CONFIG_ROW_CONFIG_MORE_URL' => cot_url('admin', 'm=structure&n=' . $n . '&d=' . $durl . '&id=' . $structure_id . '&al=' . $structure_code . '&a=reset&v=' . $row_c['config_name'] . '&' . cot_xg()), 'ADMIN_CONFIG_ROW_CONFIG_MORE' => $hint));
/* === Hook - Part2 : Include === */
foreach ($extp as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.OPTIONS.CONFIG.ADMIN_CONFIG_ROW.ADMIN_CONFIG_ROW_OPTION');
}
$t->parse('MAIN.OPTIONS.CONFIG.ADMIN_CONFIG_ROW');
}
/* === Hook === */
foreach (cot_getextplugins('admin.config.edit.tags') as $pl) {
include $pl;
}
/* ===== */
$t->assign('CONFIG_HIDDEN', cot_inputbox('hidden', 'editconfig', $structure_code));
示例4: cot_date
$t_o->assign(array("OFFER_ROW_DATE" => cot_date('d.m.Y H:i', $offer['offer_date']), "OFFER_ROW_DATE_STAMP" => $offer['offer_date'], "OFFER_ROW_TEXT" => cot_parse($offer['offer_text']), "OFFER_ROW_COSTMIN" => number_format($offer['offer_cost_min'], '0', '.', ' '), "OFFER_ROW_COSTMAX" => number_format($offer['offer_cost_max'], '0', '.', ' '), "OFFER_ROW_TIMEMIN" => $offer['offer_time_min'], "OFFER_ROW_TIMEMAX" => $offer['offer_time_max'], "OFFER_ROW_TIMETYPE" => $L['offers_timetype'][$offer['offer_time_type']], "OFFER_ROW_HIDDEN" => $offer['offer_hidden'], "OFFER_ROW_CHOISE" => $offer['offer_choise']));
// Extrafields
if (isset($cot_extrafields[$db_projects_offers])) {
foreach ($cot_extrafields[$db_projects_offers] as $exfld) {
$uname = mb_strtoupper($exfld['field_name']);
$t_o->assign(array('OFFER_ROW_' . $uname . '_TITLE' => isset($L['offers_' . $exfld['field_name'] . '_title']) ? $L['offers_' . $exfld['field_name'] . '_title'] : $exfld['field_description'], 'OFFER_ROW_' . $uname => cot_build_extrafields_data('offers', $exfld, $offer['item_' . $exfld['field_name']])));
}
}
$choise_enabled = true;
/* === Hook - Part1 : Include === */
foreach ($extp1 as $pl) {
include $pl;
}
/* ===== */
if ($usr['id'] == $item['item_userid'] && $choise_enabled) {
$t_o->assign(array("OFFER_ROW_SETPERFORMER" => cot_url('projects', 'id=' . $id . '&a=setperformer&userid=' . $offer['user_id'] . '&' . cot_xg()), "OFFER_ROW_REFUSE" => cot_url('projects', 'id=' . $id . '&a=refuse&userid=' . $offer['user_id'] . '&' . cot_xg())));
/* === Hook - Part2 : Include === */
foreach ($extp2 as $pl) {
include $pl;
}
/* ===== */
$t_o->parse("MAIN.ROWS.CHOISE");
}
if ($usr['id'] == $offer['offer_userid'] || $usr['id'] == $item['item_userid'] || $usr['isadmin']) {
$sql_prjposts = $db->query("SELECT * FROM {$db_projects_posts} as p LEFT JOIN {$db_users} as u ON u.user_id=p.post_userid\n\t\t\tWHERE post_pid=" . $id . " AND post_oid=" . $offer['offer_id'] . " ORDER BY post_date ASC");
while ($posts = $sql_prjposts->fetch()) {
$t_o->assign(cot_generate_usertags($posts, 'POST_ROW_OWNER_'));
$t_o->assign(array("POST_ROW_TEXT" => cot_parse($posts['post_text']), "POST_ROW_DATE" => cot_date('d.m.y H:i', $posts['post_date']), "POST_ROW_DATE_STAMP" => $posts['post_date']));
/* === Hook - Part3 : Include === */
foreach ($extp3 as $pl) {
include $pl;
示例5: defined
<?php
/**
* pagecattree Plugin for Cotonti CMF
*
* @version 2.0.0
* @author esclkm, http://www.littledev.ru
* @copyright (c) 2008-2011 esclkm, http://www.littledev.ru
*/
defined('COT_CODE') or die('Wrong URL.');
$tree = $cot_structure->build_tree();
// max
//str_pad
if ($id > 0) {
require_once cot_incfile('cateditor', 'plug', 'admin.edit');
$editor = form_structure_editor($id);
} else {
$parentid = cot_import('parentid', 'G', 'INT');
require_once cot_incfile('cateditor', 'plug', 'admin.new');
$editor = form_structure_new($parentid);
}
$t->assign(array('NEWCATEGORY_URL' => cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&parentid=' . $id), 'RESYNC_URL' => cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&a=resyncall&' . cot_xg()), 'TREE' => $tree, 'EDITOR' => $editor));
示例6: cot_getextplugins
$ii = 0;
/* === Hook - Part1 : Set === */
$extp = cot_getextplugins('referers.admin.loop');
/* ===== */
foreach ($referers as $referer => $url) {
$tt->assign('ADMIN_REFERERS_REFERER', htmlspecialchars($referer));
foreach ($url as $uri => $count) {
$tt->assign(array('ADMIN_REFERERS_URI' => htmlspecialchars(cot_cutstring($uri, 128)), 'ADMIN_REFERERS_COUNT' => $count, 'ADMIN_REFERERS_ODDEVEN' => cot_build_oddeven($ii)));
/* === Hook - Part2 : Include === */
foreach ($extp as $pl) {
include $pl;
}
/* ===== */
$tt->parse('MAIN.REFERERS_ROW.REFERERS_URI');
}
$tt->parse('MAIN.REFERERS_ROW');
$ii++;
}
$is_ref_empty = true;
} else {
$is_ref_empty = false;
}
$tt->assign(array('ADMIN_REFERERS_URL_PRUNE' => cot_url('admin', 'm=other&p=referers&a=prune&' . cot_xg()), 'ADMIN_REFERERS_URL_PRUNELOWHITS' => cot_url('admin', 'm=other&p=referers&a=prunelowhits&' . cot_xg()), 'ADMIN_REFERERS_PAGINATION_PREV' => $pagenav['prev'], 'ADMIN_REFERERS_PAGNAV' => $pagenav['main'], 'ADMIN_REFERERS_PAGINATION_NEXT' => $pagenav['next'], 'ADMIN_REFERERS_TOTALITEMS' => $totalitems, 'ADMIN_REFERERS_ON_PAGE' => $ii));
cot_display_messages($tt);
/* === Hook === */
foreach (cot_getextplugins('referers.admin.tags') as $pl) {
include $pl;
}
/* ===== */
$tt->parse('MAIN');
$plugin_body = $tt->text('MAIN');
示例7: cot_comments_display
//.........这里部分代码省略.........
}
/* ===== */
$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) {
$i++;
$kk++;
$com_admin = $auth_admin ? cot_rc('comments_code_admin', array('ipsearch' => cot_build_ipsearch($row['com_authorip']), 'delete_url' => cot_confirm_url(cot_url('plug', 'e=comments&a=delete&cat=' . $cat . '&id=' . $row['com_id'] . '&' . cot_xg()), 'comments', 'comments_confirm_delete'))) : '';
$com_text = cot_parse($row['com_text'], $cfg['plugin']['comments']['markup']);
$time_limit = $sys['now'] < $row['com_date'] + $cfg['plugin']['comments']['time'] * 60 ? TRUE : FALSE;
$usr['isowner_com'] = $time_limit && ($usr['id'] > 0 && $row['com_authorid'] == $usr['id'] || $usr['id'] == 0 && !empty($_SESSION['cot_comments_edit'][$row['com_id']]) && $usr['ip'] == $row['com_authorip']);
$com_gup = $sys['now'] - ($row['com_date'] + $cfg['plugin']['comments']['time'] * 60);
$allowed_time = $usr['isowner_com'] && !$usr['isadmin'] ? ' - ' . cot_build_timegap($sys['now'] + $com_gup, $sys['now']) . $L['plu_comgup'] : '';
$com_edit = $auth_admin || $usr['isowner_com'] ? cot_rc('comments_code_edit', array('edit_url' => cot_url('plug', 'e=comments&m=edit&cat=' . $cat . '&id=' . $row['com_id']), 'allowed_time' => $allowed_time)) : '';
if ($row['com_area'] == 'page') {
if ($usr['id'] == 0 && $usr['isowner_com'] && $cfg['cache_page']) {
$cfg['cache_page'] = $cfg['cache_index'] = false;
}
}
$t->assign(array('COMMENTS_ROW_ID' => $row['com_id'], 'COMMENTS_ROW_ORDER' => $cfg['plugin']['comments']['order'] == 'Recent' ? $totalitems - $i + 1 : $i, 'COMMENTS_ROW_URL' => cot_url($link_area, $link_params, '#c' . $row['com_id']), 'COMMENTS_ROW_AUTHOR' => cot_build_user($row['com_authorid'], htmlspecialchars($row['com_author'])), 'COMMENTS_ROW_AUTHORID' => $row['com_authorid'], 'COMMENTS_ROW_TEXT' => $com_text, 'COMMENTS_ROW_DATE' => cot_date('datetime_medium', $row['com_date']), 'COMMENTS_ROW_DATE_STAMP' => $row['com_date'], 'COMMENTS_ROW_ADMIN' => $com_admin, 'COMMENTS_ROW_EDIT' => $com_edit, 'COMMENTS_ROW_ODDEVEN' => cot_build_oddeven($kk), 'COMMENTS_ROW_NUM' => $kk));
// Extrafields
if (!empty(cot::$extrafields[cot::$db->com])) {
foreach (cot::$extrafields[cot::$db->com] as $exfld) {
$tag = mb_strtoupper($exfld['field_name']);
$exfld_title = cot_extrafield_title($exfld, 'comments_');
$t->assign(array('COMMENTS_ROW_' . $tag . '_TITLE' => $exfld_title, 'COMMENTS_ROW_' . $tag => cot_build_extrafields_data('comments', $exfld, $row['com_' . $exfld['field_name']]), 'COMMENTS_ROW_' . $tag . '_VALUE' => $row['com_' . $exfld['field_name']]));
}
}
$t->assign(cot_generate_usertags($row, 'COMMENTS_ROW_AUTHOR_', htmlspecialchars($row['com_author'])));
/* === Hook - Part2 : Include === */
foreach ($extp as $pl) {
include $pl;
}
/* ===== */
$t->parse('COMMENTS.COMMENTS_ROW');
}
$pagenav = cot_pagenav($link_area, $link_params, $d, $totalitems, $cfg['plugin']['comments']['maxcommentsperpage'], $d_var, '#comments', $cfg['jquery'] && $cfg['ajax_enabled'], 'comments', 'plug', "e=comments&area={$ext_name}&cat={$cat}&item={$code}");
$t->assign(array('COMMENTS_PAGES_INFO' => cot_rc('comments_code_pages_info', array('totalitems' => $totalitems, 'onpage' => $i - $d)), 'COMMENTS_PAGES_TOTALITEMS' => $totalitems, 'COMMENTS_PAGES_PAGESPREV' => $pagenav['prev'], 'COMMENTS_PAGES_PAGNAV' => $pagenav['main'], 'COMMENTS_PAGES_PAGESNEXT' => $pagenav['next']));
$t->parse('COMMENTS.PAGNAVIGATOR');
} elseif (!$sql->rowCount() && $enabled) {
$t->assign(array('COMMENTS_EMPTYTEXT' => $L['com_nocommentsyet']));
$t->parse('COMMENTS.COMMENTS_EMPTY');
}
/* == Hook == */
foreach (cot_getextplugins('comments.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('COMMENTS');
$res_display = $t->text('COMMENTS');
return $res_display;
}
示例8: str_replace
$t->assign(array('ADMIN_CACHE_MEMORY_DRIVER' => str_replace('_driver', '', $cache->mem_driver), 'ADMIN_CACHE_MEMORY_PERCENTBAR' => ceil($info['occupied'] / $info['max'] * 100), 'ADMIN_CACHE_MEMORY_AVAILABLE' => $info['available'], 'ADMIN_CACHE_MEMORY_MAX' => $info['max']));
$t->parse('MAIN.ADMIN_CACHE_MEMORY');
}
$sql = $db->query("SELECT * FROM {$db_cache} WHERE 1 ORDER by c_name ASC");
$cachesize = 0;
$ii = 0;
/* === Hook - Part1 : Set === */
$extp = cot_getextplugins('admin.cache.loop');
/* ===== */
foreach ($sql->fetchAll() as $row) {
$row['c_value'] = htmlspecialchars($row['c_value']);
$row['size'] = mb_strlen($row['c_value']);
$cachesize += $row['size'];
$t->assign(array('ADMIN_CACHE_ITEM_DEL_URL' => cot_url('admin', 'm=cache&a=delete&name=' . $row['c_name'] . '&' . cot_xg()), 'ADMIN_CACHE_ITEM_NAME' => $row['c_name'], 'ADMIN_CACHE_EXPIRE' => $row['c_expire'] > 0 ? cot_date('datetime_short', $row['c_expire']) : '-', 'ADMIN_CACHE_SIZE' => $row['size'], 'ADMIN_CACHE_VALUE' => $a == 'showall' ? $row['c_value'] : cot_cutstring($row['c_value'], 80), 'ADMIN_CACHE_ROW_ODDEVEN' => cot_build_oddeven($ii)));
/* === Hook - Part2 : Include === */
foreach ($extp as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.ADMIN_CACHE_ROW');
$ii++;
}
$t->assign(array('ADMIN_CACHE_URL_REFRESH' => cot_url('admin', 'm=cache'), 'ADMIN_CACHE_URL_PURGE' => cot_url('admin', 'm=cache&a=purge&' . cot_xg()), 'ADMIN_CACHE_URL_SHOWALL' => cot_url('admin', 'm=cache&a=showall'), 'ADMIN_CACHE_CACHESIZE' => $cachesize));
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('admin.cache.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN');
$adminmain = $t->text('MAIN');
示例9: cot_auth_clear
/* ===== */
cot_auth_clear('all');
$cache && $cache->db->remove('cot_groups', 'system');
cot_message('Deleted');
cot_redirect(cot_url('admin', 'm=users', '', true));
} else {
$showdefault = false;
$sql = $db->query("SELECT * FROM {$db_groups} WHERE grp_id='{$g}'");
cot_die($sql->rowCount() == 0);
$row = $sql->fetch();
$sql1 = $db->query("SELECT COUNT(*) FROM {$db_groups_users} WHERE gru_groupid='{$g}'");
$row['grp_memberscount'] = $sql1->fetchColumn();
$row['grp_name'] = htmlspecialchars($row['grp_name']);
$row['grp_title'] = htmlspecialchars($row['grp_title']);
$adminpath[] = array(cot_url('admin', 'm=users&n=edit&g=' . $g), $row['grp_name']);
$t->assign(array('ADMIN_USERS_GRP_NAME' => $row['grp_name'], 'ADMIN_USERS_GRP_TITLE' => $row['grp_title'], 'ADMIN_USERS_EDITFORM_URL' => cot_url('admin', 'm=users&n=edit&a=update&g=' . $g), 'ADMIN_USERS_EDITFORM_GRP_NAME' => cot_inputbox('text', 'rname', $row['grp_name'], 'size="40" maxlength="64"'), 'ADMIN_USERS_EDITFORM_GRP_TITLE' => cot_inputbox('text', 'rtitle', $row['grp_title'], 'size="40" maxlength="64"'), 'ADMIN_USERS_EDITFORM_GRP_DESC' => cot_inputbox('text', 'rdesc', htmlspecialchars($row['grp_desc']), 'size="40" maxlength="64"'), 'ADMIN_USERS_EDITFORM_GRP_ICON' => cot_inputbox('text', 'ricon', htmlspecialchars($row['grp_icon']), 'size="40" maxlength="128"'), 'ADMIN_USERS_EDITFORM_GRP_ALIAS' => cot_inputbox('text', 'ralias', htmlspecialchars($row['grp_alias']), 'size="40" maxlength="24"'), 'ADMIN_USERS_EDITFORM_GRP_DISABLED' => $g <= 5 ? $L['No'] : cot_radiobox($row['grp_disabled'], 'rdisabled', array(1, 0), array($L['Yes'], $L['No'])), 'ADMIN_USERS_EDITFORM_GRP_MAINTENANCE' => cot_radiobox($row['grp_maintenance'], 'rmtmode', array(1, 0), array($L['Yes'], $L['No'])), 'ADMIN_USERS_EDITFORM_GRP_SKIPRIGHTS' => cot_radiobox($row['grp_skiprights'], 'rskiprights', array(1, 0), array($L['Yes'], $L['No'])), 'ADMIN_USERS_EDITFORM_GRP_RLEVEL' => cot_selectbox($row['grp_level'], 'rlevel', range(0, 99), range(0, 99), false), 'ADMIN_USERS_EDITFORM_GRP_MEMBERSCOUNT' => $row['grp_memberscount'], 'ADMIN_USERS_EDITFORM_GRP_MEMBERSCOUNT_URL' => cot_url('users', 'g=' . $g), 'ADMIN_USERS_EDITFORM_SKIPRIGHTS' => $row['grp_skiprights'], 'ADMIN_USERS_EDITFORM_RIGHT_URL' => cot_url('admin', 'm=rights&g=' . $g), 'ADMIN_USERS_EDITFORM_DEL_URL' => cot_url('admin', 'm=users&n=edit&a=delete&g=' . $g . '&' . cot_xg()), 'ADMIN_USERS_EDITFORM_DEL_CONFIRM_URL' => cot_confirm_url(cot_url('admin', 'm=users&n=edit&a=delete&g=' . $g . '&' . cot_xg()))));
/* === Hook === */
foreach (cot_getextplugins('admin.users.edit.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.ADMIN_USERS_EDIT');
}
}
if (!isset($showdefault) || $showdefault == true) {
$sql = $db->query("SELECT DISTINCT(gru_groupid), COUNT(*) FROM {$db_groups_users} WHERE 1 GROUP BY gru_groupid");
while ($row = $sql->fetch()) {
$members[$row['gru_groupid']] = $row['COUNT(*)'];
}
$sql->closeCursor();
$sql = $db->query("SELECT * FROM {$db_groups} WHERE 1 ORDER BY grp_level DESC, grp_id DESC");
示例10: array
}
if (in_array($pfs_extension, $gd_supported) && $cfg['pfs']['th_amode'] != 'Disabled') {
if (!file_exists($thumbs_dir_user . $pfs_file) && file_exists($pfs_dir_user . $pfs_file)) {
$th_colortext = array(hexdec(mb_substr($cfg['pfs']['th_colortext'], 0, 2)), hexdec(mb_substr($cfg['pfs']['th_colortext'], 2, 2)), hexdec(mb_substr($cfg['pfs']['th_colortext'], 4, 2)));
$th_colorbg = array(hexdec(mb_substr($cfg['pfs']['th_colorbg'], 0, 2)), hexdec(mb_substr($cfg['pfs']['th_colorbg'], 2, 2)), hexdec(mb_substr($cfg['pfs']['th_colorbg'], 4, 2)));
cot_imageresize($pfs_dir_user . $pfs_file, $thumbs_dir_user . $pfs_file, $cfg['pfs']['th_x'], $cfg['pfs']['th_y'], '', $th_colorbg, $cfg['pfs']['th_jpeg_quality'], true);
}
if ($standalone) {
$add_thumbnail .= cot_rc('pfs_link_addthumb');
$add_image = cot_rc('pfs_link_addpix');
}
if ($opt == 'thumbs') {
$pfs_icon = cot_rc('pfs_link_thumbnail', array('thumbpath' => $thumbs_dir_user));
}
}
$t->assign(array('PFS_ROW_ID' => $pfs_id, 'PFS_ROW_FILE' => $pfs_file, 'PFS_ROW_DATE' => cot_date('datetime_medium', $pfs_date), 'PFS_ROW_DATE_STAMP' => $pfs_date, 'PFS_ROW_EXT' => $pfs_extension, 'PFS_ROW_DESC' => $pfs_desc, 'PFS_ROW_TYPE' => $filedesc[$pfs_extension], 'PFS_ROW_FILE_URL' => $pfs_fullfile, 'PFS_ROW_SIZE' => cot_build_filesize($pfs_filesize, 1), 'PFS_ROW_SIZE_BYTES' => $pfs_filesize, 'PFS_ROW_ICON' => $pfs_icon, 'PFS_ROW_DELETE_URL' => cot_confirm_url(cot_url('pfs', 'a=delete&' . cot_xg() . '&id=' . $pfs_id . '&' . $more . '&opt=' . $opt), 'pfs', 'pfs_confirm_delete_file'), 'PFS_ROW_EDIT_URL' => cot_url('pfs', 'm=edit&id=' . $pfs_id . '&' . $more), 'PFS_ROW_COUNT' => $row['pfs_count'], 'PFS_ROW_INSERT' => $standalone ? $add_thumbnail . $add_image . $add_file : ''));
/* === Hook - Part2 : Include === */
foreach ($extp as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.PFS_ROW');
$pfs_foldersize = $pfs_foldersize + $pfs_filesize;
$iji++;
}
if ($files_count > 0 || $folders_count > 0) {
if ($folders_count > 0) {
$totalitemsf = $folders_count;
$pagenav = cot_pagenav('pfs', $more, $df, $totalitemsf, $cfg['pfs']['maxpfsperpage'], 'df');
$t->assign(array('PFF_FOLDERCOUNT_TITLE' => cot_declension($folders_count, $Ls['Folders']), 'PFF_FILESCOUNT_TITLE' => cot_declension($subfiles_count, $Ls['Files']), 'PFF_ONPAGE_FOLDERS_TITLE' => cot_declension($iki, $Ls['Folders']), 'PFF_ONPAGE_FILES_TITLE' => cot_declension($subfiles_count_on_page, $Ls['Files']), 'PFF_FOLDERCOUNT' => $folders_count, 'PFF_FILESCOUNT' => $subfiles_count, 'PFF_ONPAGE_FOLDERS' => $iki, 'PFF_ONPAGE_FILES' => $subfiles_count_on_page, 'PFF_PAGING_PREV' => $pagenav['prev'], 'PFF_PAGING_CURRENT' => $pagenav['main'], 'PFF_PAGING_NEXT' => $pagenav['next']));
}
示例11: defined
<?php
/**
* [BEGIN_COT_EXT]
* Hooks=projects.offers.choise
* [END_COT_EXT]
*/
/**
* Sbr plugin
*
* @package sbr
* @version 1.0.3
* @author CMSWorks Team
* @copyright Copyright (c) CMSWorks.ru
* @license BSD
*/
defined('COT_CODE') or die('Wrong URL.');
require_once cot_incfile('sbr', 'plug');
require_once cot_incfile('projects', 'module');
require_once cot_incfile('payments', 'module');
if ($offers['item_choise'] != 'refuse') {
$t_o->assign(array("OFFER_ROW_SBRCREATELINK" => cot_url('sbr', 'm=add&pid=' . $id . '&uid=' . $offer['offer_userid'] . '&' . cot_xg())));
}
示例12: cot_block
if ($pinfo = cot_payments_payinfo($pid)) {
// Блокируем доступ к несобственным платежкам
cot_block($usr['id'] == $pinfo['pay_userid']);
// Если счета пользователей включены, то проверяем баланс
if ($cfg['payments']['balance_enabled'] && $pinfo['pay_area'] != 'balance' && $usr['id'] > 0) {
$ubalance = cot_payments_getuserbalance($usr['id']);
if ($ubalance >= $pinfo['pay_summ']) {
if (cot_payments_updatestatus($pid, 'paid')) {
cot_payments_updateuserbalance($usr['id'], -$pinfo['pay_summ'], $pid);
/* === Hook === */
foreach (cot_getextplugins('payments.billing.paid.done') as $pl) {
include $pl;
}
/* ===== */
if (!empty($pinfo['pay_redirect'])) {
$pinfo['pay_redirect'] = $pinfo['pay_redirect'] . '&' . cot_xg();
cot_redirect($pinfo['pay_redirect']);
} else {
cot_redirect(cot_url('index'));
}
}
} else {
$rsumm = $pinfo['pay_summ'] - $ubalance;
cot_redirect(cot_url('payments', 'm=balance&n=billing&rsumm=' . $rsumm . '&pid=' . $pid, '', true));
}
}
// Выводим подключенные платежные системы
if ($cot_billings) {
if (count($cot_billings) == 1) {
foreach ($cot_billings as $bill) {
cot_redirect(cot_url('plug', 'e=' . $bill['plug'] . '&pid=' . $pid, '', true));
示例13: array
$sql = !empty($nbanlistip) || !empty($nbanlistemail) ? $db->insert($db_banlist, array('banlist_ip' => $nbanlistip, 'banlist_email' => $nbanlistemail, 'banlist_reason' => $nbanlistreason, 'banlist_expire' => (int) $nexpire)) : '';
$sql ? cot_message('alreadyaddnewentry') : cot_message('Error');
} elseif ($a == 'delete') {
cot_check_xg();
$id = cot_import('id', 'G', 'INT');
$db->delete($db_banlist, "banlist_id={$id}") ? cot_message('alreadydeletednewentry') : cot_message('Error');
}
$totalitems = $db->countRows($db_banlist);
$pagenav = cot_pagenav('admin', 'm=other&p=banlist', $d, $totalitems, $maxperpage, 'd', '', $cfg['jquery'] && $cfg['turnajax']);
$sql = $db->query("SELECT * FROM {$db_banlist} ORDER by banlist_expire DESC, banlist_ip LIMIT {$d}, " . $maxperpage);
$ii = 0;
/* === Hook - Part1 : Set === */
$extp = cot_getextplugins('banlist.admin.loop');
/* ===== */
foreach ($sql->fetchAll() as $row) {
$tt->assign(array('ADMIN_BANLIST_ROW_ID' => $row['banlist_id'], 'ADMIN_BANLIST_ROW_URL' => cot_url('admin', 'm=other&p=banlist&a=update&id=' . $row['banlist_id'] . '&d=' . $durl), 'ADMIN_BANLIST_ROW_DELURL' => cot_url('admin', 'm=other&p=banlist&a=delete&id=' . $row['banlist_id'] . '&' . cot_xg()), 'ADMIN_BANLIST_ROW_EXPIRE' => $row['banlist_expire'] > 0 ? cot_date('datetime_medium', $row['banlist_expire']) : $L['banlist_neverexpire'], 'ADMIN_BANLIST_ROW_EXPIRE_STAMP' => $row['banlist_expire'] > 0 ? $row['banlist_expire'] : '', 'ADMIN_BANLIST_ROW_IP' => cot_inputbox('text', 'rbanlistip', $row['banlist_ip'], 'size="18" maxlength="16"'), 'ADMIN_BANLIST_ROW_EMAIL' => cot_inputbox('text', 'rbanlistemail', $row['banlist_email'], 'size="10" maxlength="64"'), 'ADMIN_BANLIST_ROW_REASON' => cot_inputbox('text', 'rbanlistreason', $row['banlist_reason'], 'size="22" maxlength="64"'), 'ADMIN_BANLIST_ROW_ODDEVEN' => cot_build_oddeven($ii)));
/* === Hook - Part2 : Include === */
foreach ($extp as $pl) {
include $pl;
}
/* ===== */
$tt->parse('MAIN.ADMIN_BANLIST_ROW');
$ii++;
}
$time_array = array('0', '3600', '7200', '14400', '28800', '57600', '86400', '172800', '345600', '604800', '1209600', '1814400', '2592000');
$time_values = array($L['banlist_neverexpire'], cot_declension(1, $Ls['Hours']), cot_declension(2, $Ls['Hours']), cot_declension(4, $Ls['Hours']), cot_declension(8, $Ls['Hours']), cot_declension(16, $Ls['Hours']), cot_declension(1, $Ls['Days']), cot_declension(2, $Ls['Days']), cot_declension(4, $Ls['Days']), cot_declension(1, $Ls['Weeks']), cot_declension(2, $Ls['Weeks']), cot_declension(3, $Ls['Weeks']), cot_declension(1, $Ls['Months']));
$tt->assign(array('ADMIN_BANLIST_PAGINATION_PREV' => $pagenav['prev'], 'ADMIN_BANLIST_PAGNAV' => $pagenav['main'], 'ADMIN_BANLIST_PAGINATION_NEXT' => $pagenav['next'], 'ADMIN_BANLIST_TOTALITEMS' => $totalitems, 'ADMIN_BANLIST_COUNTER_ROW' => $ii, 'ADMIN_BANLIST_URLFORMADD' => cot_url('admin', 'm=other&p=banlist&a=add'), 'ADMIN_BANLIST_EXPIRE' => cot_selectbox('0', 'nexpire', $time_array, $time_values, false), 'ADMIN_BANLIST_IP' => cot_inputbox('text', 'nbanlistip', '', 'size="18" maxlength="16"'), 'ADMIN_BANLIST_EMAIL' => cot_inputbox('text', 'nbanlistemail', '', 'size="24" maxlength="64"'), 'ADMIN_BANLIST_REASON' => cot_inputbox('text', 'nbanlistreason', '', 'size="48" maxlength="64"')));
cot_display_messages($tt);
/* === Hook === */
foreach (cot_getextplugins('banlist.admin.tags') as $pl) {
include $pl;
示例14: defined
[BEGIN_COT_EXT]
Hooks=tools
[END_COT_EXT]
==================== */
/**
* Search for an IP in the user database
*
*
* @copyright (c) Cotonti Team
* @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
*/
defined('COT_CODE') or die('Wrong URL');
$adminhelp = $L['ipsearch_help'];
$adminsubtitle = $L['ipsearch_title'];
$t = new XTemplate(cot_tplfile('ipsearch', 'plug', true));
$t->assign(array('IPSEARCH_FORM_URL' => cot_url('admin', 'm=other&p=ipsearch&a=search&' . cot_xg()), 'IPSEARCH_ID' => $id));
if ($a == 'search') {
cot_check_xg();
$id_g = cot_import('id', 'G', 'TXT', 15);
$id_p = cot_import('id', 'P', 'TXT', 15);
if (!empty($id_g)) {
$id = $id_g;
} else {
$id = $id_p;
}
$userip = explode(".", $id);
if (count($userip) != 4 || mb_strlen($userip[0]) > 3 || mb_strlen($userip[1]) > 3 || mb_strlen($userip[2]) > 3 || mb_strlen($userip[3]) > 3) {
cot_die();
}
$ipmask1 = $userip[0] . "." . $userip[1] . "." . $userip[2] . "." . $userip[3];
$ipmask2 = $userip[0] . "." . $userip[1] . "." . $userip[2];
示例15: foreach
foreach ($item_mas as $k => $v) {
if ($k == 'pages') {
foreach ($v as $kk => $vv) {
$row_item = cot_generate_pagetags($vv, 'ADMIN_TAGS_ITEM_', 200);
if ($row_item['ADMIN_TAGS_ITEM_TITLE'] == 'Удалено') {
} else {
$tt->assign($row_item);
//$tt->assign(cot_generate_usertags($row_item['page_ownerid'], 'ADMIN_TAGS_PAGE_OWNER_'), htmlspecialchars($row['user_name']));
$tt->parse('MAIN.ADMIN_TAGS_ROW.ADMIN_TAGS_ROW_ITEMS');
}
}
} elseif ($k == 'forum') {
}
}
}
$tt->assign(array('ADMIN_TAGS_FORM_ACTION' => cot_url('admin', 'm=other&p=tags&d=' . $durl), 'ADMIN_TAGS_DEL_URL' => cot_url('admin', 'm=other&p=tags&a=delete&tag=' . str_replace(' ', '_', $row['tag']) . '&' . cot_xg()), 'ADMIN_TAGS_CODE' => $row['tag'], 'ADMIN_TAGS_TAG' => cot_inputbox('text', 'tag', htmlspecialchars_decode($row['tag']), array('size' => '30', 'maxlength' => '255')), 'ADMIN_TAGS_AREA' => $row['tag_area'], 'ADMIN_TAGS_COUNT' => $row['tag_cnt'], 'ADMIN_TAGS_ITEMS' => str_replace(array('pages:', ','), array('', ', '), $row['tag_grp']), 'ADMIN_TAGS_ODDEVEN' => cot_build_oddeven($ii)));
/* === Hook - Part2 : Include === */
foreach ($extp as $pl) {
include $pl;
}
/* ===== */
$tt->parse('MAIN.ADMIN_TAGS_ROW');
$ii++;
}
$tt->assign(array('ADMIN_TAGS_CONFIG_URL' => cot_url('admin', 'm=config&n=edit&o=plug&p=tags'), 'ADMIN_TAGS_ADMINWARNINGS' => $adminwarnings, 'ADMIN_TAGS_FORM_ACTION' => cot_url('admin', 'm=other&p=tags'), 'ADMIN_TAGS_ORDER' => cot_selectbox($sorttype, 'sorttype', array_keys($sort_type), array_values($sort_type), false), 'ADMIN_TAGS_WAY' => cot_selectbox($sortway, 'sortway', array_keys($sort_way), array_values($sort_way), false), 'ADMIN_TAGS_FILTER' => cot_selectbox($filter, 'filter', array_keys($filter_type), array_values($filter_type), false), 'ADMIN_TAGS_PAGINATION_PREV' => $pagenav['prev'], 'ADMIN_TAGS_PAGNAV' => $pagenav['main'], 'ADMIN_TAGS_PAGINATION_NEXT' => $pagenav['next'], 'ADMIN_TAGS_TOTALITEMS' => $totalitems, 'ADMIN_TAGS_COUNTER_ROW' => $ii));
/* === Hook === */
foreach (cot_getextplugins('admin.tags.tags') as $pl) {
include $pl;
}
/* ===== */
cot_display_messages($tt);