• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP sortthreadsortselectoption函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: threadsort_checkoption

function threadsort_checkoption($sortid = 0, $unchangeable = 1)
{
    global $_G;
    $_G['forum_selectsortid'] = $sortid ? intval($sortid) : '';
    loadcache(array('threadsort_option_' . $sortid));
    sortthreadsortselectoption($sortid);
    $_G['forum_optionlist'] = $_G['cache']['threadsort_option_' . $sortid];
    $_G['forum_checkoption'] = array();
    if (is_array($_G['forum_optionlist'])) {
        foreach ($_G['forum_optionlist'] as $optionid => $option) {
            $_G['forum_checkoption'][$option['identifier']]['optionid'] = $optionid;
            $_G['forum_checkoption'][$option['identifier']]['title'] = $option['title'];
            $_G['forum_checkoption'][$option['identifier']]['type'] = $option['type'];
            $_G['forum_checkoption'][$option['identifier']]['required'] = $option['required'] ? 1 : 0;
            $_G['forum_checkoption'][$option['identifier']]['unchangeable'] = $_G['gp_action'] == 'edit' && $unchangeable && $option['unchangeable'] ? 1 : 0;
            $_G['forum_checkoption'][$option['identifier']]['maxnum'] = $option['maxnum'] ? intval($option['maxnum']) : '';
            $_G['forum_checkoption'][$option['identifier']]['minnum'] = $option['minnum'] ? intval($option['minnum']) : '';
            $_G['forum_checkoption'][$option['identifier']]['maxlength'] = $option['maxlength'] ? intval($option['maxlength']) : '';
        }
    }
}
开发者ID:v998,项目名称:discuzx-en,代码行数:21,代码来源:function_threadsort.php


示例2: COUNT

if ($_G['setting']['allowmoderatingthread'] && $_G['uid']) {
    $threadmodcount = DB::result_first("SELECT COUNT(*) FROM " . DB::table($threadtable) . " WHERE fid='{$_G['fid']}' AND displayorder='-2' AND authorid='{$_G['uid']}'");
}
if ($_G['forum']['modworks'] || $_G['forum']['modnewposts']) {
    $_G['forum']['modnewposts'] && ($_G['forum']['modworks'] = 1);
    $modusernum = $_G['group']['allowmoduser'] ? DB::result_first("SELECT COUNT(*) FROM " . DB::table('common_member_validate') . " WHERE status='0'") : 0;
}
$optionadd = $filterurladd = $searchsorton = '';
$quicksearchlist = array();
if (!empty($_G['forum']['threadsorts']['types'])) {
    require_once libfile('function/threadsort');
    $showpic = intval($_G['gp_showpic']);
    $templatearray = $sortoptionarray = array();
    foreach ($_G['forum']['threadsorts']['types'] as $stid => $sortname) {
        loadcache(array('threadsort_option_' . $stid, 'threadsort_template_' . $stid));
        sortthreadsortselectoption($stid);
        $templatearray[$stid] = $_G['cache']['threadsort_template_' . $stid]['subject'];
        $sortoptionarray[$stid] = $_G['cache']['threadsort_option_' . $stid];
    }
    if (!empty($_G['forum']['threadsorts']['defaultshow']) && empty($_G['gp_sortid']) && empty($_G['gp_sortall'])) {
        $_G['gp_sortid'] = $_G['forum']['threadsorts']['defaultshow'];
        $_G['gp_filter'] = 'sortid';
        $_SERVER['QUERY_STRING'] = $_SERVER['QUERY_STRING'] ? $_SERVER['QUERY_STRING'] . '&sortid=' . $_G['gp_sortid'] : 'sortid=' . $_G['gp_sortid'];
        $filterurladd = '&filter=sort';
    }
    $_G['gp_sortid'] = $_G['gp_sortid'] ? $_G['gp_sortid'] : $_G['gp_searchsortid'];
    if (isset($_G['gp_sortid']) && $_G['forum']['threadsorts']['types'][$_G['gp_sortid']]) {
        $searchsortoption = $sortoptionarray[$_G['gp_sortid']];
        $quicksearchlist = quicksearch($searchsortoption);
        $_G['forum_optionlist'] = $_G['cache']['threadsort_option_' . $_G['gp_sortid']];
        $forum_optionlist = getsortedoptionlist();
开发者ID:kleitz,项目名称:sports,代码行数:31,代码来源:forum_forumdisplay.php


示例3: cpmsg

 if (empty($_G['gp_searchoption']) && !$_G['gp_sortid']) {
     cpmsg('threadtype_content_no_choice', 'action=threadtypes&operation=content', 'error');
 }
 $mpurl = ADMINSCRIPT . '?action=threadtypes&operation=content&sortid=' . $_G['gp_sortid'] . '&searchsortsubmit=true';
 if (!is_array($_G['gp_searchoption'])) {
     $mpurl .= '&searchoption=' . $_G['gp_searchoption'];
     $_G['gp_searchoption'] = unserialize(base64_decode($_G['gp_searchoption']));
 } else {
     $mpurl .= '&searchoption=' . base64_encode(serialize($_G['gp_searchoption']));
 }
 shownav('forum', 'threadtype_infotypes');
 showsubmenu('threadtype_infotypes', array(array('threadtype_infotypes_type', 'threadtypes', 0), array('threadtype_infotypes_content', 'threadtypes&operation=content', 1), array(array('menu' => $curclassname ? $curclassname : 'threadtype_infotypes_option', 'submenu' => $classoptionmenu))));
 loadcache('forums');
 loadcache(array('threadsort_option_' . $_G['gp_sortid']));
 require_once libfile('function/threadsort');
 sortthreadsortselectoption($_G['gp_sortid']);
 $sortoptionarray = $_G['cache']['threadsort_option_' . $_G['gp_sortid']];
 $selectsql = '';
 if ($_G['gp_searchoption']) {
     foreach ($_G['gp_searchoption'] as $optionid => $option) {
         $fieldname = $sortoptionarray[$optionid]['identifier'] ? $sortoptionarray[$optionid]['identifier'] : 1;
         if ($option['value']) {
             if (in_array($option['type'], array('number', 'radio'))) {
                 $option['value'] = intval($option['value']);
                 $exp = '=';
                 if ($option['condition']) {
                     $exp = $option['condition'] == 1 ? '>' : '<';
                 }
                 $sql = "{$fieldname}{$exp}'{$option['value']}'";
             } elseif ($option['type'] == 'select') {
                 $subvalues = $currentchoices = array();
开发者ID:pan289091315,项目名称:Discuz,代码行数:31,代码来源:admincp_threadtypes.php


示例4: getdata

 function getdata($style, $parameter)
 {
     global $_G;
     $parameter = $this->cookparameter($parameter);
     loadcache('forums');
     $tids = !empty($parameter['tids']) ? explode(',', $parameter['tids']) : array();
     $fids = isset($parameter['fids']) && !in_array(0, (array) $parameter['fids']) ? $parameter['fids'] : array_keys($_G['cache']['forums']);
     $startrow = !empty($parameter['startrow']) ? intval($parameter['startrow']) : 0;
     $items = !empty($parameter['showitems']) ? intval($parameter['showitems']) : 10;
     $digest = isset($parameter['digest']) ? $parameter['digest'] : 0;
     $stick = isset($parameter['stick']) ? $parameter['stick'] : 0;
     $orderby = isset($parameter['orderby']) ? in_array($parameter['orderby'], array('lastpost', 'dateline', 'replies', 'views', 'heats', 'recommends')) ? $parameter['orderby'] : 'lastpost' : 'lastpost';
     $lastpost = isset($parameter['lastpost']) ? intval($parameter['lastpost']) : 0;
     $recommend = !empty($parameter['recommend']) ? 1 : 0;
     $sortid = isset($parameter['sortids']) ? intval($parameter['sortids']) : '';
     if ($fids) {
         $thefids = array();
         foreach ($fids as $fid) {
             if ($_G['cache']['forums'][$fid]['type'] == 'group') {
                 $thefids[] = $fid;
             }
         }
         if ($thefids) {
             foreach ($_G['cache']['forums'] as $value) {
                 if ($value['fup'] && in_array($value['fup'], $thefids)) {
                     $fids[] = intval($value['fid']);
                 }
             }
         }
         $fids = array_unique($fids);
     }
     $datalist = $list = array();
     $threadtypeids = array();
     $sql = ($tids ? ' AND t.tid IN (' . dimplode($tids) . ')' : '') . ($sortid ? ' AND t.sortid=' . $sortid : '') . ($fids ? ' AND t.fid IN (' . dimplode($fids) . ')' : '') . ($digest ? ' AND t.digest IN (' . dimplode($digest) . ')' : '') . ($stick ? ' AND t.displayorder IN (' . dimplode($stick) . ')' : '') . " AND t.closed='0' AND t.isgroup='0'";
     if ($lastpost) {
         $historytime = TIMESTAMP - $lastpost;
         $sql .= " AND t.dateline>='{$historytime}'";
     }
     if ($orderby == 'heats') {
         $_G['setting']['indexhot']['days'] = !empty($_G['setting']['indexhot']['days']) ? intval($_G['setting']['indexhot']['days']) : 8;
         $heatdateline = TIMESTAMP - 86400 * $_G['setting']['indexhot']['days'];
         $sql .= " AND t.dateline>'{$heatdateline}' AND t.heats>'0'";
     }
     $sqlfrom = "FROM `" . DB::table('forum_thread') . "` t";
     $joinmethod = empty($tids) ? 'INNER' : 'LEFT';
     if ($recommend) {
         $sqlfrom .= " {$joinmethod} JOIN `" . DB::table('forum_forumrecommend') . "` fc ON fc.tid=t.tid";
     }
     require_once libfile('function/threadsort');
     $templatearray = $sortoptionarray = array();
     loadcache(array('threadsort_option_' . $sortid, 'threadsort_template_' . $sortid));
     sortthreadsortselectoption($sortid);
     $templatearray[$sortid] = $_G['cache']['threadsort_template_' . $sortid]['block'];
     $sortoptionarray[$sortid] = $_G['cache']['threadsort_option_' . $sortid];
     $isthreadtype = strpos($templatearray[$sortid], '{typename}') !== false || strpos($templatearray[$sortid], '{typename_url}') !== false ? true : false;
     $threadtypes = array();
     if ($isthreadtype && $fids) {
         foreach (C::t('forum_forumfield')->fetch_all($fids) as $fid => $forum) {
             $threadtypes[$fid] = dunserialize($forum['threadtypes']);
         }
     }
     $html = '';
     $threadlist = $verify = $verifyuids = array();
     $query = DB::query("SELECT t.*\r\n\t\t\t{$sqlfrom} WHERE 1 {$sql}\r\n\t\t\tAND t.readperm='0'\r\n\t\t\tAND t.displayorder>='0'\r\n\t\t\tORDER BY t.{$orderby} DESC\r\n\t\t\tLIMIT {$startrow},{$items};");
     while ($thread = DB::fetch($query)) {
         if (isset($_G['setting']['verify']['enabled']) && $_G['setting']['verify']['enabled']) {
             $verifyuids[$thread['authorid']] = $thread['authorid'];
         }
         if ($thread['highlight']) {
             $color = array('', '#EE1B2E', '#EE5023', '#996600', '#3C9D40', '#2897C5', '#2B65B7', '#8F2A90', '#EC1282');
             $string = sprintf('%02d', $thread['highlight']);
             $stylestr = sprintf('%03b', $string[0]);
             $thread['highlight'] = ' style="';
             $thread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
             $thread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
             $thread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
             $thread['highlight'] .= $string[1] ? 'color: ' . $color[$string[1]] : '';
             $thread['highlight'] .= '"';
         } else {
             $thread['highlight'] = '';
         }
         $thread['lastposterenc'] = rawurlencode($thread['lastposter']);
         $fid = $thread['fid'];
         if ($thread['typeid'] && $isthreadtype && $threadtypes[$fid] && !empty($threadtypes[$fid]['prefix']) && isset($threadtypes[$fid]['types'][$thread['typeid']])) {
             if ($threadtypes[$fid]['prefix'] == 1) {
                 $thread['typehtml'] = '<em>[<a href="forum.php?mod=forumdisplay&fid=' . $fid . '&amp;filter=typeid&amp;typeid=' . $thread['typeid'] . '">' . $threadtypes[$fid]['types'][$thread['typeid']] . '</a>]</em>';
             } elseif ($threadtypes[$fid]['icons'][$thread['typeid']] && $threadtypes[$fid]['prefix'] == 2) {
                 $thread['typehtml'] = '<em><a title="' . $threadtypes[$fid]['types'][$thread['typeid']] . '" href="forum.php?mod=forumdisplay&fid=' . $fid . '&amp;filter=typeid&amp;typeid=' . $thread['typeid'] . '">' . '<img style="vertical-align: middle;padding-right:4px;" src="' . $threadtypes[$fid]['icons'][$thread['typeid']] . '" alt="' . $threadtypes[$fid]['types'][$thread['typeid']] . '" /></a></em>';
             }
             $thread['typename'] = $threadtypes[$fid]['types'][$thread['typeid']];
         } else {
             $thread['typename'] = $thread['typehtml'] = '';
         }
         $thread['dateline'] = dgmdate($thread['dateline'], 'u', '9999', getglobal('setting/dateformat'));
         $thread['lastpost'] = dgmdate($thread['lastpost'], 'u');
         $threadlist[$thread['tid']] = $thread;
     }
     if (!empty($threadlist)) {
         if ($verifyuids) {
             foreach (C::t('common_member_verify')->fetch_all($verifyuids) as $value) {
//.........这里部分代码省略.........
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:101,代码来源:block_sort.php


示例5: cpmsg

 if (empty($_GET['searchoption']) && !$_GET['sortid']) {
     cpmsg('threadtype_content_no_choice', 'action=threadtypes&operation=content', 'error');
 }
 $mpurl = ADMINSCRIPT . '?action=threadtypes&operation=content&sortid=' . $_GET['sortid'] . '&searchsortsubmit=true';
 if (!is_array($_GET['searchoption'])) {
     $mpurl .= '&searchoption=' . $_GET['searchoption'];
     $_GET['searchoption'] = dunserialize(base64_decode($_GET['searchoption']));
 } else {
     $mpurl .= '&searchoption=' . base64_encode(serialize($_GET['searchoption']));
 }
 shownav('forum', 'threadtype_infotypes');
 showsubmenu('threadtype_infotypes', array(array('threadtype_infotypes_type', 'threadtypes', 0), array('threadtype_infotypes_content', 'threadtypes&operation=content', 1), array(array('menu' => $curclassname ? $curclassname : 'threadtype_infotypes_option', 'submenu' => $classoptionmenu))));
 loadcache('forums');
 loadcache(array('threadsort_option_' . $_GET['sortid']));
 require_once libfile('function/threadsort');
 sortthreadsortselectoption($_GET['sortid']);
 $sortoptionarray = $_G['cache']['threadsort_option_' . $_GET['sortid']];
 $selectsql = '';
 if ($_GET['searchoption']) {
     foreach ($_GET['searchoption'] as $optionid => $option) {
         $fieldname = $sortoptionarray[$optionid]['identifier'] ? $sortoptionarray[$optionid]['identifier'] : 1;
         if ($option['value']) {
             if (in_array($option['type'], array('number', 'radio'))) {
                 $option['value'] = intval($option['value']);
                 $exp = '=';
                 if ($option['condition']) {
                     $exp = $option['condition'] == 1 ? '>' : '<';
                 }
                 $sql = "{$fieldname}{$exp}'{$option['value']}'";
             } elseif ($option['type'] == 'select') {
                 $subvalues = $currentchoices = array();
开发者ID:deepziyu,项目名称:JX3PVE,代码行数:31,代码来源:admincp_threadtypes.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP soundex函数代码示例发布时间:2022-05-23
下一篇:
PHP sortheader函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap