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


PHP moddisplay函数代码示例

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


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

示例1: forum

function forum(&$forum)
{
    global $_G;
    $lastvisit = $_G['member']['lastvisit'];
    if (!$forum['viewperm'] || $forum['viewperm'] && forumperm($forum['viewperm']) || !empty($forum['allowview']) || isset($forum['users']) && strstr($forum['users'], "\t{$_G['uid']}\t")) {
        $forum['permission'] = 2;
    } elseif (!$_G['setting']['hideprivate']) {
        $forum['permission'] = 1;
    } else {
        return FALSE;
    }
    if ($forum['icon']) {
        $forum['icon'] = get_forumimg($forum['icon']);
        $forum['icon'] = '<a href="forum.php?mod=forumdisplay&fid=' . $forum['fid'] . '"><img src="' . $forum['icon'] . '" align="left" alt="" /></a>';
    }
    $lastpost = array(0, 0, '', '');
    $forum['lastpost'] = is_string($forum['lastpost']) ? explode("\t", $forum['lastpost']) : $forum['lastpost'];
    $forum['lastpost'] = count($forum['lastpost']) != 4 ? $lastpost : $forum['lastpost'];
    list($lastpost['tid'], $lastpost['subject'], $lastpost['dateline'], $lastpost['author']) = $forum['lastpost'];
    $thisforumlastvisit = array();
    if ($_G['cookie']['forum_lastvisit']) {
        preg_match("/D\\_" . $forum['fid'] . "\\_(\\d+)/", $_G['cookie']['forum_lastvisit'], $thisforumlastvisit);
    }
    $forum['folder'] = ($thisforumlastvisit && $thisforumlastvisit[1] > $lastvisit ? $thisforumlastvisit[1] : $lastvisit) < $lastpost['dateline'] ? ' class="new"' : '';
    if ($lastpost['tid']) {
        $lastpost['dateline'] = dgmdate($lastpost['dateline'], 'u');
        $lastpost['authorusername'] = $lastpost['author'];
        if ($lastpost['author']) {
            $lastpost['author'] = '<a href="home.php?mod=space&username=' . rawurlencode($lastpost['author']) . '">' . $lastpost['author'] . '</a>';
        }
        $forum['lastpost'] = $lastpost;
    } else {
        $forum['lastpost'] = $lastpost['authorusername'] = '';
    }
    $forum['moderators'] = moddisplay($forum['moderators'], $_G['setting']['moddisplay'], !empty($forum['inheritedmod']));
    if (isset($forum['subforums'])) {
        $forum['subforums'] = implode(', ', $forum['subforums']);
    }
    return TRUE;
}
开发者ID:softhui,项目名称:discuz,代码行数:40,代码来源:function_forumlist.php

示例2: forum

function forum(&$forum)
{
    global $_DCOOKIE, $timestamp, $timeformat, $dateformat, $discuz_uid, $groupid, $lastvisit, $moddisplay, $timeoffset, $hideprivate, $onlinehold;
    if (!$forum['viewperm'] || $forum['viewperm'] && forumperm($forum['viewperm']) || !empty($forum['allowview']) || isset($forum['users']) && strstr($forum['users'], "\t{$discuz_uid}\t")) {
        $forum['permission'] = 2;
    } elseif (!$hideprivate) {
        $forum['permission'] = 1;
    } else {
        return FALSE;
    }
    if ($forum['icon']) {
        if (strstr($forum['icon'], ',')) {
            $flash = explode(",", $forum['icon']);
            $forum['icon'] = "<a href=\"forumdisplay.php?fid={$forum['fid']}\"><embed style=\"float:left; margin-right: 10px\" src=\"" . trim($flash[0]) . "\" width=\"" . trim($flash[1]) . "\" height=\"" . trim($flash[2]) . "\" type=\"application/x-shockwave-flash\" align=\"left\"></embed></a>";
        } else {
            $forum['icon'] = "<a href=\"forumdisplay.php?fid={$forum['fid']}\"><img style=\"float:left; margin-right: 10px\" src=\"{$forum['icon']}\" align=\"left\" alt=\"\" border=\"0\" /></a>";
        }
    }
    $lastpost = array('tid' => 0, 'dateline' => 0, 'subject' => '', 'author' => '');
    list($lastpost['tid'], $lastpost['subject'], $lastpost['dateline'], $lastpost['author']) = is_array($forum['lastpost']) ? $forum['lastpost'] : explode("\t", $forum['lastpost']);
    $forum['folder'] = (isset($_DCOOKIE['fid' . $forum['fid']]) && $_DCOOKIE['fid' . $forum['fid']] > $lastvisit ? $_DCOOKIE['fid' . $forum['fid']] : $lastvisit) < $lastpost['dateline'] ? ' class="new"' : '';
    if ($lastpost['tid']) {
        $lastpost['dateline'] = dgmdate("{$dateformat} {$timeformat}", $lastpost['dateline'] + $timeoffset * 3600);
        $lastpost['authorusername'] = $lastpost['author'];
        if ($lastpost['author']) {
            $lastpost['author'] = '<a href="space.php?username=' . rawurlencode($lastpost['author']) . '">' . $lastpost['author'] . '</a>';
        }
        $forum['lastpost'] = $lastpost;
    } else {
        $forum['lastpost'] = $lastpost['authorusername'] = '';
    }
    $forum['moderators'] = moddisplay($forum['moderators'], $moddisplay, !empty($forum['inheritedmod']));
    if (isset($forum['subforums'])) {
        $forum['subforums'] = implode(', ', $forum['subforums']);
    }
    return TRUE;
}
开发者ID:lilhorse,项目名称:cocoa,代码行数:37,代码来源:forum.func.php

示例3: moddisplay

    if ($forum['type'] != 'group') {
        $threads += $forum['threads'];
        $posts += $forum['posts'];
        $todayposts += $forum['todayposts'];
        if (forum($forum)) {
            $forum['orderid'] = $catlist[$forum['fup']]['forumscount']++;
            $forum['subforums'] = '';
            $forumlist[$forum['fid']] = $forum;
            $catlist[$forum['fup']]['forums'][] = $forum['fid'];
            $fids .= ',' . $forum['fid'];
        }
    } else {
        $forum['collapseimg'] = 'collapsed_no.gif';
        $collapse['category_' . $forum['fid']] = '';
        if ($forum['moderators']) {
            $forum['moderators'] = moddisplay($forum['moderators'], 'flat');
        }
        $forum['forumscount'] = 0;
        $forum['forumcolumns'] = 0;
        $catlist[$forum['fid']] = $forum;
        $navigation = '&raquo; ' . $forum['name'];
        $navtitle = strip_tags($forum['name']) . ' - ';
    }
}
$query = $db->query("SELECT fid, fup, name, threads, posts, todayposts FROM {$tablepre}forums WHERE status='1' AND fup IN ({$fids}) AND type='sub' ORDER BY displayorder");
while ($forum = $db->fetch_array($query)) {
    if ($subforumsindex && $forumlist[$forum['fup']]['permission'] == 2) {
        $forumlist[$forum['fup']]['subforums'] .= '<a href="forumdisplay.php?fid=' . $forum['fid'] . '"><u>' . $forum['name'] . '</u></a>&nbsp;&nbsp;';
    }
    $forumlist[$forum['fup']]['threads'] += $forum['threads'];
    $forumlist[$forum['fup']]['posts'] += $forum['posts'];
开发者ID:lilhorse,项目名称:cocoa,代码行数:31,代码来源:category.inc.php

示例4: unserialize

$forum['modrecommend'] = $forum['modrecommend'] ? unserialize($forum['modrecommend']) : array();
if ($forum['modrecommend'] && $forum['modrecommend']['open']) {
    $forum['recommendlist'] = recommendupdate($fid, $forum['modrecommend']);
}
if ($forum['recommendlist']) {
    if (empty($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'], 'recommendlist') === FALSE) {
        $collapse['recommendlist'] = '';
        $collapse['recommendlist_link'] = 'display: none';
    } else {
        $collapse['recommendlist'] = 'display: none';
        $collapse['recommendlist_link'] = '';
    }
}
$toptablewidth = $forum['rules'] && $forum['recommendlist'] ? '50%' : '100%';
$forum['typemodels'] = $forum['typemodels'] ? unserialize($forum['typemodels']) : array();
$moderatedby = moddisplay($forum['moderators'], 'forumdisplay');
$highlight = empty($highlight) ? '' : htmlspecialchars($highlight);
if ($forum['autoclose']) {
    $closedby = $forum['autoclose'] > 0 ? 'dateline' : 'lastpost';
    $forum['autoclose'] = abs($forum['autoclose']) * 86400;
}
$subexists = 0;
foreach ($_DCACHE['forums'] as $sub) {
    if ($sub['type'] == 'sub' && $sub['fup'] == $fid && (!$hideprivate || !$sub['viewperm'] || forumperm($sub['viewperm']) || strstr($sub['users'], "\t{$discuz_uid}\t"))) {
        $subexists = 1;
        $sublist = array();
        $sql = $accessmasks ? "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, ff.description, ff.moderators, ff.icon, ff.viewperm, a.allowview FROM {$tablepre}forums f\r\n\t\t\t\t\t\tLEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid\r\n\t\t\t\t\t\tLEFT JOIN {$tablepre}access a ON a.uid='{$discuz_uid}' AND a.fid=f.fid\r\n\t\t\t\t\t\tWHERE fup='{$fid}' AND status>0 AND type='sub' ORDER BY f.displayorder" : "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, ff.description, ff.moderators, ff.icon, ff.viewperm FROM {$tablepre}forums f\r\n\t\t\t\t\t\tLEFT JOIN {$tablepre}forumfields ff USING(fid)\r\n\t\t\t\t\t\tWHERE f.fup='{$fid}' AND f.status>0 AND f.type='sub' ORDER BY f.displayorder";
        $query = $db->query($sql);
        while ($sub = $db->fetch_array($query)) {
            if (forum($sub)) {
                $sub['orderid'] = count($sublist);
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:forumdisplay.php

示例5: quicksearch

    }
    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 = '&amp;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();
    }
}
$moderatedby = $_G['forum']['status'] != 3 ? moddisplay($_G['forum']['moderators'], 'forumdisplay') : '';
$_G['gp_highlight'] = empty($_G['gp_highlight']) ? '' : htmlspecialchars($_G['gp_highlight']);
if ($_G['forum']['autoclose']) {
    $closedby = $_G['forum']['autoclose'] > 0 ? 'dateline' : 'lastpost';
    $_G['forum']['autoclose'] = abs($_G['forum']['autoclose']) * 86400;
}
$subexists = 0;
foreach ($_G['cache']['forums'] as $sub) {
    if ($sub['type'] == 'sub' && $sub['fup'] == $_G['fid'] && (!$_G['setting']['hideprivate'] || !$sub['viewperm'] || forumperm($sub['viewperm']) || strstr($sub['users'], "\t{$_G['uid']}\t"))) {
        if (!$sub['status']) {
            continue;
        }
        $subexists = 1;
        $sublist = array();
        $sql = !empty($_G['member']['accessmasks']) ? "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.domain, ff.description, ff.moderators, ff.icon, ff.viewperm, ff.extra, ff.redirect, a.allowview FROM " . DB::table('forum_forum') . " f\r\n\t\t\t\t\t\tLEFT JOIN " . DB::table('forum_forumfield') . " ff ON ff.fid=f.fid\r\n\t\t\t\t\t\tLEFT JOIN " . DB::table('forum_access') . " a ON a.uid='{$_G['uid']}' AND a.fid=f.fid\r\n\t\t\t\t\t\tWHERE fup='{$_G['fid']}' AND status>'0' AND type='sub' ORDER BY f.displayorder" : "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.domain, ff.description, ff.moderators, ff.icon, ff.viewperm, ff.extra, ff.redirect FROM " . DB::table('forum_forum') . " f\r\n\t\t\t\t\t\tLEFT JOIN " . DB::table('forum_forumfield') . " ff USING(fid)\r\n\t\t\t\t\t\tWHERE f.fup='{$_G['fid']}' AND f.status>'0' AND f.type='sub' ORDER BY f.displayorder";
        $query = DB::query($sql);
开发者ID:kleitz,项目名称:sports,代码行数:31,代码来源:forum_forumdisplay.php

示例6: forum_display

 public function forum_display($fid, $topicInstance)
 {
     if (!file_exists('../../data/attachment/appbyme')) {
         $url = file_exists('../manage/App.xml') ? join("", file('../manage/App.xml')) : array();
     } else {
         $url = file_exists('../../data/attachment/appbyme/App.xml') ? join("", file('../../data/attachment/appbyme/App.xml')) : array();
     }
     $result = $topicInstance->xml_to_array($url);
     if (empty($result['board']['fid'])) {
         $gid = intval(getgpc('gid'));
         $catlist = $forumlist = $sublist = $forumname = $collapse = $favforumlist = array();
         if (!$gid) {
             $forums = C::t('forum_forum')->fetch_all_by_status(1);
             $fids = array();
             foreach ($forums as $forum) {
                 $fids[$forum['fid']] = $forum['fid'];
             }
             $forum_access = array();
             if (!empty($_G['member']['accessmasks'])) {
                 $forum_access = C::t('forum_access')->fetch_all_by_fid_uid($fids, $_G['uid']);
             }
             $forum_fields = C::t('forum_forumfield')->fetch_all($fids);
             foreach ($forums as $forum) {
                 if ($forum_fields[$forum['fid']]['fid']) {
                     $forum = array_merge($forum, $forum_fields[$forum['fid']]);
                 }
                 if ($forum_access['fid']) {
                     $forum = array_merge($forum, $forum_access[$forum['fid']]);
                 }
                 $forumname[$forum['fid']] = strip_tags($forum['name']);
                 $forum['extra'] = empty($forum['extra']) ? array() : dunserialize($forum['extra']);
                 if (!is_array($forum['extra'])) {
                     $forum['extra'] = array();
                 }
                 if ($forum['type'] != 'group') {
                     $threads += $forum['threads'];
                     $posts += $forum['posts'];
                     $todayposts += $forum['todayposts'];
                     if ($forum['type'] == 'forum' && isset($catlist[$forum['fup']])) {
                         if (forum($forum)) {
                             $catlist[$forum['fup']]['forums'][] = $forum['fid'];
                             $forum['orderid'] = $catlist[$forum['fup']]['forumscount']++;
                             $forum['subforums'] = '';
                             $forumlist[$forum['fid']] = $forum;
                         }
                     } elseif (isset($forumlist[$forum['fup']])) {
                         $forumlist[$forum['fup']]['threads'] += $forum['threads'];
                         $forumlist[$forum['fup']]['posts'] += $forum['posts'];
                         $forumlist[$forum['fup']]['todayposts'] += $forum['todayposts'];
                         if ($_G['setting']['subforumsindex'] && $forumlist[$forum['fup']]['permission'] == 2 && !($forumlist[$forum['fup']]['simple'] & 16) || $forumlist[$forum['fup']]['simple'] & 8) {
                             $forumurl = !empty($forum['domain']) && !empty($_G['setting']['domain']['root']['forum']) ? 'http://' . $forum['domain'] . '.' . $_G['setting']['domain']['root']['forum'] : 'forum.php?mod=forumdisplay&fid=' . $forum['fid'];
                             $forumlist[$forum['fup']]['subforums'] .= (empty($forumlist[$forum['fup']]['subforums']) ? '' : ', ') . '<a href="' . $forumurl . '" ' . (!empty($forum['extra']['namecolor']) ? ' style="color: ' . $forum['extra']['namecolor'] . ';"' : '') . '>' . $forum['name'] . '</a>';
                         }
                     }
                 } else {
                     if ($forum['moderators']) {
                         $forum['moderators'] = moddisplay($forum['moderators'], 'flat');
                     }
                     $forum['forumscount'] = 0;
                     $catlist[$forum['fid']] = $forum;
                 }
             }
         } else {
             $gquery = C::t('forum_forum')->fetch_all_info_by_fids($gid);
             $query = C::t('forum_forum')->fetch_all_info_by_fids(0, 1, 0, $gid, 1, 0, 0, 'forum');
             if (!empty($_G['member']['accessmasks'])) {
                 $fids = array_keys($query);
                 $accesslist = C::t('forum_access')->fetch_all_by_fid_uid($fids, $_G['uid']);
                 foreach ($query as $key => $val) {
                     $query[$key]['allowview'] = $accesslist[$key];
                 }
             }
             $query = array_merge($gquery, $query);
             $fids = array();
             foreach ($query as $forum) {
                 $forum['extra'] = dunserialize($forum['extra']);
                 if (!is_array($forum['extra'])) {
                     $forum['extra'] = array();
                 }
                 if ($forum['type'] != 'group') {
                     $threads += $forum['threads'];
                     $posts += $forum['posts'];
                     $todayposts += $forum['todayposts'];
                     if (forum($forum)) {
                         $forum['orderid'] = $catlist[$forum['fup']]['forumscount']++;
                         $forum['subforums'] = '';
                         $forumlist[$forum['fid']] = $forum;
                         $catlist[$forum['fup']]['forums'][] = $forum['fid'];
                         $fids[] = $forum['fid'];
                     }
                 } else {
                     $forum['collapseimg'] = 'collapsed_no.gif';
                     $collapse['category_' . $forum['fid']] = '';
                     if ($forum['moderators']) {
                         $forum['moderators'] = moddisplay($forum['moderators'], 'flat');
                     }
                     $catlist[$forum['fid']] = $forum;
                     $navigation = '<em>&rsaquo;</em> ' . $forum['name'];
                     $navtitle_g = strip_tags($forum['name']);
                 }
//.........这里部分代码省略.........
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:101,代码来源:mobcentDatabase.php


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