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


PHP cot_build_oddeven函数代码示例

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


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

示例1: form_structure_editor

function form_structure_editor($id)
{
    global $cot_structure, $cot_extrafields, $db_structure, $structure, $L, $R;
    $row = $cot_structure->category($id);
    if (empty($row)) {
        return null;
    }
    $ii++;
    $structure_id = $row['structure_id'];
    $structure_code = $row['structure_code'];
    $n = $row['structure_area'];
    $dozvil = $row['structure_count'] > 0 ? false : true;
    $is_module = cot_module_active($n);
    $t = new XTemplate(cot_tplfile('cateditor.admin.edit', 'plug'));
    $t->assign(array('ADMIN_STRUCTURE_HEADER' => $row['structure_title'], 'ADMIN_STRUCTURE_DEL_URL' => $dozvil ? cot_confirm_url(cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&a=delete&id=' . $row['structure_id'] . '&' . cot_xg()), 'admin') : '', 'ADMIN_STRUCTURE_UPDATE_FORM_URL' => cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&id=' . $structure_id . '&a=update'), 'ADMIN_STRUCTURE_ID' => $row['structure_id'], 'ADMIN_STRUCTURE_CODE' => cot_inputbox('text', 'rstructurecode', $structure_code, 'size="10" maxlength="255"'), 'ADMIN_STRUCTURE_PATHFIELDIMG' => mb_strpos($row['structure_path'], '.') == 0 ? $R['admin_icon_join1'] : $R['admin_icon_join2'], 'ADMIN_STRUCTURE_PATH' => cot_inputbox('text', 'rstructurepath', $row['structure_path'], 'size="12" maxlength="255"'), 'ADMIN_STRUCTURE_TPL' => cot_inputbox('text', 'rstructuretpl', $row['structure_tpl'], 'size="10" maxlength="255"'), 'ADMIN_STRUCTURE_TITLE' => cot_inputbox('text', 'rstructuretitle', $row['structure_title'], 'size="32" maxlength="255"'), 'ADMIN_STRUCTURE_DESC' => cot_inputbox('text', 'rstructuredesc', $row['structure_desc'], 'size="64" maxlength="255"'), 'ADMIN_STRUCTURE_ICON' => cot_inputbox('text', 'rstructureicon', $row['structure_icon'], 'size="64" maxlength="128"'), 'ADMIN_STRUCTURE_LOCKED' => cot_checkbox($row['structure_locked'], 'rstructurelocked'), 'ADMIN_STRUCTURE_COUNT' => $row['structure_count'], 'ADMIN_STRUCTURE_PARENT' => $cot_structure->select($cot_structure->get_parent($id), 'rstructureparent', true, 'disabled="disabled"'), 'ADMIN_STRUCTURE_JUMPTO_URL' => cot_url($n, 'c=' . $structure_code), 'ADMIN_STRUCTURE_RIGHTS_URL' => $is_module ? cot_url('admin', 'm=rightsbyitem&ic=' . $n . '&io=' . $structure_code) : '', 'ADMIN_STRUCTURE_ODDEVEN' => cot_build_oddeven($ii)));
    foreach ($cot_extrafields[$db_structure] as $exfld) {
        $exfld_val = cot_build_extrafields('rstructure' . $exfld['field_name'], $exfld, $row['structure_' . $exfld['field_name']]);
        $exfld_title = isset($L['structure_' . $exfld['field_name'] . '_title']) ? $L['structure_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
        $t->assign(array('ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) => $exfld_val, 'ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) . '_TITLE' => $exfld_title, 'ADMIN_STRUCTURE_EXTRAFLD' => $exfld_val, 'ADMIN_STRUCTURE_EXTRAFLD_TITLE' => $exfld_title));
        $t->parse('MAIN.EXTRAFLD');
    }
    require_once cot_incfile('configuration');
    $optionslist = cot_config_list($is_module ? 'module' : 'plug', $n, $structure_code);
    /* === Hook - Part1 : Set === */
    $extp = cot_getextplugins('admin.config.edit.loop');
    /* ===== */
    foreach ($optionslist as $row_c) {
        list($title, $hint) = cot_config_titles($row_c['config_name'], $row_c['config_text']);
        if ($row_c['config_type'] == COT_CONFIG_TYPE_SEPARATOR) {
            $t->assign('ADMIN_CONFIG_FIELDSET_TITLE', $title);
            $t->parse('MAIN.OPTIONS.CONFIG.ADMIN_CONFIG_ROW.ADMIN_CONFIG_FIELDSET_BEGIN');
        } else {
            $t->assign(array('ADMIN_CONFIG_ROW_CONFIG' => cot_config_input($row_c['config_name'], $row_c['config_type'], $row_c['config_value'], $row_c['config_variants']), 'ADMIN_CONFIG_ROW_CONFIG_TITLE' => $title, 'ADMIN_CONFIG_ROW_CONFIG_MORE_URL' => cot_url('admin', 'm=structure&n=' . $n . '&d=' . $durl . '&id=' . $structure_id . '&al=' . $structure_code . '&a=reset&v=' . $row_c['config_name'] . '&' . cot_xg()), 'ADMIN_CONFIG_ROW_CONFIG_MORE' => $hint));
            /* === Hook - Part2 : Include === */
            foreach ($extp as $pl) {
                include $pl;
            }
            /* ===== */
            $t->parse('MAIN.CONFIG.ADMIN_CONFIG_ROW.ADMIN_CONFIG_ROW_OPTION');
        }
        $t->parse('MAIN.CONFIG.ADMIN_CONFIG_ROW');
    }
    /* === Hook  === */
    foreach (cot_getextplugins('admin.config.edit.tags') as $pl) {
        include $pl;
    }
    /* ===== */
    $t->assign('CONFIG_HIDDEN', cot_inputbox('hidden', 'editconfig', $structure_code));
    $t->parse('MAIN.CONFIG');
    $t->parse('MAIN');
    return $t->text('MAIN');
}
开发者ID:esclkm,项目名称:cot-cateditor,代码行数:52,代码来源:cateditor.admin.edit.php

示例2: cot_url

$t->assign(array('TYPE_ALL_URL' => cot_url('admin', 'm=projects&c=' . $c), 'TYPE_ALL_ACT' => empty($type) ? 'act' : ''));
$t->parse('MAIN.TYPES');
$t->assign(array("SEARCH_ACTION_URL" => cot_url('admin', "m=projects&c=" . $c . "&type=" . $type, '', true), "SEARCH_SQ" => cot_inputbox('text', 'sq', $sq, 'class="schstring"'), "SEARCH_STATE" => cot_radiobox($state, 'state', array(0, 1, 2), array('опубликованные', 'скрытые', 'на проверке')), "SEARCH_CAT" => cot_projects_selectcat($c, 'c'), "SEARCH_SORTER" => cot_selectbox($sort, "sort", array('', 'costasc', 'costdesc'), array($L['projects_mostrelevant'], $L['projects_costasc'], $L['projects_costdesc']), false), 'TYPES_EDIT' => cot_url('admin', 'm=projects&p=types'), 'PAGENAV_PAGES' => $pagenav['main'], 'PAGENAV_PREV' => $pagenav['prev'], 'PAGENAV_NEXT' => $pagenav['next'], 'CATALOG' => cot_build_structure_projects_tree('', array($c)), 'CATTITLE' => !empty($c) ? ' / ' . !empty($c) ? ' / ' . htmlspecialchars($structure['projects'][$c]['title']) : '' : ''));
$sqllist_rowset = $sqllist->fetchAll();
$sqllist_idset = array();
foreach ($sqllist_rowset as $item) {
    $sqllist_idset[$item['item_id']] = $item['item_alias'];
}
/* === Hook === */
$extp = cot_getextplugins('projects.admin.list.loop');
/* ===== */
foreach ($sqllist_rowset as $item) {
    $jj++;
    $t->assign(cot_generate_usertags($item, 'PRJ_ROW_OWNER_'));
    $t->assign(cot_generate_projecttags($item, 'PRJ_ROW_', $cfg['projects']['shorttextlen'], $usr['isadmin'], $cfg['homebreadcrumb']));
    $t->assign(array('PRJ_ROW_ODDEVEN' => cot_build_oddeven($jj), 'PRJ_ROW_EDIT_URL' => cot_url('projects', 'm=edit&id=' . $item['item_id']), 'PRJ_ROW_VALIDATE_URL' => cot_url('admin', 'm=projects&p=default&a=validate&id=' . $item['item_id']), 'PRJ_ROW_DELETE_URL' => cot_url('admin', 'm=projects&p=default&a=delete&id=' . $item['item_id'])));
    /* === Hook - Part2 : Include === */
    foreach ($extp as $pl) {
        include $pl;
    }
    /* ===== */
    $t->parse("MAIN.PRJ_ROWS");
}
/* === Hook === */
$extp = cot_getextplugins('projects.admin.list.tags');
foreach ($extp as $pl) {
    include $pl;
}
/* ===== */
$t->parse("MAIN");
$adminmain = $t->text("MAIN");
开发者ID:Andreyjktl,项目名称:cot-freelance,代码行数:31,代码来源:projects.admin.default.php

示例3: foreach

foreach (cot_getextplugins('market.list.search.tags') as $pl) {
    include $pl;
}
/* ===== */
$sqllist_rowset = $sqllist->fetchAll();
$sqllist_idset = array();
foreach ($sqllist_rowset as $item) {
    $sqllist_idset[$item['item_id']] = $item['item_alias'];
}
/* === Hook === */
$extp = cot_getextplugins('market.list.loop');
/* ===== */
foreach ($sqllist_rowset as $item) {
    $jj++;
    $t->assign(cot_generate_usertags($item, 'PRD_ROW_OWNER_'));
    $t->assign(cot_generate_markettags($item, 'PRD_ROW_', $cfg['market']['shorttextlen'], $usr['isadmin'], $cfg['homebreadcrumb']));
    $t->assign(array("PRD_ROW_ODDEVEN" => cot_build_oddeven($jj)));
    /* === Hook - Part2 : Include === */
    foreach ($extp as $pl) {
        include $pl;
    }
    /* ===== */
    $t->parse("MAIN.PRD_ROWS");
}
/* === Hook === */
foreach (cot_getextplugins('market.list.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
$module_body = $t->text('MAIN');
开发者ID:Andreyjktl,项目名称:cot-freelance,代码行数:31,代码来源:market.list.php

示例4: 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);
}
开发者ID:Andreyjktl,项目名称:cot-freelance,代码行数:31,代码来源:projects.search.list.php

示例5: cot_getmarketlist

function cot_getmarketlist($template = 'index', $count = 5, $sqlsearch = '', $order = "item_date DESC")
{
    global $db, $db_market, $cfg, $db_users;
    list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = cot_auth('market', 'any', 'RWA');
    $t = new XTemplate(cot_tplfile(array('market', $template), 'module'));
    $sqlsearch = !empty($sqlsearch) ? " AND " . $sqlsearch : '';
    $sqllist = $db->query("SELECT * FROM {$db_market} AS p LEFT JOIN {$db_users} AS u ON u.user_id=p.item_userid\n\tWHERE item_state=0 {$sqlsearch} ORDER BY {$order} LIMIT " . (int) $count);
    $sqllist_rowset = $sqllist->fetchAll();
    $sqllist_idset = array();
    foreach ($sqllist_rowset as $item) {
        $sqllist_idset[$item['item_id']] = $item['item_alias'];
    }
    foreach ($sqllist_rowset as $item) {
        $jj++;
        $t->assign(cot_generate_usertags($item, 'PRD_ROW_OWNER_'));
        $t->assign(cot_generate_markettags($item, 'PRD_ROW_', $cfg['market']['shorttextlen'], $usr['isadmin'], $cfg['homebreadcrumb']));
        $t->assign(array("PRD_ROW_ODDEVEN" => cot_build_oddeven($jj)));
        $t->parse("MARKET.PRD_ROWS");
    }
    $t->parse("MARKET");
    return $t->text("MARKET");
}
开发者ID:ASDAFF,项目名称:cot-freelance,代码行数:22,代码来源:market.functions.php

示例6: cot_import

        $rinput['type_title'] = cot_import($rtitle, 'D', 'TXT');
        if (!empty($rinput['type_title'])) {
            $db->update($db_projects_types, $rinput, "type_id=" . (int) $rid);
        } else {
            $db->delete($db_projects_types, "type_id=" . (int) $rid);
        }
    }
    if (!empty($rdefault)) {
        $db->update($db_config, array('config_value' => $rdefault), "config_name = ? \n\t\t\tAND config_cat = ?", array('default_type', 'projects'));
    }
    $cache && $cache->clear();
    cot_redirect(cot_url('admin', 'm=projects&p=types&d=' . $d_url, '#footer', true));
    exit;
}
$totalitems = $db->query("SELECT COUNT(*) FROM {$db_projects_types}")->fetchColumn();
$sql = $db->query("SELECT * FROM {$db_projects_types} ORDER by type_title ASC LIMIT {$d}, " . $cfg['maxrowsperpage']);
$pagenav = cot_pagenav('admin', 'm=projects&p=types', $d, $totalitems, $cfg['maxrowsperpage']);
$t = new XTemplate(cot_tplfile('projects.admin.types', 'module'));
$jj = 0;
while ($item = $sql->fetch()) {
    $jj++;
    $t->assign(array('TYPE_ROW_ID' => cot_inputbox('text', 'rtitle[' . $item['type_id'] . ']', $item['type_title']), 'TYPE_ROW_TITLE' => cot_inputbox('text', 'rtitle[' . $item['type_id'] . ']', $item['type_title']), 'TYPE_ROW_DEFAULT' => cot_radiobox($cfg['projects']['default_type'], 'rdefault', $item['type_id']), 'TYPE_ROW_DEL_URL' => cot_url('admin', 'm=projects&p=types&id=' . $item['type_id'] . '&a=delete'), 'TYPE_ROW_NUM' => $jj, 'TYPE_ROW_ODDEVEN' => cot_build_oddeven($jj)));
    $t->parse("MAIN.ROWS");
}
if ($jj == 0) {
    $t->parse("MAIN.NOROWS");
}
$t->assign(array("EDITFORM_ACTION_URL" => cot_url('admin', 'm=projects&p=types&a=edit&d=' . $d_url), "ADDFORM_ACTION_URL" => cot_url('admin', 'm=projects&p=types&a=add'), "PAGENAV_PAGES" => $pagenav['main'], "PAGENAV_PREV" => $pagenav['prev'], "PAGENAV_NEXT" => $pagenav['next'], "ADDFORM_TITLE" => cot_inputbox('text', 'rtitle', ''), "ADDFORM_DEFAULT" => cot_inputbox('checkbox', 'rdefault', 1)));
$t->parse("MAIN.ADDFORM");
$t->parse("MAIN");
$adminmain = $t->text("MAIN");
开发者ID:Andreyjktl,项目名称:cot-freelance,代码行数:31,代码来源:projects.admin.types.php

示例7: cot_page_enum

/**
 * Generates page list widget
 * @param  mixed   $categories       Custom parent categories code
 * @param  integer $count            Number of items to show. 0 - all items
 * @param  string  $template         Path for template file
 * @param  string  $order            Sorting order (SQL)
 * @param  string  $condition        Custom selection filter (SQL)
 * @param  mixed   $active_only	     Custom parent category code
 * @param  boolean $use_subcat       Include subcategories TRUE/FALSE
 * @param  boolean $exclude_current  Exclude the current page from the rowset for pages.
 * @param  string  $blacklist        Category black list, semicolon separated
 * @param  string  $pagination       Pagination symbol
 * @param  integer $cache_ttl        Cache lifetime in seconds, 0 disables cache
 * @return string                    Parsed HTML
 */
function cot_page_enum($categories = '', $count = 0, $template = '', $order = '', $condition = '', $active_only = true, $use_subcat = true, $exclude_current = false, $blacklist = '', $pagination = '', $cache_ttl = null)
{
    global $db, $db_pages, $db_users, $structure, $cfg, $sys, $lang, $cache;
    // Compile lists
    if (!is_array($blacklist)) {
        $blacklist = str_replace(' ', '', $blacklist);
        $blacklist = !empty($blacklist) ? explode(',', $blacklist) : array();
    }
    // Get the cats
    if (!empty($categories)) {
        if (!is_array($categories)) {
            $categories = str_replace(' ', '', $categories);
            $categories = explode(',', $categories);
        }
        $categories = array_unique($categories);
        if ($use_subcat) {
            $total_categogies = array();
            foreach ($categories as $cat) {
                $cats = cot_structure_children('page', $cat, $use_subcat);
                $total_categogies = array_merge($total_categogies, $cats);
            }
            $categories = array_unique($total_categogies);
        }
        $categories = count($blacklist) > 0 ? array_diff($categories, $blacklist) : $categories;
        $where['cat'] = "page_cat IN ('" . implode("','", $cats) . "')";
    } elseif (count($blacklist)) {
        $where['cat_black'] = "page_cat NOT IN ('" . implode("','", $blacklist) . "')";
    }
    $where['condition'] = $condition;
    if ($exclude_current && defined('COT_PAGES') && !defined('COT_LIST')) {
        global $id;
        $where['page_id'] = "page_id != {$id}";
    }
    if ($active_only) {
        $where['state'] = "page_state=0";
        $where['date'] = "page_begin <= {$sys['now']} AND (page_expire = 0 OR page_expire > {$sys['now']})";
    }
    // Get pagination number if necessary
    if (!empty($pagination)) {
        list($pg, $d, $durl) = cot_import_pagenav($pagination, $count);
    } else {
        $d = 0;
    }
    // Display the items
    $mskin = file_exists($template) ? $template : cot_tplfile(array('page', 'enum', $template), 'module');
    /* === Hook === */
    foreach (cot_getextplugins('page.enum.query') as $pl) {
        include $pl;
    }
    /* ===== */
    if (cot_plugin_active('comments')) {
        global $db_com;
        require_once cot_incfile('comments', 'plug');
        $cns_join_columns .= ", (SELECT COUNT(*) FROM `{$db_com}` WHERE com_area = 'page' AND com_code = p.page_id) AS com_count";
    }
    $sql_order = empty($order) ? 'ORDER BY page_date DESC' : "ORDER BY {$order}";
    $sql_limit = $count > 0 ? "LIMIT {$d}, {$count}" : '';
    $where = array_filter($where);
    $where = $where ? 'WHERE ' . implode(' AND ', $where) : '';
    $sql_total = "SELECT COUNT(*) FROM {$db_pages} AS p {$cns_join_tables} {$where}";
    $sql_query = "SELECT p.*, u.* {$cns_join_columns} FROM {$db_pages} AS p LEFT JOIN {$db_users} AS u ON p.page_ownerid = u.user_id\n\t\t\t{$cns_join_tables} {$where} {$sql_order} {$sql_limit}";
    $t = new XTemplate($mskin);
    isset($md5hash) || ($md5hash = 'page_enum_' . md5(str_replace($sys['now'], '_time_', $mskin . $lang . $sql_query)));
    if ($cache && (int) $cache_ttl > 0) {
        $page_query_html = $cache->disk->get($md5hash, 'page', (int) $cache_ttl);
        if (!empty($page_query_html)) {
            return $page_query_html;
        }
    }
    $totalitems = $db->query($sql_total)->fetchColumn();
    $sql = $db->query($sql_query);
    $sql_rowset = $sql->fetchAll();
    $jj = 0;
    foreach ($sql_rowset as $pag) {
        $jj++;
        $t->assign(cot_generate_pagetags($pag, 'PAGE_ROW_'));
        $t->assign(array('PAGE_ROW_NUM' => $jj, 'PAGE_ROW_ODDEVEN' => cot_build_oddeven($jj), 'PAGE_ROW_RAW' => $pag));
        $t->assign(cot_generate_usertags($pag, 'PAGE_ROW_OWNER_'));
        /* === Hook === */
        foreach (cot_getextplugins('page.enum.loop') as $pl) {
            include $pl;
        }
        /* ===== */
        if (cot_plugin_active('comments')) {
            $rowe_urlp = empty($pag['page_alias']) ? array('c' => $pag['page_cat'], 'id' => $pag['page_id']) : array('c' => $pag['page_cat'], 'al' => $pag['page_alias']);
//.........这里部分代码省略.........
开发者ID:CrazyFreeMan,项目名称:Cotonti,代码行数:101,代码来源:page.functions.php

示例8: implode

     $where_and['or'] = '(' . implode(' OR ', $where_or) . ')';
     $where_and = array_diff($where_and, array(''));
     $where = implode(' AND ', $where_and);
     $maxitems = $cfg_maxitems - $items;
     $maxitems = $maxitems < 0 ? 0 : $maxitems;
     if (!$db->fieldExists($db_forum_topics, "ft_{$rs['frmsort']}")) {
         $rs['frmsort'] = 'updated';
     }
     $sql = $db->query("SELECT SQL_CALC_FOUND_ROWS p.*, t.*\n\t\t\t \tFROM {$db_forum_posts} AS p, {$db_forum_topics} AS t\n\t\t\t\tWHERE {$where} AND p.fp_topicid = t.ft_id\n\t\t\t\tGROUP BY t.ft_id ORDER BY ft_" . $rs['frmsort'] . " " . $rs['frmsort2'] . "\n\t\t\t\tLIMIT {$d}, {$maxitems}");
     $items = $sql->rowCount();
     $totalitems[] = $db->query('SELECT FOUND_ROWS()')->fetchColumn();
     $jj = 0;
     while ($row = $sql->fetch()) {
         if ($row['ft_updated'] > 0) {
             $post_url = $cfg['plugin']['search']['searchurl'] == 'Single' ? cot_url('forums', 'm=posts&id=' . $row['fp_id'] . '&highlight=' . $hl) : cot_url('forums', 'm=posts&p=' . $row['fp_id'] . '&highlight=' . $hl, '#' . $row['fp_id']);
             $t->assign(array('PLUGIN_FR_CATEGORY' => cot_breadcrumbs(cot_forums_buildpath($row['ft_cat']), false), 'PLUGIN_FR_TITLE' => cot_rc_link($post_url, htmlspecialchars($row['ft_title'])), 'PLUGIN_FR_TITLE_URL' => $post_url, 'PLUGIN_FR_TEXT' => cot_clear_mark($row['fp_text'], $words), 'PLUGIN_FR_TIME' => $row['ft_updated'] > 0 ? cot_date('datetime_medium', $row['ft_updated']) : cot_date('datetime_medium', $row['fp_updated']), 'PLUGIN_FR_TIMESTAMP' => $row['ft_updated'] > 0 ? $row['ft_updated'] : $row['fp_updated'], 'PLUGIN_FR_ODDEVEN' => cot_build_oddeven($jj), 'PLUGIN_FR_NUM' => $jj));
             $t->parse('MAIN.RESULTS.FORUMS.ITEM');
         }
         $jj++;
     }
     $sql->closeCursor();
     if ($jj > 0) {
         $t->parse('MAIN.RESULTS.FORUMS');
     }
 }
 /* === Hook === */
 foreach (cot_getextplugins('search.list') as $pl) {
     include $pl;
 }
 /* ===== */
 if (array_sum($totalitems) < 1) {
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:search.php

示例9: 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

示例10: cot_message

            $db->delete($db_cache, "c_name = 'cot_rc_html'");
        }
    } else {
        cot_message('Error');
    }
}
$row = cot_diskcache_list();
$cachefiles = $cachesize = 0;
$ii = 0;
/* === Hook - Part1 : Set === */
$extp = cot_getextplugins('admin.cache.disk.loop');
/* ===== */
foreach ($row as $i => $x) {
    $cachefiles += $x[0];
    $cachesize += $x[1];
    $t->assign(array('ADMIN_DISKCACHE_ITEM_DEL_URL' => cot_url('admin', 'm=cache&s=disk&a=delete&id=' . $i . '&' . cot_xg()), 'ADMIN_DISKCACHE_ITEM_NAME' => $i, 'ADMIN_DISKCACHE_FILES' => $x[0], 'ADMIN_DISKCACHE_SIZE' => $x[1], 'ADMIN_DISKCACHE_ROW_ODDEVEN' => cot_build_oddeven($ii)));
    /* === Hook - Part2 : Include === */
    foreach ($extp as $pl) {
        include $pl;
    }
    /* ===== */
    $t->parse('MAIN.ADMIN_DISKCACHE_ROW');
    $ii++;
}
$t->assign(array('ADMIN_DISKCACHE_URL_REFRESH' => cot_url('admin', 'm=cache&s=disk'), 'ADMIN_DISKCACHE_URL_PURGE' => cot_url('admin', 'm=cache&s=disk&a=purge&' . cot_xg()), 'ADMIN_DISKCACHE_CACHEFILES' => $cachefiles, 'ADMIN_DISKCACHE_CACHESIZE' => $cachesize));
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('admin.cache.disk.tags') as $pl) {
    include $pl;
}
/* ===== */
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:admin.cache.disk.php

示例11: cot_url

            $row['com_url'] = cot_url('plug', 'e=gal&pic=' . $row['com_value'], '#c' . $row['com_id']);
            break;
        case 'users':
            $row['com_url'] = cot_url('users', 'm=details&id=' . $row['com_value'], '#c' . $row['com_id']);
            break;
        case 'polls':
            $row['com_url'] = cot_url('polls', 'id=' . $row['com_value'] . "&comments=1", '#c' . $row['com_id']);
            break;
        case 'e_shop':
            $row['com_url'] = cot_url('plug', 'e=e_shop&sh=product&productID=' . $row['com_value'], '#c' . $row['com_id']);
            break;
        default:
            $row['com_url'] = '';
            break;
    }
    $t->assign(array('ADMIN_COMMENTS_ITEM_DEL_URL' => cot_url('admin', 'm=other&p=comments&a=delete&id=' . $row['com_id'] . '&' . cot_xg()), 'ADMIN_COMMENTS_ITEM_ID' => $row['com_id'], 'ADMIN_COMMENTS_CODE' => $row['com_code'], 'ADMIN_COMMENTS_AREA' => $row['com_area'], 'ADMIN_COMMENTS_AUTHOR' => $row['com_author'], 'ADMIN_COMMENTS_DATE' => cot_date('datetime_medium', $row['com_date']), 'ADMIN_COMMENTS_DATE_STAMP' => $row['com_date'], 'ADMIN_COMMENTS_TEXT' => $row['com_text'], 'ADMIN_COMMENTS_URL' => $row['com_url'], 'ADMIN_COMMENTS_ODDEVEN' => cot_build_oddeven($ii)));
    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('ADMIN_COMMENTS_' . $tag . '_TITLE' => $exfld_title, 'ADMIN_COMMENTS_' . $tag => cot_build_extrafields_data('comments', $exfld, $row['com_' . $exfld['field_name']]), 'ADMIN_COMMENTS_' . $tag . '_VALUE' => $row['com_' . $exfld['field_name']]));
        }
    }
    /* === Hook - Part2 : Include === */
    foreach ($extp as $pl) {
        include $pl;
    }
    /* ===== */
    $t->parse('MAIN.ADMIN_COMMENTS_ROW');
    $ii++;
}
开发者ID:Roffun,项目名称:Cotonti,代码行数:31,代码来源:comments.tools.php

示例12: is_array

            $t->assign(array('FORUMS_SECTIONS_ROW_SUBITEMS' => is_array($nxtlvl[$y]) && $cfg['forums']['cat_' . $y]['defstate'] ? 1 : 0, 'FORUMS_SECTIONS_ROW_ACTIVITY' => cot_rc('forums_icon_section_activity', array('secact_num' => $secact_num)), 'FORUMS_SECTIONS_ROW_ACTIVITYVALUE' => $secact_num, 'FORUMS_SECTIONS_ROW_VIEWERS' => $cot_sections_vw_cur, 'FORUMS_SECTIONS_ROW_ODDEVEN' => cot_build_oddeven($yy), 'FORUMS_SECTIONS_ROW_NUM' => $yy));
            /* === Hook - Part2 : Include === */
            foreach ($extps as $pl) {
                include $pl;
            }
            /* ===== */
            $t->parse('MAIN.FORUMS_SECTIONS.CAT.SECTION');
        }
    }
    $xx++;
    $fold = !$cfg['forums']['cat_' . $x]['defstate'];
    if ($c) {
        $fold = (int) ($c == 'fold' ? true : ($c == 'unfold' ? false : ($c == $x ? false : true)));
    }
    $t->assign(cot_generate_sectiontags($x, 'FORUMS_SECTIONS_ROW_', $cat_top[$x]));
    $t->assign(array('FORUMS_SECTIONS_ROW_FOLD' => $fold, 'FORUMS_SECTIONS_ROW_SUBITEMS' => is_array($nxtlvl[$x]) ? 1 : 0, 'FORUMS_SECTIONS_ROW_ODDEVEN' => cot_build_oddeven($xx), 'FORUMS_SECTIONS_ROW_NUM' => $xx));
    /* === Hook - Part2 : Include === */
    foreach ($extp as $pl) {
        include $pl;
    }
    /* ===== */
    $t->parse('MAIN.FORUMS_SECTIONS.CAT');
}
$t->parse('MAIN.FORUMS_SECTIONS');
/* === Hook === */
foreach (cot_getextplugins('forums.sections.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
$t->out('MAIN');
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:forums.sections.php

示例13: XTemplate

 }
 $t = new XTemplate(cot_tplfile('i18n.structure', 'plug'));
 // Render table
 $ii = 0;
 $k = -1;
 /* === Hook - Part1 : Set === */
 $extp = cot_getextplugins('i18n.structure.loop');
 /* ===== */
 foreach ($structure['page'] as $code => $row) {
     if (cot_i18n_enabled($code)) {
         $k++;
         if ($k < $d || $ii == $maxperpage) {
             continue;
         }
         $cat_i18n = $i18n_structure[$code][$i18n_locale];
         $t->assign(array('I18N_CATEGORY_ROW_TITLE' => htmlspecialchars($row['title']), 'I18N_CATEGORY_ROW_DESC' => htmlspecialchars($row['desc']), 'I18N_CATEGORY_ROW_CODE_NAME' => "code[{$ii}]", 'I18N_CATEGORY_ROW_CODE_VALUE' => $code, 'I18N_CATEGORY_ROW_ITITLE_NAME' => "title[{$ii}]", 'I18N_CATEGORY_ROW_ITITLE_VALUE' => htmlspecialchars($cat_i18n['title']), 'I18N_CATEGORY_ROW_IDESC_NAME' => "desc[{$ii}]", 'I18N_CATEGORY_ROW_IDESC_VALUE' => htmlspecialchars($cat_i18n['desc']), 'I18N_CATEGORY_ROW_ODDEVEN' => cot_build_oddeven($ii)));
         /* === Hook - Part2 : Include === */
         foreach ($extp as $pl) {
             include $pl;
         }
         /* ===== */
         $t->parse('MAIN.I18N_CATEGORY_ROW');
         $ii++;
     }
 }
 $totalitems = $k + 1;
 $pagenav = cot_pagenav('plug', 'e=i18n&m=structure&l=' . $i18n_locale, $d, $totalitems, $maxperpage, 'd', '', $cfg['jquery'] && $cfg['turnajax']);
 $t->assign(array('I18N_ACTION' => cot_url('plug', 'e=i18n&m=structure&l=' . $i18n_locale . '&a=update&d=' . $durl), 'I18N_ORIGINAL_LANG' => $i18n_locales[$cfg['defaultlang']], 'I18N_TARGET_LANG' => $i18n_locales[$i18n_locale], 'I18N_PAGINATION_PREV' => $pagenav['prev'], 'I18N_PAGNAV' => $pagenav['main'], 'I18N_PAGINATION_NEXT' => $pagenav['next']));
 cot_display_messages($t);
 /* === Hook === */
 foreach (cot_getextplugins('i18n.structure.tags') as $pl) {
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:i18n.structure.php

示例14: cot_rc

            $row['ft_icon'] .= $row['ft_state'] ? '_locked' : '';
        }
        $row['ft_icon_type'] = $row['ft_icon'];
        $row['ft_icon'] = cot_rc('forums_icon_topic', array('icon' => $row['ft_icon']));
        $row['ft_lastpostername'] = cot_build_user($row['ft_lastposterid'], htmlspecialchars($row['ft_lastpostername']));
    }
    if ($row['ft_postcount'] > $cfg['forums']['maxpostsperpage'] && !$row['ft_movedto']) {
        $pn_q = $row['ft_movedto'] > 0 ? $row['ft_movedto'] : $row['ft_id'];
        $pn = cot_pagenav('forums', 'm=posts&q=' . $pn_q, 0, $row['ft_postcount'], $cfg['forums']['maxpostsperpage'], 'd');
        $row['ft_pages'] = cot_rc('forums_code_topic_pages', array('main' => $pn['main'], 'first' => $pn['first'], 'last' => $pn['last']));
    }
    $row['ft_icon_type_ex'] = $row['ft_icon_type'];
    if ($row['ft_user_posted']) {
        $row['ft_icon_type_ex'] .= '_posted';
    }
    $t->assign(array('FORUMS_TOPICS_ROW_ID' => $row['ft_id'], 'FORUMS_TOPICS_ROW_STATE' => $row['ft_state'], 'FORUMS_TOPICS_ROW_ICON' => $row['ft_icon'], 'FORUMS_TOPICS_ROW_ICON_TYPE' => $row['ft_icon_type'], 'FORUMS_TOPICS_ROW_ICON_TYPE_EX' => $row['ft_icon_type_ex'], 'FORUMS_TOPICS_ROW_TITLE' => htmlspecialchars($row['ft_title']), 'FORUMS_TOPICS_ROW_DESC' => htmlspecialchars($row['ft_desc']), 'FORUMS_TOPICS_ROW_CREATIONDATE' => cot_date('datetime_short', $row['ft_creationdate']), 'FORUMS_TOPICS_ROW_CREATIONDATE_STAMP' => $row['ft_creationdate'], 'FORUMS_TOPICS_ROW_UPDATEDURL' => $row['ft_lastposturl'], 'FORUMS_TOPICS_ROW_UPDATED' => $row['ft_lastpostlink'], 'FORUMS_TOPICS_ROW_UPDATED_STAMP' => $row['ft_updated'], 'FORUMS_TOPICS_ROW_MOVED' => $row['ft_movedto'] > 0 ? 1 : 0, 'FORUMS_TOPICS_ROW_TIMEAGO' => cot_build_timegap($row['ft_updated']), 'FORUMS_TOPICS_ROW_POSTCOUNT' => $row['ft_postcount'], 'FORUMS_TOPICS_ROW_REPLYCOUNT' => $row['ft_replycount'], 'FORUMS_TOPICS_ROW_VIEWCOUNT' => $row['ft_viewcount'], 'FORUMS_TOPICS_ROW_FIRSTPOSTER' => cot_build_user($row['ft_firstposterid'], htmlspecialchars($row['ft_firstpostername'])), 'FORUMS_TOPICS_ROW_LASTPOSTER' => $row['ft_lastpostername'], 'FORUMS_TOPICS_ROW_USER_POSTED' => (int) $row['ft_user_posted'], 'FORUMS_TOPICS_ROW_URL' => $row['ft_url'], 'FORUMS_TOPICS_ROW_PREVIEW' => $row['ft_preview'] . '...', 'FORUMS_TOPICS_ROW_PAGES' => $row['ft_pages'], 'FORUMS_TOPICS_ROW_MAXPAGES' => $row['ft_maxpages'], 'FORUMS_TOPICS_ROW_ODDEVEN' => cot_build_oddeven($ft_num), 'FORUMS_TOPICS_ROW_NUM' => $ft_num, 'FORUMS_TOPICS_ROW' => $row));
    foreach ($cot_extrafields[$db_forum_topics] as $exfld) {
        $tag = mb_strtoupper($exfld['field_name']);
        $t->assign(array('FORUMS_TOPICS_ROW_' . $tag . '_TITLE' => isset($L['forums_topics_' . $exfld['field_name'] . '_title']) ? $L['forums_topics_' . $exfld['field_name'] . '_title'] : $exfld['field_description'], 'FORUMS_TOPICS_ROW_' . $tag => cot_build_extrafields_data('forums', $exfld, $row['ft_' . $exfld['field_name']], $cfg['forums']['markup'] && $cfg['forums']['cat_' . $s]['allowbbcodes']), 'FORUMS_TOPICS_ROW_' . $tag . '_VALUE' => $row['ft_' . $exfld['field_name']]));
    }
    /* === Hook - Part2 : Include === */
    foreach ($extp as $pl) {
        include $pl;
    }
    /* ===== */
    $t->parse('MAIN.FORUMS_TOPICS_ROW');
}
$pagenav = cot_pagenav('forums', "m=topics&s={$s}&ord={$o}&w={$w}", $d, $totaltopics, $cfg['forums']['maxtopicsperpage']);
$toptitle = cot_breadcrumbs(cot_forums_buildpath($s), $cfg['homebreadcrumb']);
$toptitle .= $usr['isadmin'] ? $R['forums_code_admin_mark'] : '';
$jumpbox[cot_url('forums')] = $L['Forums'];
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:forums.topics.php

示例15: 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


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