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


PHP groupaccess函数代码示例

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


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

示例1: makeheader

function makeheader()
{
    global $data, $varcsettings, $db_prefix, $locale, $size, $gamefile;
    echo "<fieldset><legend>" . $locale['VARC206'] . "</legend>";
    echo "<table align='center' valign='middle' width='95%' cellspacing='0' cellpadding='0'>\n<td align='left'><b> [ <a href='" . INFUSIONS . "varcade/index.php'>" . $locale['VARC100'] . "</a>  ]</b>";
    if ($varcsettings['popup'] == "1") {
        echo "<b> [ <a href='#' onclick=window.open('" . INFUSIONS . "varcade/random.php?p=1','VArcpopup','scrollbars=yes,resizable=yes,width=800,height=700')>" . $locale['VARC101'] . "</a> ] </b>";
    } else {
        echo "<b> [ <a href='" . INFUSIONS . "varcade/random.php'>" . $locale['VARC101'] . "</a> ] </b>";
    }
    if (iMEMBER) {
        if ($varcsettings['favorites'] == "1") {
            echo "<b> [ <a href='" . INFUSIONS . "varcade/favorit_games.php'>" . $locale['VARC102'] . "</a> ] </b>";
        }
    }
    echo " <input type='text' id='query' class='textbox' style=' height: 17px; width: 100px; border: 1px solid #000; background-color: #636363; color: #000; font-size: 12px;' value='" . $locale['VARC103'] . "' onBlur=\"if(this.value=='') this.value='" . $locale['VARC103'] . "';\" onFocus=\"if(this.value=='" . $locale['VARC103'] . "') this.value='';\" onKeyDown=\"if(event.keyCode==13) Search();\">";
    echo "</td>";
    $result1 = dbquery("SELECT * FROM " . $db_prefix . "varcade_cats WHERE " . groupaccess('access') . " ORDER BY title ASC");
    echo "<td align='right'>";
    echo "<form method='post' action='" . INFUSIONS . "varcade/index.php'>";
    echo "<select name='category' class='textbox' onChange=\"this.form.submit()\">";
    echo '<option value="">' . $locale['VARC104'] . '</option>';
    while ($data1 = dbarray($result1)) {
        echo "<option value='" . $data1['cid'] . "'>" . $data1['title'] . "</option>";
    }
    echo "</select></form></td></table></fieldset>";
}
开发者ID:simplyianm,项目名称:clububer,代码行数:27,代码来源:functions.php

示例2: showsublinks

function showsublinks($sep = "&middot;", $class = "")
{
    $sres = dbquery("SELECT link_window, link_visibility, link_url, link_name FROM " . DB_SITE_LINKS . "\n\t\tWHERE " . groupaccess('link_visibility') . " AND link_position>='2' AND link_url!='---' ORDER BY link_order ASC");
    if (dbrows($sres)) {
        $i = 0;
        $res = "<ul>\n";
        while ($sdata = dbarray($sres)) {
            $link_target = $sdata['link_window'] == "1" ? " target='_blank'" : "";
            $li_class = $i == 0 ? " class='first-link" . ($class ? " {$class}" : "") . "'" : ($class ? " class='{$class}'" : "");
            if (strstr($sdata['link_url'], "http://") || strstr($sdata['link_url'], "https://")) {
                $res .= "<li" . $li_class . ">" . $sep . "<a href='" . $sdata['link_url'] . "'{$link_target}><span>" . $sdata['link_name'] . "</span></a></li>\n";
            } else {
                $res .= "<li" . $li_class . ">" . $sep . "<a href='" . BASEDIR . $sdata['link_url'] . "'{$link_target}><span>" . $sdata['link_name'] . "</span></a></li>\n";
            }
            $i++;
        }
        if (iMEMBER) {
            $res .= "<li" . $li_class . ">" . $sep . "<a href='" . BASEDIR . "setuser.php?logout=yes'><span>Logout</span></a> </li>\n";
        } else {
            $res .= "<li" . $li_class . ">" . $sep . "<a href='" . BASEDIR . "register.php'><span>Register</span></a> </li>\n";
        }
        $res .= "</ul>\n";
        return $res;
    }
}
开发者ID:edwintcloud,项目名称:mycms,代码行数:25,代码来源:theme_functions_include.php

示例3: get_forum_thread

 /**
  * Get thread structure on specific forum id.
  * @param            $forum_id
  * @param bool|FALSE $filter
  * @return array
  */
 public static function get_forum_thread($forum_id, $filter = FALSE)
 {
     $info = array();
     $locale = fusion_get_locale("", FORUM_LOCALE);
     $forum_settings = ForumServer::get_forum_settings();
     $userdata = fusion_get_userdata();
     $userdata['user_id'] = !empty($userdata['user_id']) ? (int) intval($userdata['user_id']) : 0;
     $lastVisited = isset($userdata['user_lastvisit']) && isnum($userdata['user_lastvisit']) ? $userdata['user_lastvisit'] : time();
     /**
      * Get threads with filter conditions (XSS prevention)
      */
     $thread_query = "\n        SELECT\n        count(t.thread_id) 'thread_max_rows',\n        count(a1.attach_id) 'attach_image',\n        count(a2.attach_id) 'attach_files'\n        FROM " . DB_FORUM_THREADS . " t\n        LEFT JOIN " . DB_FORUMS . " tf ON tf.forum_id = t.forum_id\n        INNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n        #LEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id\n        LEFT JOIN " . DB_FORUM_POSTS . " p1 ON p1.thread_id = t.thread_id and p1.post_id = t.thread_lastpostid\n        LEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n        LEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND p1.post_id = v.post_id\n        LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n        LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = t.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n        WHERE t.forum_id='" . intval($forum_id) . "' AND t.thread_hidden='0' AND " . groupaccess('tf.forum_access') . "\n        " . (isset($filter['condition']) ? $filter['condition'] : '') . "\n        GROUP BY tf.forum_id\n        ";
     $thread_result = dbquery($thread_query);
     $thread_rows = dbrows($thread_result);
     $count = array("thread_max_rows" => 0, "attach_image" => 0, "attach_files" => 0);
     $info['item'][$forum_id]['forum_threadcount'] = 0;
     $info['item'][$forum_id]['forum_threadcount_word'] = format_word($count['thread_max_rows'], $locale['fmt_thread']);
     if ($thread_rows > 0) {
         $count = dbarray($thread_result);
         $info['item'][$forum_id]['forum_threadcount'] = 0;
         $info['item'][$forum_id]['forum_threadcount_word'] = format_word($count['thread_max_rows'], $locale['fmt_thread']);
     }
     $info['thread_max_rows'] = $count['thread_max_rows'];
     if ($info['thread_max_rows'] > 0) {
         $info['threads']['pagenav'] = "";
         $info['threads']['pagenav2'] = "";
         // anti-XSS filtered rowstart
         $_GET['thread_rowstart'] = isset($_GET['thread_rowstart']) && isnum($_GET['thread_rowstart']) && $_GET['thread_rowstart'] <= $count['thread_max_rows'] ? $_GET['thread_rowstart'] : 0;
         $thread_query = "\n            SELECT t.*, tf.forum_type, tf.forum_name, tf.forum_cat,\n            tu1.user_name ' author_name', tu1.user_status 'author_status', tu1.user_avatar 'author_avatar',\n            tu2.user_name 'last_user_name', tu2.user_status 'last_user_status', tu2.user_avatar 'last_user_avatar',\n            p1.post_datestamp, p1.post_message,\n            IF (n.thread_id > 0, 1 , 0) 'user_tracked',\n            count(v.vote_user) 'thread_rated',\n            count(pv.forum_vote_user_id) 'poll_voted',\n            p.forum_poll_title,\n            count(v.post_id) AS vote_count,\n            a1.attach_name, a1.attach_id,\n            a2.attach_name, a2.attach_id,\n            count(a1.attach_mime) 'attach_image',\n            count(a2.attach_mime) 'attach_files',\n            min(p2.post_datestamp) 'first_post_datestamp'\n            FROM " . DB_FORUM_THREADS . " t\n            LEFT JOIN " . DB_FORUMS . " tf ON tf.forum_id = t.forum_id\n            INNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n            LEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id\n            LEFT JOIN " . DB_FORUM_POSTS . " p1 ON p1.thread_id = t.thread_id and p1.post_id = t.thread_lastpostid\n            LEFT JOIN " . DB_FORUM_POSTS . " p2 ON p2.thread_id = t.thread_id\n            LEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n            #LEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND p1.post_id = v.post_id\n            LEFT JOIN " . DB_FORUM_VOTES . " v on v.thread_id = t.thread_id AND v.vote_user='" . $userdata['user_id'] . "' AND v.forum_id = t.forum_id AND tf.forum_type='4'\n            LEFT JOIN " . DB_FORUM_POLL_VOTERS . " pv on pv.thread_id = t.thread_id AND pv.forum_vote_user_id='" . $userdata['user_id'] . "' AND t.thread_poll=1\n            LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n            LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = t.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n            LEFT JOIN " . DB_FORUM_THREAD_NOTIFY . " n on n.thread_id = t.thread_id and n.notify_user = '" . $userdata['user_id'] . "'\n            WHERE t.forum_id='" . $forum_id . "' AND t.thread_hidden='0' AND " . groupaccess('tf.forum_access') . "\n            " . (isset($filter['condition']) ? $filter['condition'] : '') . "\n            " . (multilang_table("FO") ? "AND tf.forum_language='" . LANGUAGE . "'" : '') . "\n            GROUP BY t.thread_id\n            " . (isset($filter['order']) ? $filter['order'] : '') . "\n            LIMIT " . intval($_GET['thread_rowstart']) . ", " . $forum_settings['threads_per_page'];
         $cthread_result = dbquery($thread_query);
         if (dbrows($cthread_result) > 0) {
             while ($threads = dbarray($cthread_result)) {
                 $icon = "";
                 $match_regex = $threads['thread_id'] . "\\|" . $threads['thread_lastpost'] . "\\|" . $threads['forum_id'];
                 if ($threads['thread_lastpost'] > $lastVisited) {
                     if (iMEMBER && ($threads['thread_lastuser'] == $userdata['user_id'] || preg_match("(^\\.{$match_regex}\$|\\.{$match_regex}\\.|\\.{$match_regex}\$)", $userdata['user_threads']))) {
                         $icon = "<i class='" . get_forumIcons('thread') . "' title='" . $locale['forum_0261'] . "'></i>";
                     } else {
                         $icon = "<i class='" . get_forumIcons('new') . "' title='" . $locale['forum_0260'] . "'></i>";
                     }
                 }
                 $author = array('user_id' => $threads['thread_author'], 'user_name' => $threads['author_name'], 'user_status' => $threads['author_status'], 'user_avatar' => $threads['author_avatar']);
                 $lastuser = array('user_id' => $threads['thread_lastuser'], 'user_name' => $threads['last_user_name'], 'user_status' => $threads['last_user_status'], 'user_avatar' => $threads['last_user_avatar']);
                 $threads += array("thread_link" => array("link" => FORUM . "viewthread.php?thread_id=" . $threads['thread_id'], "title" => $threads['thread_subject']), "forum_type" => $threads['forum_type'], "thread_pages" => makepagenav(0, $forum_settings['posts_per_page'], $threads['thread_postcount'], 3, FORUM . "viewthread.php?thread_id=" . $threads['thread_id'] . "&amp;"), "thread_icons" => array('lock' => $threads['thread_locked'] ? "<i class='" . self::get_forumIcons('lock') . "' title='" . $locale['forum_0263'] . "'></i>" : '', 'sticky' => $threads['thread_sticky'] ? "<i class='" . self::get_forumIcons('sticky') . "' title='" . $locale['forum_0103'] . "'></i>" : '', 'poll' => $threads['thread_poll'] ? "<i class='" . self::get_forumIcons('poll') . "' title='" . $locale['forum_0314'] . "'></i>" : '', 'hot' => $threads['thread_postcount'] >= 20 ? "<i class='" . self::get_forumIcons('hot') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'reads' => $threads['thread_views'] >= 20 ? "<i class='" . self::get_forumIcons('reads') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'image' => $threads['attach_image'] > 0 ? "<i class='" . self::get_forumIcons('image') . "' title='" . $locale['forum_0313'] . "'></i>" : '', 'file' => $threads['attach_files'] > 0 ? "<i class='" . self::get_forumIcons('file') . "' title='" . $locale['forum_0312'] . "'></i>" : '', 'icon' => $icon), "thread_starter" => $locale['forum_0006'] . timer($threads['first_post_datestamp']) . " " . $locale['by'] . " " . profile_link($author['user_id'], $author['user_name'], $author['user_status']) . "</span>", "thread_author" => $author, "thread_last" => array('avatar' => display_avatar($lastuser, '30px', '', '', ''), 'profile_link' => profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']), 'time' => $threads['post_datestamp'], 'post_message' => parseubb(parsesmileys($threads['post_message'])), "formatted" => "<div class='pull-left'>" . display_avatar($lastuser, '30px', '', '', '') . "</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='overflow-hide'>" . $locale['forum_0373'] . " <span class='forum_profile_link'>" . profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']) . "</span><br/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . timer($threads['post_datestamp']) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>"));
                 if ($threads['thread_sticky']) {
                     $info['threads']['sticky'][$threads['thread_id']] = $threads;
                 } else {
                     $info['threads']['item'][$threads['thread_id']] = $threads;
                 }
             }
         }
         if ($info['thread_max_rows'] > $forum_settings['threads_per_page']) {
             $info['threads']['pagenav'] = makepagenav($_GET['thread_rowstart'], $forum_settings['threads_per_page'], $info['thread_max_rows'], 3, clean_request("", array("thread_rowstart"), FALSE) . "&amp;", "thread_rowstart");
             $info['threads']['pagenav2'] = makepagenav($_GET['thread_rowstart'], $forum_settings['threads_per_page'], $info['thread_max_rows'], 3, clean_request("", array("thread_rowstart"), FALSE) . "&amp;", "thread_rowstart", TRUE);
         }
     }
     return (array) $info;
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:64,代码来源:threads.php

示例4: download_subcats

function download_subcats($id, $type = "")
{
    global $locale, $subcats_available;
    $result = dbquery("SELECT download_cat_id, download_cat_name, download_cat_description FROM " . DB_DOWNLOAD_CATS . " WHERE " . groupaccess('download_cat_access') . " AND download_cat_parent='" . $id . "' ORDER BY download_cat_name");
    $k = dbrows($result);
    if ($k > 0) {
        if ($type == "2") {
            $counter = 0;
            $columns = 2;
            echo "<tr>\n";
            echo "<td class='tbl2' colspan='" . $columns . "'><span class='side'><strong>" . $locale['432'] . "</strong></span></td><tr>\n";
            while ($data = dbarray($result)) {
                if ($counter != 0 && $counter % $columns == 0) {
                    echo "</tr>\n<tr>\n";
                }
                $num = dbcount("(download_cat)", DB_DOWNLOADS, "download_cat='" . (int) $data['download_cat_id'] . "'");
                if ($num > 0) {
                    $subcats_available = true;
                }
                echo "<td valign='top' width='50%' class='tbl1 download_idx_cat_name'><!--download_idx_cat_name--><a href='" . FUSION_SELF . "?cat_id=" . $data['download_cat_id'] . "'>" . $data['download_cat_name'] . "</a> <span class='small2'>({$num})</span>";
                if ($data['download_cat_description'] != "") {
                    echo "<br />\n<span class='small'>" . $data['download_cat_description'] . "</span>";
                }
                echo "</td>\n";
                $counter++;
            }
            if ($counter % $columns != 0) {
                echo "<td valign='top' width='50%' class='tbl1 download_idx_cat_name'></td>\n";
            }
            echo "<div style='margin:5px'></div>";
            echo "</tr>\n";
        } else {
            echo "<br />";
            echo "<tr><td colspan='8' class='tbl1 small' style='text-align:left;'>";
            echo "<span class='side'><strong>" . $locale['432'] . ": </strong></span>";
            while ($data = dbarray($result)) {
                $k--;
                $num = dbcount("(download_cat)", DB_DOWNLOADS, "download_cat='" . (int) $data['download_cat_id'] . "'");
                echo "<a href='" . FUSION_SELF . "?cat_id=" . $data['download_cat_id'] . "'>" . $data['download_cat_name'] . "</a> <span class='small2'>(" . $num . ")</span>";
                if ($k > 0) {
                    echo ", ";
                }
            }
            echo "</td></tr>\n";
        }
    }
}
开发者ID:keddyboys,项目名称:kmods,代码行数:47,代码来源:subcats_downloads_include.php

示例5: showsidelinks

function showsidelinks(array $options = array(), $id = 0)
{
    global $userdata;
    static $data = array();
    $settings = fusion_get_settings();
    $acclevel = isset($userdata['user_level']) ? $userdata['user_level'] : 0;
    $res =& $res;
    if (empty($data)) {
        $data = dbquery_tree_full(DB_SITE_LINKS, "link_id", "link_cat", "WHERE link_position <= 2" . (multilang_table("SL") ? " AND link_language='" . LANGUAGE . "'" : "") . " AND " . groupaccess('link_visibility') . " ORDER BY link_cat, link_order");
    }
    if (!$id) {
        $res .= "<ul class='main-nav'>\n";
    } else {
        $res .= "<ul class='sub-nav p-l-10' style='display: none;'>\n";
    }
    foreach ($data[$id] as $link_id => $link_data) {
        $li_class = "";
        if ($link_data['link_name'] != "---" && $link_data['link_name'] != "===") {
            $link_target = $link_data['link_window'] == "1" ? " target='_blank'" : "";
            if (START_PAGE == $link_data['link_url']) {
                $li_class .= ($li_class ? " " : "") . "current-link";
            }
            if (preg_match("!^(ht|f)tp(s)?://!i", $link_data['link_url'])) {
                $item_link = $link_data['link_url'];
            } else {
                $item_link = BASEDIR . $link_data['link_url'];
            }
            $link_icon = "";
            if ($link_data['link_icon']) {
                $link_icon = "<i class='" . $link_data['link_icon'] . "'></i>";
            }
            $res .= "<li" . ($li_class ? " class='" . $li_class . "'" : "") . ">\n";
            $res .= "<a class='display-block p-5 p-l-0 p-r-0' href='{$item_link}' {$link_target}>\n";
            $res .= $link_icon . $link_data['link_name'];
            $res .= "</a>\n";
            if (isset($data[$link_id])) {
                $res .= showsidelinks($options, $link_data['link_id']);
            }
            $res .= "</li>\n";
        } elseif ($link_data['link_cat'] > 0) {
            echo "<li class='divider'></li>";
        }
    }
    $res .= "</ul>\n";
    return $res;
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:46,代码来源:css_navigation_panel.php

示例6: weblink_subcats

function weblink_subcats($id, $type = "")
{
    global $locale;
    $result = dbquery("SELECT weblink_cat_id, weblink_cat_name, weblink_cat_description FROM " . DB_WEBLINK_CATS . " WHERE " . groupaccess('weblink_cat_access') . " AND weblink_cat_parent='" . (int) $id . "'  ORDER BY weblink_cat_name");
    $k = dbrows($result);
    if ($k > 0) {
        if ($type == "2") {
            $counter = 0;
            $columns = 2;
            echo "<span class='side'><strong>" . $locale['413'] . "</strong></span><br />\n";
            echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
            while ($data = dbarray($result)) {
                if ($counter != 0 && $counter % $columns == 0) {
                    echo "</tr>\n<tr>\n";
                }
                $num = dbcount("(weblink_cat)", DB_WEBLINKS, "weblink_cat='" . (int) $data['weblink_cat_id'] . "'");
                echo "<td valign='top' width='50%' class='tbl'><a href='" . FUSION_SELF . "?cat_id=" . $data['weblink_cat_id'] . "'>" . $data['weblink_cat_name'] . "</a> <span class='small2'>(" . $num . ")</span>";
                if ($data['weblink_cat_description'] != "") {
                    echo "<br />\n<span class='small'>" . $data['weblink_cat_description'] . "</span>";
                }
                echo "</td>\n";
                $counter++;
            }
            if ($counter % $columns != 0) {
                echo "<td valign='top' width='50%' class='tbl'></td>\n";
            }
            echo "</tr>\n</table>\n";
            echo "<div style='margin:5px'></div>";
            echo "<br />";
        } else {
            echo "<br />";
            echo "<span class='side'><strong>" . $locale['413'] . ": </strong></span>";
            while ($data = dbarray($result)) {
                $k--;
                $num = dbcount("(weblink_cat)", DB_WEBLINKS, "weblink_cat='" . (int) $data['weblink_cat_id'] . "'");
                echo "<a href='" . FUSION_SELF . "?cat_id=" . $data['weblink_cat_id'] . "'>" . $data['weblink_cat_name'] . "</a> <span class='small2'>(" . $num . ")</span>";
                if ($k > 0) {
                    echo ", ";
                }
            }
        }
    }
}
开发者ID:keddyboys,项目名称:kmods,代码行数:43,代码来源:subcats_weblinks_include.php

示例7: article_subcats

function article_subcats($id, $type = "")
{
    global $locale;
    $result = dbquery("SELECT article_cat_id, article_cat_name, article_cat_description FROM " . DB_ARTICLE_CATS . " WHERE " . groupaccess('article_cat_access') . " AND article_cat_parent='" . (int) $id . "'  ORDER BY article_cat_name");
    $k = dbrows($result);
    if ($k > 0) {
        if ($type == "1") {
            $counter = 0;
            $columns = 2;
            echo "<span class='side'><strong>" . $locale['406'] . "</strong></span><br />\n";
            echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
            while ($data = dbarray($result)) {
                if ($counter != 0 && $counter % $columns == 0) {
                    echo "</tr>\n<tr>\n";
                }
                $num = dbcount("(article_cat)", DB_ARTICLES, "article_cat='" . $data['article_cat_id'] . "' AND article_draft='0'");
                echo "<td valign='top' width='50%' class='tbl article_idx_cat_name'><!--article_idx_cat_name--><a href='" . FUSION_SELF . "?cat_id=" . $data['article_cat_id'] . "'>" . $data['article_cat_name'] . "</a> <span class='small2'>({$num})</span>";
                if ($data['article_cat_description'] != "") {
                    echo "<br />\n<span class='small'>" . $data['article_cat_description'] . "</span>";
                }
                echo "</td>\n";
                $counter++;
            }
            echo "</tr>\n</table>\n";
            echo "<div style='margin:5px'></div>";
        } else {
            echo "<br />";
            echo "<span class='side'><strong>" . $locale['406'] . ": </strong></span>";
            while ($data = dbarray($result)) {
                $k--;
                $num = dbcount("(article_cat)", DB_ARTICLES, "article_cat='" . (int) $data['article_cat_id'] . "' AND article_draft='0'");
                echo "<!--article_idx_cat_name--><a href='" . FUSION_SELF . "?cat_id=" . $data['article_cat_id'] . "'>" . $data['article_cat_name'] . "</a> <span class='small2'>({$num})</span>";
                if ($k > 0) {
                    echo ", ";
                }
            }
        }
    }
}
开发者ID:keddyboys,项目名称:kmods,代码行数:39,代码来源:subcats_articles_include.php

示例8: author

| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once dirname(__FILE__) . "../../../../maincore.php";
header('Content-Type: application/rss+xml; charset=' . $locale['charset'] . '');
if (file_exists(INFUSIONS . "rss_feeds_panel/locale/" . LANGUAGE . ".php")) {
    include INFUSIONS . "rss_feeds_panel/locale/" . LANGUAGE . ".php";
} else {
    include INFUSIONS . "rss_feeds_panel/locale/English.php";
}
if (db_exists(DB_NEWS)) {
    $result = dbquery("SELECT * FROM " . DB_NEWS . " WHERE " . groupaccess('news_visibility') . (multilang_table("NS") ? " AND news_language='" . LANGUAGE . "'" : "") . "\tORDER BY news_datestamp DESC LIMIT 0,10");
    $rssimage = $settings['siteurl'] . $settings['sitebanner'];
    echo "<?xml version=\"1.0\" encoding=\"" . $locale['charset'] . "\"?>\n\n";
    echo "<rss version=\"2.0\">\n\n\t<image>\n <url>{$rssimage}</url>\n </image>\n\t<channel>\n";
    if (dbrows($result) != 0) {
        echo "<title>" . $settings['sitename'] . $locale['rss004'] . (multilang_table("NS") ? " " . $locale['rss007'] . " " . LANGUAGE : "") . "</title>\n";
        echo "<link>" . $settings['siteurl'] . "</link>\n \r\n\t  <description>" . $settings['description'] . "</description>\n";
        while ($row = dbarray($result)) {
            $rsid = intval($row['news_id']);
            $rtitle = $row['news_subject'];
            $description = stripslashes(nl2br($row['news_news']));
            $description = strip_tags($description, "<a><p><br /><br /><hr />");
            echo "<item>\n";
            echo "<title>" . htmlspecialchars($rtitle) . "</title>\n";
            echo "<link>" . $settings['siteurl'] . "infusions/news/news.php?readmore=" . $rsid . "</link>\n";
            echo "<description>" . htmlspecialchars($description) . "</description>\n";
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:rss_news.php

示例9: pdp_update_cat_downloads

            pdp_update_cat_downloads($last_cat);
            pdp_update_cat_downloads($download->data['cat_id']);
        }
        if ($ok) {
            if ($download->status == PDP_PRO_NEW) {
                fallback('edit_files.php?did=' . $download->id);
            }
            fallback(FUSION_SELF . '?did=' . $download->id . '&errno=0');
        }
    }
}
/****************************************************************************
 * CREATE
 */
$all_cats = array();
$res = dbquery("SELECT  cat_name, top_cat, cat_id, cat_upload_access" . " FROM " . DB_PDP_CATS . "" . (iPDP_MOD ? "" : " WHERE " . groupaccess("cat_upload_access")) . " ORDER BY cat_order ASC");
while ($data = dbarray($res)) {
    $all_cats[$data['cat_id']] = array("name" => $data['cat_name'], "parentcat" => $data['top_cat'], "access" => $data['cat_upload_access']);
}
function pdp_tmp_show_cat($parentid, $cat_array, $level, $sel_this)
{
    $retval = "";
    foreach ($cat_array as $myid => $thiscat) {
        if ($thiscat['parentcat'] == $parentid && checkgroup($thiscat['access'])) {
            $retval .= "<option value='{$myid}'" . ($sel_this == $myid ? ' selected="selected"' : '') . '>' . str_repeat("&nbsp;", $level * 4) . $thiscat['name'] . '</option>';
            $retval .= pdp_tmp_show_cat($myid, $cat_array, $level + 1, $sel_this);
        }
    }
    return $retval;
}
$sel_cats = pdp_tmp_show_cat(0, $all_cats, 0, $download->data['cat_id']);
开发者ID:petemadsen,项目名称:Professional-Download-System,代码行数:31,代码来源:edit_desc.php

示例10: search_fieldsvar

     } else {
         if ($_GET['fields'] == 2) {
             $fieldsvar = search_fieldsvar($ssubject, $smessage, $sextended);
         } else {
             $fieldsvar = "";
         }
     }
 }
 if ($fieldsvar) {
     $rows = dbcount("(news_id)", DB_NEWS, groupaccess('news_visibility') . " AND " . $fieldsvar . " AND (news_start='0'||news_start<=" . time() . ") AND (news_end='0'||news_end>=" . time() . ") " . ($_GET['datelimit'] != 0 ? " AND news_datestamp>=" . (time() - $_GET['datelimit']) : ""));
 } else {
     $rows = 0;
 }
 if ($rows != 0) {
     $items_count .= THEME_BULLET . "&nbsp;<a href='" . FUSION_SELF . "?stype=news&amp;stext=" . $_GET['stext'] . "&amp;" . $composevars . "'>" . $rows . " " . ($rows == 1 ? $locale['n401'] : $locale['n402']) . " " . $locale['522'] . "</a><br />\n";
     $result = dbquery("SELECT tn.*, tu.user_id, tu.user_name, tu.user_status FROM " . DB_NEWS . " tn\r\n\t\t\tLEFT JOIN " . DB_USERS . " tu ON tn.news_name=tu.user_id\r\n\t\t\tWHERE " . groupaccess('news_visibility') . " AND (news_start='0'||news_start<=" . time() . ")\r\n\t\t\tAND (news_end='0'||news_end>=" . time() . ") AND " . $fieldsvar . "\r\n\t\t\t" . ($_GET['datelimit'] != 0 ? " AND news_datestamp>=" . (time() - $_GET['datelimit']) : "") . "\r\n\t\t\tORDER BY " . $sortby . " " . ($_GET['order'] == 1 ? "ASC" : "DESC") . ($_GET['stype'] != "all" ? " LIMIT " . $_GET['rowstart'] . ",10" : ""));
     while ($data = dbarray($result)) {
         $search_result = "";
         $text_all = $data['news_news'] . " " . $data['news_extended'];
         $text_all = search_striphtmlbbcodes($text_all);
         $text_frag = search_textfrag($text_all);
         // $text_frag = highlight_words($swords, $text_frag);
         $subj_c = search_stringscount($data['news_subject']);
         $text_c = search_stringscount($data['news_news']);
         $text_c2 = search_stringscount($data['news_extended']);
         $search_result .= "<a href='news.php?readmore=" . $data['news_id'] . "'>" . $data['news_subject'] . "</a>" . "<br /><br />\n";
         // $search_result .= "<a href='news.php?readmore=".$data['news_id']."'>".highlight_words($swords, $data['news_subject'])."</a>"."<br /><br />\n";
         $search_result .= "<div class='quote' style='width:auto;height:auto;overflow:auto'>" . $text_frag . "</div><br />";
         $search_result .= "<span class='small2'>" . $locale['global_070'] . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "\n";
         $search_result .= $locale['global_071'] . showdate("longdate", $data['news_datestamp']) . "</span><br />\n";
         $search_result .= "<span class='small'>" . $subj_c . " " . ($subj_c == 1 ? $locale['520'] : $locale['521']) . " " . $locale['n403'] . " " . $locale['n404'] . ", ";
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:31,代码来源:search_news_include.php

示例11: dbquery

         $dell_f_post = true;
         echo $locale['605'] . "<br />\n";
     } else {
         echo $locale['606'] . "<br />\n";
     }
     if ($dell_f_post && count($array_post) == 1) {
         echo "<br /><strong>" . $locale['607'] . "</strong><br /><br />\n";
         echo "<a href='" . FORUM . "viewthread.php?thread_id=" . $pdata['thread_id'] . "&amp;rowstart=" . $_GET['rowstart'] . "'>" . $locale['609'] . "</a>";
         $f_post_blo = true;
     }
     echo "</div></div>\n";
 }
 if (!isset($_POST['new_forum_id']) && !$f_post_blo) {
     $forum_list = "";
     $current_cat = "";
     $fl_result = dbquery("\r\n\t\t\t\t\tSELECT f.forum_id, f.forum_name, f2.forum_name AS forum_cat_name, \r\n\t\t\t\t\t\t(SELECT COUNT(thread_id) \r\n\t\t\t\t\t\tFROM " . DB_THREADS . " th \r\n\t\t\t\t\t\tWHERE f.forum_id=th.forum_id AND th.thread_id!='" . $pdata['thread_id'] . "'\r\n\t\t\t\t\t\tGROUP BY th.forum_id) AS threadcount\r\n\t\t\t\t\tFROM " . DB_FORUMS . " f\r\n\t\t\t\t\tINNER JOIN " . DB_FORUMS . " f2 ON f.forum_cat=f2.forum_id\r\n\t\t\t\t\tWHERE " . groupaccess('f.forum_access') . " AND f.forum_cat!='0' \r\n\t\t\t\t\tHAVING threadcount != 0\r\n\t\t\t\t\tORDER BY f2.forum_order ASC, f.forum_order ASC\r\n\t\t\t\t");
     if (dbrows($fl_result) > 0) {
         while ($fl_data = dbarray($fl_result)) {
             if ($fl_data['forum_cat_name'] != $current_cat) {
                 if ($current_cat != "") {
                     $forum_list .= "</optgroup>\n";
                 }
                 $current_cat = $fl_data['forum_cat_name'];
                 $forum_list .= "<optgroup label='" . $fl_data['forum_cat_name'] . "'>\n";
             }
             $sel = $fl_data['forum_id'] == $fdata['forum_id'] ? " selected='selected'" : "";
             $forum_list .= "<option value='" . $fl_data['forum_id'] . "'{$sel}>" . $fl_data['forum_name'] . "</option>\n";
         }
         $forum_list .= "</optgroup>\n";
         echo "<form name='modopts' method='post' action='" . FUSION_SELF . "?thread_id=" . $fdata['thread_id'] . "&amp;rowstart=" . $_GET['rowstart'] . "'>\n";
         echo "<table cellpadding='0' cellspacing='0' width='100%' align='center'>\n<tr>\n";
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:31,代码来源:viewthread_options.php

示例12: author

| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
// Count Max
$result = dbquery("SELECT tp.post_id FROM " . DB_FORUM_POSTS . " tp\n\tINNER JOIN " . DB_FORUM_THREADS . " tt ON tp.thread_id = tt.thread_id\n\tINNER JOIN " . DB_FORUMS . " tf ON tp.forum_id = tf.forum_id\n\t" . (multilang_table("FO") ? "WHERE tf.forum_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('forum_access') . "\n\tAND tt.thread_postcount='1' AND tt.thread_locked='0' AND post_hidden='0' AND thread_hidden='0'\n\tGROUP BY tt.thread_id\n\t");
$this->forum_info['post_rows'] = dbrows($result);
if (dbrows($result) > 0) {
    if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
        $_GET['rowstart'] = 0;
    }
    require_once INCLUDES . "mimetypes_include.php";
    $result = dbquery("\n\t\tSELECT tp.forum_id, tp.thread_id, tp.post_id, tp.post_author, tp.post_message, tp.post_datestamp,\n\t\tt.*, tf.*,\n\t\ttu1.user_name AS author_name, tu1.user_status AS author_status, tu1.user_avatar as author_avatar,\n\t\ttu2.user_name AS last_user_name, tu2.user_status AS last_user_status, tu2.user_avatar AS last_user_avatar,\n\t\tp.forum_poll_title,\n\t\tcount(v.post_id) AS vote_count,\n\t\ta1.attach_name, a1.attach_id,\n\t\ta2.attach_name, a2.attach_id,\n\t\tcount(a1.attach_mime) 'attach_image',\n\t\tcount(a2.attach_mime) 'attach_files'\n\t\tFROM " . DB_FORUM_POSTS . " tp\n\t\tINNER JOIN " . DB_FORUMS . " tf ON tp.forum_id=tf.forum_id\n\t\tINNER JOIN " . DB_FORUM_THREADS . " t ON tp.thread_id=t.thread_id\n\t\tINNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n\t\tLEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id #issue 323\n\t\tLEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n\t\tLEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND tp.post_id = v.post_id\n\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = t.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t" . (multilang_table("FO") ? "WHERE tf.forum_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('tf.forum_access') . "\n\t\tAND t.thread_postcount='1' AND t.thread_locked='0'\n\t\tAND post_hidden='0' AND thread_hidden='0'\n\t\tGROUP BY t.thread_id\n\t\tORDER BY tp.post_datestamp DESC LIMIT " . $_GET['rowstart'] . "," . $forum_settings['posts_per_page'] . "\n\t\t");
    while ($threads = dbarray($result)) {
        // opt for moderators.
        $this->forum_info['moderators'] = \PHPFusion\Forums\Moderator::parse_forum_mods($threads['forum_mods']);
        $icon = "";
        $match_regex = $threads['thread_id'] . "\\|" . $threads['thread_lastpost'] . "\\|" . $threads['forum_id'];
        if ($threads['thread_lastpost'] > $this->forum_info['lastvisited']) {
            if (iMEMBER && ($threads['thread_lastuser'] == $userdata['user_id'] || preg_match("(^\\.{$match_regex}\$|\\.{$match_regex}\\.|\\.{$match_regex}\$)", $userdata['user_threads']))) {
                $icon = "<i class='" . get_forumIcons('thread') . "' title='" . $locale['forum_0261'] . "'></i>";
            } else {
                $icon = "<i class='" . get_forumIcons('new') . "' title='" . $locale['forum_0260'] . "'></i>";
            }
        }
        $author = array('user_id' => $threads['thread_author'], 'user_name' => $threads['author_name'], 'user_status' => $threads['author_status'], 'user_avatar' => $threads['author_avatar']);
        $lastuser = array('user_id' => $threads['thread_lastuser'], 'user_name' => $threads['last_user_name'], 'user_status' => $threads['last_user_status'], 'user_avatar' => $threads['last_user_avatar']);
        $threads += array("thread_link" => array("link" => INFUSIONS . "forum/viewthread.php?thread_id=" . $threads['thread_id'], "title" => $threads['thread_subject']), "forum_type" => $threads['forum_type'], "thread_pages" => makepagenav(0, $forum_settings['posts_per_page'], $threads['thread_postcount'], 3, FORUM . "viewthread.php?thread_id=" . $threads['thread_id'] . "&amp;"), "thread_icons" => array('lock' => $threads['thread_locked'] ? "<i class='" . get_forumIcons('lock') . "' title='" . $locale['forum_0263'] . "'></i>" : '', 'sticky' => $threads['thread_sticky'] ? "<i class='" . get_forumIcons('sticky') . "' title='" . $locale['forum_0103'] . "'></i>" : '', 'poll' => $threads['thread_poll'] ? "<i class='" . get_forumIcons('poll') . "' title='" . $locale['forum_0314'] . "'></i>" : '', 'hot' => $threads['thread_postcount'] >= 20 ? "<i class='" . get_forumIcons('hot') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'reads' => $threads['thread_views'] >= 20 ? "<i class='" . get_forumIcons('reads') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'image' => $threads['attach_image'] > 0 ? "<i class='" . get_forumIcons('image') . "' title='" . $locale['forum_0313'] . "'></i>" : '', 'file' => $threads['attach_files'] > 0 ? "<i class='" . get_forumIcons('file') . "' title='" . $locale['forum_0312'] . "'></i>" : '', 'icon' => $icon), "thread_starter" => $locale['forum_0006'] . timer($threads['post_datestamp']) . " " . $locale['by'] . " " . profile_link($author['user_id'], $author['user_name'], $author['user_status']) . "</span>", "thread_author" => $author, "thread_last" => array('avatar' => display_avatar($lastuser, '30px', '', '', ''), 'profile_link' => profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']), 'time' => $threads['post_datestamp'], 'post_message' => parseubb(parsesmileys($threads['post_message'])), "formatted" => "<div class='pull-left'>" . display_avatar($lastuser, '30px', '', '', '') . "</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='overflow-hide'>" . $locale['forum_0373'] . " <span class='forum_profile_link'>" . profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']) . "</span><br/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . timer($threads['post_datestamp']) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>"));
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:unanswered.php

示例13: author

| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
require_once THEMES . "templates/global/home.php";
require_once INCLUDES . "infusions_include.php";
include LOCALE . LOCALESET . "homepage.php";
add_to_title($locale['home']);
add_breadcrumb(array("title" => $locale['home'], "link" => BASEDIR . "home.php"));
$configs = array();
$configs[DB_NEWS] = array('select' => "SELECT\n\tns.news_id as id, ns.news_subject as title, ns.news_news as content,\n\tns.news_datestamp as datestamp, us.user_id, us.user_name,\n\tus.user_status, nc.news_cat_id as cat_id, nc.news_cat_name as cat_name,\n\tns.news_image as image,\n\tnc.news_cat_image as cat_image,\n\tcount(c1.comment_id) as comment_count,\n\tcount(r1.rating_id) as rating_count\n\tFROM " . DB_NEWS . " as ns\n\tLEFT JOIN " . DB_NEWS_CATS . " as nc ON nc.news_cat_id = ns.news_cat\n\tLEFT JOIN " . DB_COMMENTS . " as c1 on (c1.comment_item_id = ns.news_id and c1.comment_type = 'NS')\n\tLEFT JOIN " . DB_RATINGS . " as r1 on (r1.rating_item_id = ns.news_id AND r1.rating_type = 'NS')\n\tINNER JOIN " . DB_USERS . " as us ON ns.news_name = us.user_id\n\tWHERE (" . time() . " > ns.news_start OR ns.news_start = 0)\n\tAND (" . time() . " < ns.news_end OR ns.news_end = 0)\n\tAND " . groupaccess('ns.news_visibility') . " " . (multilang_table("NS") ? "AND news_language='" . LANGUAGE . "'" : "") . "\n\tgroup by ns.news_id\n\tORDER BY ns.news_datestamp DESC LIMIT 3", 'locale' => array('norecord' => $locale['home_0050'], 'blockTitle' => $locale['home_0000']), 'infSettings' => get_settings("news"), 'categoryLinkPattern' => INFUSIONS . "news/news.php?cat_id={cat_id}", 'contentLinkPattern' => INFUSIONS . "news/news.php?readmore={id}");
$configs[DB_ARTICLES] = array('select' => "SELECT\n\tar.article_id as id, ar.article_subject as title, ar.article_snippet as content,\n\tar.article_datestamp as datestamp, ac.article_cat_id as cat_id, ac.article_cat_name as cat_name,\n\tus.user_id, us.user_name, us.user_status\n\tFROM " . DB_ARTICLES . " as ar\n\tINNER JOIN " . DB_ARTICLE_CATS . " as ac ON ac.article_cat_id = ar.article_cat\n\tINNER JOIN " . DB_USERS . " as us ON us.user_id = ar.article_name\n\tWHERE " . groupaccess('ar.article_visibility') . " " . (multilang_table("AR") ? "AND ac.article_cat_language='" . LANGUAGE . "'" : "") . "\n\tORDER BY ar.article_datestamp DESC LIMIT 3", 'locale' => array('norecord' => $locale['home_0051'], 'blockTitle' => $locale['home_0001']), 'infSettings' => get_settings("article"), 'categoryLinkPattern' => INFUSIONS . "articles/articles.php?cat_id={cat_id}", 'contentLinkPattern' => INFUSIONS . "articles/articles.php?article_id={id}");
$configs[DB_BLOG] = array('select' => "SELECT\n\tbl.blog_id as id, bl.blog_subject as title, bl.blog_blog as content,\n\tbl.blog_datestamp as datestamp, us.user_id, us.user_name,\n\tus.user_status, bc.blog_cat_id as cat_id, bc.blog_cat_name as cat_name,\n\tbl.blog_image as image,\n\tbc.blog_cat_image as cat_image,\n\tcount(c1.comment_id) as comment_count,\n\tcount(r1.rating_id) as rating_count\n\tFROM " . DB_BLOG . " as bl\n\tLEFT JOIN " . DB_BLOG_CATS . " as bc ON bc.blog_cat_id = bl.blog_cat\n\tLEFT JOIN " . DB_COMMENTS . " as c1 on (c1.comment_item_id = bl.blog_id and c1.comment_type = 'BL')\n\tLEFT JOIN " . DB_RATINGS . " as r1 on (r1.rating_item_id = bl.blog_id AND r1.rating_type = 'BL')\n\tINNER JOIN " . DB_USERS . " as us ON bl.blog_name = us.user_id\n\tWHERE (" . time() . " > bl.blog_start OR bl.blog_start = 0)\n\tAND (" . time() . " < bl.blog_end OR bl.blog_end = 0)\n\tAND " . groupaccess('bl.blog_visibility') . " " . (multilang_table("BL") ? "AND blog_language='" . LANGUAGE . "'" : "") . "\n\tgroup by bl.blog_id\n\tORDER BY bl.blog_datestamp DESC LIMIT 3", 'locale' => array('norecord' => $locale['home_0052'], 'blockTitle' => $locale['home_0002']), 'infSettings' => get_settings("blog"), 'categoryLinkPattern' => INFUSIONS . "blog/blog.php?cat_id={cat_id}", 'contentLinkPattern' => INFUSIONS . "blog/blog.php?readmore={id}");
$configs[DB_DOWNLOADS] = array('select' => "SELECT\n\tdl.download_id as id, dl.download_title as title, dl.download_description_short as content,\n\tdl.download_datestamp as datestamp, dc.download_cat_id as cat_id, dc.download_cat_name as cat_name,\n\tus.user_id, us.user_name, us.user_status,\n\tdl.download_image as image,\n\tcount(c1.comment_id) as comment_count,\n\tcount(r1.rating_id) as rating_count\n\tFROM " . DB_DOWNLOADS . " dl\n\tINNER JOIN " . DB_DOWNLOAD_CATS . " dc ON dc.download_cat_id = dl.download_cat\n\tINNER JOIN " . DB_USERS . " us ON us.user_id = dl.download_user\n\tLEFT JOIN " . DB_COMMENTS . " as c1 on (c1.comment_item_id = dl.download_id and c1.comment_type = 'D')\n\tLEFT JOIN " . DB_RATINGS . " as r1 on (r1.rating_item_id = dl.download_id AND r1.rating_type = 'D')\n\tWHERE " . groupaccess('dl.download_visibility') . " " . (multilang_table("DL") ? "AND dc.download_cat_language='" . LANGUAGE . "'" : "") . "\n\tgroup by dl.download_id\n\tORDER BY dl.download_datestamp DESC LIMIT 3", 'locale' => array('norecord' => $locale['home_0053'], 'blockTitle' => $locale['home_0003']), 'infSettings' => get_settings("downloads"), 'categoryLinkPattern' => DOWNLOADS . "downloads.php?cat_id={cat_id}", 'contentLinkPattern' => DOWNLOADS . "downloads.php?cat_id={cat_id}&download_id={id}");
$contents = array();
foreach ($configs as $table => $config) {
    if (!db_exists($table)) {
        continue;
    }
    $contents[$table] = array('data' => array(), 'colwidth' => 0, 'norecord' => $config['locale']['norecord'], 'blockTitle' => $config['locale']['blockTitle'], 'infSettings' => $config['infSettings']);
    $result = dbquery($config['select']);
    $items_count = dbrows($result);
    if (!$items_count) {
        continue;
    }
    $contents[$table]['colwidth'] = floor(12 / $items_count);
    $data = array();
    $count = 1;
    while ($row = dbarray($result)) {
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:home.php

示例14: render_news

            render_news($news_subject, $news_news, $news_info);
        }
        echo "<!--sub_news_idx-->\n";
        if ($rows > $items_per_page) {
            echo "<div align='center' style=';margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], $items_per_page, $rows, 3) . "\n</div>\n";
        }
    } else {
        opentable($locale['global_077']);
        echo "<div style='text-align:center'><br />\n" . $locale['global_078'] . "<br /><br />\n</div>\n";
        closetable();
    }
} else {
    if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
        $_GET['rowstart'] = 0;
    }
    $result = dbquery("SELECT tn.*, tc.*, tu.user_id, tu.user_name, tu.user_status FROM " . DB_NEWS . " tn\n\t\tLEFT JOIN " . DB_USERS . " tu ON tn.news_name=tu.user_id\n\t\tLEFT JOIN " . DB_NEWS_CATS . " tc ON tn.news_cat=tc.news_cat_id\n\t\tWHERE " . groupaccess('news_visibility') . " AND news_id='" . $_GET['readmore'] . "' AND news_draft='0'\n\t\tLIMIT 1");
    if (dbrows($result)) {
        include INCLUDES . "comments_include.php";
        include INCLUDES . "ratings_include.php";
        $data = dbarray($result);
        if (!isset($_POST['post_comment']) && !isset($_POST['post_rating'])) {
            $result2 = dbquery("UPDATE " . DB_NEWS . " SET news_reads=news_reads+1 WHERE news_id='" . $_GET['readmore'] . "'");
            $data['news_reads']++;
        }
        $news_cat_image = "";
        $news_subject = $data['news_subject'];
        if ($data['news_image_t1'] && $settings['news_image_readmore'] == "0") {
            $img_size = @getimagesize(IMAGES_N . $data['news_image']);
            $news_cat_image = "<a href=\"javascript:;\" onclick=\"window.open('" . IMAGES_N . $data['news_image'] . "','','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=" . ($img_size[0] + 20) . ",height=" . ($img_size[1] + 20) . "')\"><img src='" . IMAGES_N_T . $data['news_image_t1'] . "' alt='" . $data['news_subject'] . "' class='news-category' /></a>";
        } elseif ($data['news_cat_image']) {
            $news_cat_image = "<a href='news_cats.php?cat_id=" . $data['news_cat'] . "'><img src='" . get_image("nc_" . $data['news_cat_name']) . "' alt='" . $data['news_cat_name'] . "' class='news-category' /></a>";
开发者ID:dioda,项目名称:phpfusion,代码行数:31,代码来源:news.php

示例15: dbquery

     $result = dbquery("SELECT thread_lastpost, thread_lastuser FROM " . DB_THREADS . " WHERE forum_id='" . $_POST['new_forum_id'] . "' AND thread_hidden='0' ORDER BY thread_lastpost DESC LIMIT 1");
     if (dbrows($result)) {
         $pdata2 = dbarray($result);
         $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_lastpost='" . $pdata2['thread_lastpost'] . "', forum_postcount=forum_postcount+" . $post_count . ", forum_threadcount=forum_threadcount+1, forum_lastuser='" . $pdata2['thread_lastuser'] . "' WHERE forum_id='" . $_POST['new_forum_id'] . "'");
     } else {
         $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_lastpost='0', forum_postcount=forum_postcount+1, forum_threadcount=forum_threadcount+" . $post_count . ", forum_lastuser='0' WHERE forum_id='" . $_POST['new_forum_id'] . "'");
     }
     echo "<div style='text-align:center'><br />\n" . $locale['452'] . "<br /><br />\n";
     echo "<a href='index.php'>" . $locale['403'] . "</a><br /><br />\n</div>\n";
 } else {
     $move_list = "";
     $sel = "";
     $result = dbquery("SELECT forum_id, forum_name FROM " . DB_FORUMS . " WHERE forum_cat='0' ORDER BY forum_order");
     if (dbrows($result) != 0) {
         while ($data = dbarray($result)) {
             $result2 = dbquery("SELECT forum_id, forum_name FROM " . DB_FORUMS . " WHERE forum_cat='" . $data['forum_id'] . "' AND forum_parent='0' AND " . groupaccess('forum_access') . " ORDER BY forum_order");
             //subforums
             if (dbrows($result2) != 0) {
                 $move_list .= "<optgroup label='" . $data['forum_name'] . "'>\n";
                 while ($data2 = dbarray($result2)) {
                     if ($_GET['forum_id'] == $data2['forum_id']) {
                         $sel = " selected";
                     } else {
                         $sel = "";
                     }
                     $move_list .= "<option value='" . $data2['forum_id'] . "'{$sel}>" . $data2['forum_name'] . "</option>\n";
                     $move_list .= forum_move_to($data2['forum_id']);
                     //subforums
                 }
                 $move_list .= "</optgroup>\n";
             }
开发者ID:keddyboys,项目名称:kmods,代码行数:31,代码来源:options.php


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