本文整理汇总了PHP中cot_date函数的典型用法代码示例。如果您正苦于以下问题:PHP cot_date函数的具体用法?PHP cot_date怎么用?PHP cot_date使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cot_date函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlspecialchars
if ($advert->owner['user_id'] == 0) {
?>
Добрый день!
<?php
} else {
?>
Добрый день, <?php
echo htmlspecialchars($advert->owner['full_name']);
?>
!
<?php
}
?>
<p>
Вы получили это письмо потому, что <b><?php
echo cot_date('date_full', $advert->expire);
?>
</b> истекает срок публикации Вашего объявления на сайте
«<a href="<?php
echo cot::$cfg['mainurl'];
?>
" target="_blank"><?php
echo htmlspecialchars(cot::$cfg["maintitle"]);
?>
</a>».<br />
После этого оно будет закрыто и больше не будет видно другим пользователям сайта.
</p>
<p>
<b>«<a href="<?php
echo $this->advertUrl;
?>
示例2: foreach
// 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.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');
示例3: switch
include $pl;
}
/* ===== */
switch ($msg) {
/* ======== Users ======== */
case '100':
$rd = 2;
$ru = cot_url('login', empty($redirect) ? '' : "redirect={$redirect}");
break;
case '102':
$r = 1;
$rd = 2;
break;
case '153':
if ($num > 0) {
$body .= cot_rc('msg_code_153_date', array('date' => cot_date('datetime_medium', $num)));
}
break;
/* ======== Error Pages ========= */
/* ======== Error Pages ========= */
case '400':
case '401':
case '403':
case '404':
case '500':
$rd = 5;
$ru = empty($redirect) ? '' : str_replace('&', '&', base64_decode($redirect));
break;
/* ======== System messages ======== */
/* ======== System messages ======== */
case '916':
示例4: cot_url
}
/* ===== */
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;
}
/* ===== */
$t_o->parse("MAIN.ROWS.POSTS.POSTS_ROWS");
}
$t_o->assign(array("ADDPOST_ACTION_URL" => cot_url('projects', 'id=' . $id . '&oid=' . $offer['offer_id'] . '&a=addpost'), "ADDPOST_TEXT" => cot_textarea('posttext', $offer_post['post_text'], 3, 60), "ADDPOST_OFFERID" => $offer['offer_id']));
$t_o->parse("MAIN.ROWS.POSTS.POSTFORM");
$t_o->parse("MAIN.ROWS.POSTS");
}
/* === Hook - Part4 : Include === */
foreach ($extp4 as $pl) {
include $pl;
}
示例5: 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);
}
示例6: 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])) {
//.........这里部分代码省略.........
示例7: cot_generate_markettags
/**
* Returns all product tags for coTemplate
*
* @param mixed $item_data product Info Array or ID
* @param string $tag_prefix Prefix for tags
* @param int $textlength Text truncate
* @param bool $admin_rights product 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_markettags($item_data, $tag_prefix = '', $textlength = 0, $admin_rights = null, $pagepath_home = false, $emptytitle = '')
{
global $db, $cot_extrafields, $cfg, $L, $Ls, $R, $db_market, $usr, $sys, $cot_yesno, $structure, $db_structure;
static $extp_first = null, $extp_main = null;
if (is_null($extp_first)) {
$extp_first = cot_getextplugins('markettags.first');
$extp_main = cot_getextplugins('markettags.main');
}
/* === Hook === */
foreach ($extp_first as $pl) {
include $pl;
}
/* ===== */
if (!is_array($item_data)) {
$sql = $db->query("SELECT * FROM {$db_market} WHERE item_id = '" . (int) $item_data . "' LIMIT 1");
$item_data = $sql->fetch();
}
if ($item_data['item_id'] > 0 && !empty($item_data['item_title'])) {
if (is_null($admin_rights)) {
$admin_rights = cot_auth('market', $item_data['item_cat'], 'A');
}
$item_data['item_pageurl'] = empty($item_data['item_alias']) ? cot_url('market', 'c=' . $item_data['item_cat'] . '&id=' . $item_data['item_id']) : cot_url('market', 'c=' . $item_data['item_cat'] . '&al=' . $item_data['item_alias']);
$catpatharray[] = array(cot_url('market'), $L['market']);
$itempatharray[] = array($item_data['item_pageurl'], $item_data['item_title']);
$patharray = array_merge($catpatharray, cot_structure_buildpath('market', $item_data['item_cat']), $itempatharray);
$itempath = cot_breadcrumbs($patharray, $pagepath_home, true);
$patharray = array_merge($catpatharray, cot_structure_buildpath('market', $item_data['item_cat']));
$catpath = cot_breadcrumbs($patharray, $pagepath_home, true);
$text = cot_parse($item_data['item_text'], $cfg['market']['markup'], $item_data['item_parser']);
$text_cut = (int) $textlength > 0 ? cot_string_truncate($text, $textlength) : $text;
$item_data['item_status'] = cot_market_status($item_data['item_state']);
$temp_array = array('ID' => $item_data['item_id'], 'ALIAS' => $item_data['item_alias'], 'STATE' => $item_data['item_state'], 'STATUS' => $item_data['item_status'], 'LOCALSTATUS' => $L['market_status_' . $item_data['item_status']], 'URL' => $item_data['item_pageurl'], 'USER_PRDURL' => cot_url('users', 'm=details&id=' . $item_data['item_userid'] . '&u=' . $item_data['user_name'] . '&tab=market'), 'TITLE' => $itempath, 'SHORTTITLE' => $item_data['item_title'], 'CAT' => $item_data['item_cat'], 'CATTITLE' => htmlspecialchars($structure['market'][$item_data['item_cat']]['title']), 'CATURL' => cot_url('market', 'c=' . $item_data['item_cat']), 'CATPATH' => $catpath, 'TEXT' => $text, 'SHORTTEXT' => $text_cut, 'COST' => number_format($item_data['item_cost'], '0', '.', ' '), 'DATE' => cot_date('datetime_medium', $item_data['item_date']), 'DATE_STAMP' => $item_data['item_date'], 'SHOW_URL' => $item_data['item_pageurl'], 'COUNT' => $item_data['item_count'], 'USER_IS_ADMIN' => $admin_rights || $usr['id'] == $item_data['item_userid']);
if ($admin_rights || $usr['id'] == $item_data['item_userid']) {
$temp_array['ADMIN_EDIT'] = cot_rc_link(cot_url('market', 'm=edit&id=' . $item_data['item_id']), $L['Edit']);
$temp_array['ADMIN_EDIT_URL'] = cot_url('market', 'm=edit&id=' . $item_data['item_id']);
$temp_array['HIDEPRODUCT_URL'] = cot_url('market', 'm=edit&id=' . $item_data['item_id'] . ($item_data['item_state'] == 1 ? '&a=public' : '&a=hide'));
$temp_array['HIDEPRODUCT_TITLE'] = $item_data['item_state'] == 1 ? $L['Publish'] : $L['Hide'];
}
// Extrafields
if (isset($cot_extrafields[$db_market])) {
foreach ($cot_extrafields[$db_market] as $exfld) {
$tag = mb_strtoupper($exfld['field_name']);
$temp_array[$tag . '_TITLE'] = isset($L['market_' . $exfld['field_name'] . '_title']) ? $L['market_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$temp_array[$tag] = cot_build_extrafields_data('market', $exfld, $item_data['item_' . $exfld['field_name']]);
}
}
// Extra fields for structure
if (isset($cot_extrafields[$db_structure])) {
foreach ($cot_extrafields[$db_structure] as $exfld) {
$tag = mb_strtoupper($exfld['field_name']);
$temp_array['CAT_' . $tag . '_TITLE'] = isset($L['structure_' . $exfld['field_name'] . '_title']) ? $L['structure_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$temp_array['CAT_' . $tag] = cot_build_extrafields_data('structure', $exfld, $structure['market'][$item_data['item_cat']][$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;
}
示例8: cot_url
echo cot_url('admin', array('m' => 'subscribe', 'n' => 'user', 'f[sid]' => $item->id, 'f[active]' => 1));
?>
">
<?php
echo $this->activeSubscribers;
?>
</a>
</p>
<p>
<?php
$lastEx = '<span class="fa fa-minus"></span>';
if (!empty($item->last_executed)) {
$tmp = strtotime('1970-01-02 00:01:00');
$tmp2 = strtotime($item->last_executed);
if ($tmp2 > $tmp) {
$lastEx = cot_date($Ldt['datetime_full'], $tmp2);
}
}
?>
<?php
echo cot::$L['subscribe_last_executed'];
?>
: <?php
echo $lastEx;
?>
<br /><?php
echo cot::$L['subscribe_last_sent'];
?>
: <?php
echo $item->last_sent;
?>
示例9: cot_redirect
$sql_pfs_update = $db->query("UPDATE {$db_pfs} SET\n\t\tpfs_desc='" . $db->prep($rdesc) . "',\n\t\tpfs_folderid={$folderid}\n\t\tWHERE pfs_userid={$userid} AND pfs_id={$id}");
cot_redirect(cot_url('pfs', "f={$pfs_folderid}&" . $more, '', true));
}
/* ============= */
$out['subtitle'] = $L['pfs_title'];
if (!$standalone) {
require_once $cfg['system_dir'] . '/header.php';
}
$t = new XTemplate(cot_tplfile('pfs.edit'));
if ($standalone) {
cot_sendheaders();
$html = Resources::render();
if ($html) {
$out['head_head'] = $html . $out['head_head'];
}
$t->assign(array('PFS_HEAD' => $out['head_head']));
$t->parse('MAIN.STANDALONE_HEADER');
$t->parse('MAIN.STANDALONE_FOOTER');
}
$t->assign(array('PFS_TITLE' => cot_breadcrumbs($title, $cfg['homebreadcrumb']), 'PFS_ACTION' => cot_url('pfs', 'm=edit&a=update&id=' . $pfs_id . '&' . $more), 'PFS_FILE' => $pfs_file, 'PFS_DATE' => cot_date('datetime_medium', $pfs_date), 'PFS_DATE_STAMP' => $pfs_date, 'PFS_FOLDER' => cot_selectbox_folders($userid, '', $pfs_folderid), 'PFS_URL' => $ff, 'PFS_DESC' => cot_inputbox('text', 'rdesc', $pfs_desc, 'size="56" maxlength="255"'), 'PFS_SIZE' => cot_build_filesize($pfs_size_bytes, 1), 'PFS_SIZE_BYTES' => $pfs_size_bytes, 'PFS_SIZE_KB' => $pfs_size_bytes / 1024));
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('pfs.edit.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN');
$t->out('MAIN');
if (!$standalone) {
require_once $cfg['system_dir'] . '/footer.php';
}
示例10: mb_strlen
if (!empty($c) && isset($structure['folio'][$c])) {
$mtch = $structure['folio'][$c]['path'] . ".";
$mtchlen = mb_strlen($mtch);
$catsub = array();
$catsub[] = $c;
foreach ($structure['folio'] as $i => $x) {
if (mb_substr($x['path'], 0, $mtchlen) == $mtch) {
$catsub[] = $i;
}
}
$sqllist = $db->query("SELECT p.*, u.* FROM {$db_folio} AS p\n\t\t\t\tLEFT JOIN {$db_users} AS u ON p.item_userid = u.user_id\n\t\t\tWHERE item_state=0 AND item_cat IN ('" . implode("','", $catsub) . "') \n\t\t\tORDER BY item_date DESC LIMIT " . $cfg['rss']['rss_maxitems']);
} else {
$sqllist = $db->query("SELECT p.*, u.* FROM {$db_folio} AS p\n\t\t\t\tLEFT JOIN {$db_users} AS u ON p.item_userid = u.user_id\n\t\t\tWHERE item_state=0 \n\t\t\tORDER BY item_date DESC LIMIT " . $cfg['rss']['rss_maxitems']);
}
$i = 0;
$sqllist_rowset = $sqllist->fetchAll();
$sqllist_idset = array();
foreach ($sqllist_rowset as $item) {
$sqllist_idset[$item['item_id']] = $item['item_alias'];
}
foreach ($sqllist_rowset as $row) {
$row['item_pageurl'] = empty($row['item_alias']) ? cot_url('folio', 'c=' . $row['item_cat'] . '&id=' . $row['item_id'], '', true) : cot_url('folio', 'c=' . $row['item_cat'] . '&al=' . $row['item_alias'], '', true);
$items[$i]['title'] = $row['item_title'];
$items[$i]['link'] = COT_ABSOLUTE_URL . $row['item_pageurl'];
$items[$i]['pubDate'] = cot_date('r', $row['item_date']);
$items[$i]['description'] = cot_parse($row['item_text']);
$items[$i]['fields'] = cot_generate_foliotags($row);
$i++;
}
$sqllist->closeCursor();
}
示例11: defined
*/
/**
* Frelancers plugin
*
* @package freelancers
* @version 2.2.2
* @author CMSWorks Team
* @copyright Copyright (c) CMSWorks.ru, littledev.ru
* @license BSD
*/
defined('COT_CODE') or die('Wrong URL');
if ($c == "users") {
$defult_c = false;
$groupid = cot_import('groupid', 'G', 'INT');
$query_string = !empty($groupid) ? "AND user_maingrp=" . $groupid : "AND user_maingrp=4";
if ($id != 'all') {
$catsub = cot_fl_cat_children($id);
$sql = $db->query("SELECT * FROM {$db_users} AS u\n\t\t\tWHERE user_cat IN ('" . implode("','", $catsub) . "') " . $query_string . "\n\t\t\tORDER BY user_regdate DESC LIMIT " . $cfg['rss']['rss_maxitems']);
} else {
$sql = $db->query("SELECT * FROM {$db_users} AS u\n\t\t\tWHERE " . $query_string . "\n\t\t\tORDER BY user_regdate DESC LIMIT " . $cfg['rss']['rss_maxitems']);
}
$i = 0;
while ($row = $sql->fetch()) {
$items[$i]['title'] = $row['user_name'];
$items[$i]['link'] = COT_ABSOLUTE_URL . cot_url('users', 'm=details&id=' . $row['user_id'] . '&u=' . $row['user_name'], '', true);
$items[$i]['pubDate'] = cot_date('r', $row['user_regdate']);
$items[$i]['fields'] = cot_generate_usertags($row);
$i++;
}
$sql->closeCursor();
}
示例12: str_replace
$info['available'] = '?';
}
$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;
}
/* ===== */
示例13: cot_log
$com_grp = $usr['isadmin'] ? 'adm' : 'usr';
cot_log('Edited comment #' . $id, $com_grp);
cot_redirect(cot_url($url_area, $url_params, '#c' . $id, true));
}
}
$t->assign(array('COMMENTS_TITLE' => $plugin_title, 'COMMENTS_TITLE_URL' => cot_url('plug', 'e=comments')));
$t->parse('MAIN.COMMENTS_TITLE');
$sql = $db->query("SELECT * FROM {$db_com} WHERE com_id=? AND com_code=? AND com_area=?", array($id, $item, $area));
cot_die($sql->rowCount() != 1);
$com = $sql->fetch();
$com_limit = $sys['now'] < $com['com_date'] + $cfg['plugin']['comments']['time'] * 60 ? TRUE : FALSE;
$usr['isowner'] = $com_limit && ($usr['id'] > 0 && $com['com_authorid'] == $usr['id'] || $usr['id'] == 0 && isset($_SESSION['cot_comments_edit'][$id]));
$usr['allow_write'] = $usr['isadmin'] || $usr['isowner'];
cot_block($usr['allow_write']);
$editor = $cfg['plugin']['comments']['markup'] ? 'input_textarea_minieditor' : '';
$t->assign(array('COMMENTS_FORM_POST' => cot_url('plug', 'e=comments&m=edit&a=update&area=' . $area . '&cat=' . $cat . '&item=' . $com['com_code'] . '&id=' . $com['com_id']), 'COMMENTS_POSTER_TITLE' => $L['Poster'], 'COMMENTS_POSTER' => $com['com_author'], 'COMMENTS_IP_TITLE' => $L['Ip'], 'COMMENTS_IP' => $com['com_authorip'], 'COMMENTS_DATE_TITLE' => $L['Date'], 'COMMENTS_DATE' => cot_date('datetime_medium', $com['com_date']), 'COMMENTS_DATE_STAMP' => $com['com_date'], 'COMMENTS_FORM_UPDATE_BUTTON' => $L['Update'], 'COMMENTS_FORM_TEXT' => cot_textarea('comtext', $com['com_text'], 8, 64, '', $editor)));
// Extra fields
foreach ($cot_extrafields[$db_com] as $exfld) {
$uname = strtoupper($exfld['field_name']);
$exfld_val = cot_build_extrafields('rcomments' . $exfld['field_name'], $exfld, $com[$exfld['field_name']]);
$exfld_title = isset($L['comments_' . $exfld['field_name'] . '_title']) ? $L['comments_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
$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_FORM_EDIT.EXTRAFLD');
}
/* == Hook == */
foreach (cot_getextplugins('comments.edit.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN.COMMENTS_FORM_EDIT');
}
示例14: array
$title_params = array('EDIT' => $L['Edit'], 'NAME' => $urr['user_name']);
$out['subtitle'] = cot_title('{EDIT} - {NAME}', $title_params);
$out['head'] .= $R['code_noindex'];
$mskin = cot_tplfile(array('users', 'edit', $usr['maingrp']), 'module');
/* === Hook === */
foreach (cot_getextplugins('users.edit.main') as $pl) {
include $pl;
}
/* ===== */
require_once $cfg['system_dir'] . '/header.php';
$t = new XTemplate($mskin);
require_once cot_incfile('forms');
$protected = $sys['protecttopadmin'] ? array('disabled' => 'disabled') : array();
$editor_class = $cfg['users']['usertextimg'] ? 'minieditor' : '';
$delete_pfs = cot_module_active('pfs') ? cot_checkbox(false, 'ruserdelpfs', $L['PFS']) : '';
$t->assign(array('USERS_EDIT_TITLE' => cot_breadcrumbs(array(array(cot_url('users'), $L['Users']), array(cot_url('users', 'm=details&id=' . $urr['user_id'] . '&u=' . $urr['user_name']), $urr['user_name']), array(cot_url('users', 'm=edit&id=' . $urr['user_id']), $L['Edit'])), $cfg['homebreadcrumb']), 'USERS_EDIT_DETAILSLINK' => cot_url('users', 'm=details&id=' . $urr['user_id']), 'USERS_EDIT_EDITLINK' => cot_url('users', 'm=edit&id=' . $urr['user_id']), 'USERS_EDIT_SUBTITLE' => $L['useed_subtitle'], 'USERS_EDIT_SEND' => cot_url('users', 'm=edit&a=update&' . cot_xg() . '&id=' . $urr['user_id']), 'USERS_EDIT_ID' => $urr['user_id'], 'USERS_EDIT_NAME' => cot_inputbox('text', 'rusername', $urr['user_name'], array('size' => 32, 'maxlength' => 100) + $protected), 'USERS_EDIT_ACTIVE' => $user_form_active, 'USERS_EDIT_BANNED' => $user_form_banned, 'USERS_EDIT_THEME' => cot_inputbox('text', 'rusertheme', $urr['user_theme'], array('size' => 32, 'maxlength' => 32)), 'USERS_EDIT_LANG' => cot_inputbox('text', 'ruserlang', $urr['user_lang'], array('size' => 32, 'maxlength' => 32)), 'USERS_EDIT_NEWPASS' => cot_inputbox('password', 'rusernewpass', '', array('size' => 12, 'maxlength' => 32, 'autocomplete' => 'off') + $protected), 'USERS_EDIT_MAINGRP' => cot_build_group($urr['user_maingrp']), 'USERS_EDIT_GROUPS' => cot_build_groupsms($urr['user_id'], $usr['isadmin'], $urr['user_maingrp']), 'USERS_EDIT_COUNTRY' => cot_selectbox_countries($urr['user_country'], 'rusercountry'), 'USERS_EDIT_EMAIL' => cot_inputbox('text', 'ruseremail', $urr['user_email'], array('size' => 32, 'maxlength' => 64)), 'USERS_EDIT_HIDEEMAIL' => cot_radiobox($urr['user_hideemail'], 'ruserhideemail', array(1, 0), array($L['Yes'], $L['No'])), 'USERS_EDIT_TEXT' => cot_textarea('rusertext', $urr['user_text'], 4, 56, array('class' => $editor_class)), 'USERS_EDIT_GENDER' => cot_selectbox_gender($urr['user_gender'], 'rusergender'), 'USERS_EDIT_BIRTHDATE' => cot_selectbox_date(cot_date2stamp($urr['user_birthdate']), 'short', 'ruserbirthdate', cot_date('Y', $sys['now']), cot_date('Y', $sys['now']) - 100, false), 'USERS_EDIT_TIMEZONE' => cot_selectbox_timezone($urr['user_timezone'], 'rusertimezone'), 'USERS_EDIT_REGDATE' => cot_date('datetime_medium', $urr['user_regdate']), 'USERS_EDIT_REGDATE_STAMP' => $urr['user_regdate'], 'USERS_EDIT_LASTLOG' => cot_date('datetime_medium', $urr['user_lastlog']), 'USERS_EDIT_LASTLOG_STAMP' => $urr['user_lastlog'], 'USERS_EDIT_LOGCOUNT' => $urr['user_logcount'], 'USERS_EDIT_LASTIP' => cot_build_ipsearch($urr['user_lastip']), 'USERS_EDIT_DELETE' => $sys['user_istopadmin'] ? cot_radiobox(0, 'ruserdelete', array(1, 0), array($L['Yes'], $L['No'])) . $delete_pfs : $L['na']));
// Extra fields
foreach ($cot_extrafields[$db_users] as $exfld) {
$tag = strtoupper($exfld['field_name']);
$t->assign(array('USERS_EDIT_' . $tag => cot_build_extrafields('ruser' . $exfld['field_name'], $exfld, $urr['user_' . $exfld['field_name']]), 'USERS_EDIT_' . $tag . '_TITLE' => isset($L['user_' . $exfld['field_name'] . '_title']) ? $L['user_' . $exfld['field_name'] . '_title'] : $exfld['field_description']));
}
// Error and message reporting
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('users.edit.tags') as $pl) {
include $pl;
}
/* ===== */
$t->parse('MAIN');
$t->out('MAIN');
require_once $cfg['system_dir'] . '/footer.php';
示例15: foreach
<?php
// Error and message handling
$this->displayMessages();
if (!empty($userSubscribes)) {
foreach ($userSubscribes as $itemRow) {
$subRow = $subscribes[$itemRow->rawValue('subscribe')];
$nextRun = '';
$attrs = 'data-id="' . $itemRow->rawValue('subscribe') . '"';
if ($this->user['user_id'] != cot::$usr['id']) {
$attrs .= ' data-uid="' . $this->user['user_id'] . '"';
}
if (!empty($subRow->next_run)) {
$tmp = cot::$sys['now'];
$tmp2 = strtotime($subRow->next_run);
if ($tmp2 > $tmp) {
$nextRun = cot_date($Ldt['datetime_full'], $tmp2);
}
}
?>
<div class="list-row subscribe">
<h2>
<?php
echo htmlspecialchars($subRow->title);
?>
</h2>
<div>
<?php
// Статус рассылки
if (!$subRow->active) {
echo cot::$L['subscribe_subscribe'] . ': ';
?>