本文整理汇总了PHP中cot_rc_link函数的典型用法代码示例。如果您正苦于以下问题:PHP cot_rc_link函数的具体用法?PHP cot_rc_link怎么用?PHP cot_rc_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cot_rc_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cot_generate_sbrtags
function cot_generate_sbrtags($item_data, $tag_prefix = '', $admin_rights = null, $pagepath_home = false)
{
global $db, $cot_extrafields, $cfg, $L, $Ls, $R, $db_sbr, $db_sbr_stages, $sys;
static $extp_first = null, $extp_main = null;
if (is_null($extp_first)) {
$extp_first = cot_getextplugins('sbrtags.first');
$extp_main = cot_getextplugins('sbrtags.main');
}
/* === Hook === */
foreach ($extp_first as $pl) {
include $pl;
}
/* ===== */
if (!is_array($item_data)) {
$sql = $db->query("SELECT * FROM {$db_sbr} WHERE sbr_id = '" . (int) $item_data . "' LIMIT 1");
$item_data = $sql->fetch();
}
if ($item_data['sbr_id'] > 0 && !empty($item_data['sbr_title'])) {
if (is_null($admin_rights)) {
$admin_rights = cot_auth('plug', 'sbr', 'A');
}
$patharray[] = array(cot_url('sbr'), $L['sbr']);
$patharray[] = array(cot_url('sbr', 'id=' . $item_data['sbr_id']), $item_data['sbr_title']);
$itempath = cot_breadcrumbs($patharray, $pagepath_home, true);
$temp_array = array('ID' => $item_data['sbr_id'], 'STATUS' => $item_data['sbr_status'], 'LOCALSTATUS' => $L['sbr_status_' . $item_data['sbr_status']], 'LABELSTATUS' => $R['sbr_labels'][$item_data['sbr_status']], 'URL' => cot_url('sbr', 'id=' . $item_data['sbr_id']), 'TITLE' => $itempath, 'SHORTTITLE' => $item_data['sbr_title'], 'CREATEDATE' => date('d.m.Y H:i', $item_data['sbr_create']), 'CREATEDATE_STAMP' => $item_data['sbr_create'], 'BEGINDATE' => date('d.m.Y H:i', $item_data['sbr_begin']), 'BEGINDATE_STAMP' => $item_data['sbr_begin'], 'DONEDATE' => date('d.m.Y H:i', $item_data['sbr_done']), 'DONEDATE_STAMP' => $item_data['sbr_done'], 'COST' => $item_data['sbr_cost'], 'TAX' => $item_data['sbr_tax'], 'TOTAL' => $item_data['sbr_cost'] + $item_data['sbr_tax'], 'USER_IS_ADMIN' => $admin_rights || $usr['id'] == $item_data['item_userid']);
if ($admin_rights || $usr['id'] == $item_data['sbr_employer']) {
$temp_array['ADMIN_EDIT'] = cot_rc_link(cot_url('sbr', 'm=edit&id=' . $item_data['sbr_id']), $L['Edit']);
$temp_array['ADMIN_EDIT_URL'] = cot_url('sbr', 'm=edit&id=' . $item_data['sbr_id']);
}
// Extrafields
if (isset($cot_extrafields[$db_sbr])) {
foreach ($cot_extrafields[$db_sbr] as $exfld) {
$tag = mb_strtoupper($exfld['field_name']);
$temp_array[$tag . '_TITLE'] = isset($L['sbr_' . $exfld['field_name'] . '_title']) ? $L['sbr_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$temp_array[$tag] = cot_build_extrafields_data('sbr', $exfld, $item_data['item_' . $exfld['field_name']]);
}
}
/* === Hook === */
foreach ($extp_main as $pl) {
include $pl;
}
/* ===== */
} else {
$temp_array = array('TITLE' => !empty($emptytitle) ? $emptytitle : $L['Deleted'], 'SHORTTITLE' => !empty($emptytitle) ? $emptytitle : $L['Deleted']);
}
$return_array = array();
foreach ($temp_array as $key => $val) {
$return_array[$tag_prefix . $key] = $val;
}
return $return_array;
}
示例2: cot_generate_sectiontags
/**
* Returns all section tags for coTemplate
*
* @param string $cat Forums structure cat code
* @param string $tag_prefix Prefix for tags
* @param array $stat Category statistics
*
* @return array
*/
function cot_generate_sectiontags($cat, $tag_prefix = '', $stat = NULL)
{
global $cfg, $structure, $cot_extrafields, $usr, $sys, $L, $db_structure;
$stat['fs_lt_date'] = !empty($stat['fs_lt_date']) ? $stat['fs_lt_date'] : 0;
$stat['fs_lt_posterid'] = !empty($stat['fs_lt_posterid']) ? $stat['fs_lt_posterid'] : 0;
$usr['lastvisit'] = !empty($usr['lastvisit']) ? $usr['lastvisit'] : 0;
$new_elems = $usr['id'] > 0 && $stat['fs_lt_date'] > $usr['lastvisit'] && $stat['fs_lt_posterid'] != $usr['id'];
$sections = array($tag_prefix . 'CAT' => $cat, $tag_prefix . 'LOCKED' => $structure['forums'][$cat]['locked'], $tag_prefix . 'TITLE' => $structure['forums'][$cat]['title'], $tag_prefix . 'DESC' => cot_parse_autourls($structure['forums'][$cat]['desc']) . ($structure['forums'][$cat]['locked'] ? ' ' . $L['Locked'] : ''), $tag_prefix . 'ICON' => empty($structure['forums'][$cat]['icon']) ? '' : cot_rc('img_structure_cat', array('icon' => $structure['forums'][$cat]['icon'], 'title' => htmlspecialchars($structure['forums'][$cat]['title']), 'desc' => htmlspecialchars($structure['forums'][$cat]['desc']))), $tag_prefix . 'URL' => cot_url('forums', 'm=topics&s=' . $cat), $tag_prefix . 'SECTIONSURL' => cot_url('forums', 'c=' . $cat), $tag_prefix . 'NEWPOSTS' => $new_elems, $tag_prefix . 'CAT_DEFSTATE' => htmlspecialchars($cfg['forums']['cat_' . $cat]['defstate']));
if (is_array($stat)) {
if ($stat['fs_lt_date'] > 0) {
$sections += array($tag_prefix . 'LASTPOSTDATE' => cot_date('datetime_short', $stat['fs_lt_date']), $tag_prefix . 'LASTPOSTER' => cot_build_user($stat['fs_lt_posterid'], htmlspecialchars($stat['fs_lt_postername'])), $tag_prefix . 'LASTPOST' => cot_rc_link($new_elems ? cot_url('forums', 'm=posts&q=' . $stat['fs_lt_id'] . '&n=unread', '#unread') : cot_url('forums', 'm=posts&q=' . $stat['fs_lt_id'] . '&n=last', '#bottom'), cot_cutstring($stat['fs_lt_title'], 32)), $tag_prefix . 'LASTPOST_URL' => $new_elems ? cot_url('forums', 'm=posts&q=' . $stat['fs_lt_id'] . '&n=unread', '#unread') : cot_url('forums', 'm=posts&q=' . $stat['fs_lt_id'] . '&n=last', '#bottom'), $tag_prefix . 'TIMEAGO' => cot_build_timegap($stat['fs_lt_date'], $sys['now']));
}
$sections += array($tag_prefix . 'TOPICCOUNT' => $stat['topiccount'], $tag_prefix . 'LASTPOSTDATE_STAMP' => $stat['fs_lt_date'], $tag_prefix . 'POSTCOUNT' => $stat['postcount'], $tag_prefix . 'VIEWCOUNT' => $stat['viewcount'], $tag_prefix . 'VIEWCOUNT_SHORT' => $stat['viewcount'] > 9999 ? floor($stat['viewcount'] / 1000) . 'k' : $stat['viewcount']);
}
if (!is_array($stat) || !$stat['fs_lt_date']) {
$sections[$tag_prefix . 'LASTPOSTDATE'] = '';
$sections[$tag_prefix . 'LASTPOSTER'] = '';
$sections[$tag_prefix . 'LASTPOST'] = '';
$sections[$tag_prefix . 'TIMEAGO'] = '';
$sections[$tag_prefix . 'TOPICCOUNT'] = 0;
$sections[$tag_prefix . 'POSTCOUNT'] = 0;
$sections[$tag_prefix . 'VIEWCOUNT'] = 0;
$sections[$tag_prefix . 'VIEWCOUNT_SHORT'] = 0;
}
foreach ($cot_extrafields[$db_structure] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$sections[$tag_prefix . $uname . '_TITLE'] = isset($L['structure_' . $exfld['field_name'] . '_title']) ? $L['structure_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$sections[$tag_prefix . $uname] = cot_build_extrafields_data('structure', $exfld, $structure['forums'][$cat][$exfld['field_name']]);
$sections[$tag_prefix . $uname . '_VALUE'] = $structure['forums'][$cat][$exfld['field_name']];
}
return $sections;
}
示例3: FOUND_ROWS
}
$sqllist = $db->query("SELECT SQL_CALC_FOUND_ROWS p.* {$search_join_columns}\n\t\tFROM {$db_projects} AS p {$search_join_condition}\n\t\tWHERE {$where}\n\t\tORDER BY item_" . $rs['prjsort'] . " " . $rs['prjsort2'] . "\n\t\tLIMIT {$d}, " . $cfg_maxitems . $search_union_query);
$items = $sql->rowCount();
$totalitems[] = $db->query('SELECT FOUND_ROWS()')->fetchColumn();
$jj = 0;
$sqllist_rowset = $sqllist->fetchAll();
$sqllist_idset = array();
foreach ($sqllist_rowset as $item) {
$sqllist_idset[$item['item_id']] = $item['item_alias'];
}
/* === Hook - Part 1 === */
$extp = cot_getextplugins('projects.search.loop');
/* ===== */
foreach ($sqllist_rowset as $row) {
$url_cat = cot_url('projects', 'c=' . $row['item_cat']);
$url_prj = empty($row['item_alias']) ? cot_url('projects', 'c=' . $row['item_cat'] . '&id=' . $row['item_id'] . '&highlight=' . $hl) : cot_url('projects', 'c=' . $row['item_cat'] . '&al=' . $row['item_alias'] . '&highlight=' . $hl);
$t->assign(cot_generate_projecttags($row, 'PLUGIN_PROJECTSRES_'));
$t->assign(array('PLUGIN_PROJECTSRES_CATEGORY' => cot_rc_link($url_cat, $structure['projects'][$row['item_cat']]['tpath']), 'PLUGIN_PROJECTSRES_CATEGORY_URL' => $url_cat, 'PLUGIN_PROJECTSRES_TITLE' => cot_rc_link($url_prj, htmlspecialchars($row['item_title'])), 'PLUGIN_PROJECTSRES_TEXT' => cot_clear_mark($row['item_text'], $words), 'PLUGIN_PROJECTSRES_TIME' => cot_date('datetime_medium', $row['item_date']), 'PLUGIN_PROJECTSRES_TIMESTAMP' => $row['item_date'], 'PLUGIN_PROJECTSRES_ODDEVEN' => cot_build_oddeven($jj), 'PLUGIN_PROJECTSRES_NUM' => $jj));
/* === Hook - Part 2 === */
foreach ($extp as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.RESULTS.PROJECTS.ITEM');
$jj++;
}
if ($jj > 0) {
$t->parse('MAIN.RESULTS.PROJECTS');
}
unset($where_and, $where_or, $where);
}
示例4: cot_generate_pagetags
/**
* Returns all page tags for coTemplate
*
* @param mixed $page_data Page Info Array or ID
* @param string $tag_prefix Prefix for tags
* @param int $textlength Text truncate
* @param bool $admin_rights Page Admin Rights
* @param bool $pagepath_home Add home link for page path
* @param string $emptytitle Page title text if page does not exist
* @return array
* @global CotDB $db
*/
function cot_generate_pagetags($page_data, $tag_prefix = '', $textlength = 0, $admin_rights = null, $pagepath_home = false, $emptytitle = '')
{
global $db, $cot_extrafields, $cfg, $L, $Ls, $R, $db_pages, $usr, $sys, $cot_yesno, $structure, $db_structure;
static $extp_first = null, $extp_main = null;
static $pag_auth = array();
if (is_null($extp_first)) {
$extp_first = cot_getextplugins('pagetags.first');
$extp_main = cot_getextplugins('pagetags.main');
}
/* === Hook === */
foreach ($extp_first as $pl) {
include $pl;
}
/* ===== */
if (!is_array($page_data)) {
$sql = $db->query("SELECT * FROM {$db_pages} WHERE page_id = '" . (int) $page_data . "' LIMIT 1");
$page_data = $sql->fetch();
}
if ($page_data['page_id'] > 0 && !empty($page_data['page_title'])) {
if (is_null($admin_rights)) {
if (!isset($pag_auth[$page_data['page_cat']])) {
$pag_auth[$page_data['page_cat']] = cot_auth('page', $page_data['page_cat'], 'RWA1');
}
$admin_rights = (bool) $pag_auth[$page_data['page_cat']][2];
}
$pagepath = cot_structure_buildpath('page', $page_data['page_cat']);
$catpath = cot_breadcrumbs($pagepath, $pagepath_home);
$page_data['page_pageurl'] = empty($page_data['page_alias']) ? cot_url('page', 'c=' . $page_data['page_cat'] . '&id=' . $page_data['page_id']) : cot_url('page', 'c=' . $page_data['page_cat'] . '&al=' . $page_data['page_alias']);
$page_link[] = array($page_data['page_pageurl'], $page_data['page_title']);
$page_data['page_fulltitle'] = cot_breadcrumbs(array_merge($pagepath, $page_link), $pagepath_home);
if (!empty($page_data['page_url']) && $page_data['page_file']) {
$dotpos = mb_strrpos($page_data['page_url'], ".") + 1;
$type = mb_strtolower(mb_substr($page_data['page_url'], $dotpos, 5));
$page_data['page_fileicon'] = cot_rc('page_icon_file_path', array('type' => $type));
if (!file_exists($page_data['page_fileicon'])) {
$page_data['page_fileicon'] = cot_rc('page_icon_file_default');
}
$page_data['page_fileicon'] = cot_rc('page_icon_file', array('icon' => $page_data['page_fileicon']));
} else {
$page_data['page_fileicon'] = '';
}
$date_format = 'datetime_medium';
$text = cot_parse($page_data['page_text'], $cfg['page']['markup'], $page_data['page_parser']);
$text_cut = cot_cut_more($text);
if ($textlength > 0 && mb_strlen($text_cut) > $textlength) {
$text_cut = cot_string_truncate($text_cut, $textlength);
}
$cutted = mb_strlen($text) > mb_strlen($text_cut) ? true : false;
$cat_url = cot_url('page', 'c=' . $page_data['page_cat']);
$validate_url = cot_url('admin', "m=page&a=validate&id={$page_data['page_id']}&x={$sys['xk']}");
$unvalidate_url = cot_url('admin', "m=page&a=unvalidate&id={$page_data['page_id']}&x={$sys['xk']}");
$edit_url = cot_url('page', "m=edit&id={$page_data['page_id']}");
$delete_url = cot_url('page', "m=edit&a=update&delete=1&id={$page_data['page_id']}&x={$sys['xk']}");
$page_data['page_status'] = cot_page_status($page_data['page_state'], $page_data['page_begin'], $page_data['page_expire']);
$temp_array = array('URL' => $page_data['page_pageurl'], 'ID' => $page_data['page_id'], 'TITLE' => $page_data['page_fulltitle'], 'ALIAS' => $page_data['page_alias'], 'STATE' => $page_data['page_state'], 'STATUS' => $page_data['page_status'], 'LOCALSTATUS' => $L['page_status_' . $page_data['page_status']], 'SHORTTITLE' => htmlspecialchars($page_data['page_title'], ENT_COMPAT, 'UTF-8', false), 'CAT' => $page_data['page_cat'], 'CATURL' => $cat_url, 'CATTITLE' => htmlspecialchars($structure['page'][$page_data['page_cat']]['title']), 'CATPATH' => $catpath, 'CATPATH_SHORT' => cot_rc_link($cat_url, htmlspecialchars($structure['page'][$page_data['page_cat']]['title'])), 'CATDESC' => htmlspecialchars($structure['page'][$page_data['page_cat']]['desc']), 'CATICON' => $structure['page'][$page_data['page_cat']]['icon'], 'KEYWORDS' => htmlspecialchars($page_data['page_keywords']), 'DESC' => htmlspecialchars($page_data['page_desc']), 'TEXT' => $text, 'TEXT_CUT' => $text_cut, 'TEXT_IS_CUT' => $cutted, 'DESC_OR_TEXT' => !empty($page_data['page_desc']) ? htmlspecialchars($page_data['page_desc']) : $text, 'MORE' => $cutted ? cot_rc('list_more', array('page_url' => $page_data['page_pageurl'])) : '', 'AUTHOR' => htmlspecialchars($page_data['page_author']), 'OWNERID' => $page_data['page_ownerid'], 'OWNERNAME' => htmlspecialchars($page_data['user_name']), 'DATE' => cot_date($date_format, $page_data['page_date']), 'BEGIN' => cot_date($date_format, $page_data['page_begin']), 'EXPIRE' => cot_date($date_format, $page_data['page_expire']), 'UPDATED' => cot_date($date_format, $page_data['page_updated']), 'DATE_STAMP' => $page_data['page_date'], 'BEGIN_STAMP' => $page_data['page_begin'], 'EXPIRE_STAMP' => $page_data['page_expire'], 'UPDATED_STAMP' => $page_data['page_updated'], 'FILE' => $cot_yesno[$page_data['page_file']], 'FILE_URL' => empty($page_data['page_url']) ? '' : cot_url('page', 'c=' . $page_data['page_cat'] . '&id=' . $page_data['page_id'] . '&a=dl'), 'FILE_SIZE' => $page_data['page_size'] / 1024, 'FILE_SIZE_BYTES' => $page_data['page_size'], 'FILE_SIZE_READABLE' => cot_build_filesize($page_data['page_size'], 1), 'FILE_ICON' => $page_data['page_fileicon'], 'FILE_COUNT' => $page_data['page_filecount'], 'FILE_COUNTTIMES' => cot_declension($page_data['page_filecount'], $Ls['Times']), 'FILE_NAME' => basename($page_data['page_url']), 'COUNT' => $page_data['page_count'], 'ADMIN' => $admin_rights ? cot_rc('list_row_admin', array('unvalidate_url' => $unvalidate_url, 'edit_url' => $edit_url)) : '', 'NOTAVAILABLE' => $page_data['page_begin'] > $sys['now'] ? $L['page_notavailable'] . cot_build_timegap($sys['now'], $pag['page_begin']) : '');
// Admin tags
if ($admin_rights) {
$validate_confirm_url = cot_confirm_url($validate_url, 'page', 'page_confirm_validate');
$unvalidate_confirm_url = cot_confirm_url($unvalidate_url, 'page', 'page_confirm_unvalidate');
$delete_confirm_url = cot_confirm_url($delete_url, 'page', 'page_confirm_delete');
$temp_array['ADMIN_EDIT'] = cot_rc_link($edit_url, $L['Edit']);
$temp_array['ADMIN_EDIT_URL'] = $edit_url;
$temp_array['ADMIN_UNVALIDATE'] = $page_data['page_state'] == 1 ? cot_rc_link($validate_confirm_url, $L['Validate'], 'class="confirmLink"') : cot_rc_link($unvalidate_confirm_url, $L['Putinvalidationqueue'], 'class="confirmLink"');
$temp_array['ADMIN_UNVALIDATE_URL'] = $page_data['page_state'] == 1 ? $validate_confirm_url : $unvalidate_confirm_url;
$temp_array['ADMIN_DELETE'] = cot_rc_link($delete_confirm_url, $L['Delete'], 'class="confirmLink"');
$temp_array['ADMIN_DELETE_URL'] = $delete_confirm_url;
} else {
if ($usr['id'] == $page_data['page_ownerid']) {
$temp_array['ADMIN_EDIT'] = cot_rc_link($edit_url, $L['Edit']);
$temp_array['ADMIN_EDIT_URL'] = $edit_url;
}
}
if (cot_auth('page', 'any', 'W')) {
$clone_url = cot_url('page', "m=add&c={$page_data['page_cat']}&clone={$page_data['page_id']}");
$temp_array['ADMIN_CLONE'] = cot_rc_link($clone_url, $L['page_clone']);
$temp_array['ADMIN_CLONE_URL'] = $clone_url;
}
// Extrafields
if (isset($cot_extrafields[$db_pages])) {
foreach ($cot_extrafields[$db_pages] as $exfld) {
$tag = mb_strtoupper($exfld['field_name']);
$temp_array[$tag . '_TITLE'] = isset($L['page_' . $exfld['field_name'] . '_title']) ? $L['page_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$temp_array[$tag] = cot_build_extrafields_data('page', $exfld, $page_data['page_' . $exfld['field_name']], $page_data['page_parser']);
$temp_array[$tag . '_VALUE'] = $page_data['page_' . $exfld['field_name']];
}
}
// Extra fields for structure
if (isset($cot_extrafields[$db_structure])) {
//.........这里部分代码省略.........
示例5: cot_rc
$t->assign(array('PM_ROW_ID' => $row['pm_id'], 'PM_ROW_STATE' => $row['pm_tostate'], 'PM_ROW_STAR' => cot_rc($star_class ? 'pm_icon_unstar' : 'pm_icon_star', array('link' => cot_url('pm', 'f=' . $f . '&filter=' . $filter . '&a=star&id=' . $row['pm_id'] . '&d=' . $durl))), 'PM_ROW_STAR_URL' => cot_url('pm', 'f=' . $f . '&filter=' . $filter . '&a=star&id=' . $row['pm_id'] . '&d=' . $durl), 'PM_ROW_DATE' => cot_date('datetime_medium', $row['pm_date']), 'PM_ROW_DATE_STAMP' => $row['pm_date'], 'PM_ROW_TITLE' => cot_rc_link(cot_url('pm', 'm=message&id=' . $row['pm_id']), htmlspecialchars($row['pm_title']), array('class' => $cfg['pm']['turnajax'] ? 'ajax' : '')), 'PM_ROW_URL' => cot_url('pm', 'm=message&id=' . $row['pm_id']), 'PM_ROW_TEXT' => $pm_data, 'PM_ROW_ICON_STATUS' => $row['pm_icon_readstatus'], 'PM_ROW_ICON_STARRED' => $row['pm_icon_starred'], 'PM_ROW_ICON_DELETE' => cot_rc_link($url_delete, $R['pm_icon_trashcan'], array('title' => $L['Delete'], 'class' => $cfg['pm']['turnajax'] ? 'ajax' : '')), 'PM_ROW_ICON_DELETE_CONFIRM' => cot_rc_link(cot_confirm_url($url_delete), $R['pm_icon_trashcan'], array('title' => $L['Delete'], 'class' => $cfg['pm']['turnajax'] ? 'ajax' : '')), 'PM_ROW_DELETE_URL' => $url_delete, 'PM_ROW_DELETE_CONFIRM_URL' => cot_confirm_url($url_delete), 'PM_ROW_ICON_EDIT' => $row['pm_tostate'] == 0 ? cot_rc_link($url_edit, $R['pm_icon_edit'], array('title' => $L['Edit'], 'class' => $cfg['pm']['turnajax'] ? 'ajax' : '')) : '', 'PM_ROW_EDIT_URL' => $row['pm_tostate'] == 0 ? $url_edit : '', 'PM_ROW_DESC' => $pm_desc, 'PM_ROW_ODDEVEN' => cot_build_oddeven($jj), 'PM_ROW_NUM' => $jj));
$t->assign(cot_generate_usertags($row, 'PM_ROW_USER_'));
/* === Hook - Part2 : Include === */
foreach ($extp as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.PM_ROW');
}
if ($jj == 0) {
$t->parse('MAIN.PM_ROW_EMPTY');
}
if (!COT_AJAX) {
$t->parse('MAIN.BEFORE_AJAX');
$t->parse('MAIN.AFTER_AJAX');
}
$url_newpm = cot_url('pm', 'm=send');
$url_inbox = cot_url('pm');
$url_sentbox = cot_url('pm', 'f=sentbox');
$url_all = cot_url('pm', 'f=' . $f);
$url_unread = cot_url('pm', 'f=' . $f . '&filter=unread');
$url_starred = cot_url('pm', 'f=' . $f . '&filter=starred');
$t->assign(array('PM_PAGETITLE' => cot_breadcrumbs($title, $cfg['homebreadcrumb']), 'PM_SUBTITLE' => $subtitle, 'PM_FORM_UPDATE' => cot_url('pm', cot_xg() . '&f=' . $f . '&filter=' . $filter . '&d=' . $durl), 'PM_SENDNEWPM' => $usr['auth_write'] ? cot_rc_link($url_newpm, $L['pm_sendnew'], $cfg['pm']['turnajax'] ? array('class' => 'ajax') : '') : '', 'PM_SENDNEWPM_URL' => $usr['auth_write'] ? $url_newpm : '', 'PM_INBOX' => cot_rc_link($url_inbox, $L['pm_inbox'], $cfg['pm']['turnajax'] ? array('class' => 'ajax') : ''), 'PM_INBOX_URL' => $url_inbox, 'PM_INBOX_COUNT' => $totalinbox, 'PM_SENTBOX' => cot_rc_link($url_sentbox, $L['pm_sentbox'], $cfg['pm']['turnajax'] ? array('class' => 'ajax') : ''), 'PM_SENTBOX_URL' => $url_sentbox, 'PM_SENTBOX_COUNT' => $totalsentbox, 'PM_FILTER_ALL' => cot_rc_link($url_all, $L['pm_all'], $cfg['pm']['turnajax'] ? array('class' => 'ajax') : ''), 'PM_FILTER_ALL_URL' => $url_all, 'PM_FILTER_UNREAD' => cot_rc_link($url_unread, $L['pm_unread'], $cfg['pm']['turnajax'] ? array('class' => 'ajax') : ''), 'PM_FILTER_UNREAD_URL' => $url_unread, 'PM_FILTER_STARRED' => cot_rc_link($url_starred, $L['pm_starred'], $cfg['pm']['turnajax'] ? array('class' => 'ajax') : ''), 'PM_FILTER_STARRED_URL' => $url_starred, 'PM_PAGEPREV' => $pagenav['prev'], 'PM_PAGENEXT' => $pagenav['next'], 'PM_PAGES' => $pagenav['main'], 'PM_CURRENTPAGE' => $pagenav['current'], 'PM_TOTALPAGES' => $pagenav['total'], 'PM_SENT_TYPE' => $f == 'sentbox' ? $L['Recipient'] : $L['Sender']));
/* === Hook === */
foreach (cot_getextplugins('pm.list.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN');
$t->out('MAIN');
require_once $cfg['system_dir'] . '/footer.php';
示例6: cot_tag_search_projects
function cot_tag_search_projects($query)
{
global $db, $t, $L, $lang, $cfg, $usr, $qs, $d, $db_tag_references, $db_projects, $o, $row, $sys;
if (!cot_module_active('projects')) {
return;
}
$query = cot_tag_parse_query($query, 'p.item_id');
if (empty($query)) {
return;
}
$totalitems = $db->query("SELECT DISTINCT COUNT(*)\n\t\tFROM {$db_tag_references} AS r LEFT JOIN {$db_projects} AS p\n\t\t\tON r.tag_item = p.item_id\n\t\tWHERE r.tag_area = 'projects' AND ({$query}) AND p.item_state = 0")->fetchColumn();
switch ($o) {
case 'title':
$order = 'ORDER BY `item_title`';
break;
case 'date':
$order = 'ORDER BY `item_date` DESC';
break;
case 'category':
$order = 'ORDER BY `item_cat`';
break;
default:
$order = '';
}
/* == Hook == */
foreach (cot_getextplugins('tags.search.projects.query') as $pl) {
include $pl;
}
/* ===== */
$sql = $db->query("SELECT DISTINCT p.* {$join_columns}\n\t\tFROM {$db_tag_references} AS r LEFT JOIN {$db_projects} AS p\n\t\t\tON r.tag_item = p.item_id {$join_tables}\n\t\tWHERE r.tag_area = 'projects' AND ({$query}) AND p.item_id IS NOT NULL AND p.item_state = 0 {$join_where}\n\t\t{$order}\n\t\tLIMIT {$d}, {$cfg['maxrowsperpage']}");
$t->assign('TAGS_RESULT_TITLE', $L['tags_Found_in_projects']);
$pcount = $sql->rowCount();
/* == Hook : Part 1 == */
$extp = cot_getextplugins('tags.search.projects.loop');
/* ===== */
if ($pcount > 0) {
foreach ($sql->fetchAll() as $row) {
$tags = cot_tag_list($row['item_id'], 'projects');
$tag_list = '';
$tag_i = 0;
foreach ($tags as $tag) {
$tag_t = $cfg['plugin']['tags']['title'] ? cot_tag_title($tag) : $tag;
$tag_u = $cfg['plugin']['tags']['translit'] ? cot_translit_encode($tag) : $tag;
$tl = $lang != 'en' && $tag_u != $tag ? 1 : null;
if ($tag_i > 0) {
$tag_list .= ', ';
}
$tag_list .= cot_rc_link(cot_url('plug', array('e' => 'tags', 'a' => 'projects', 't' => str_replace(' ', '-', $tag_u), 'tl' => $tl)), htmlspecialchars($tag_t));
$tag_i++;
}
$t->assign(cot_generate_projecttags($row, 'TAGS_RESULT_ROW_'));
$t->assign(array('TAGS_RESULT_ROW_TITLE' => htmlspecialchars($row['item_title']), 'TAGS_RESULT_ROW_PATH' => cot_breadcrumbs(cot_structure_buildpath('projects', $row['item_cat']), false), 'TAGS_RESULT_ROW_TAGS' => $tag_list));
/* == Hook : Part 2 == */
foreach ($extp as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.TAGS_RESULT.TAGS_RESULT_ROW');
}
$sql->closeCursor();
$qs_u = $cfg['plugin']['tags']['translit'] ? cot_translit_encode($qs) : $qs;
$tl = $lang != 'en' && $qs_u != $qs ? 1 : null;
$pagenav = cot_pagenav('plug', array('e' => 'tags', 'a' => 'projects', 't' => $qs_u, 'tl' => $tl), $d, $totalitems, $cfg['maxrowsperpage']);
$t->assign(array('TAGS_PAGEPREV' => $pagenav['prev'], 'TAGS_PAGENEXT' => $pagenav['next'], 'TAGS_PAGNAV' => $pagenav['main']));
/* == Hook == */
foreach (cot_getextplugins('tags.search.projects.tags') as $pl) {
include $pl;
}
/* ===== */
}
if ($pcount == 0) {
$t->parse('MAIN.TAGS_RESULT.TAGS_RESULT_NONE');
}
$t->parse('MAIN.TAGS_RESULT');
}
示例7: cot_url
$title[] = !$id ? $L['pmsend_title'] : $L['Edit'] . ' #' . $id;
$url_newpm = cot_url('pm', 'm=send');
$url_inbox = cot_url('pm');
$url_sentbox = cot_url('pm', 'f=sentbox');
if (COT_AJAX) {
// Attach rich text editors to AJAX loaded page
$rc_tmp = $out['footer_rc'];
$out['footer_rc'] = '';
if (is_array($cot_plugins['editor'])) {
foreach ($cot_plugins['editor'] as $k) {
if ($k['pl_code'] == $editor && cot_auth('plug', $k['pl_code'], 'R')) {
include $cfg['plugins_dir'] . '/' . $k['pl_file'];
break;
}
}
}
$text_editor_code = $out['footer_rc'];
$out['footer_rc'] = $rc_tmp;
}
$t->assign(array('PMSEND_TITLE' => cot_breadcrumbs($title, $cfg['homebreadcrumb']), 'PMSEND_SENDNEWPM' => $usr['auth_write'] ? cot_rc_link($url_newpm, $L['pm_sendnew'], array('class' => $cfg['pm']['turnajax'] ? 'ajax' : '')) : '', 'PMSEND_SENDNEWPM_URL' => $usr['auth_write'] ? $url_newpm : '', 'PMSEND_INBOX' => cot_rc_link($url_inbox, $L['pm_inbox'], array('class' => $cfg['pm']['turnajax'] ? 'ajax' : '')), 'PMSEND_INBOX_URL' => $url_inbox, 'PMSEND_INBOX_COUNT' => $totalinbox, 'PMSEND_SENTBOX' => cot_rc_link($url_sentbox, $L['pm_sentbox'], array('class' => $cfg['pm']['turnajax'] ? 'ajax' : '')), 'PMSEND_SENTBOX_URL' => $url_sentbox, 'PMSEND_SENTBOX_COUNT' => $totalsentbox, 'PMSEND_FORM_SEND' => cot_url('pm', 'm=send&a=send' . $idurl), 'PMSEND_FORM_TITLE' => cot_inputbox('text', 'newpmtitle', htmlspecialchars($newpmtitle), 'size="56" maxlength="255"'), 'PMSEND_FORM_TEXT' => cot_textarea('newpmtext', $newpmtext, 8, 56, '', 'input_textarea_editor') . $text_editor_code, 'PMSEND_FORM_TOUSER' => cot_textarea('newpmrecipient', $touser, 3, 56, 'class="userinput"'), 'PMSEND_FORM_NOT_TO_SENTBOX' => cot_checkbox(false, 'fromstate', cot::$L['pm_notmovetosentbox'], '', '3')));
/* === Hook === */
foreach (cot_getextplugins('pm.send.tags') as $pl) {
include $pl;
}
/* ===== */
if (!$id) {
$t->parse('MAIN.PMSEND_USERLIST');
}
$t->parse('MAIN');
$t->out('MAIN');
require_once $cfg['system_dir'] . '/footer.php';
示例8: foreach
$jj = 0;
foreach ($sql_rowset as $pag) {
$jj++;
$url = cot_url('index', 'c=' . $pag['page_cat']);
$news->assign(cot_generate_pagetags($pag, 'PAGE_ROW_', $v[2]));
$news->assign(array('PAGE_ROW_NEWSPATH' => cot_rc_link($url, htmlspecialchars($structure['page'][$row['page_cat']]['title'])), 'PAGE_ROW_NEWSPATH_URL' => $url, 'PAGE_ROW_CATDESC' => htmlspecialchars($structure['page'][$pag['page_cat']]['desc']), 'PAGE_ROW_OWNER' => cot_build_user($pag['page_ownerid'], htmlspecialchars($pag['user_name'])), 'PAGE_ROW_ODDEVEN' => cot_build_oddeven($jj), 'PAGE_ROW_NUM' => $jj));
$news->assign(cot_generate_usertags($pag, 'PAGE_ROW_OWNER_'));
/* === Hook - Part2 : Include === LOOP === */
foreach ($news_extp as $pl) {
include $pl;
}
/* ===== */
$news->parse('NEWS.PAGE_ROW');
}
$url_newpage = cot_url('page', 'm=add&c=' . $cat);
$news->assign(array('PAGE_PAGENAV' => $pagenav['main'], 'PAGE_PAGEPREV' => $pagenav['prev'], 'PAGE_PAGENEXT' => $pagenav['next'], 'PAGE_PAGELAST' => $pagenav['last'], 'PAGE_PAGENUM' => $pagenav['current'], 'PAGE_PAGECOUNT' => $pagenav['total'], 'PAGE_ENTRIES_ONPAGE' => $pagenav['onpage'], 'PAGE_ENTRIES_TOTAL' => $pagenav['entries'], 'PAGE_SUBMITNEWPOST' => cot_auth('page', $cat, 'W') ? cot_rc_link($url_newpage, $L['Submitnew']) : '', 'PAGE_SUBMITNEWPOST_URL' => cot_auth('page', $cat, 'W') ? $url_newpage : '', 'PAGE_CATTITLE' => $structure['page'][$cat]['title'], 'PAGE_CATPATH' => cot_breadcrumbs(cot_structure_buildpath('page', $cat), false), 'PAGE_CAT' => $cat));
/* === Hook - Part2 : Include === TAGS === */
foreach ($news_tags_extp as $pl) {
include $pl;
}
/* ===== */
$news->parse('NEWS');
$news_html = $news->text('NEWS');
// Cache for guests
if ($usr['id'] == 0 && $cache && (int) $cfg['plugin']['news']['cache_ttl'] > 0) {
$cache->disk->store($news_cache_id, $news_html, 'news');
}
$t->assign($catn == 0 ? 'INDEX_NEWS' : 'INDEX_NEWS_' . $tagname, $news_html);
$catn++;
}
}
示例9: cot_auth
if ($usr['id'] > 0) {
$out['adminpanel'] = cot_auth('admin', 'any', 'R') ? cot_rc_link(cot_url('admin'), $L['Administration']) : '';
$out['loginout_url'] = cot_url('login', 'out=1&' . cot_xg());
$out['loginout'] = cot_rc_link($out['loginout_url'], $L['Logout']);
$out['profile'] = cot_rc_link(cot_url('users', 'm=profile'), $L['Profile']);
$t->assign(array('HEADER_USER_NAME' => $usr['name'], 'HEADER_USER_ADMINPANEL' => $out['adminpanel'], 'HEADER_USER_ADMINPANEL_URL' => cot_url('admin'), 'HEADER_USER_LOGINOUT' => $out['loginout'], 'HEADER_USER_LOGINOUT_URL' => $out['loginout_url'], 'HEADER_USER_PROFILE' => $out['profile'], 'HEADER_USER_PROFILE_URL' => cot_url('users', 'm=profile'), 'HEADER_USER_MESSAGES' => $usr['messages']));
/* === Hook === */
foreach (cot_getextplugins('header.user.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('HEADER.USER');
} else {
$out['guest_username'] = $R['form_guest_username'];
$out['guest_password'] = $R['form_guest_password'];
$out['guest_register'] = cot_rc_link(cot_url('users', 'm=register'), $L['Register']);
$out['guest_cookiettl'] = $cfg['forcerememberme'] ? $R['form_guest_remember_forced'] : $R['form_guest_remember'];
$t->assign(array('HEADER_GUEST_SEND' => cot_url('login', 'a=check&' . $sys['url_redirect']), 'HEADER_GUEST_USERNAME' => $out['guest_username'], 'HEADER_GUEST_PASSWORD' => $out['guest_password'], 'HEADER_GUEST_REGISTER' => $out['guest_register'], 'HEADER_GUEST_REGISTER_URL' => cot_url('users', 'm=register'), 'HEADER_GUEST_COOKIETTL' => $out['guest_cookiettl']));
/* === Hook === */
foreach (cot_getextplugins('header.guest.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('HEADER.GUEST');
}
/* === Hook === */
foreach (cot_getextplugins('header.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('HEADER');
示例10: count
}
$cot_act[$parents[0]] += $cot_sections_act[$i];
}
}
$secact_max = count($cot_act) > 0 ? max($cot_act) : 0;
$out['subtitle'] = $L['Forums'];
/* === Hook === */
foreach (cot_getextplugins('forums.sections.main') as $pl) {
include $pl;
}
/* ===== */
require_once $cfg['system_dir'] . '/header.php';
$t = new XTemplate(cot_tplfile('forums.sections'));
$url_markall = cot_url('forums', "n=markall");
$title[] = array(cot_url('forums'), $L['Forums']);
$t->assign(array('FORUMS_RSS' => cot_url('rss', 'm=forums'), 'FORUMS_SECTIONS_PAGETITLE' => cot_breadcrumbs($title, $cfg['homebreadcrumb']), 'FORUMS_SECTIONS_MARKALL' => $usr['id'] > 0 ? cot_rc_link($url_markall, $L['forums_markallasread']) : '', 'FORUMS_SECTIONS_MARKALL_URL' => $usr['id'] > 0 ? $url_markall : ''));
$xx = 0;
/* === Hook - Part1 : Set === */
$extp = cot_getextplugins('forums.sections.loop');
/* ===== */
/* === Hook - Part1 : Set === */
$extps = cot_getextplugins('forums.sections.loop.sections');
/* ===== */
/* === Hook - Part1 : Set === */
$extpss = cot_getextplugins('forums.sections.loop.subsections');
/* ===== */
foreach ($fstlvl as $x) {
if (is_array($nxtlvl[$x])) {
$yy = 0;
foreach ($nxtlvl[$x] as $y) {
if (is_array($nxtlvl[$y]) && $cfg['forums']['cat_' . $y]['defstate']) {
示例11: cot_tplfile
$urr = $sql->fetch();
$out['subtitle'] = $L['Profile'];
$out['head'] .= $R['code_noindex'];
$mskin = cot_tplfile(array('users', 'profile'), 'module');
/* === Hook === */
foreach (cot_getextplugins('users.profile.main') as $pl) {
include $pl;
}
/* ===== */
require_once $cfg['system_dir'] . '/header.php';
$t = new XTemplate($mskin);
require_once cot_incfile('forms');
$protected = !$cfg['users']['useremailchange'] ? array('disabled' => 'disabled') : array();
$profile_form_email = cot_inputbox('text', 'ruseremail', $urr['user_email'], array('size' => 32, 'maxlength' => 64) + $protected);
$editor_class = $cfg['users']['usertextimg'] ? 'minieditor' : '';
$t->assign(array('USERS_PROFILE_TITLE' => cot_rc_link(cot_url('users', 'm=profile'), $L['pro_title']), 'USERS_PROFILE_SUBTITLE' => $L['pro_subtitle'], 'USERS_PROFILE_DETAILSLINK' => cot_url('users', 'm=details&id=' . $urr['user_id']), 'USERS_PROFILE_EDITLINK' => cot_url('users', 'm=edit&id=' . $urr['user_id']), 'USERS_PROFILE_FORM_SEND' => cot_url('users', "m=profile&a=update&" . cot_xg()), 'USERS_PROFILE_ID' => $urr['user_id'], 'USERS_PROFILE_NAME' => htmlspecialchars($urr['user_name']), 'USERS_PROFILE_MAINGRP' => cot_build_group($urr['user_maingrp']), 'USERS_PROFILE_GROUPS' => cot_build_groupsms($urr['user_id'], FALSE, $urr['user_maingrp']), 'USERS_PROFILE_COUNTRY' => cot_selectbox_countries($urr['user_country'], 'rusercountry'), 'USERS_PROFILE_TEXT' => cot_textarea('rusertext', $urr['user_text'], 8, 56, array('class' => $editor_class)), 'USERS_PROFILE_EMAIL' => $profile_form_email, 'USERS_PROFILE_EMAILPASS' => cot_inputbox('password', 'rmailpass', '', array('size' => 12, 'maxlength' => 32, 'autocomplete' => 'off')), 'USERS_PROFILE_HIDEEMAIL' => cot_radiobox($urr['user_hideemail'], 'ruserhideemail', array(1, 0), array($L['Yes'], $L['No'])), 'USERS_PROFILE_THEME' => cot_selectbox_theme($urr['user_theme'], $urr['user_scheme'], 'rusertheme'), 'USERS_PROFILE_LANG' => cot_selectbox_lang($urr['user_lang'], 'ruserlang'), 'USERS_PROFILE_GENDER' => cot_selectbox_gender($urr['user_gender'], 'rusergender'), 'USERS_PROFILE_BIRTHDATE' => cot_selectbox_date(cot_date2stamp($urr['user_birthdate']), 'short', 'ruserbirthdate', cot_date('Y', $sys['now']), cot_date('Y', $sys['now']) - 100, false), 'USERS_PROFILE_TIMEZONE' => cot_selectbox_timezone($urr['user_timezone'], 'rusertimezone'), 'USERS_PROFILE_REGDATE' => cot_date('datetime_medium', $urr['user_regdate']), 'USERS_PROFILE_REGDATE_STAMP' => $urr['user_regdate'], 'USERS_PROFILE_LASTLOG' => cot_date('datetime_medium', $urr['user_lastlog']), 'USERS_PROFILE_LASTLOG_STAMP' => $urr['user_lastlog'], 'USERS_PROFILE_LOGCOUNT' => $urr['user_logcount'], 'USERS_PROFILE_ADMINRIGHTS' => '', 'USERS_PROFILE_OLDPASS' => cot_inputbox('password', 'roldpass', '', array('size' => 12, 'maxlength' => 32)), 'USERS_PROFILE_NEWPASS1' => cot_inputbox('password', 'rnewpass1', '', array('size' => 12, 'maxlength' => 32, 'autocomplete' => 'off')), 'USERS_PROFILE_NEWPASS2' => cot_inputbox('password', 'rnewpass2', '', array('size' => 12, 'maxlength' => 32, 'autocomplete' => 'off'))));
// Extra fields
if (!empty(cot::$extrafields[cot::$db->users])) {
foreach (cot::$extrafields[cot::$db->users] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('ruser' . $exfld['field_name'], $exfld, $urr['user_' . $exfld['field_name']]);
$exfld_title = cot_extrafield_title($exfld, 'user_');
$t->assign(array('USERS_PROFILE_' . $uname => $exfld_val, 'USERS_PROFILE_' . $uname . '_TITLE' => $exfld_title, 'USERS_PROFILE_EXTRAFLD' => $exfld_val, 'USERS_PROFILE_EXTRAFLD_TITLE' => $exfld_title));
$t->parse('MAIN.EXTRAFLD');
}
}
/* === Hook === */
foreach (cot_getextplugins('users.profile.tags') as $pl) {
include $pl;
}
/* ===== */
示例12: rev
if (cot_auth('forums', $key, 'R')) {
$jumpbox[cot_url('forums', "m=topics&s=" . $key, '', true)] = $val['tpath'];
}
}
function rev($sway)
{
return $sway == 'desc' ? 'asc' : 'desc';
}
function cursort($trigger, $way)
{
global $R;
if ($trigger) {
return $way == 'asc' ? $R['icon_down'] : $R['icon_up'];
}
return '';
}
foreach (array('title', 'viewcount', 'postcount', 'creationdate', 'updated') as $ord) {
$title_urls[$ord] = cot_url('forums', "m=topics&s={$s}&ord={$ord}&w=" . rev($w));
}
$t->assign(array('FORUMS_TOPICS_PARENT_SECTION_ID' => $s, 'FORUMS_TOPICS_SECTION_RSS' => cot_url('rss', "m=section&c={$s}"), 'FORUMS_TOPICS_PAGETITLE' => $toptitle, 'FORUMS_TOPICS_SHORTTITLE' => htmlspecialchars($structure['forums'][$s]['title']), 'FORUMS_TOPICS_SUBTITLE' => $structure['forums'][$s]['desc'], 'FORUMS_TOPICS_NEWTOPICURL' => cot_url('forums', "m=newtopic&s=" . $s), 'FORUMS_TOPICS_PAGES' => $pagenav['main'], 'FORUMS_TOPICS_PAGEPREV' => $pagenav['prev'], 'FORUMS_TOPICS_PAGENEXT' => $pagenav['next'], 'FORUMS_TOPICS_PAGELAST' => $pagenav['last'], 'FORUMS_TOPICS_PAGECURRENT' => $pagenav['current'], 'FORUMS_TOPICS_PAGETOTAL' => $pagenav['total'], 'FORUMS_TOPICS_PAGEONPAGE' => $pagenav['onpage'], 'FORUMS_TOPICS_PAGEENTRIES' => $pagenav['entries'], 'FORUMS_TOPICS_PRVTOPICS' => $prvtopics, 'FORUMS_TOPICS_JUMPBOX' => cot_selectbox($s, 'jumpbox', array_keys($jumpbox), array_values($jumpbox), false, 'onchange="redirect(this)"'), 'FORUMS_TOPICS_TITLE_TOPICS' => cot_rc_link($title_urls['title'], $L['forums_topics'] . ' ' . cursort($o == 'title', $w), 'rel="nofollow"'), 'FORUMS_TOPICS_TITLE_TOPICS_URL' => $title_urls['title'], 'FORUMS_TOPICS_TITLE_VIEWS' => cot_rc_link($title_urls['viewcount'], $L['Views'] . " " . cursort($o == 'viewcount', $w), 'rel="nofollow"'), 'FORUMS_TOPICS_TITLE_VIEWS_URL' => $title_urls['viewcount'], 'FORUMS_TOPICS_TITLE_POSTS' => cot_rc_link($title_urls['postcount'], $L['forums_posts'] . " " . cursort($o == 'postcount', $w), 'rel="nofollow"'), 'FORUMS_TOPICS_TITLE_POSTS_URL' => $title_urls['postcount'], 'FORUMS_TOPICS_TITLE_REPLIES' => cot_rc_link($title_urls['postcount'], $L['Replies'] . " " . cursort($o == 'postcount', $w), 'rel="nofollow"'), 'FORUMS_TOPICS_TITLE_REPLIES_URL' => $title_urls['postcount'], 'FORUMS_TOPICS_TITLE_STARTED' => cot_rc_link($title_urls['creationdate'], $L['Started'] . " " . cursort($o == 'creationdate', $w), 'rel="nofollow"'), 'FORUMS_TOPICS_TITLE_STARTED_URL' => $title_urls['creationdate'], 'FORUMS_TOPICS_TITLE_LASTPOST' => cot_rc_link($title_urls['updated'], $L['Lastpost'] . " " . cursort($o == 'updated', $w), 'rel="nofollow"'), 'FORUMS_TOPICS_TITLE_LASTPOST_URL' => $title_urls['updated']));
/* === Hook === */
foreach (cot_getextplugins('forums.topics.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN');
$t->out('MAIN');
require_once $cfg['system_dir'] . '/footer.php';
if ($cache && $usr['id'] === 0 && $cfg['cache_forums']) {
$cache->page->write();
}
示例13: cot_pagenav
}
if ($files_count > 0) {
$thumbspagination = $opt == 'thumbs' ? '&opt=thumbs' : '';
$totalitems = $files_count;
$pagnavParams = 'f=' . $f;
if (!empty($more)) {
$pagnavParams .= '&' . $more;
}
$pagnavParams .= $thumbspagination;
$pagenav = cot_pagenav('pfs', $pagnavParams, $d, $totalitems, $cfg['pfs']['maxpfsperpage']);
$filesinfolder .= $f > 0 ? $L['pfs_filesinthisfolder'] : $L['pfs_filesintheroot'];
$t->assign(array('PFS_FILESCOUNT_TITLE' => cot_declension($files_count, $Ls['Files']), 'PFS_ONPAGE_FILES_TITLE' => cot_declension($iji, $Ls['Files']), 'PFS_FILESCOUNT' => $files_count, 'PFS_INTHISFOLDER' => $filesinfolder, 'PFS_ONPAGE_FILES' => $iji, 'PFS_PAGING_PREV' => $pagenav['prev'], 'PFS_PAGING_CURRENT' => $pagenav['main'], 'PFS_PAGING_NEXT' => $pagenav['next']));
}
}
// ========== Statistics =========
$showthumbs .= $opt != 'thumbs' && $files_count > 0 && $cfg['pfs']['th_amode'] != 'Disabled' ? cot_rc_link(cot_url('pfs', 'f=' . $f . '&' . $more . '&opt=thumbs'), $L['Thumbnails']) : '';
$t->assign(array('PFS_TOTALSIZE' => cot_build_filesize($pfs_totalsize, 1), 'PFS_TOTALSIZE_BYTES' => $pfs_totalsize, 'PFS_TOTALSIZE_KB' => floor($pfs_totalsize / 1024), 'PFS_MAXTOTAL' => cot_build_filesize($maxtotal, 1), 'PFS_MAXTOTAL_BYTES' => $maxtotal, 'PFS_MAXTOTAL_KB' => $maxtotal / 1024, 'PFS_PERCENTAGE' => $maxtotal > 0 ? round($pfs_totalsize / $maxtotal * 100) : 0, 'PFS_MAXFILESIZE' => cot_build_filesize($maxfile, 1), 'PFS_MAXFILESIZE_BYTES' => $maxfile, 'PFS_MAXFILESIZE_KB' => $maxfile / 1024, 'PFS_SHOWTHUMBS' => $showthumbs));
// ========== Upload =========
$t->assign(array('PFS_UPLOAD_FORM_MAX_SIZE' => $maxfile, 'PFS_UPLOAD_FORM_USERID' => $userid));
$t->assign(array('PFS_UPLOAD_FORM_ACTION' => cot_url('pfs', "f={$f}&a=upload&{$more}"), 'PFS_UPLOAD_FORM_FOLDERS' => cot_selectbox_folders($userid, '', $f)));
for ($ii = 0; $ii < $cfg['pfs']['pfsmaxuploads']; $ii++) {
$t->assign(array('PFS_UPLOAD_FORM_ROW_ID' => $ii, 'PFS_UPLOAD_FORM_ROW_NUM' => $ii + 1));
$t->parse('MAIN.PFS_UPLOAD_FORM.PFS_UPLOAD_FORM_ROW');
}
$t->parse('MAIN.PFS_UPLOAD_FORM');
// ========== Allowed =========
reset($cot_extensions);
sort($cot_extensions);
foreach ($cot_extensions as $k => $line) {
$t->assign(array('ALLOWED_ROW_ICON' => $icon[$line[0]], 'ALLOWED_ROW_EXT' => $line[0], 'ALLOWED_ROW_DESC' => $filedesc[$line[0]]));
$t->parse('MAIN.ALLOWED_ROW');
示例14: mb_substr
for ($i = 0; $i < $pag['page_totaltabs']; $i++) {
if (mb_strpos($pag['page_tabs'][$i], '<br />') === 0) {
$pag['page_tabs'][$i] = mb_substr($pag['page_tabs'][$i], 6);
}
$p1 = mb_strpos($pag['page_tabs'][$i], '[title]');
$p2 = mb_strpos($pag['page_tabs'][$i], '[/title]');
if ($p2 > $p1 && $p1 < 4) {
$pag['page_tabtitle'][$i] = mb_substr($pag['page_tabs'][$i], $p1 + 7, $p2 - $p1 - 7);
if ($i == $pag['page_tab']) {
$pag['page_tabs'][$i] = trim(str_replace('[title]' . $pag['page_tabtitle'][$i] . '[/title]', '', $pag['page_tabs'][$i]));
}
} else {
$pag['page_tabtitle'][$i] = $i == 0 ? $pag['page_title'] : $L['Page'] . ' ' . ($i + 1);
}
$tab_url = empty($al) ? cot_url('page', 'c=' . $pag['page_cat'] . '&id=' . $id . '&pg=' . $i) : cot_url('page', 'c=' . $pag['page_cat'] . '&al=' . $al . '&pg=' . $i);
$pag['page_tabtitles'][] .= cot_rc_link($tab_url, $i + 1 . '. ' . $pag['page_tabtitle'][$i], array('class' => 'page_tabtitle'));
$pag['page_tabs'][$i] = str_replace('[newpage]', '', $pag['page_tabs'][$i]);
$pag['page_tabs'][$i] = preg_replace('#^(<br />)+#', '', $pag['page_tabs'][$i]);
$pag['page_tabs'][$i] = trim($pag['page_tabs'][$i]);
}
$pag['page_tabtitles'] = implode('<br />', $pag['page_tabtitles']);
$pag['page_text'] = $pag['page_tabs'][$pag['page_tab']];
// Temporarily disable easypagenav to allow 0-based numbers
$tmp = $cfg['easypagenav'];
$cfg['easypagenav'] = false;
$pn = cot_pagenav('page', empty($al) ? 'id=' . $id : 'al=' . $al, $pag['page_tab'], $pag['page_totaltabs'], 1, 'pg');
$pag['page_tabnav'] = $pn['main'];
$cfg['easypagenav'] = $tmp;
$t->assign(array('PAGE_MULTI_TABNAV' => $pag['page_tabnav'], 'PAGE_MULTI_TABTITLES' => $pag['page_tabtitles'], 'PAGE_MULTI_CURTAB' => $pag['page_tab'] + 1, 'PAGE_MULTI_MAXTAB' => $pag['page_totaltabs'], 'PAGE_TEXT' => $pag['page_text']));
$t->parse('MAIN.PAGE_MULTI');
}
示例15: cot_url
$t->assign('USER_HIDDEN', $L['Hidden']);
} else {
continue;
}
}
if ($row['is_user']) {
$count_users++;
$url_ipsearch = cot_url('admin', 'm=other&p=ipsearch&a=search&id=' . $row['online_ip'] . '&' . cot_xg());
$t->assign(array('USER_LOCATION' => htmlspecialchars($row['online_location']), 'USER_SUBLOCATION' => htmlspecialchars($row['online_subloc']), 'USER_IP' => $ipsearch ? cot_rc_link($url_ipsearch, $row['online_ip']) : $row['online_ip'], 'USER_IP_URL' => $ipsearch ? $url_ipsearch : '', 'USER_LINK' => cot_build_user($row['online_userid'], htmlspecialchars($row['online_name'])), 'USER_LASTSEEN' => cot_build_timegap($row['online_lastseen'], $sys['now'])));
$t->assign(cot_generate_usertags($row, 'USER_'));
/* === Hook - Part2 : Include === */
foreach ($users_loop_hook as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.USERS');
} else {
$count_guests++;
$url_ipsearch = cot_url('admin', 'm=other&p=ipsearch&a=search&id=' . $row['online_ip'] . '&' . cot_xg());
$t->assign(array('GUEST_LOCATION' => htmlspecialchars($row['online_location']), 'GUEST_SUBLOCATION' => htmlspecialchars($row['online_subloc']), 'GUEST_IP' => $ipsearch ? cot_rc_link($url_ipsearch, $row['online_ip']) : $row['online_ip'], 'GUEST_IP_URL' => $ipsearch ? $url_ipsearch : '', 'GUEST_NUMBER' => $count_guests + $guest_start_num, 'GUEST_LASTSEEN' => cot_build_timegap($row['online_lastseen'], $sys['now'])));
/* === Hook - Part2 : Include === */
foreach ($guests_loop_hook as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.GUESTS');
}
//if (($count_users + $count_guests) >= $maxuserssperpage) break;
}
$sql_users->closeCursor();
$t->assign(array('WHO_PAGINATION' => $pagenav['main'], 'WHO_PAGEPREV' => $pagenav['prev'], 'WHO_PAGENEXT' => $pagenav['next'], 'WHO_CURRENTPAGE' => $pagenav['current'], 'WHO_TOTALLINES' => $totallines, 'WHO_MAXPERPAGE' => $maxuserssperpage, 'WHO_TOTALPAGES' => $pagenav['total'], 'STAT_MAXUSERS' => $maxusers, 'STAT_COUNT_USERS' => $who_users, 'STAT_COUNT_GUESTS' => $who_guests, 'USERS' => cot_declension($who_users, $Ls['Members'], true), 'GUESTS' => cot_declension($who_guests, $Ls['Guests'], true)));