<?php /* ==================== [BEGIN_COT_EXT] Hooks=header.main Tags=header.tpl:{HEADER_USER_PMS},{HEADER_USER_PMREMINDER} [END_COT_EXT] ==================== */ /** * PM header notices * * @package PM * @copyright (c) Cotonti Team * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt */ defined('COT_CODE') or die('Wrong URL.'); if ($usr['id'] > 0) { $out['pms'] = cot_rc_link(cot_url('pm'), $L['Private_Messages']); require_once cot_incfile('pm', 'module'); if ($usr['newpm']) { $usr['messages'] = $db->query("SELECT COUNT(*) FROM {$db_pm} WHERE pm_touserid='" . $usr['id'] . "' AND pm_tostate=0")->fetchColumn(); } $out['pmreminder'] = cot_rc_link(cot_url('pm'), $usr['messages'] > 0 ? cot_declension($usr['messages'], $Ls['Privatemessages']) : $L['hea_noprivatemessages']); $t->assign(array('HEADER_USER_PM_URL' => cot_url('pm'), 'HEADER_USER_PMS' => $out['pms'], 'HEADER_USER_PMREMINDER' => $out['pmreminder'])); } if ($cfg['pm']['css'] && $env['ext'] == 'pm') { Resources::linkFile($cfg['modules_dir'] . '/pm/tpl/pm.css'); }
/** * A shortcut for plain output of a link to a CSS/JS file in the header of the page * * @global array $out Output snippets * @param string $path Stylesheet *.css or script *.js path/url * @param bool $prepend Prepend this file before other header outputs * * @deprecated Will be removed in v.1.0. Use Resources::linkFile() instead */ function cot_rc_link_file($path, $prepend = false) { $order = 60; if ($prepend) { $order = 40; } Resources::linkFile($path, '', $order); }
/* ===== */ $out['logstatus'] = $usr['id'] > 0 ? $L['hea_youareloggedas'] . ' ' . $usr['name'] : $L['hea_youarenotlogged']; $out['userlist'] = cot_auth('users', 'a', 'R') ? cot_rc_link(cot_url('users'), $L['Users']) : ''; unset($title_tags, $title_data); if (is_numeric($pg) && $pg > 1) { // Append page number to subtitle $out['subtitle'] .= cot_rc('code_title_page_num', array('num' => $pg)); } $title_params = array('MAINTITLE' => $cfg['maintitle'], 'DESCRIPTION' => $cfg['subtitle'], 'SUBTITLE' => $out['subtitle']); if (defined('COT_INDEX')) { $out['fulltitle'] = cot_title('title_header_index', $title_params); } else { $out['fulltitle'] = cot_title('title_header', $title_params); } if ($cfg['jquery'] && $cfg['jquery_cdn']) { Resources::linkFile($cfg['jquery_cdn'], 'js', 30); } $html = Resources::render(); if ($html) { $out['head_head'] = $html . $out['head_head']; } $out['meta_contenttype'] = $cfg['xmlclient'] ? 'application/xml' : 'text/html'; $out['basehref'] = $R['code_basehref']; $out['meta_charset'] = 'UTF-8'; $out['meta_desc'] = empty($out['desc']) ? $cfg['subtitle'] : htmlspecialchars($out['desc']); $out['meta_keywords'] = empty($out['keywords']) ? $cfg['metakeywords'] : htmlspecialchars($out['keywords']); $out['meta_lastmod'] = gmdate('D, d M Y H:i:s'); $out['head_head'] .= $out['head']; if ($sys['noindex']) { $out['head_head'] .= $R['code_noindex']; }