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


PHP cot_getextplugins函数代码示例

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


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

示例1: cot_load_structure_custom

function cot_load_structure_custom()
{
    global $db, $db_structure, $cfg, $cot_extrafields, $structure;
    $structure = array();
    if (defined('COT_UPGRADE')) {
        $sql = $db->query("SELECT * FROM {$db_structure} ORDER BY structure_path ASC");
        $row['structure_area'] = 'page';
    } else {
        $sql = $db->query("SELECT * FROM {$db_structure} ORDER BY structure_area ASC, structure_path ASC");
    }
    /* == Hook: Part 1 ==*/
    $extp = cot_getextplugins('structure');
    /* ================= */
    $path = array();
    // code path tree
    $tpath = array();
    // title path tree
    $tpls = array();
    // tpl codes tree
    foreach ($sql->fetchAll() as $row) {
        $last_dot = mb_strrpos($row['structure_path'], '.');
        $row['structure_tpl'] = empty($row['structure_tpl']) ? $row['structure_code'] : $row['structure_tpl'];
        if ($last_dot > 0) {
            $path1 = mb_substr($row['structure_path'], 0, $last_dot);
            $path[$row['structure_path']] = $path[$path1] . '.' . $row['structure_code'];
            $separaror = $cfg['separator'] == strip_tags($cfg['separator']) ? ' ' . $cfg['separator'] . ' ' : ' \\ ';
            $tpath[$row['structure_path']] = $tpath[$path1] . $separaror . $row['structure_title'];
            $parent_dot = mb_strrpos($path[$path1], '.');
            $parent = $parent_dot > 0 ? mb_substr($path[$path1], $parent_dot + 1) : $path[$path1];
            $subcats[$row['structure_area']][$parent][] = $row['structure_code'];
        } else {
            $path[$row['structure_path']] = $row['structure_code'];
            $tpath[$row['structure_path']] = $row['structure_title'];
            $parent = $row['structure_code'];
            // self
        }
        if ($row['structure_tpl'] == 'same_as_parent') {
            $row['structure_tpl'] = $tpls[$parent];
        }
        $tpls[$row['structure_code']] = $row['structure_tpl'];
        $structure[$row['structure_area']][$row['structure_code']] = array('path' => $path[$row['structure_path']], 'tpath' => $tpath[$row['structure_path']], 'rpath' => $row['structure_path'], 'id' => $row['structure_id'], 'tpl' => $row['structure_tpl'], 'title' => $row['structure_title'], 'desc' => $row['structure_desc'], 'icon' => $row['structure_icon'], 'locked' => $row['structure_locked'], 'count' => $row['structure_count']);
        if (is_array($cot_extrafields[$db_structure])) {
            foreach ($cot_extrafields[$db_structure] as $exfld) {
                $structure[$row['structure_area']][$row['structure_code']][$exfld['field_name']] = $row['structure_' . $exfld['field_name']];
            }
        }
        /* == Hook: Part 2 ==*/
        foreach ($extp as $pl) {
            include $pl;
        }
        /* ================= */
    }
    foreach ($structure as $area => $area_structure) {
        foreach ($area_structure as $i => $x) {
            $structure[$area][$i]['subcats'] = $subcats[$area][$i];
        }
    }
}
开发者ID:ASDAFF,项目名称:cot-freelance,代码行数:58,代码来源:functions.custom.php

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

示例3: htmlpurifier_filter

/**
 * A HTM filter callback using HTML Purifier
 *
 * @param string $value Unfiltered HTML value
 * @param string $name Input name
 * @return string Purified HTML
 */
function htmlpurifier_filter($value, $name)
{
    global $cfg, $sys, $usr;
    if ($sys['parser'] == 'html') {
        static $purifier = null;
        // Lazy loading to save performance
        if (is_null($purifier)) {
            define('HTMLPURIFIER_PREFIX', $cfg['plugins_dir'] . '/htmlpurifier/lib/standalone');
            require_once $cfg['plugins_dir'] . '/htmlpurifier/lib/HTMLPurifier.standalone.php';
            $cacheDir = $cfg['cache_dir'] . DIRECTORY_SEPARATOR . 'htmlpurifier';
            if (!file_exists($cacheDir)) {
                mkdir($cacheDir, 0775, true);
            }
            $cacheDir = realpath($cacheDir);
            $config = HTMLPurifier_Config::createDefault();
            $config->set('HTML.Doctype', $cfg['plugin']['htmlpurifier']['doctype']);
            $config->set('HTML.TidyLevel', $cfg['plugin']['htmlpurifier']['tidylevel']);
            $config->set('URI.Base', COT_ABSOLUTE_URL);
            $config->set('URI.Host', $sys['domain']);
            if ($cfg['plugin']['htmlpurifier']['rel2abs']) {
                $config->set('URI.MakeAbsolute', true);
            }
            $config->set('Cache.SerializerPath', $cacheDir);
            // Load preset
            if ($usr['id'] > 0) {
                $preset_name = 'group_' . $usr['maingrp'];
                if (!file_exists($cfg['plugins_dir'] . "/htmlpurifier/presets/htmlpurifier.{$preset_name}.preset.php")) {
                    $preset_name = 'default';
                }
            } else {
                $preset_name = 'group_1';
            }
            require_once $cfg['plugins_dir'] . "/htmlpurifier/presets/htmlpurifier.{$preset_name}.preset.php";
            /* config extension */
            foreach (cot_getextplugins('htmlpurifier.config') as $pl) {
                include $pl;
            }
            foreach ($htmlpurifier_preset as $key => $val) {
                $config->set($key, $val);
            }
            $purifier = new HTMLPurifier($config);
        }
        return $purifier->purify($value);
    } else {
        return $value;
    }
}
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:54,代码来源:htmlpurifier.php

示例4: generateTags

 /**
  * Returns client tags for coTemplate
  *
  * @param brs_model_Client|int $client
  * @param string $tagPrefix Prefix for tags
  * @param bool $cacheitem Cache tags
  * @return array|void
  *
  * @deprecated
  */
 public static function generateTags($client, $tagPrefix = '', $cacheitem = true)
 {
     global $cfg, $L, $usr;
     static $extp_first = null, $extp_main = null;
     static $cache = array();
     if (is_null($extp_first)) {
         $extp_first = cot_getextplugins('banners.client.tags.first');
         $extp_main = cot_getextplugins('banners.client.tags.main');
     }
     /* === Hook === */
     foreach ($extp_first as $pl) {
         include $pl;
     }
     /* ===== */
     if (is_object($client) && is_array($cache[$client->bac_id])) {
         $temp_array = $cache[$client->bac_id];
     } elseif (is_int($client) && is_array($cache[$client])) {
         $temp_array = $cache[$client];
     } else {
         if (is_int($client) && $client > 0) {
             $client = self::getById($client);
         }
         $purchase = array(BaClient::PURCHASE_DEFAULT => $L['Default'], BaClient::PURCHASE_UNLIMITED => $L['ba_unlimited'], BaClient::PURCHASE_YEARLY => $L['ba_pt_yearly'], BaClient::PURCHASE_MONTHLY => $L['ba_pt_monthly'], BaClient::PURCHASE_WEEKLY => $L['ba_pt_weekly'], BaClient::PURCHASE_DAILY => $L['ba_pt_daily']);
         $temp_array = array();
         if ($client->bac_id > 0) {
             $item_link = cot_url('admin', array('m' => 'other', 'p' => 'banners', 'n' => 'clients', 'a' => 'edit', 'id' => $client->bac_id));
             $temp_array = array('URL' => $item_link, 'ID' => $client->bac_id, 'TITLE' => htmlspecialchars($client->bac_title), 'PUBLISHED' => $client->bac_published ? $L['Yes'] : $L['No'], 'PURCHASE' => $client->bac_purchase_type, 'PURCHASE_TEXT' => $purchase[$client->bac_purchase_type]);
             /* === Hook === */
             foreach ($extp_main as $pl) {
                 include $pl;
             }
             /* ===== */
             $cacheitem && ($cache[$client->bac_id] = $temp_array);
         } else {
             // Клиента не существует
         }
     }
     $return_array = array();
     foreach ($temp_array as $key => $val) {
         $return_array[$tagPrefix . $key] = $val;
     }
     return $return_array;
 }
开发者ID:Alex300,项目名称:brs,代码行数:53,代码来源:Client.php

示例5: cot_forums_prunetopics

/**
 * Deletes outdated topics
 *
 * @param string $mode Selection criteria
 * @param string $section Section
 * @param int $param Selection parameter value
 * @return int
 * @global CotDB $db
 */
function cot_forums_prunetopics($mode, $section, $param)
{
    global $db, $cfg, $sys, $db_forum_topics, $db_forum_posts, $db_forum_stats, $db_users, $L;
    $num = 0;
    $num1 = 0;
    if (!is_int($param)) {
        $param = (int) $param;
    }
    switch ($mode) {
        case 'updated':
            $limit = $sys['now'] - $param * 86400;
            $sql1 = $db->query("SELECT * FROM {$db_forum_topics} WHERE ft_cat=" . $db->quote($section) . " AND ft_updated < {$limit} AND ft_sticky='0'");
            break;
        case 'single':
            $sql1 = $db->query("SELECT * FROM {$db_forum_topics} WHERE ft_cat=" . $db->quote($section) . " AND ft_id={$param}");
            break;
    }
    if ($sql1->rowCount() > 0) {
        foreach ($sql1->fetchAll() as $row1) {
            $q = $row1['ft_id'];
            /* === Hook === */
            foreach (cot_getextplugins('forums.functions.prunetopics') as $pl) {
                include $pl;
            }
            /* ===== */
            // Decrease postcount for users
            foreach ($db->query("SELECT COUNT(*) AS cnt, fp_posterid FROM {$db_forum_posts}  WHERE fp_topicid={$q} GROUP BY fp_posterid")->fetchAll() as $row2) {
                $db->query("UPDATE {$db_users} SET user_postcount = user_postcount - ? WHERE user_id = ?", array((int) $row2['cnt'], (int) $row2['fp_posterid']));
            }
            $num += $db->delete($db_forum_posts, "fp_topicid={$q}");
            $num1 += $db->delete($db_forum_topics, "ft_id={$q}");
        }
        $sql = $db->delete($db_forum_topics, "ft_movedto={$q}");
        $sql = $db->query("UPDATE {$db_forum_stats} SET fs_topiccount=fs_topiccount-{$num1}, fs_postcount=fs_postcount-{$num} WHERE fs_cat=" . $db->quote($section));
    }
    $num1 = $num1 == '' ? '0' : $num1;
    return $num1;
}
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:47,代码来源:forums.functions.php

示例6: defined

/**
 * Administration panel - PHP Infos
 *
 * @package Cotonti
 * @copyright (c) Cotonti Team
 * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
 */
defined('COT_CODE') && defined('COT_ADMIN') or die('Wrong URL.');
list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = cot_auth('admin', 'a');
cot_block($usr['auth_read']);
$t = new XTemplate(cot_tplfile('admin.infos', 'core'));
$adminpath[] = array(cot_url('admin', 'm=other'), $L['Other']);
$adminpath[] = array(cot_url('admin', 'm=infos'), $L['adm_infos']);
$adminhelp = $L['adm_help_versions'];
$adminsubtitle = $L['adm_infos'];
/* === Hook === */
foreach (cot_getextplugins('admin.infos.first') as $pl) {
    include $pl;
}
/* ===== */
@error_reporting(0);
$t->assign(array('ADMIN_INFOS_PHPVER' => function_exists('phpversion') ? phpversion() : $L['adm_help_config'], 'ADMIN_INFOS_ZENDVER' => function_exists('zend_version') ? zend_version() : $L['adm_help_config'], 'ADMIN_INFOS_INTERFACE' => function_exists('php_sapi_name') ? php_sapi_name() : $L['adm_help_config'], 'ADMIN_INFOS_CACHEDRIVERS' => is_array($cot_cache_drivers) ? implode(', ', $cot_cache_drivers) : '', 'ADMIN_INFOS_OS' => function_exists('php_uname') ? php_uname() : $L['adm_help_config'], 'ADMIN_INFOS_DATE' => cot_date('datetime_medium', $sys['now'], false), 'ADMIN_INFOS_GMDATE' => gmdate('Y-m-d H:i'), 'ADMIN_INFOS_GMTTIME' => $usr['gmttime'], 'ADMIN_INFOS_USRTIME' => $usr['localtime'], 'ADMIN_INFOS_TIMETEXT' => $usr['timetext']));
/* === Hook === */
foreach (cot_getextplugins('admin.infos.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
$adminmain = $t->text('MAIN');
@error_reporting(7);
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:30,代码来源:admin.infos.php

示例7: defined

    include $pl;
}
/* ===== */
$out['head'] .= $R['code_noindex'];
$out['subtitle'] = $title;
require_once $cfg['system_dir'] . '/header.php';
$tpl_type = defined('COT_ADMIN') ? 'core' : 'module';
$t = new XTemplate(cot_tplfile('message', $tpl_type));
if (COT_AJAX) {
    $t->assign('AJAX_MODE', true);
}
$errmsg = $title;
$title .= $usr['isadmin'] ? ' (#' . $msg . ')' : '';
$t->assign('MESSAGE_TITLE', $title);
$t->assign('MESSAGE_BODY', $body);
if ($msg == '920') {
    $confirm_no_url = preg_match("/^.+" . preg_quote($sys['domain'] . "/"), $_SERVER['HTTP_REFERER']) ? str_replace('&', '&amp;', $_SERVER['HTTP_REFERER']) : cot_url('index');
    if (preg_match('#[ "\':]#', base64_decode($redirect))) {
        $redirect = '';
    }
    $t->assign(array('MESSAGE_CONFIRM_YES' => base64_decode($redirect), 'MESSAGE_CONFIRM_NO' => $confirm_no_url));
    $t->parse('MAIN.MESSAGE_CONFIRM');
}
/* === Hook === */
foreach (cot_getextplugins('message.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
$t->out('MAIN');
require_once $cfg['system_dir'] . '/footer.php';
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:message.php

示例8: str_replace

        }
        $t->parse($id || !empty($al) ? 'MAIN.OPTIONS' : 'MAIN.DEFAULT.ROW');
    }
    if (!$id && empty($al)) {
        $t->assign(array('ADMIN_STRUCTURE_PAGINATION_PREV' => $pagenav['prev'], 'ADMIN_STRUCTURE_PAGNAV' => $pagenav['main'], 'ADMIN_STRUCTURE_PAGINATION_NEXT' => $pagenav['next'], 'ADMIN_STRUCTURE_TOTALITEMS' => $totalitems, 'ADMIN_STRUCTURE_COUNTER_ROW' => $ii));
        $t->parse('MAIN.DEFAULT');
        // flush post buffer if it contains Update Table data
        $uri = str_replace('&_ajax=1', '', $_SERVER['REQUEST_URI']);
        $hash = md5($uri);
        if (is_array($_SESSION['cot_buffer'][$hash]['rstructurecode'])) {
            unset($_SESSION['cot_buffer'][$hash]);
        }
        $t->assign(array('ADMIN_STRUCTURE_URL_FORM_ADD' => cot_url('admin', 'm=structure&n=' . $n . '&mode=' . $mode . '&a=add&d=' . $durl), 'ADMIN_STRUCTURE_CODE' => cot_inputbox('text', 'rstructurecode', null, 'size="16"'), 'ADMIN_STRUCTURE_PATH' => cot_inputbox('text', 'rstructurepath', null, 'size="16" maxlength="16"'), 'ADMIN_STRUCTURE_TITLE' => cot_inputbox('text', 'rstructuretitle', null, 'size="64" maxlength="100"'), 'ADMIN_STRUCTURE_DESC' => cot_inputbox('text', 'rstructuredesc', null, 'size="64" maxlength="255"'), 'ADMIN_STRUCTURE_ICON' => cot_inputbox('text', 'rstructureicon', null, 'size="64" maxlength="128"'), 'ADMIN_STRUCTURE_LOCKED' => cot_checkbox(null, 'rstructurelocked'), 'ADMIN_STRUCTURE_TPLMODE' => cot_radiobox(null, 'rtplmode', array('1', '2', '3'), array($L['adm_tpl_empty'], $L['adm_tpl_parent'], $L['adm_tpl_forced']), '', '<br />')));
        // Extra fields
        foreach ($cot_extrafields[$db_structure] as $exfld) {
            $exfld_val = cot_build_extrafields('rstructure' . $exfld['field_name'], $exfld, null);
            $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.NEWCAT.EXTRAFLD');
        }
        $t->parse('MAIN.NEWCAT');
    }
    cot_display_messages($t);
    /* === Hook  === */
    foreach (cot_getextplugins('admin.structure.tags') as $pl) {
        include $pl;
    }
    /* ===== */
    $t->parse('MAIN');
    $adminmain = $t->text('MAIN');
}
开发者ID:Logodeveloper,项目名称:valencia,代码行数:31,代码来源:admin.structure.php

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

示例10: array

if ($usr['id'] != $item['item_userid'] && (!$usr['isadmin'] || $cfg['folio']['count_admin'])) {
    $item['item_count']++;
    $db->update($db_folio, array('item_count' => $item['item_count']), "item_id=" . (int) $item['item_id']);
}
$title_params = array('TITLE' => empty($item['item_metatitle']) ? $item['item_title'] : $item['item_metatitle'], 'CATEGORY' => $structure['folio'][$item['item_cat']]['title']);
$out['subtitle'] = cot_title($cfg['folio']['title_folio'], $title_params);
$out['desc'] = !empty($item['item_metadesc']) ? $item['item_metadesc'] : cot_cutstring(strip_tags(cot_parse($item['item_text'], $cfg['folio']['markup'], $item['item_parser'])), 160);
$out['meta_keywords'] = !empty($item['item_keywords']) ? $item['item_keywords'] : $structure['folio'][$item['item_cat']]['keywords'];
// Building the canonical URL
$pageurl_params = array('c' => $item['item_cat']);
empty($al) ? $pageurl_params['id'] = $id : ($pageurl_params['al'] = $al);
$out['canonical_uri'] = cot_url('folio', $pageurl_params);
$mskin = cot_tplfile(array('folio', $structure['folio'][$item['item_cat']]['tpl']));
/* === Hook === */
foreach (cot_getextplugins('folio.main') as $pl) {
    include $pl;
}
/* ===== */
$t = new XTemplate($mskin);
$t->assign(cot_generate_usertags($item, 'PRD_OWNER_'));
$t->assign(cot_generate_foliotags($item, 'PRD_', $cfg['folio']['shorttextlen'], $usr['isadmin'], $cfg['homebreadcrumb']));
/* === Hook === */
foreach (cot_getextplugins('folio.tags') as $pl) {
    include $pl;
}
/* ===== */
if ($usr['isadmin']) {
    $t->parse('MAIN.PRD_ADMIN');
}
$t->parse('MAIN');
$module_body = $t->text('MAIN');
开发者ID:ASDAFF,项目名称:cot-freelance,代码行数:31,代码来源:folio.main.php

示例11: cot_poll_delete

/**
 * Delete Poll
 *
 * @param int $id Poll ID or Poll Code if $type is not epmty
 * @param string $type Poll type
 * @return bool
 * @global CotDB $db
 */
function cot_poll_delete($id, $type = '')
{
    global $db, $db_polls, $db_polls_options, $db_polls_voters;
    if ($type) {
        $sql = $db->query("SELECT poll_id FROM {$db_polls} WHERE poll_type = '" . $db->prep($type) . "' AND poll_code = '{$id}' LIMIT 1");
        $id = ($row = $sql->fetch()) ? $row['poll_id'] : 0;
    }
    if ((int) $id > 0) {
        $db->delete($db_polls, "poll_id = " . $id);
        $db->delete($db_polls_options, "po_pollid = " . $id);
        $db->delete($db_polls_voters, "pv_pollid = " . $id);
        /* === Hook === */
        foreach (cot_getextplugins('polls.functions.delete') as $pl) {
            include $pl;
        }
        /* ===== */
        return true;
    } else {
        return false;
    }
}
开发者ID:Logodeveloper,项目名称:valencia,代码行数:29,代码来源:polls.functions.php

示例12: array

    $adminpath[] = array(cot_url('admin', 'm=extensions'), $L['Extensions']);
    $adminpath[] = array(cot_url('admin', 'm=extensions&a=details&mod=' . $m), $cot_modules[$m]['title']);
    $adminpath[] = array(cot_url('admin', 'm=' . $m), $L['Administration']);
    $adminhelp = $L['adm_help_pfs'];
    $adminsubtitle = $L['pfs_title'];
    /* === Hook === */
    foreach (cot_getextplugins('pfs.admin.first') as $pl) {
        include $pl;
    }
    /* ===== */
    if (!function_exists('gd_info')) {
        $is_adminwarnings = true;
    } else {
        $gd_datas = gd_info();
        foreach ($gd_datas as $k => $i) {
            if (mb_strlen($i) < 2) {
                $i = $cot_yesno[$i];
            }
            $t->assign(array('ADMIN_PFS_DATAS_NAME' => $k, 'ADMIN_PFS_DATAS_ENABLE_OR_DISABLE' => $i));
            $t->parse('MAIN.PFS_ROW');
        }
    }
    $t->assign(array('ADMIN_PFS_URL_CONFIG' => cot_url('admin', 'm=config&n=edit&o=module&p=pfs'), 'ADMIN_PFS_URL_ALLPFS' => cot_url('admin', 'm=pfs&s=allpfs'), 'ADMIN_PFS_URL_SFS' => cot_url('pfs', 'userid=0')));
    /* === Hook  === */
    foreach (cot_getextplugins('pfs.admin.tags') as $pl) {
        include $pl;
    }
    /* ===== */
}
$t->parse('MAIN');
$adminmain = $t->text('MAIN');
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:pfs.admin.php

示例13: XTemplate

$t = new XTemplate($mskin);
cot_display_messages($t);
if ($db->query("SELECT fp_id FROM {$db_forum_posts} WHERE fp_topicid = {$q} ORDER BY fp_id ASC LIMIT 1")->fetchColumn() == $p) {
    $t->assign(array('FORUMS_EDITPOST_TOPICTITTLE' => cot_inputbox('text', 'rtopictitle', $rowt['ft_title'], array('size' => 56, 'maxlength' => 255)), 'FORUMS_EDITPOST_TOPICDESCRIPTION' => cot_inputbox('text', 'rtopicdesc', $rowt['ft_desc'], array('size' => 56, 'maxlength' => 255))));
    // Extra fields
    foreach ($cot_extrafields[$db_forum_topics] as $exfld) {
        $uname = strtoupper($exfld['field_name']);
        $exfld_val = cot_build_extrafields('rtopic' . $exfld['field_name'], $exfld, $rowt['ft_' . $exfld['field_name']]);
        $exfld_title = isset($L['forums_topics_' . $exfld['field_name'] . '_title']) ? $L['forums_topics_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
        $t->assign(array('FORUMS_EDITPOST_TOPIC_' . $uname => $exfld_val, 'FORUMS_EDITPOST_TOPIC_' . $uname . '_TITLE' => $exfld_title, 'FORUMS_EDITPOST_TOPIC_EXTRAFLD' => $exfld_val, 'FORUMS_EDITPOST_TOPIC_EXTRAFLD_TITLE' => $exfld_title));
        $t->parse('MAIN.FORUMS_EDITPOST_FIRSTPOST.TOPIC_EXTRAFLD');
    }
    $t->parse('MAIN.FORUMS_EDITPOST_FIRSTPOST');
}
$t->assign(array('FORUMS_EDITPOST_PAGETITLE' => $toptitle, 'FORUMS_EDITPOST_SUBTITLE' => $L['forums_postedby'] . ": <a href=\"users.php?m=details&id=" . $rowpost['fp_posterid'] . "\">" . $rowpost['fp_postername'] . "</a> @ " . cot_date('datetime_medium', $rowpost['fp_updated']), 'FORUMS_EDITPOST_UPDATED' => cot_date('datetime_medium', $rowpost['fp_updated']), 'FORUMS_EDITPOST_UPDATED_STAMP' => $rowpost['fp_updated'], 'FORUMS_EDITPOST_SEND' => cot_url('forums', "m=editpost&a=update&s=" . $s . "&q=" . $q . "&p=" . $p . '&d=' . $durl . "&" . cot_xg()), 'FORUMS_EDITPOST_TEXT' => cot_textarea('rmsgtext', $rowpost['fp_text'], 20, 56, '', 'input_textarea_' . $minimaxieditor), 'FORUMS_EDITPOST_EDITTIMEOUT' => cot_build_timegap(0, $cfg['forums']['edittimeout'] * 3600)));
// Extra fields
foreach ($cot_extrafields[$db_forum_posts] as $exfld) {
    $uname = strtoupper($exfld['field_name']);
    $exfld_val = cot_build_extrafields('rmsg' . $exfld['field_name'], $exfld, $rowpost['fp_' . $exfld['field_name']]);
    $exfld_title = isset($L['forums_posts_' . $exfld['field_name'] . '_title']) ? $L['forums_posts_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
    $t->assign(array('FORUMS_EDITPOST_' . $uname => $exfld_val, 'FORUMS_EDITPOST_' . $uname . '_TITLE' => $exfld_title, 'FORUMS_EDITPOST_EXTRAFLD' => $exfld_val, 'FORUMS_EDITPOST_EXTRAFLD_TITLE' => $exfld_title));
    $t->parse('MAIN.EXTRAFLD');
}
/* === Hook === */
foreach (cot_getextplugins('forums.editpost.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
$t->out('MAIN');
require_once $cfg['system_dir'] . '/footer.php';
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:forums.editpost.php

示例14: cot_apply_rwr

/**
 * Applies Handly URLs rewrite to current script parameters
 * @global array $cfg
 */
function cot_apply_rwr()
{
    global $cfg, $structure;
    if (function_exists('cot_apply_rwr_custom')) {
        return cot_apply_rwr_custom();
    }
    $rwr = cot_import('rwr', 'G', 'TXT');
    if (isset($rwr) && !empty($rwr)) {
        // Ignore ending slash and split the path into parts
        $path = explode('/', mb_strrpos($rwr, '/') === mb_strlen($rwr) - 1 ? mb_substr($rwr, 0, -1) : $rwr);
        $count = count($path);
        $rwr_continue = true;
        /* === Hook === */
        foreach (cot_getextplugins('urleditor.rewrite.first') as $pl) {
            include $pl;
        }
        /* ===== */
        if (!$rwr_continue) {
            return;
        }
        $filtered = cot_import($path[0], 'D', 'ALP');
        if ($count == 1) {
            if (isset($structure['page'][$filtered]) || $filtered == 'unvalidated' || $filtered == 'saved_drafts') {
                // Is a category
                $_GET['e'] = 'page';
                $_GET['c'] = $filtered;
            } elseif (file_exists($cfg['modules_dir'] . '/' . $filtered) || file_exists($cfg['plugins_dir'] . '/' . $filtered)) {
                // Is an extension
                $_GET['e'] = $filtered;
            } elseif (in_array($filtered, array('register', 'profile', 'passrecover'))) {
                // Special users shortcuts
                $_GET['e'] = 'users';
                $_GET['m'] = $filtered;
            } else {
                // Maybe it is a system page, if not 404 will be given
                $_GET['e'] = 'page';
                $_GET['c'] = 'system';
                $id = cot_import($path[0], 'D', 'INT');
                if ($id) {
                    $_GET['id'] = $id;
                } else {
                    $alias = preg_replace('`[+/?%#&]`', '', cot_import($path[0], 'D', 'TXT'));
                    $_GET['al'] = $alias;
                }
            }
        } else {
            // Special shortcuts
            if ($filtered == 'users' && $count == 2 && !isset($_GET['m'])) {
                // User profiles
                $_GET['e'] = 'users';
                $_GET['m'] = 'details';
                $_GET['u'] = $path[1];
                return;
            } elseif ($filtered == 'tags') {
                // Tags
                $_GET['e'] = 'tags';
                if ($count == 3) {
                    $_GET['a'] = $path[1];
                    $_GET['t'] = $path[2];
                } else {
                    $_GET['a'] = 'pages';
                    $_GET['t'] = $path[1];
                }
                return;
            } elseif ($filtered == 'rss') {
                // RSS
                $_GET['e'] = 'rss';
                $_GET['m'] = $path[1];
                if ($count == 3) {
                    is_numeric($path[2]) ? $_GET['id'] = $path[2] : ($_GET['c'] = $path[2]);
                } else {
                    $_GET['c'] = $path[1];
                }
                return;
            }
            $last = $count - 1;
            $ext = isset($structure['page'][$filtered]) ? 'page' : $filtered;
            $_GET['e'] = $ext;
            $cat_chain = array_slice($path, 0, -1);
            if (isset($structure[$ext][$path[$last]]) && !in_array($path[$last], $cat_chain)) {
                // Is a category
                $_GET['c'] = $path[$last];
            } else {
                // Is a page/item
                if ($ext == 'page' || $count > 2) {
                    $_GET['c'] = $path[$last - 1];
                }
                if (is_numeric($path[$last])) {
                    $_GET['id'] = $path[$last];
                } else {
                    // Can be a cat or al, let the module decide
                    if ($count == 2 && !isset($structure[$ext][$_GET['c']])) {
                        $_GET['c'] = $path[$last];
                    }
                    $_GET['al'] = $path[$last];
                }
//.........这里部分代码省略.........
开发者ID:Logodeveloper,项目名称:Cotonti,代码行数:101,代码来源:urleditor.functions.php

示例15: defined

 * @author CMSWorks Team
 * @copyright Copyright (c) CMSWorks.ru
 * @license BSD
 */
defined('COT_CODE') or die('Wrong URL');
require_once cot_incfile('forms');
list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = cot_auth('plug', 'sbr');
/* === Hook === */
foreach (cot_getextplugins('sbr.stage.first') as $pl) {
    include $pl;
}
/* ===== */
if (!empty($num)) {
    $sql = $db->query("SELECT * FROM {$db_sbr_stages} WHERE stage_sid=" . $id . " AND stage_num=" . $num . " LIMIT 1");
    $stage = $sql->fetch();
}
$t->assign(array('STAGE_NUM' => $stage['stage_num'], 'STAGE_ID' => $stage['stage_id'], 'STAGE_TITLE' => $stage['stage_title'], 'STAGE_TEXT' => $stage['stage_text'], 'STAGE_COST' => $stage['stage_cost'], 'STAGE_DAYS' => $stage['stage_days'], 'STAGE_STATUS' => $stage['stage_status'], 'STAGE_BEGIN' => $stage['stage_begin'], 'STAGE_DONE' => $stage['stage_done'], 'STAGE_EXPIRE' => $stage['stage_expire'], 'STAGE_EXPIREDATE' => $stage['stage_begin'] + $stage['stage_days'] * 24 * 60 * 60, 'STAGE_EXPIREDAYS' => cot_build_timegap($sys['now'], $stage['stage_begin'] + $stage['stage_days'] * 24 * 60 * 60), 'STAGE_DONE_URL' => cot_url('sbr', 'id=' . $id . '&num=' . $stage['stage_num'] . '&action=done'), 'STAGE_CLAIM_URL' => cot_url('sbr', 'id=' . $id . '&num=' . $stage['stage_num'] . '&action=claim'), 'STAGE_DECISION_URL' => cot_url('sbr', 'id=' . $id . '&num=' . $stage['stage_num'] . '&action=decision')));
$stagefiles = $db->query("SELECT * FROM {$db_sbr_files} WHERE file_sid=" . $id . " AND file_area='stage' AND file_code='" . $stage['stage_num'] . "' ORDER BY file_id ASC")->fetchAll();
if (count($stagefiles) > 0) {
    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.SBR.STAGE.FILES.FILE_ROW');
    }
    $t->parse('MAIN.SBR.STAGE.FILES');
}
/* === Hook === */
foreach (cot_getextplugins('sbr.stage.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN.SBR.STAGE');
开发者ID:cotemplate,项目名称:cot-sbr,代码行数:31,代码来源:sbr.stage.php


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