当前位置: 首页>>代码示例>>PHP>>正文


PHP cot_build_user函数代码示例

本文整理汇总了PHP中cot_build_user函数的典型用法代码示例。如果您正苦于以下问题:PHP cot_build_user函数的具体用法?PHP cot_build_user怎么用?PHP cot_build_user使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cot_build_user函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cot_rights_parseline

function cot_rights_parseline($row, $title, $link, $ico = '')
{
    global $L, $advanced, $t, $out;
    $mn['R'] = 1;
    $mn['W'] = 2;
    $mn['1'] = 4;
    if ($advanced) {
        $mn['2'] = 8;
        $mn['3'] = 16;
        $mn['4'] = 32;
        $mn['5'] = 64;
    } else {
        $rv['2'] = 8;
        $rv['3'] = 16;
        $rv['4'] = 32;
        $rv['5'] = 64;
    }
    $mn['A'] = 128;
    foreach ($mn as $code => $value) {
        $state[$code] = ($row['auth_rights'] & $value) == $value ? TRUE : FALSE;
        $locked[$code] = ($row['auth_rights_lock'] & $value) == $value ? TRUE : FALSE;
        $out['tpl_rights_parseline_locked'] = $locked[$code];
        $out['tpl_rights_parseline_state'] = $state[$code];
        $t->assign(array('ADMIN_RIGHTS_ROW_ITEMS_NAME' => 'auth[' . $row['auth_code'] . '][' . $row['auth_option'] . '][' . $code . ']', 'ADMIN_RIGHTS_ROW_ITEMS_CHECKED' => $state[$code] ? " checked=\"checked\"" : '', 'ADMIN_RIGHTS_ROW_ITEMS_DISABLED' => $locked[$code] ? " disabled=\"disabled\"" : ''));
        $t->parse('MAIN.RIGHTS_SECTION.RIGHTS_ROW.RIGHTS_ROW_ITEMS');
    }
    if (!$advanced) {
        $preserve = '';
        foreach ($rv as $code => $value) {
            if (($row['auth_rights'] & $value) == $value) {
                $preserve .= '<input type="hidden" name="auth[' . $row['auth_code'] . '][' . $row['auth_option'] . '][' . $code . ']" value="1" />';
            }
        }
        $t->assign('ADMIN_RIGHTS_ROW_PRESERVE', $preserve);
    }
    $ico = !empty($ico) && file_exists($ico) ? $ico : '';
    $t->assign(array('ADMIN_RIGHTS_ROW_AUTH_CODE' => $row['auth_code'], 'ADMIN_RIGHTS_ROW_TITLE' => $title, 'ADMIN_RIGHTS_ROW_LINK' => $link, 'ADMIN_RIGHTS_ROW_ICO' => $ico, 'ADMIN_RIGHTS_ROW_RIGHTSBYITEM' => cot_url('admin', 'm=rightsbyitem&ic=' . $row['auth_code'] . '&io=' . $row['auth_option']), 'ADMIN_RIGHTS_ROW_USER' => cot_build_user($row['auth_setbyuserid'], htmlspecialchars($row['user_name']))));
    $t->parse('MAIN.RIGHTS_SECTION.RIGHTS_ROW');
}
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:39,代码来源:admin.rights.php

示例2: cot_url

         $news_link_params .= $key != $cat && $var[3] != 0 && $xx != 0 ? "&" . $key . "d=" . $var[3]['durl'] : '';
         $xx++;
     }
 }
 $news_link = cot_url('index', $news_link_params);
 $catd = $catn != 0 && !$cfg['plugin']['news']['syncpagination'] ? $cat . "d" : "d";
 $pagenav = cot_pagenav('index', $news_link_params, $v[3]['d'], $totalnews, $v[1], $catd);
 $filename = str_replace(array(' ', ',', '.', '-'), '_', $v[0]);
 $news = new XTemplate(cot_tplfile($catn == 0 ? "news" : "news." . $filename, 'plug'));
 $sql_rowset = $sql->fetchAll();
 $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;
 }
 /* ===== */
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:news.php

示例3: 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');
开发者ID:Roffun,项目名称:Cotonti,代码行数:31,代码来源:contact.tools.php

示例4: cot_build_recentpages

function cot_build_recentpages($template, $mode = 'recent', $maxperpage = 5, $d = 0, $titlelength = 0, $textlength = 0, $rightprescan = true, $cat = '')
{
    global $db, $structure, $db_pages, $db_users, $sys, $cfg, $L, $cot_extrafields, $usr;
    $recentitems = new XTemplate(cot_tplfile($template, 'plug'));
    // Load all cats and subcats in white list if set
    if (!empty($cfg['plugin']['recentitems']['whitelist'])) {
        $whitelist = array();
        foreach (preg_split('#\\r?\\n#', $cfg['plugin']['recentitems']['whitelist']) as $c) {
            $whitelist = array_merge($whitelist, cot_structure_children('page', $c, true, true, $rightprescan));
        }
    } else {
        $whitelist = false;
    }
    // Load all cats and subcats in black list if set
    if (!empty($cfg['plugin']['recentitems']['blacklist'])) {
        $blacklist = array();
        foreach (preg_split('#\\r?\\n#', $cfg['plugin']['recentitems']['blacklist']) as $c) {
            $blacklist = array_merge($blacklist, cot_structure_children('page', $c, true, true, $rightprescan));
        }
    } else {
        $blacklist = false;
    }
    if ($rightprescan || $cat) {
        // Get selected cats
        $catsub = cot_structure_children('page', $cat, true, true, $rightprescan);
        if ($whitelist) {
            // Must be both in selected and whitelist
            $catsub = array_intersect($catsub, $whitelist);
        } elseif ($blacklist) {
            // Must be in selected but not in blacklist
            $catsub = array_diff($catsub, $blacklist);
        }
        $incat = "AND page_cat IN ('" . implode("','", $catsub) . "')";
    } elseif ($whitelist) {
        // Only cats from white list
        $incat = "AND page_cat IN ('" . implode("','", $whitelist) . "')";
    } elseif ($blacklist) {
        // All cats but not in black list
        $incat = "AND page_cat NOT IN ('" . implode("','", $blacklist) . "')";
    }
    if ($mode == 'recent') {
        $where = "WHERE page_state=0 AND page_begin <= {$sys['now']} AND (page_expire = 0 OR page_expire > {$sys['now']}) AND page_cat <> 'system' " . $incat;
        $totalrecent['pages'] = $cfg['plugin']['recentitems']['maxpages'];
    } else {
        $where = "WHERE page_date >= {$mode} AND page_begin <= {$sys['now']} AND (page_expire = 0 OR page_expire > {$sys['now']}) AND page_state=0 AND page_cat <> 'system' " . $incat;
        $totalrecent['pages'] = $db->query("SELECT COUNT(*) FROM {$db_pages} " . $where)->fetchColumn();
    }
    $join_columns = '';
    $join_tables = '';
    /* === Hook === */
    foreach (cot_getextplugins('recentitems.recentpages.first') as $pl) {
        include $pl;
    }
    /* ===== */
    $sql = $db->query("SELECT p.*, u.* {$join_columns}\n\t\tFROM {$db_pages} AS p\n\t\t\tLEFT JOIN {$db_users} AS u ON u.user_id=p.page_ownerid\n\t\t{$join_tables}\n\t\t{$where} ORDER by page_date desc LIMIT {$d}, {$maxperpage}");
    $jj = 0;
    /* === Hook - Part1 === */
    $extp = cot_getextplugins('recentitems.recentpages.tags');
    /* ===== */
    foreach ($sql->fetchAll() as $pag) {
        $jj++;
        if ((int) $titlelength > 0 && mb_strlen($pag['page_title']) > $titlelength) {
            $pag['page_title'] = cot_string_truncate($pag['page_title'], $titlelength, false) . "...";
        }
        $recentitems->assign(cot_generate_pagetags($pag, 'PAGE_ROW_', $textlength));
        $recentitems->assign(array('PAGE_ROW_SHORTTITLE' => htmlspecialchars($pag['page_title']), 'PAGE_ROW_OWNER' => cot_build_user($pag['page_ownerid'], htmlspecialchars($pag['user_name'])), 'PAGE_ROW_ODDEVEN' => cot_build_oddeven($jj), 'PAGE_ROW_NUM' => $jj));
        $recentitems->assign(cot_generate_usertags($pag, 'PAGE_ROW_OWNER_'));
        /* === Hook - Part2 === */
        foreach ($extp as $pl) {
            include $pl;
        }
        /* ===== */
        $recentitems->parse('MAIN.PAGE_ROW');
    }
    if ($d == 0 && $jj == 0) {
        $recentitems->parse('MAIN.NO_PAGES_FOUND');
    }
    $recentitems->parse('MAIN');
    return $d == 0 || $jj > 0 ? $recentitems->text('MAIN') : '';
}
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:80,代码来源:recentitems.functions.php

示例5: cot_getextplugins

$jj = 0;
/* === Hook - Part1 : Set === */
$extp = cot_getextplugins('page.list.loop');
/* ===== */
$sqllist_rowset = $sqllist->fetchAll();
$sqllist_rowset_other = false;
/* === Hook === */
foreach (cot_getextplugins('page.list.before_loop') as $pl) {
    include $pl;
}
/* ===== */
if (!$sqllist_rowset_other) {
    foreach ($sqllist_rowset as $pag) {
        $jj++;
        $t->assign(cot_generate_pagetags($pag, 'LIST_ROW_', $cfg['page']['truncatetext'], $usr['isadmin']));
        $t->assign(array('LIST_ROW_OWNER' => cot_build_user($pag['page_ownerid'], htmlspecialchars($pag['user_name'])), 'LIST_ROW_ODDEVEN' => cot_build_oddeven($jj), 'LIST_ROW_NUM' => $jj));
        $t->assign(cot_generate_usertags($pag, 'LIST_ROW_OWNER_'));
        /* === Hook - Part2 : Include === */
        foreach ($extp as $pl) {
            include $pl;
        }
        /* ===== */
        $t->parse('MAIN.LIST_ROW');
    }
}
/* === Hook === */
foreach (cot_getextplugins('page.list.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
开发者ID:Roffun,项目名称:Cotonti,代码行数:31,代码来源:page.list.php

示例6: 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;
}
开发者ID:Roffun,项目名称:Cotonti,代码行数:101,代码来源:comments.functions.php

示例7: 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;
}
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:41,代码来源:forums.functions.php

示例8: ceil

    if ($durl > ceil($fpu)) {
        $guest_start_num = $maxuserssperpage - $who_users % $maxuserssperpage + ($durl - 1 - ceil($fpu)) * $maxuserssperpage;
    }
}
foreach ($sql_users->fetchAll() as $row) {
    if ($hiddenusers && in_array($row['user_id'], $hiddenusers)) {
        if (cot_auth('plug', 'hiddengroups', '1')) {
            $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;
        }
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:whosonline.php

示例9: defined

<?php

/* ====================
[BEGIN_COT_EXT]
Hooks=forums.topics.tags
Tags=forums.topics.tpl:{FORUMS_TOPICS_VIEWERS},{FORUMS_TOPICS_VIEWER_NAMES}
[END_COT_EXT]
==================== */
/**
 * Forums online users in section display
 *
 * @package WhosOnline
 * @copyright (c) Cotonti Team
 * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
 */
defined('COT_CODE') or die('Wrong URL');
if ($cfg['forums']['cat_' . $s]['allowviewers']) {
    $v = 0;
    $sql_forums_view = $db->query("SELECT online_name, online_userid FROM {$db_online} WHERE online_location='Forums' AND online_subloc=" . $db->quote($structure['forums'][$s]['title']));
    while ($rowv = $sql_forums_view->fetch()) {
        if ($rowv['online_name'] != 'v') {
            $fs_viewers_names .= $v > 0 ? ', ' : '';
            $fs_viewers_names .= cot_build_user($rowv['online_userid'], htmlspecialchars($rowv['online_name']));
            $v++;
        }
    }
    $sql_forums_view->closeCursor();
    $fs_viewers = $v;
    $t->assign(array('FORUMS_TOPICS_VIEWERS' => $fs_viewers, 'FORUMS_TOPICS_VIEWER_NAMES' => $fs_viewers_names));
    $t->parse('MAIN.FORUMS_SECTIONS_VIEWERS');
}
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:whosonline.forums.topics.tags.php

示例10: foreach

foreach (cot_getextplugins('sbr.add.main') as $pl) {
    include $pl;
}
/* ===== */
$t = new XTemplate($mskin);
if (!empty($uid)) {
    $t->assign(cot_generate_usertags($uid, 'SBR_PERFORMER_'));
} else {
    $t->assign('SBRADD_FORM_PERFORMER', cot_inputbox('text', 'rsbrperformer', $rsbrperformer, 'placeholder="' . $L['sbr_performer_placeholder'] . '"'));
}
if (!empty($pid)) {
    $t->assign(cot_generate_projecttags($pid, 'SBR_PROJECT_'));
}
$patharray[] = array(cot_url('sbr'), $L['sbr']);
$patharray[] = array(cot_url('sbr', 'm=add&pid=' . $pid . '&uip=' . $uid), $L['sbr_addtitle']);
$t->assign(array('SBRADD_TITLE' => cot_breadcrumbs($patharray, $cfg['homebreadcrumb'], true), 'SBRADD_SUBTITLE' => $L['sbr_addtitle'], 'SBRADD_ADMINEMAIL' => "mailto:" . $cfg['adminemail'], 'SBRADD_FORM_SEND' => cot_url('sbr', 'm=add&pid=' . $pid . '&uid=' . $uid . '&a=add'), 'SBRADD_FORM_OWNER' => cot_build_user($usr['id'], htmlspecialchars($usr['name'])), 'SBRADD_FORM_OWNERID' => $usr['id'], 'SBRADD_FORM_MAINTITLE' => cot_inputbox('text', 'rsbrtitle', $rsbr['sbr_title'])));
for ($i = 1; $i <= $stagescount; $i++) {
    $t->assign(array('STAGEADD_FORM_NUM' => $i, 'STAGEADD_FORM_TITLE' => cot_inputbox('text', 'rstagetitle[' . $i . ']', $rstagetitle[$i]), 'STAGEADD_FORM_TEXT' => cot_textarea('rstagetext[' . $i . ']', $rstagetext[$i], 10, 120, '', 'input_textarea'), 'STAGEADD_FORM_COST' => cot_inputbox('text', 'rstagecost[' . $i . ']', $rstagecost[$i], array('class' => 'stagecost', 'size' => '10', 'maxlength' => '100')), 'STAGEADD_FORM_DAYS' => cot_inputbox('text', 'rstagedays[' . $i . ']', $rstagedays[$i], array('size' => '10', 'maxlength' => '100'))));
    /* === Hook === */
    foreach (cot_getextplugins('sbr.add.stages.tags') as $pl) {
        include $pl;
    }
    /* ===== */
    $t->parse('MAIN.STAGE_ROW');
}
// Extra fields
foreach ($cot_extrafields[$db_sbr] as $exfld) {
    $uname = strtoupper($exfld['field_name']);
    $exfld_val = cot_build_extrafields('rsbr' . $exfld['field_name'], $exfld, $rsbr['sbr_' . $exfld['field_name']]);
    $exfld_title = isset($L['sbr_' . $exfld['field_name'] . '_title']) ? $L['sbr_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
    $t->assign(array('SBRADD_FORM_' . $uname => $exfld_val, 'SBRADD_FORM_' . $uname . '_TITLE' => $exfld_title, 'SBRADD_FORM_EXTRAFLD' => $exfld_val, 'SBRADD_FORM_EXTRAFLD_TITLE' => $exfld_title));
开发者ID:cotemplate,项目名称:cot-sbr,代码行数:31,代码来源:sbr.add.php

示例11: cot_rights_parseline

function cot_rights_parseline($row, $title, $link)
{
    global $L, $advanced, $t, $out, $ic;
    $mn['R'] = 1;
    $mn['W'] = 2;
    if ($advanced || $ic == 'page') {
        $mn['1'] = 4;
    } else {
        $rv['1'] = 4;
    }
    if ($advanced) {
        $mn['2'] = 8;
        $mn['3'] = 16;
        $mn['4'] = 32;
        $mn['5'] = 64;
    } else {
        $rv['2'] = 8;
        $rv['3'] = 16;
        $rv['4'] = 32;
        $rv['5'] = 64;
    }
    $mn['A'] = 128;
    foreach ($mn as $code => $value) {
        $state[$code] = ($row['auth_rights'] & $value) == $value ? TRUE : FALSE;
        $locked[$code] = ($row['auth_rights_lock'] & $value) == $value ? TRUE : FALSE;
        $out['tpl_rights_parseline_locked'] = $locked[$code];
        $out['tpl_rights_parseline_state'] = $state[$code];
        $t->assign(array('ADMIN_RIGHTSBYITEM_ROW_ITEMS_NAME' => 'auth[' . $row['auth_groupid'] . '][' . $code . ']', 'ADMIN_RIGHTSBYITEM_ROW_ITEMS_CHECKED' => $state[$code] ? " checked=\"checked\"" : '', 'ADMIN_RIGHTSBYITEM_ROW_ITEMS_DISABLED' => $locked[$code] ? " disabled=\"disabled\"" : ''));
        $t->parse('MAIN.RIGHTSBYITEM_ROW.ROW_ITEMS');
    }
    if (!$advanced) {
        $preserve = '';
        foreach ($rv as $code => $value) {
            if (($row['auth_rights'] & $value) == $value) {
                $preserve .= '<input type="hidden" name="auth[' . $row['auth_groupid'] . '][' . $code . ']" value="1" />';
            }
        }
        $t->assign('ADMIN_RIGHTSBYITEM_ROW_PRESERVE', $preserve);
    }
    $t->assign(array('ADMIN_RIGHTSBYITEM_ROW_TITLE' => $title, 'ADMIN_RIGHTSBYITEM_ROW_LINK' => $link, 'ADMIN_RIGHTSBYITEM_ROW_USER' => cot_build_user($row['auth_setbyuserid'], htmlspecialchars($row['user_name'])), 'ADMIN_RIGHTSBYITEM_ROW_JUMPTO' => cot_url('users', 'g=' . $row['auth_groupid'])));
    $t->parse('MAIN.RIGHTSBYITEM_ROW');
}
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:42,代码来源:admin.rightsbyitem.php

示例12: cot_tplfile

$out['head'] .= $R['code_noindex'];
$mskin = cot_tplfile(array('sbr', 'edit'), 'plug');
/* === Hook === */
foreach (cot_getextplugins('sbr.edit.main') as $pl) {
    include $pl;
}
/* ===== */
$t = new XTemplate($mskin);
$t->assign(cot_generate_sbrtags($sbr, 'SBR_'));
$t->assign(cot_generate_usertags($sbr['sbr_performer'], 'SBR_PERFORMER_'));
if (!empty($sbr['sbr_pid'])) {
    $t->assign(cot_generate_projecttags($sbr['sbr_pid'], 'SBR_PROJECT_'));
}
$patharray[] = array(cot_url('sbr'), $L['sbr']);
$patharray[] = array(cot_url('sbr', 'm=edit&id=' . $id), $L['sbr_edittitle']);
$t->assign(array('SBREDIT_TITLE' => cot_breadcrumbs($patharray, $cfg['homebreadcrumb'], true), 'SBREDIT_SUBTITLE' => $L['sbr_edittitle'], 'SBREDIT_ADMINEMAIL' => "mailto:" . $cfg['adminemail'], 'SBREDIT_FORM_SEND' => cot_url('sbr', 'm=edit&id=' . $id . '&a=update'), 'SBREDIT_FORM_OWNER' => cot_build_user($usr['id'], htmlspecialchars($usr['name'])), 'SBREDIT_FORM_OWNERID' => $usr['id'], 'SBREDIT_FORM_MAINTITLE' => cot_inputbox('text', 'rsbrtitle', $sbr['sbr_title'])));
$stages = $db->query("SELECT * FROM {$db_sbr_stages} WHERE stage_sid=" . $sbr['sbr_id'] . " ORDER BY stage_num ASC")->fetchAll();
if (empty($stagescount)) {
    $stagescount = count($stages);
}
foreach ($stages as $stage) {
    $t->assign(array('STAGEEDIT_FORM_NUM' => $stage['stage_num'], 'STAGEEDIT_FORM_TITLE' => cot_inputbox('text', 'rstagetitle[' . $stage['stage_num'] . ']', $stage['stage_title']), 'STAGEEDIT_FORM_TEXT' => cot_textarea('rstagetext[' . $stage['stage_num'] . ']', $stage['stage_text'], 10, 120, '', 'input_textarea'), 'STAGEEDIT_FORM_COST' => cot_inputbox('text', 'rstagecost[' . $stage['stage_num'] . ']', $stage['stage_cost'], array('class' => 'stagecost', 'size' => '10', 'maxlength' => '100')), 'STAGEEDIT_FORM_DAYS' => cot_inputbox('text', 'rstagedays[' . $stage['stage_num'] . ']', $stage['stage_days'], array('size' => '10', 'maxlength' => '100'))));
    $stagefiles = $db->query("SELECT * FROM {$db_sbr_files} WHERE file_sid=" . $sbr['sbr_id'] . " AND file_area='stage' AND file_code='" . $stage['stage_num'] . "' ORDER BY file_id ASC")->fetchAll();
    foreach ($stagefiles as $file) {
        $t->assign(array('FILE_ROW_ID' => $file['file_id'], 'FILE_ROW_URL' => $file['file_url'], 'FILE_ROW_TITLE' => $file['file_title'], 'FILE_ROW_EXT' => $file['file_ext'], 'FILE_ROW_SIZE' => $file['file_size']));
        $t->parse('MAIN.STAGE_ROW.FILE_ROW');
    }
    /* === Hook === */
    foreach (cot_getextplugins('sbr.edit.stages.tags') as $pl) {
        include $pl;
    }
开发者ID:cotemplate,项目名称:cot-sbr,代码行数:31,代码来源:sbr.edit.php

示例13: while

    $ipmask1 = $userip[0] . "." . $userip[1] . "." . $userip[2] . "." . $userip[3];
    $ipmask2 = $userip[0] . "." . $userip[1] . "." . $userip[2];
    $ipmask3 = $userip[0] . "." . $userip[1];
    $res_host = @gethostbyaddr($id);
    $res_dns = $res_host == $id ? 'Unknown' : $res_host;
    $sql = $db->query("SELECT user_id, user_name, user_lastip FROM {$db_users} WHERE user_lastip='{$ipmask1}' ");
    $totalmatches1 = $sql->rowCount();
    while ($row = $sql->fetch()) {
        $t->assign(array('IPSEARCH_USER_IPMASK1' => cot_build_user($row['user_id'], htmlspecialchars($row['user_name'])), 'IPSEARCH_USER_LASTIP_IPMASK1' => cot_build_ipsearch($row['user_lastip'])));
        $t->parse('MAIN.IPSEARCH_RESULTS.IPSEARCH_IPMASK1');
    }
    $sql->closeCursor();
    $sql = $db->query("SELECT user_id, user_name, user_lastip FROM {$db_users} WHERE user_lastip LIKE '{$ipmask2}.%' ");
    $totalmatches2 = $sql->rowCount();
    while ($row = $sql->fetch()) {
        $t->assign(array('IPSEARCH_USER_IPMASK2' => cot_build_user($row['user_id'], htmlspecialchars($row['user_name'])), 'IPSEARCH_USER_LASTIP_IPMASK2' => cot_build_ipsearch($row['user_lastip'])));
        $t->parse('MAIN.IPSEARCH_RESULTS.IPSEARCH_IPMASK2');
    }
    $sql->closeCursor();
    $sql = $db->query("SELECT user_id, user_name, user_lastip FROM {$db_users} WHERE user_lastip LIKE '{$ipmask3}.%.%' ");
    $totalmatches3 = $sql->rowCount();
    while ($row = $sql->fetch()) {
        $t->assign(array('IPSEARCH_USER_IPMASK3' => cot_build_user($row['user_id'], htmlspecialchars($row['user_name'])), 'IPSEARCH_USER_LASTIP_IPMASK3' => cot_build_ipsearch($row['user_lastip'])));
        $t->parse('MAIN.IPSEARCH_RESULTS.IPSEARCH_IPMASK3');
    }
    $sql->closeCursor();
    $t->assign(array('IPSEARCH_RES_DNS' => $res_dns, 'IPSEARCH_TOTALMATCHES1' => $totalmatches1, 'IPSEARCH_IPMASK1' => $ipmask1, 'IPSEARCH_TOTALMATCHES2' => $totalmatches2, 'IPSEARCH_IPMASK2' => $ipmask2, 'IPSEARCH_TOTALMATCHES3' => $totalmatches3, 'IPSEARCH_IPMASK3' => $ipmask3));
    $t->parse('MAIN.IPSEARCH_RESULTS');
}
$t->parse('MAIN');
$plugin_body .= $t->text('MAIN');
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:ipsearch.admin.php

示例14: foreach

/* ===== */
$fp_num = 0;
foreach ($sql_forums->fetchAll() as $row) {
    $row['user_text'] = $cfg['forums']['cat_' . $s]['allowusertext'] ? $row['user_text'] : '';
    $fp_num++;
    $rowquote_url = $usr['id'] > 0 ? cot_url('forums', 'm=posts&s=' . $s . '&q=' . $q . '&quote=' . $row['fp_id'] . '&d=' . $durl . '&n=last', '#np') : '';
    $rowquote = $usr['id'] > 0 ? cot_rc('forums_rowquote', array('url' => $rowquote_url)) : '';
    $rowedit_url = ($usr['isadmin'] || $row['fp_posterid'] == $usr['id'] && ($cfg['forums']['edittimeout'] == '0' || $sys['now'] - $row['fp_creation'] < $cfg['forums']['edittimeout'] * 3600)) && $usr['id'] > 0 ? cot_url('forums', 'm=editpost&s=' . $s . '&q=' . $q . '&p=' . $row['fp_id'] . '&d=' . $durl . '&' . cot_xg()) : '';
    $rowedit = ($usr['isadmin'] || $row['fp_posterid'] == $usr['id'] && ($cfg['forums']['edittimeout'] == '0' || $sys['now'] - $row['fp_creation'] < $cfg['forums']['edittimeout'] * 3600)) && $usr['id'] > 0 ? cot_rc('forums_rowedit', array('url' => $rowedit_url)) : '';
    $rowdelete_url = $usr['id'] > 0 && ($usr['isadmin'] || $row['fp_posterid'] == $usr['id'] && ($cfg['forums']['edittimeout'] == '0' || $sys['now'] - $row['fp_creation'] < $cfg['forums']['edittimeout'] * 3600)) ? cot_confirm_url(cot_url('forums', 'm=posts&a=delete&' . cot_xg() . '&s=' . $s . '&q=' . $q . '&p=' . $row['fp_id'] . '&d=' . $durl), 'forums', 'forums_confirm_delete_post') : '';
    $rowdelete = $usr['id'] > 0 && ($usr['isadmin'] || $row['fp_posterid'] == $usr['id'] && ($cfg['forums']['edittimeout'] == '0' || $sys['now'] - $row['fp_creation'] < $cfg['forums']['edittimeout'] * 3600) && $fp_num > 1) ? cot_rc('forums_rowdelete', array('url' => $rowdelete_url)) : '';
    if (!empty($row['fp_updater'])) {
        $row['fp_updatedby'] = sprintf($L['forums_updatedby'], htmlspecialchars($row['fp_updater']), cot_date('datetime_medium', $row['fp_updated']), cot_build_timegap($row['fp_updated'], $sys['now']));
    }
    $t->assign(cot_generate_usertags($row, 'FORUMS_POSTS_ROW_USER'));
    $t->assign(array('FORUMS_POSTS_ROW_ID' => $row['fp_id'], 'FORUMS_POSTS_ROW_POSTID' => 'post_' . $row['fp_id'], 'FORUMS_POSTS_ROW_IDURL' => cot_url('forums', 'm=posts&id=' . $row['fp_id']), 'FORUMS_POSTS_ROW_URL' => cot_url('forums', 'm=posts&q=' . $row['fp_topicid'] . '&d=' . $durl, "#" . $row['fp_id']), 'FORUMS_POSTS_ROW_CREATION' => cot_date('datetime_medium', $row['fp_creation']), 'FORUMS_POSTS_ROW_CREATION_STAMP' => $row['fp_creation'], 'FORUMS_POSTS_ROW_UPDATED' => cot_date('datetime_medium', $row['fp_updated']), 'FORUMS_POSTS_ROW_UPDATED_STAMP' => $row['fp_updated'], 'FORUMS_POSTS_ROW_UPDATER' => htmlspecialchars($row['fp_updater']), 'FORUMS_POSTS_ROW_UPDATEDBY' => $row['fp_updatedby'], 'FORUMS_POSTS_ROW_TEXT' => cot_parse($row['fp_text'], $cfg['forums']['markup'] && $cfg['forums']['cat_' . $s]['allowbbcodes']), 'FORUMS_POSTS_ROW_ANCHORLINK' => cot_rc('forums_code_post_anchor', array('id' => $row['fp_id'])), 'FORUMS_POSTS_ROW_POSTERNAME' => cot_build_user($row['fp_posterid'], htmlspecialchars($row['fp_postername'])), 'FORUMS_POSTS_ROW_POSTERID' => $row['fp_posterid'], 'FORUMS_POSTS_ROW_POSTERIP' => $usr['isadmin'] ? cot_build_ipsearch($row['fp_posterip']) : '', 'FORUMS_POSTS_ROW_DELETE' => $rowdelete, 'FORUMS_POSTS_ROW_DELETE_URL' => $rowdelete_url, 'FORUMS_POSTS_ROW_EDIT' => $rowedit, 'FORUMS_POSTS_ROW_EDIT_URL' => $rowedit_url, 'FORUMS_POSTS_ROW_QUOTE' => $rowquote, 'FORUMS_POSTS_ROW_QUOTE_URL' => $rowquote_url, 'FORUMS_POSTS_ROW_BOTTOM' => (empty($id) ? $d + $fp_num : $id) == $totalposts ? $R['forums_code_bottom'] : ($usr['id'] > 0 && $n == 'unread' && $row['fp_creation'] > $usr['lastvisit'] ? $R['forums_code_unread'] : ''), 'FORUMS_POSTS_ROW_ODDEVEN' => cot_build_oddeven($fp_num), 'FORUMS_POSTS_ROW_NUM' => $fp_num, 'FORUMS_POSTS_ROW_ORDER' => empty($id) ? $d + $fp_num : $id));
    foreach ($cot_extrafields[$db_forum_posts] as $exfld) {
        $tag = mb_strtoupper($exfld['field_name']);
        $t->assign(array('FORUMS_POSTS_ROW_' . $tag . '_TITLE' => isset($L['forums_posts_' . $exfld['field_name'] . '_title']) ? $L['forums_posts_' . $exfld['field_name'] . '_title'] : $exfld['field_description'], 'FORUMS_POSTS_ROW_' . $tag => cot_build_extrafields_data('forums', $exfld, $row['fp_' . $exfld['field_name']], $cfg['forums']['markup'] && $cfg['forums']['cat_' . $s]['allowbbcodes']), 'FORUMS_POSTS_ROW_' . $tag . '_VALUE' => $row['fp_' . $exfld['field_name']]));
    }
    /* === Hook - Part2 : Include === */
    foreach ($extp as $pl) {
        include $pl;
    }
    /* ===== */
    $t->parse('MAIN.FORUMS_POSTS_ROW');
}
$lastpage = $d + $cfg['forums']['maxpostsperpage'] < $totalposts ? FALSE : TRUE;
$pagenav = cot_pagenav('forums', "m=posts&q={$q}", $d, $totalposts, $cfg['forums']['maxpostsperpage']);
$jumpbox[cot_url('forums')] = $L['Forums'];
foreach ($structure['forums'] as $key => $val) {
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:forums.posts.php

示例15: cot_tplfile

$mskin = cot_tplfile(array('page', $cat['tpl']));
$env['last_modified'] = $pag['page_updated'];
/* === Hook === */
foreach (cot_getextplugins('page.main') as $pl) {
    include $pl;
}
/* ===== */
if ($pag['page_file']) {
    unset($_SESSION['dl']);
    $_SESSION['dl'] = $id;
}
require_once $cfg['system_dir'] . '/header.php';
require_once cot_incfile('users', 'module');
$t = new XTemplate($mskin);
$t->assign(cot_generate_pagetags($pag, 'PAGE_', 0, $usr['isadmin'], $cfg['homebreadcrumb']));
$t->assign('PAGE_OWNER', cot_build_user($pag['page_ownerid'], htmlspecialchars($pag['user_name'])));
$t->assign(cot_generate_usertags($pag, 'PAGE_OWNER_'));
$pag['page_file'] = intval($pag['page_file']);
if ($pag['page_file'] > 0) {
    if ($sys['now'] > $pag['page_begin']) {
        if (!empty($pag['page_url'])) {
            $dotpos = mb_strrpos($pag['page_url'], ".") + 1;
            $type = mb_strtolower(mb_substr($pag['page_url'], $dotpos, 5));
            $pag['page_fileicon'] = cot_rc('page_icon_file_path');
            if (!file_exists($pag['page_fileicon'])) {
                $pag['page_fileicon'] = cot_rc('page_icon_file_default');
            }
            $pag['page_fileicon'] = cot_rc('page_icon_file', array('icon' => $pag['page_fileicon']));
        } else {
            $pag['page_fileicon'] = '';
        }
开发者ID:Roffun,项目名称:Cotonti,代码行数:31,代码来源:page.main.php


注:本文中的cot_build_user函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。