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

PHP newbb_isAdmin函数代码示例

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

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



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

示例1: getValidItems

 function getValidItems($mid, $id = 0)
 {
     static $suspension = array();
     $full_items = array();
     if (empty($mid)) {
         return $full_items;
     }
     require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.user.php";
     $uid = is_object($GLOBALS["xoopsUser"]) ? $GLOBALS["xoopsUser"]->getVar("uid") : 0;
     $ip = newbb_getIP(true);
     if (!empty($GLOBALS["xoopsModuleConfig"]['enable_usermoderate']) && !isset($suspension[$uid][$id]) && !newbb_isAdmin($id)) {
         $moderate_handler =& xoops_getmodulehandler('moderate', 'newbb');
         if ($moderate_handler->verifyUser($uid, "", $id)) {
             $suspension[$uid][$ip][$id] = 1;
         } else {
             $suspension[$uid][$ip][$id] = 0;
         }
     }
     $items = $this->getValidPerms();
     foreach ($items as $item) {
         /* skip access for suspended users */
         //if ( !empty($suspension[$uid][$ip][$id]) && in_array($item, array("post", "reply", "edit", "delete", "addpoll", "vote", "attach", "noapprove", "type")) ) continue;
         if (!empty($suspension[$uid][$ip][$id])) {
             continue;
         }
         $full_items[] = "'forum_{$item}'";
     }
     return $full_items;
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:29,代码来源:permission.forum.php


示例2: isset

 * @version		$Id $
 * @package		module::newbb
 */
include 'header.php';
$forum_id = isset($_POST['forum_id']) ? intval($_POST['forum_id']) : 0;
$topic_id = !empty($_POST['topic_id']) ? $_POST['topic_id'] : null;
$op = !empty($_POST['op']) ? $_POST['op'] : "";
$op = in_array($op, array("approve", "delete", "restore", "move")) ? $op : "";
if (empty($topic_id) || empty($op)) {
    redirect_header("javascript:history.go(-1);", 2, _MD_NORIGHTTOACCESS);
    exit;
}
$topic_id = array_values($topic_id);
$topic_handler =& xoops_getmodulehandler('topic', 'newbb');
$forum_handler =& xoops_getmodulehandler('forum', 'newbb');
$isadmin = newbb_isAdmin($forum_id);
if (!$isadmin) {
    redirect_header("index.php", 2, _MD_NORIGHTTOACCESS);
    exit;
}
switch ($op) {
    case "restore":
        $forums = array();
        $topics_obj =& $topic_handler->getAll(new Criteria("topic_id", "(" . implode(",", $topic_id) . ")", "IN"));
        foreach (array_keys($topics_obj) as $id) {
            $topic_obj =& $topics_obj[$id];
            $topic_handler->approve($topic_obj);
            $topic_handler->synchronization($topic_obj);
            $forums[$topic_obj->getVar("forum_id")] = 1;
        }
        $criteria_forum = new Criteria("forum_id", "(" . implode(",", array_keys($forums)) . ")", "IN");
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:31,代码来源:action.topic.php


示例3: intval

//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
// Author: Kazumi Ono (AKA onokazu)                                          //
// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //
include 'header.php';
$start = !empty($_GET['start']) ? intval($_GET['start']) : 0;
$forum_id = !empty($_GET['forum']) ? intval($_GET['forum']) : 0;
$isnew = !empty($_GET['new']) ? intval($_GET['new']) : 0;
$order = isset($_GET['order']) ? $_GET['order'] : "DESC";
$forum_handler =& xoops_getmodulehandler('forum', 'newbb');
$post_handler =& xoops_getmodulehandler('post', 'newbb');
$isadmin = newbb_isAdmin();
$perm = $isnew ? "access" : "view";
if (empty($forum_id)) {
    $forums = $forum_handler->getForums(0, $perm);
    $access_forums = array_keys($forums);
} else {
    $forum =& $forum_handler->get($forum_id);
    $forums[$forum_id] =& $forum;
    $access_forums = array($forum_id);
}
$post_perpage = $isnew ? $xoopsModuleConfig['topics_per_page'] : $xoopsModuleConfig['posts_per_page'];
$criteria_count = new CriteriaCompo(new Criteria("forum_id", "(" . implode(",", $access_forums) . ")", "IN"));
$criteria_count->add(new Criteria("approved", 1));
$criteria_post = new CriteriaCompo(new Criteria("p.forum_id", "(" . implode(",", $access_forums) . ")", "IN"));
$criteria_post->add(new Criteria("p.approved", 1));
$criteria_post->setSort("p.post_time");
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:viewpost.php


示例4: xoops_getmodulehandler

 include 'include/forumform.inc.php';
 $karma_handler =& xoops_getmodulehandler('karma', 'newbb');
 $user_karma = $karma_handler->getUserKarma();
 foreach ($forumpostshow as $eachpost) {
     // Sorry, in order to save queries, we have to hide the non-open post_text even if you have replied or have adequate karma, even an admin.
     if ($xoopsModuleConfig['enable_karma'] && $eachpost->getVar('post_karma') > 0) {
         $p_message = sprintf(_MD_KARMA_REQUIREMENT, "***", $eachpost->getVar('post_karma')) . "</div>";
     } elseif ($xoopsModuleConfig['allow_require_reply'] && $eachpost->getVar('require_reply')) {
         $p_message = _MD_REPLY_REQUIREMENT;
     } else {
         $p_message = $eachpost->getVar('post_text');
     }
     $isadmin = 0;
     if ($eachpost->getVar('uid')) {
         $p_name = newbb_getUnameFromId($eachpost->getVar('uid'), $xoopsModuleConfig['show_realname']);
         if (newbb_isAdmin($forum, $eachpost->getVar('uid'))) {
             $isadmin = 1;
         }
     } else {
         $poster_name = $eachpost->getVar('poster_name');
         $p_name = empty($poster_name) ? $xoopsConfig['anonymous'] : $myts->htmlSpecialChars($poster_name);
     }
     $p_date = formatTimestamp($eachpost->getVar('post_time'));
     /*
     	    if( $isadmin && $xoopsModuleConfig['allow_moderator_html']){
     	    	$p_subject = $myts->undoHtmlSpecialChars($eachpost->getVar('subject'));
     }else{
     	    	$p_subject = $eachpost->getVar('subject');
     }
     */
     $p_subject = $eachpost->getVar('subject');
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:reply.php


示例5: getAllTopics


//.........这里部分代码省略.........
         $rating = number_format($myrow['rating'] / 2, 0);
         if ($rating < 1) {
             $rating_img = newbb_displayImage($forumImage['blank']);
         } else {
             $rating_img = newbb_displayImage($forumImage['rate' . $rating]);
         }
         // ------------------------------------------------------
         // topic_page_jump
         if ($myrow['icon']) {
             $last_post_icon = '<img src="' . XOOPS_URL . '/images/subject/' . $myrow['icon'] . '" alt="" />';
         } else {
             $last_post_icon = '<img src="' . XOOPS_URL . '/images/subject/icon1.gif" alt="" />';
         }
         $topic_page_jump = '';
         $topic_page_jump_icon = '';
         $totalpages = ceil(($myrow['topic_replies'] + 1) / $xoopsModuleConfig['posts_per_page']);
         if ($totalpages > 1) {
             $topic_page_jump .= '&nbsp;&nbsp;&nbsp;<img src="' . XOOPS_URL . '/images/icons/posticon.gif" alt="" /> ';
             $append = false;
             for ($i = 1; $i <= $totalpages; $i++) {
                 if ($i > 3 && $i < $totalpages) {
                     if (!$append) {
                         $topic_page_jump .= "...";
                         $append = true;
                     }
                 } else {
                     $topic_page_jump .= '[<a href="viewtopic.php?topic_id=' . $myrow['topic_id'] . '&amp;start=' . ($i - 1) * $xoopsModuleConfig['posts_per_page'] . '">' . $i . '</a>]';
                     $topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id=" . $myrow['topic_id'] . "&amp;start=" . ($i - 1) * $xoopsModuleConfig['posts_per_page'] . "#forumpost" . $myrow['post_id'] . "'>" . newbb_displayImage($forumImage['docicon']) . "</a>";
                 }
             }
         } else {
             $topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id=" . $myrow['topic_id'] . "#forumpost" . $myrow['post_id'] . "'>" . newbb_displayImage($forumImage['docicon']) . "</a>";
         }
         // ------------------------------------------------------
         // topic_poster
         if ($myrow['topic_poster'] != 0 && $myrow['uname']) {
             if ($xoopsModuleConfig['show_realname'] && $myrow['name']) {
                 $topic_poster = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $myrow['topic_poster'] . '">' . $myts->htmlSpecialChars($myrow['name']) . '</a>';
             } else {
                 $topic_poster = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $myrow['topic_poster'] . '">' . $myts->htmlSpecialChars($myrow['uname']) . '</a>';
             }
         } else {
             $topic_poster = $myrow['poster_name'] ? $myts->htmlSpecialChars($myrow['poster_name']) : $xoopsConfig['anonymous'];
         }
         // ------------------------------------------------------
         // topic_last_poster
         if ($xoopsModuleConfig['show_realname'] && $myrow['last_post_name']) {
             $topic_last_poster = $myts->htmlSpecialChars($myrow['last_post_name']);
         } elseif ($myrow['last_poster']) {
             $topic_last_poster = $myts->htmlSpecialChars($myrow['last_poster']);
         } elseif ($myrow['last_poster_name']) {
             $topic_last_poster = $myts->htmlSpecialChars($myrow['last_poster_name']);
         } else {
             $topic_last_poster = $xoopsConfig['anonymous'];
         }
         if ($myrow['uid'] > 0) {
             $topic_last_poster = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $myrow['uid'] . '">' . $topic_last_poster . '</a>';
         }
         // ------------------------------------------------------
         // => topic array
         if (is_object($viewall_forums[$myrow['forum_id']])) {
             $forum_link = '<a href="' . XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $myrow['forum_id'] . '">' . $myts->htmlSpecialChars($viewall_forums[$myrow['forum_id']]->getVar('forum_name')) . '</a>';
         } else {
             $forum_link = '';
         }
         $topic_title = $myts->htmlSpecialChars($myrow['topic_title']);
         if ($myrow['topic_digest']) {
             $topic_title = "<span class='digest'>" . $topic_title . "</span>";
         }
         $subjectpres = explode(',', $xoopsModuleConfig['subject_prefix']);
         if (count($subjectpres) > 1) {
             foreach ($subjectpres as $subjectpre) {
                 $subject_array[] = $subjectpre;
             }
         }
         $subject_array[0] = null;
         if ($excerpt == 0) {
             $topic_excerpt = "";
         } elseif (($myrow['post_karma'] > 0 || $myrow['require_reply'] > 0) && !newbb_isAdmin($forum)) {
             $topic_excerpt = "";
         } else {
             $topic_excerpt = xoops_substr(newbb_html2text($myrow['post_text']), 0, $excerpt);
             $topic_excerpt = $myts->htmlSpecialChars($topic_excerpt);
         }
         $topic_subject = $allow_subject_prefix ? $subject_array[$myrow['topic_subject']] : "";
         $topics[$myrow['topic_id']] = array('topic_icon' => $topic_icon, 'topic_folder' => newbb_displayImage($topic_folder), 'topic_title' => $topic_subject . $topic_title, 'topic_link' => 'viewtopic.php?topic_id=' . $myrow['topic_id'] . '&amp;forum=' . $myrow['forum_id'], 'rating_img' => $rating_img, 'topic_page_jump' => $topic_page_jump, 'topic_page_jump_icon' => $topic_page_jump_icon, 'topic_replies' => $myrow['topic_replies'], 'topic_poster' => $topic_poster, 'topic_views' => $myrow['topic_views'], 'topic_time' => newbb_formatTimestamp($myrow['topic_time']), 'topic_last_posttime' => newbb_formatTimestamp($myrow['last_post_time']), 'topic_last_poster' => $topic_last_poster, 'topic_forum_link' => $forum_link, 'topic_excerpt' => $topic_excerpt, 'stick' => $stick);
     }
     if (is_array($topics) && count($topics) > 0) {
         $result2 = $this->db->query("SELECT attachment,topic_id FROM " . $this->db->prefix("bb_posts") . " WHERE topic_id IN (" . implode(',', array_keys($topics)) . ")");
         if ($result2) {
             while ($arr2 = $this->db->fetchArray($result2)) {
                 if ($arr2['attachment']) {
                     $topics[$arr2['topic_id']]['attachment'] = '&nbsp;' . newbb_displayImage($forumImage['clip'], _MD_TOPICSHASATT);
                 }
                 unset($arr2);
             }
         }
     }
     return array($topics, $sticky);
 }
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:101,代码来源:forum.php


示例6: xoops_getmodulehandler

}
include XOOPS_ROOT_PATH . "/header.php";
$topic_handler =& xoops_getmodulehandler('topic', 'newbb');
$forumtopic =& $topic_handler->get($topic_id);
$forum = $forumtopic->getVar('forum_id');
$forum_handler =& xoops_getmodulehandler('forum', 'newbb');
$viewtopic_forum =& $forum_handler->get($forum);
if (!$forum_handler->getPermission($viewtopic_forum)) {
    redirect_header("index.php", 2, _MD_NORIGHTTOACCESS);
    exit;
}
if (!$topic_handler->getPermission($viewtopic_forum, $forumtopic->getVar('topic_status'), "view")) {
    redirect_header("viewforum.php?forum=" . $viewtopic_forum->getVar('forum_id'), 2, _MD_NORIGHTTOVIEW);
    exit;
}
$isadmin = newbb_isAdmin($viewtopic_forum);
$perm = false;
if ($isadmin) {
    $perm = true;
} elseif ($topic_handler->getPermission($viewtopic_forum, $forumtopic->getVar('topic_status'), "addpoll") && $viewtopic_forum->getVar('allow_polls') == 1) {
    if (($op == "add" || $op == "save") && !$forumtopic->getVar("topic_haspoll") && is_object($xoopsUser) && $xoopsUser->getVar("uid") == $forumtopic->getVar("topic_poster")) {
        $perm = true;
    } elseif (!empty($poll_id)) {
        $poll = new XoopsPoll($poll_id);
        if (is_object($xoopsUser) && $xoopsUser->getVar("uid") == $poll->getVar("user_id")) {
            $perm = true;
        }
    }
}
if (!$perm) {
    redirect_header("viewtopic.php?topic_id=" . $topic_id, 2, _MD_NORIGHTTOACCESS);
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:polls.php


示例7: foreach

} else {
    $form_title = _EDIT . ": <a href=\"viewtopic.php?post_id={$post_id}\" rel=\"external\">" . $post_obj->getVar("subject") . "</a>";
}
$xoopsTpl->assign("form_title", $form_title);
foreach (array('start', 'topic_id', 'post_id', 'pid', 'isreply', 'isedit', 'contents_preview') as $getint) {
    ${$getint} = isset($_GET[$getint]) ? intval($_GET[$getint]) : (!empty(${$getint}) ? ${$getint} : 0);
}
foreach (array('order', 'viewmode', 'hidden', 'newbb_form', 'icon', 'op') as $getstr) {
    ${$getstr} = isset($_GET[$getstr]) ? $_GET[$getstr] : (!empty(${$getstr}) ? ${$getstr} : '');
}
$topic_handler =& xoops_getmodulehandler('topic', 'newbb');
$topic_status = $topic_handler->get(@$topic_id, 'topic_status');
$forum_form = new XoopsThemeForm(htmlspecialchars(@$form_title), 'form_post', "post.php", 'post', true);
$forum_form->setExtra('enctype="multipart/form-data"');
$uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
if (newbb_isAdmin($forum_obj) || $topic_handler->getPermission($forum_obj, $topic_status, 'type') && ($topic_id == 0 || $uid == $topic_handler->get(@$topic_id, 'topic_poster'))) {
    $type_id = $topic_handler->get(@$topic_id, 'type_id');
    $type_handler =& xoops_getmodulehandler('type', 'newbb');
    $types = $type_handler->getByForum($forum_obj->getVar("forum_id"));
    if (!empty($types)) {
        $type_element = new XoopsFormRadio(_MD_NEWBB_TYPE, 'type_id', $type_id);
        $type_element->addOption(0, _NONE);
        foreach ($types as $key => $type) {
            $value = empty($type["type_color"]) ? $type["type_name"] : "<em style=\"font-style: normal; color: " . $type["type_color"] . ";\">" . $type["type_name"] . "</em>";
            $type_element->addOption($key, $value);
        }
        $forum_form->addElement($type_element);
    } else {
        $forum_form->addElement(new XoopsFormHidden('type_id', 0));
    }
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:form.post.php


示例8: getPermission

 function getPermission($forum, $topic_locked = 0, $type = "view")
 {
     global $xoopsUser, $xoopsModule;
     static $_cachedTopicPerms;
     mod_loadFunctions("user", "newbb");
     if (newbb_isAdmin($forum)) {
         return 1;
     }
     $forum_id = is_object($forum) ? $forum->getVar('forum_id') : intval($forum);
     if ($forum_id < 1) {
         return false;
     }
     if ($topic_locked && 'view' != $type) {
         $permission = 0;
     } else {
         $perm_handler =& xoops_getmodulehandler('permission', 'newbb');
         $permission = $perm_handler->getPermission("forum", $type, $forum_id);
     }
     return $permission;
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:20,代码来源:topic.php


示例9: renderTopics


//.........这里部分代码省略.........
         // rating_img
         $rating = number_format($myrow['rating'] / 2, 0);
         $rating_img = newbb_displayImage($rating < 1 ? 'blank' : 'rate' . $rating);
         // ------------------------------------------------------
         // topic_page_jump
         $topic_page_jump = '';
         $topic_page_jump_icon = '';
         $totalpages = ceil(($myrow['topic_replies'] + 1) / $this->config['posts_per_page']);
         if ($totalpages > 1) {
             $topic_page_jump .= '&nbsp;&nbsp;';
             $append = false;
             for ($i = 1; $i <= $totalpages; $i++) {
                 if ($i > 3 && $i < $totalpages) {
                     if (!$append) {
                         $topic_page_jump .= "...";
                         $append = true;
                     }
                 } else {
                     $topic_page_jump .= '[<a href="viewtopic.php?topic_id=' . $myrow['topic_id'] . '&amp;start=' . ($i - 1) * $this->config['posts_per_page'] . '">' . $i . '</a>]';
                     $topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id=" . $myrow['topic_id'] . "&amp;start=" . ($i - 1) * $this->config['posts_per_page'] . "#forumpost" . $myrow['post_id'] . "'>" . newbb_displayImage('document') . "</a>";
                 }
             }
         } else {
             $topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id=" . $myrow['topic_id'] . "#forumpost" . $myrow['post_id'] . "'>" . newbb_displayImage('document') . "</a>";
         }
         // ------------------------------------------------------
         // => topic array
         $topic_title = $myts->htmlSpecialChars($myrow['topic_title']);
         if ($myrow['topic_digest']) {
             $topic_title = "<span class='digest'>" . $topic_title . "</span>";
         }
         if (empty($this->config["post_excerpt"])) {
             $topic_excerpt = "";
         } elseif (($myrow['post_karma'] > 0 || $myrow['require_reply'] > 0) && !newbb_isAdmin($myrow['forum_id'])) {
             $topic_excerpt = "";
         } else {
             $GLOBALS['xoopsLogger']->startTime('XOOPS output module - render - topics - fetch - substr ' . $myrow['topic_id']);
             $topic_excerpt = xoops_substr(newbb_html2text($myts->displayTarea($myrow['post_text'])), 0, $this->config["post_excerpt"]);
             $GLOBALS['xoopsLogger']->stopTime('XOOPS output module - render - topics - fetch - substr ' . $myrow['topic_id']);
             $topic_excerpt = str_replace("[", "&#91;", $myts->htmlSpecialChars($topic_excerpt));
         }
         $topics[$myrow['topic_id']] = array('topic_id' => $myrow['topic_id'], 'topic_icon' => $topic_icon, 'type_id' => $myrow['type_id'], 'topic_title' => $topic_title, 'topic_link' => 'viewtopic.php?topic_id=' . $myrow['topic_id'] . '&amp;forum=' . $myrow['forum_id'], 'rating_img' => $rating_img, 'topic_page_jump' => $topic_page_jump, 'topic_page_jump_icon' => $topic_page_jump_icon, 'topic_replies' => $myrow['topic_replies'], 'topic_poster_uid' => $myrow['topic_poster'], 'topic_poster_name' => !empty($myrow['poster_name']) ? $myts->htmlSpecialChars($myrow['poster_name']) : $anonymous, 'topic_views' => $myrow['topic_views'], 'topic_time' => newbb_formatTimestamp($myrow['topic_time']), 'topic_last_posttime' => newbb_formatTimestamp($myrow['last_post_time']), 'topic_last_poster_uid' => $myrow['uid'], 'topic_last_poster_name' => !empty($myrow['last_poster_name']) ? $myts->htmlSpecialChars($myrow['last_poster_name']) : $anonymous, 'topic_forum' => $myrow['forum_id'], 'topic_excerpt' => $topic_excerpt, 'stick' => empty($myrow['topic_sticky']), "stats" => array($myrow['topic_status'], $myrow['topic_digest'], $myrow['topic_replies']));
         /* users */
         $posters[$myrow['topic_poster']] = 1;
         $posters[$myrow['uid']] = 1;
         // reads
         if (!empty($this->config["read_mode"])) {
             $reads[$myrow['topic_id']] = $this->config["read_mode"] == 1 ? $myrow['last_post_time'] : $myrow["topic_last_post_id"];
         }
         // types
         if (!empty($myrow['type_id'])) {
             //$types[$myrow['type_id']] = 1;
         }
         // forums
         $forums[$myrow['forum_id']] = 1;
     }
     $GLOBALS['xoopsLogger']->stopTime('XOOPS output module - render - topics - fetch');
     $posters_name = newbb_getUnameFromIds(array_keys($posters), $this->config['show_realname'], true);
     $topic_isRead = newbb_isRead("topic", $reads);
     /*
     $type_list = array();
     if (count($types) > 0) {
     $type_handler =& xoops_getmodulehandler('type', 'newbb');
     $type_list = $type_handler->getAll(new Criteria("type_id", "(".implode(", ", array_keys($types)).")", "IN"), null, false);
     }
     */
开发者ID:trabisdementia,项目名称:xuups,代码行数:67,代码来源:topic.renderer.php


示例10: getAllTopics


//.........这里部分代码省略.........
         // ------------------------------------------------------
         // topic_icon: priority: sticky -> digest -> regular
         if ($myrow['topic_haspoll']) {
             if ($myrow['topic_sticky']) {
                 $topic_icon = newbb_displayImage('topic_sticky', _MD_TOPICSTICKY) . '<br />' . newbb_displayImage('poll', _MD_TOPICHASPOLL);
             } else {
                 $topic_icon = newbb_displayImage('poll', _MD_TOPICHASPOLL);
             }
         } elseif ($myrow['topic_sticky']) {
             $topic_icon = newbb_displayImage('topic_sticky', _MD_TOPICSTICKY);
         } elseif (!empty($myrow['icon'])) {
             $topic_icon = '<img src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($myrow['icon']) . '" alt="" />';
         } else {
             $topic_icon = '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />';
         }
         // ------------------------------------------------------
         // rating_img
         $rating = number_format($myrow['rating'] / 2, 0);
         $rating_img = newbb_displayImage($rating < 1 ? 'blank' : 'rate' . $rating);
         // ------------------------------------------------------
         // topic_page_jump
         $topic_page_jump = '';
         $topic_page_jump_icon = '';
         $totalpages = ceil(($myrow['topic_replies'] + 1) / $xoopsModuleConfig['posts_per_page']);
         if ($totalpages > 1) {
             $topic_page_jump .= '&nbsp;&nbsp;';
             $append = false;
             for ($i = 1; $i <= $totalpages; $i++) {
                 if ($i > 3 && $i < $totalpages) {
                     if (!$append) {
                         $topic_page_jump .= "...";
                         $append = true;
                     }
                 } else {
                     $topic_page_jump .= '[<a href="viewtopic.php?topic_id=' . $myrow['topic_id'] . '&amp;start=' . ($i - 1) * $xoopsModuleConfig['posts_per_page'] . '">' . $i . '</a>]';
                     $topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $myrow['post_id'] . "&amp;start=" . ($i - 1) * $xoopsModuleConfig['posts_per_page'] . "'>" . newbb_displayImage('document', _MD_NEWBB_GOTOLASTPOST) . "</a>";
                 }
             }
         } else {
             $topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $myrow['post_id'] . "'>" . newbb_displayImage('document', _MD_NEWBB_GOTOLASTPOST) . "</a>";
         }
         // ------------------------------------------------------
         // => topic array
         if (!empty($viewall_forums[$myrow['forum_id']])) {
             $forum_link = '<a href="' . XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $myrow['forum_id'] . '">' . $viewall_forums[$myrow['forum_id']]['forum_name'] . '</a>';
         } else {
             $forum_link = '';
         }
         $topic_title = $myts->htmlSpecialChars($myrow['topic_title']);
         if ($myrow['topic_digest']) {
             $topic_title = "<span class='digest'>" . $topic_title . "</span>";
         }
         if ($excerpt == 0) {
             $topic_excerpt = "";
         } elseif (($myrow['post_karma'] > 0 || $myrow['require_reply'] > 0) && !newbb_isAdmin($forum)) {
             $topic_excerpt = "";
         } else {
             $topic_excerpt = xoops_substr(newbb_html2text($myts->displayTarea($myrow['post_text'])), 0, $excerpt);
             $topic_excerpt = str_replace("[", "&#91;", $myts->htmlSpecialChars($topic_excerpt));
         }
         /* users */
         $posters[$myrow['topic_poster']] = 1;
         $posters[$myrow['uid']] = 1;
         // reads
         if (!empty($xoopsModuleConfig["read_mode"])) {
             $reads[$myrow['topic_id']] = $xoopsModuleConfig["read_mode"] == 1 ? $myrow['last_post_time'] : $myrow["topic_last_post_id"];
         }
         $topic_poster = newbb_getUnameFromId($myrow['topic_poster'], $xoopsModuleConfig['show_realname'], true);
         $topic_last_poster = newbb_getUnameFromId($myrow['uid'], $xoopsModuleConfig['show_realname'], true);
         $topic_isRead = newbb_isRead("topic", $reads);
         $topic_prefix = !empty($typen[$myrow['type_id']]) ? getTopicTitle("", $typen[$myrow['type_id']]["type_name"], $typen[$myrow['type_id']]["type_color"]) : "";
         // ------------------------------------------------------
         // topic_folder: priority: newhot -> hot/new -> regular
         if ($myrow['topic_status'] == 1) {
             $topic_folder = 'topic_locked';
             $topic_folder_text = _MD_TOPICLOCKED;
         } else {
             if ($myrow['topic_digest']) {
                 $topic_folder = 'topic_digest';
                 $topic_folder_text = _MD_TOPICDIGEST;
             } elseif ($myrow['topic_replies'] >= $hot_threshold) {
                 $topic_folder = empty($topic_isRead[$myrow['topic_id']]) ? 'topic_hot_new' : 'topic_hot';
                 $topic_folder_text = empty($topic_isRead[$myrow['topic_id']]) ? _MD_MORETHAN : _MD_MORETHAN2;
             } else {
                 $topic_folder = empty($topic_isRead[$myrow['topic_id']]) ? 'topic_new' : 'topic';
                 $topic_folder_text = empty($topic_isRead[$myrow['topic_id']]) ? _MD_NEWPOSTS : _MD_NONEWPOSTS;
             }
         }
         $topics[$myrow['topic_id']] = array('topic_id' => $myrow['topic_id'], 'topic_icon' => $topic_icon, 'type_id' => $myrow['type_id'], 'type_text' => $topic_prefix, 'topic_title' => $topic_title, 'topic_link' => 'viewtopic.php?topic_id=' . $myrow['topic_id'], 'rating_img' => $rating_img, 'topic_page_jump' => $topic_page_jump, 'topic_page_jump_icon' => $topic_page_jump_icon, 'topic_replies' => $myrow['topic_replies'], 'topic_poster_uid' => $myrow['topic_poster'], 'topic_poster_name' => $myts->htmlSpecialChars($myrow['poster_name'] ? $myrow['poster_name'] : $xoopsConfig['anonymous']), 'topic_views' => $myrow['topic_views'], 'topic_time' => newbb_formatTimestamp($myrow['topic_time']), 'topic_last_posttime' => newbb_formatTimestamp($myrow['last_post_time']), 'topic_last_poster_uid' => $myrow['uid'], 'topic_last_poster_name' => $myts->htmlSpecialChars($myrow['last_poster_name'] ? $myrow['last_poster_name'] : $xoopsConfig['anonymous']), 'topic_forum_link' => $forum_link, 'topic_excerpt' => $topic_excerpt, 'stick' => empty($myrow['topic_sticky']), "topic_poster" => $topic_poster, "topic_last_poster" => $topic_last_poster, "topic_folder" => newbb_displayImage($topic_folder, $topic_folder_text));
     }
     if (count($topics) > 0) {
         $sql = " SELECT DISTINCT topic_id FROM " . $this->db->prefix("bb_posts") . " WHERE attachment != ''" . " AND topic_id IN (" . implode(',', array_keys($topics)) . ")";
         if ($result = $this->db->query($sql)) {
             while (list($topic_id) = $this->db->fetchRow($result)) {
                 $topics[$topic_id]['attachment'] = '&nbsp;' . newbb_displayImage('attachment', _MD_TOPICSHASATT);
             }
         }
     }
     return array($topics, $sticky);
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:101,代码来源:forum.php


示例11: newbb_checkSubjectPrefixPermission

function newbb_checkSubjectPrefixPermission($forum = 0, $user = -1)
{
    global $xoopsUser, $xoopsModuleConfig;
    if ($xoopsModuleConfig['subject_prefix_level'] < 1) {
        return false;
    }
    if ($xoopsModuleConfig['subject_prefix_level'] == 1) {
        return true;
    }
    if ($user == -1) {
        $user =& $xoopsUser;
    }
    if (!is_object($user) && intval($user) < 1) {
        return false;
    }
    $uid = is_object($user) ? $user->getVar('uid') : intval($user);
    if ($xoopsModuleConfig['subject_prefix_level'] == 2) {
        return true;
    }
    if ($xoopsModuleConfig['subject_prefix_level'] == 3) {
        if (newbb_isAdmin($forum, $user)) {
            return true;
        } else {
            return false;
        }
    }
    if ($xoopsModuleConfig['subject_prefix_level'] == 4) {
        if (newbb_isAdministrator($user)) {
            return true;
        }
    }
    return false;
}
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:33,代码来源:functions.php


示例12: getPermission

 function getPermission($forum, $topic_locked = 0, $type = "view")
 {
     global $xoopsUser, $xoopsModule;
     static $_cachedTopicPerms;
     require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.user.php";
     if (newbb_isAdmin($forum)) {
         return 1;
     }
     $forum_id = is_object($forum) ? $forum->getVar('forum_id') : intval($forum);
     if ($forum_id < 1) {
         return false;
     }
     if ($topic_locked && 'view' != $type) {
         $permission = 0;
     } else {
         $perm_handler =& xoops_getmodulehandler('permission', 'newbb');
         $permission = $perm_handler->getPermission("forum", $type, $forum_id);
     }
     return $permission;
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:20,代码来源:topic.php


示例13: foreach

foreach (array('forum', 'topic_id', 'post_id', 'order', 'pid', 'act') as $getint) {
    ${$getint} = ${$getint} ? ${$getint} : (isset($_GET[$getint]) ? intval($_GET[$getint]) : 0);
}
$viewmode = isset($_GET['viewmode']) && $_GET['viewmode'] != 'flat' ? 'thread' : 'flat';
$viewmode = $viewmode ? $viewmode : (isset($_POST['viewmode']) ? $_POST['viewmode'] : 'flat');
if (empty($forum)) {
    redirect_header("index.php", 2, _MD_ERRORFORUM);
    exit;
}
$forum_handler =& xoops_getmodulehandler('forum', 'newbb');
$_forum =& $forum_handler->get($forum);
if (!$forum_handler->getPermission($_forum)) {
    redirect_header("index.php", 2, _MD_NORIGHTTOACCESS);
    exit;
}
$isadmin = newbb_isAdmin($_forum);
$uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
$post_handler =& xoops_getmodulehandler('post', 'newbb');
$forumpost =& $post_handler->get($post_id);
$topic_handler =& xoops_getmodulehandler('topic', 'newbb');
$topic = $topic_handler->get($topic_id);
$topic_status = $topic->getVar('topic_status');
if ($topic_handler->getPermission($forum, $topic_status, 'delete') && ($isadmin || $forumpost->checkIdentity())) {
} else {
    redirect_header("viewtopic.php?topic_id={$topic_id}&amp;order={$order}&amp;viewmode={$viewmode}&amp;pid={$pid}&amp;forum={$forum}", 2, _MD_DELNOTALLOWED);
    exit;
}
$post_handler =& xoops_getmodulehandler('post', 'newbb');
$forumpost =& $post_handler->get($post_id);
if (!$isadmin && !$forumpost->checkTimelimit('delete_timelimit')) {
    redirect_header("viewtopic.php?forum={$forum}&amp;topic_id={$topic_id}&amp;post_id={$post_id}&amp;order={$order}&amp;viewmode={$viewmode}&amp;pid={$pid}", 2, _MD_TIMEISUPDEL);
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:delete.php


示例14: is_object

 function &getPostBody($imageAsSource = false)
 {
     global $xoopsConfig, $xoopsModuleConfig, $xoopsUser, $myts;
     $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
     $karma_handler =& xoops_getmodulehandler('karma', 'newbb');
     $user_karma = $karma_handler->getUserKarma();
     $post = array();
     $post['attachment'] = false;
     $post_text = newbb_displayTarea($this->vars['post_text']['value'], $this->getVar('dohtml'), $this->getVar('dosmiley'), $this->getVar('doxcode'), $this->getVar('doimage'), $this->getVar('dobr'));
     if (newbb_isAdmin($this->getVar('forum_id')) or $this->checkIdentity()) {
         $post['text'] = $post_text . '<br />' . $this->displayAttachment($imageAsSource);
     } elseif ($xoopsModuleConfig['enable_karma'] && $this->getVar('post_karma') > $user_karma) {
         $post['text'] = sprintf(_MD_KARMA_REQUIREMENT, $user_karma, $this->getVar('post_karma'));
     } elseif ($xoopsModuleConfig['allow_require_reply'] && $this->getVar('require_reply') && (!$uid || !isset($viewtopic_users[$uid]))) {
         $post['text'] = _MD_REPLY_REQUIREMENT;
     } else {
         $post['text'] = $post_text . '<br />' . $this->displayAttachment($imageAsSource);
     }
     $member_handler =& xoops_gethandler('member');
     $eachposter =& $member_handler->getUser($this->getVar('uid'));
     if (is_object($eachposter) && $eachposter->isActive()) {
         if ($xoopsModuleConfig['show_realname'] && $eachposter->getVar('name')) {
             $post['author'] = $eachposter->getVar('name');
         } else {
             $post['author'] = $eachposter->getVar('uname');
         }
         unset($eachposter);
     } else {
         $post['author'] = $this->getVar('poster_name') ? $this->getVar('poster_name') : $xoopsConfig['anonymous'];
     }
     $post['subject'] = newbb_htmlSpecialChars($this->vars['subject']['value']);
     $post['date'] = $this->getVar('post_time');
     return $post;
 }
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:34,代码来源:post.php


示例15: getPermission

 function getPermission($forum, $topic_locked = 0, $type = "view")
 {
     global $xoopsUser, $xoopsModule;
     static $_cachedTopicPerms;
     if (newbb_isAdmin($forum)) {
         return 1;
     }
     $forum = is_object($forum) ? $forum->getVar('forum_id') : intval($forum);
     if ($forum < 1) {
         return false;
     }
     if (!isset($_cachedTopicPerms)) {
         $getpermission =& xoops_getmodulehandler('permission', 'newbb');
         $_cachedTopicPerms = $getpermission->getPermissions("topic");
     }
     $type = strtolower($type);
     $perm_item = 'forum_' . $type;
     $permission = isset($_cachedTopicPerms[$forum][$perm_item]) ? 1 : 0;
     if ($topic_locked && 'view' != $type) {
         $permission = 0;
     }
     return $permission;
 }
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:23,代码来源:topic.php


示例16: isset

$order = isset($_GET['order']) ? $_GET['order'] : "DESC";
$uid = !empty($_GET['uid']) ? intval($_GET['uid']) : 0;
$status = !empty($_GET['status']) && in_array($_GET['status'], array("active", "pending", "deleted", "new")) ? $_GET['status'] : "";
$mode = !empty($_GET['mode']) ? intval($_GET['mode']) : 0;
$mode = !empty($status) && in_array($status, array("active", "pending", "deleted")) ? 2 : $mode;
$forum_handler =& xoops_getmodulehandler('forum', 'newbb');
$post_handler =& xoops_getmodulehandler('post', 'newbb');
if (empty($forum_id)) {
    $forums = $forum_handler->getByPermission(0, "view");
    $access_forums = array_keys($forums);
    $isadmin = $GLOBALS["xoopsUserIsAdmin"];
} else {
    $forum_obj =& $forum_handler->get($forum_id);
    $forums[$forum_id] =& $forum_obj;
    $access_forums = array($forum_id);
    $isadmin = newbb_isAdmin($forum_obj);
}
/* Only admin has access to admin mode */
if (!$isadmin) {
    $status = in_array($status, array("active", "pending", "deleted")) ? "" : $status;
    $mode = 0;
}
if ($mode) {
    $_GET['viewmode'] = "flat";
}
$post_perpage = $xoopsModuleConfig['posts_per_page'];
$criteria_count = new CriteriaCompo(new Criteria("forum_id", "(" . implode(",", $access_forums) . ")", "IN"));
$criteria_post = new CriteriaCompo(new Criteria("p.forum_id", "(" . implode(",", $access_forums) . ")", "IN"));
$criteria_post->setSort("p.post_id");
$criteria_post->setOrder($order);
if (!empty($uid)) {
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:31,代码来源:viewpost.php


示例17: newbb_getUnameFromId

 $subject_pre = "";
 $subject = $forumpost->getVar('subject', "E");
 $message = $forumpost->getVar('post_text', "E");
 $poster_name = $forumpost->getVar('poster_name', "E");
 $attachments = $forumpost->getAttachment();
 $post_karma = $forumpost->getVar('post_karma');
 $require_reply = $forumpost->getVar('require_reply');
 $hidden = "";
 include 'include/forumform.inc.php';
 if (!$istopic) {
     $forumpost2 =& $post_handler->get($post_id2);
     $r_message = $forumpost2->getVar('post_text');
     $isadmin = 0;
     if ($forumpost2->getVar('uid')) {
         $r_name = newbb_getUnameFromId($forumpost2->getVar('uid'), $xoopsModuleConfig['show_realname']);
         if (newbb_isAdmin($forum, $forumpost2->getVar('uid'))) {
             $isadmin = 1;
         }
     } else {
         $poster_name = $forumpost2->getVar('poster_name');
         $r_name = empty($poster_name) ? $xoopsConfig['anonymous'] : $poster_name;
     }
     $r_date = formatTimestamp($forumpost2->getVar('post_time'));
     $r_subject = $forumpost2->getVar('subject');
     $r_content = _MD_BY . " " . $r_name . " " . _MD_ON . " " . $r_date . "<br /><br />";
     $r_content .= $r_message;
     $r_subject = $forumpost2->getVar('subject');
     echo "<table cellpadding='4' cellspacing='1' width 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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