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


PHP clean_request函数代码示例

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


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

示例1: set_filterInfo

 public function set_filterInfo()
 {
     $locale = fusion_get_locale("", FORUM_LOCALE);
     $time = isset($_GET['time']) ? $_GET['time'] : '';
     $type = isset($_GET['type']) ? $_GET['type'] : '';
     $sort = isset($_GET['sort']) ? $_GET['sort'] : '';
     $order = isset($_GET['order']) ? $_GET['order'] : '';
     $timeCol = '';
     $typeCol = '';
     if ($time) {
         $time_array = array('today' => strtotime('today'), '2days' => strtotime('-2 days'), '1week' => strtotime('-1 week'), '2week' => strtotime('-2 weeks'), '1month' => strtotime('-2 months'), '2month' => strtotime('-2 months'), '3month' => strtotime('-2 months'), '6month' => strtotime('-6 months'), '1year' => strtotime('-1 year'));
         $time_stop = $time_array['today'];
         foreach ($time_array as $key => $value) {
             if ($time == $key) {
                 $time_stop = prev($time_array);
                 break;
             }
         }
         if ($time !== 'today') {
             $start_time = intval($time_array[$time]);
             $end_time = time();
             $timeCol = "AND ((p1.post_datestamp BETWEEN '{$start_time}' AND '{$end_time}') OR (t.thread_lastpost BETWEEN '{$start_time}' AND '{$end_time}'))";
         } else {
             $timeCol = "AND (p1.post_datestamp >= " . intval($time_array[$time]) . " OR t.thread_lastpost >= " . intval($time_stop) . " )";
         }
     }
     if ($type) {
         $type_array = array('all' => '', 'discussions' => "AND (a1.attach_name IS NULL or a1.attach_name='') AND (a2.attach_name IS NULL or a2.attach_name='') AND (forum_poll_title IS NULL or forum_poll_title='')", 'attachments' => "AND a1.attach_name !='' OR a2.attach_name !='' AND (forum_poll_title IS NULL or forum_poll_title='')", 'poll' => "AND (a1.attach_name IS NULL or a1.attach_name='') AND (a2.attach_name IS NULL or a2.attach_name='') AND forum_poll_title !=''", 'solved' => "AND t.thread_answered = '1'", 'unsolved' => "AND t.thread_answered = '0'");
         $typeCol = $type_array[$type];
     }
     $sortCol = "ORDER BY t.thread_lastpost ";
     $orderCol = 'DESC';
     if ($sort) {
         $sort_array = array('author' => 't.thread_author', 'time' => 't.thread_lastpost', 'subject' => 't.thread_subject', 'reply' => 't.thread_postcount', 'view' => 't.thread_views');
         $sortCol = "ORDER BY " . $sort_array[$sort] . " ";
     }
     if ($order) {
         $order_array = array('ascending' => 'ASC', 'descending' => 'DESC');
         $orderCol = $order_array[$order];
     }
     $this->filter_sql = array('condition' => $timeCol . $typeCol, 'order' => $sortCol . $orderCol);
     // Filter Links
     $timeExt = isset($_GET['time']) ? "&time=" . $time : '';
     $typeExt = isset($_GET['type']) ? "&type=" . $type : '';
     $sortExt = isset($_GET['sort']) ? "&sort=" . $sort : '';
     $orderExt = isset($_GET['order']) ? "&order=" . $order : '';
     $baseLink = clean_request("", array("time", "type", "sort", "order"), FALSE);
     if (isset($_GET['viewforum']) && isset($_GET['forum_id'])) {
         $baseLink = INFUSIONS . 'forum/index.php?viewforum&forum_id=' . $_GET['forum_id'] . '' . (isset($_GET['parent_id']) ? '&parent_id=' . $_GET['parent_id'] . '' : '');
     }
     $timeLink = $baseLink . $typeExt . $sortExt . $orderExt;
     $this->filter_info['time'] = array($locale['forum_3006'] => $baseLink, $locale['forum_3007'] => $timeLink . '&time=today', $locale['forum_3008'] => $timeLink . '&time=2days', $locale['forum_3009'] => $timeLink . '&time=1week', $locale['forum_3010'] => $timeLink . '&time=2week', $locale['forum_3011'] => $timeLink . '&time=1month', $locale['forum_3012'] => $timeLink . '&time=2month', $locale['forum_3013'] => $timeLink . '&time=3month', $locale['forum_3014'] => $timeLink . '&time=6month', $locale['forum_3015'] => $timeLink . '&time=1year');
     $typeLink = $baseLink . $timeExt . $sortExt . $orderExt;
     $this->filter_info['type'] = array($locale['forum_3000'] => $typeLink . '&type=all', $locale['forum_3001'] => $typeLink . '&type=discussions', $locale['forum_3002'] => $typeLink . '&type=attachments', $locale['forum_3003'] => $typeLink . '&type=poll', $locale['forum_3004'] => $typeLink . '&type=solved', $locale['forum_3005'] => $typeLink . '&type=unsolved');
     $sortLink = $baseLink . $timeExt . $typeExt . $orderExt;
     $this->filter_info['sort'] = array($locale['forum_3016'] => $sortLink . '&sort=author', $locale['forum_3017'] => $sortLink . '&sort=time', $locale['forum_3018'] => $sortLink . '&sort=subject', $locale['forum_3019'] => $sortLink . '&sort=reply', $locale['forum_3020'] => $sortLink . '&sort=view');
     $orderLink = $baseLink . $timeExt . $typeExt . $sortExt;
     $this->filter_info['order'] = array($locale['forum_3021'] => $orderLink . '&order=descending', $locale['forum_3022'] => $orderLink . '&order=ascending');
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:59,代码来源:filter.php

示例2: display_thread

 public function display_thread()
 {
     $info = $this->thread()->get_threadInfo();
     if (isset($_GET['action'])) {
         $poll = new Poll($info);
         switch ($_GET['action']) {
             case 'editpoll':
                 $poll->render_poll_form(true);
                 break;
             case 'deletepoll':
                 $poll->delete_poll();
                 break;
             case 'newpoll':
                 $poll->render_poll_form();
                 break;
             case 'edit':
                 $this->render_edit_form();
                 break;
             case 'reply':
                 $this->render_reply_form();
                 break;
             default:
                 redirect(clean_request('', array('action'), false));
         }
     } else {
         $response = self::check_download_request();
         if ($response == true) {
             redirect(clean_request("", array("getfile"), false));
         }
         // +1 threadviews
         $this->increment_thread_views($info['thread']['thread_id']);
         // +1 see who is viewing thread
         $this->thread()->set_thread_visitor();
         if ($info['thread']['forum_users'] == true) {
             $info['thread_users'] = $this->get_participated_users($info);
         }
         render_thread($info);
     }
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:39,代码来源:view.php

示例3: display_news_category

/**
 * Recursive function to display administration table
 * @param     $data
 * @param int $id
 */
function display_news_category($data, $id = 0)
{
    $locale = fusion_get_locale();
    if (!$id) {
        ?>
        <table class="table table-responsive table-striped">
        <thead>
        <tr>
            <th></th>
            <th class="col-xs-4">Category Name</th>
            <th>Image</th>
            <th>News Status</th>
            <th>Draft</th>
            <th>Sticky</th>
            <th>Visibility</th>
            <th>Language</th>
            <th>Actions</th>
            <th>ID</th>
        </tr>
        </thead>
        <tbody>
    <?php 
    }
    ?>

    <?php 
    if (!empty($data[$id])) {
        ?>

        <?php 
        foreach ($data[$id] as $cat_id => $cdata) {
            $edit_link = clean_request("section=news_category&ref=news_cat_form&action=edit&cat_id=" . $cat_id, array("section", "ref", "action", "cat_id"), FALSE);
            $delete_link = clean_request("section=news_category&ref=news_cat_form&action=delete&cat_id=" . $cat_id, array("section", "ref", "action", "cat_id"), FALSE);
            ?>
            <tr>
                <td><?php 
            echo form_checkbox("news_cat_id[]", "", "", array("value" => $cat_id, "class" => "m-b-0"));
            ?>
</td>
                <td>
                    <a class="text-dark" href="<?php 
            echo $edit_link;
            ?>
">
                        <?php 
            echo $cdata['news_cat_name'];
            ?>
                    </a>
                </td>
                <td>
                    <img style="width:50px" src="<?php 
            echo get_image("nc_" . $cdata['news_cat_name']);
            ?>
"
                         alt="<?php 
            echo $cdata['news_cat_name'];
            ?>
"/>
                </td>
                <td>
                    <span class="badge"><?php 
            echo $cdata['news_published'];
            ?>
 published</span>
                    <span class="label label-default m-r-10"><i
                            class="fa fa-star fa-fw"></i> <?php 
            echo $cdata['news_draft'];
            ?>
 </span>
                    <span class="label label-warning"><i
                            class="fa fa-sticky-note-o fa-fw"></i> <?php 
            echo $cdata['news_sticky'];
            ?>
 </span>
                </td>
                <td><span class="badge"><?php 
            echo $cdata['news_cat_draft'] ? $locale['yes'] : $locale['no'];
            ?>
</span>
                </td>
                <td><span class="badge"><?php 
            echo $cdata['news_cat_sticky'] ? $locale['yes'] : $locale['no'];
            ?>
</span>
                </td>
                <td><span class="badge"><?php 
            echo getgroupname($cdata['news_cat_visibility']);
            ?>
</span></td>
                <td><?php 
            echo $cdata['news_cat_language'];
            ?>
</td>
                <td>
                    <div class="btn-group">
//.........这里部分代码省略.........
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:101,代码来源:news_cat.php

示例4: die

                    } else {
                        if ($mime_types[$extension] != $each['type']) {
                            die('Prevented an unwanted file upload attempt!');
                        }
                    }
                }
                unset($file_info, $extension);
            }
        }
        unset($mime_types);
    }
}
$defender = new defender();
// Set admin login procedures
Authenticate::setAdminLogin();
$defender->debug_notice = FALSE;
// turn this off after beta.
$defender->sniff_token();
$dynamic = new dynamics();
$dynamic->boot();
$fusion_page_head_tags =& \PHPFusion\OutputHandler::$pageHeadTags;
$fusion_page_footer_tags =& \PHPFusion\OutputHandler::$pageFooterTags;
$fusion_jquery_tags =& \PHPFusion\OutputHandler::$jqueryTags;
// Set theme using $_GET as well.
// Set theme
if ($userdata['user_level'] == USER_LEVEL_SUPER_ADMIN && isset($_GET['themes']) && theme_exists($_GET['themes'])) {
    $newUserTheme = array("user_id" => $userdata['user_id'], "user_theme" => stripinput($_GET['themes']));
    dbquery_insert(DB_USERS, $newUserTheme, "update");
    redirect(clean_request("", array("themes"), FALSE));
}
set_theme(empty($userdata['user_theme']) ? fusion_get_settings("theme") : $userdata['user_theme']);
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:maincore.php

示例5: form_button

                echo form_button('preview', $locale['articles_0240'], $locale['articles_0240'], array('class' => 'btn-default m-r-10'));
                echo form_button('publish', $locale['articles_0242'], $locale['articles_0242'], array('class' => 'btn-primary m-r-10'));
                echo form_button('delete', $locale['articles_0243'], $locale['articles_0243'], array('class' => 'btn-warning m-r-10'));
                echo closeform();
            }
        }
    }
} else {
    $result = dbquery("SELECT\n\t\t\tts.submit_id, ts.submit_datestamp, ts.submit_criteria, tu.user_id, tu.user_name, tu.user_avatar, tu.user_status\n\t\t\tFROM " . DB_SUBMISSIONS . " ts\n\t\t\tLEFT JOIN " . DB_USERS . " tu ON ts.submit_user=tu.user_id\n\t\t\tWHERE submit_type='a' order by submit_datestamp desc\n\t\t\t");
    $rows = dbrows($result);
    if ($rows > 0) {
        echo "<div class='well'>" . sprintf($locale['articles_0044'], format_word($rows, $locale['fmt_submission'])) . "</div>\n";
        echo "<table class='table table-striped'>\n";
        echo "<tr>\n";
        echo "<th>" . $locale['articles_0041'] . "</th>\n<th>" . $locale['articles_0046'] . "</th><th>" . $locale['articles_0047'] . "</th><th>" . $locale['articles_0048'] . "</th>";
        echo "</tr>\n";
        echo "<tbody>\n";
        while ($data = dbarray($result)) {
            $submit_criteria = unserialize($data['submit_criteria']);
            echo "<tr>\n";
            echo "<td><a href='" . clean_request("submit_id=" . $data['submit_id'], array("section", "aid"), TRUE) . "'>" . $submit_criteria['article_subject'] . "</a></td>\n";
            echo "<td>" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "</td>\n";
            echo "<td>" . timer($data['submit_datestamp']) . "</td>\n";
            echo "<td>" . $data['submit_id'] . "</td>\n";
            echo "</tr>\n";
        }
        echo "</tbody>\n</table>\n";
    } else {
        echo "<div class='well text-center m-t-20'>" . $locale['articles_0042'] . "</div>\n";
    }
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:article_submissions.php

示例6: showcomments


//.........这里部分代码省略.........
                    $c_start = 0;
                }
                //if (!$settings['site_seo']) {
                redirect($clink . "&amp;c_start=" . $c_start . "#c" . $id);
                //}
            }
        }
        $c_arr = array("c_con" => array(), "c_info" => array("c_makepagenav" => FALSE, "admin_link" => FALSE));
        $c_rows = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $comment_item_id . "' AND comment_type='" . $comment_type . "' AND comment_hidden='0'");
        if (!isset($_GET['c_start']) && $c_rows > $cpp) {
            $_GET['c_start'] = (ceil($c_rows / $cpp) - 1) * $cpp;
        }
        if (!isset($_GET['c_start']) || !isnum($_GET['c_start'])) {
            $_GET['c_start'] = 0;
        }
        $result = dbquery("SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcm.comment_datestamp,\n\t\t\t\t\ttcu.user_id, tcu.user_name, tcu.user_avatar, tcu.user_status\n\t\t\t\t\tFROM " . DB_COMMENTS . " tcm\n\t\t\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\t\t\t\tWHERE comment_item_id='" . $comment_item_id . "' AND comment_type='" . $comment_type . "' AND comment_hidden='0'\n\t\t\t\t\tORDER BY comment_datestamp " . $settings['comments_sorting'] . " LIMIT " . $_GET['c_start'] . "," . $cpp);
        if (dbrows($result) > 0) {
            $i = $settings['comments_sorting'] == "ASC" ? $_GET['c_start'] + 1 : $c_rows - $_GET['c_start'];
            if ($c_rows > $cpp) {
                $c_arr['c_info']['c_makepagenav'] = makepagenav($_GET['c_start'], $cpp, $c_rows, 3, $clink . "&amp;", "c_start");
            }
            while ($data = dbarray($result)) {
                $c_arr['c_con'][$i]['comment_id'] = $data['comment_id'];
                $c_arr['c_con'][$i]['edit_dell'] = FALSE;
                $c_arr['c_con'][$i]['i'] = $i;
                if ($data['user_name']) {
                    $c_arr['c_con'][$i]['comment_name'] = profile_link($data['comment_name'], $data['user_name'], $data['user_status'], 'strong text-dark');
                } else {
                    $c_arr['c_con'][$i]['comment_name'] = $data['comment_name'];
                }
                $c_arr['c_con'][$i]['user_avatar'] = display_avatar($data, '35px', '', true, 'img-rounded');
                $c_arr['c_con'][$i]['user'] = array('user_id' => $data['user_id'], 'user_name' => $data['user_name'], 'user_avatar' => $avatar = $data['user_avatar'] !== '' && file_exists(IMAGES . 'avatars/' . $data['user_avatar']) ? IMAGES . 'avatars/' . $data['user_avatar'] : IMAGES . "avatars/noavatar50.png", 'user_status' => $data['user_status']);
                $c_arr['c_con'][$i]['comment_datestamp'] = showdate('shortdate', $data['comment_datestamp']);
                $c_arr['c_con'][$i]['comment_time'] = timer($data['comment_datestamp']);
                $c_arr['c_con'][$i]['comment_message'] = "<!--comment_message-->\n" . nl2br(parseubb(parsesmileys($data['comment_message'])));
                if (iADMIN && checkrights("C") || iMEMBER && $data['comment_name'] == $userdata['user_id'] && isset($data['user_name'])) {
                    $edit_link = clean_request('c_action=edit&comment_id=' . $data['comment_id'], array('c_action', 'comment_id'), false) . "#edit_comment";
                    $delete_link = clean_request('c_action=delete&comment_id=' . $data['comment_id'], array('c_action', 'comment_id'), false);
                    $c_arr['c_con'][$i]['edit_link'] = array('link' => $edit_link, 'name' => $locale['c108']);
                    $c_arr['c_con'][$i]['delete_link'] = array('link' => $delete_link, 'name' => $locale['c109']);
                    $c_arr['c_con'][$i]['edit_dell'] = "<!--comment_actions-->\n";
                    $c_arr['c_con'][$i]['edit_dell'] .= "<div class='btn-group'>";
                    $c_arr['c_con'][$i]['edit_dell'] .= "<a class='btn btn-xs btn-default' href='" . $edit_link . "'>";
                    $c_arr['c_con'][$i]['edit_dell'] .= $locale['c108'] . "</a>\n";
                    $c_arr['c_con'][$i]['edit_dell'] .= "<a class='btn btn-xs btn-default' href='" . $delete_link . "' onclick=\"return confirm('" . $locale['c110'] . "');\">";
                    $c_arr['c_con'][$i]['edit_dell'] .= "<i class='fa fa-trash'></i> " . $locale['c109'] . "</a>";
                    $c_arr['c_con'][$i]['edit_dell'] .= "</div>\n";
                }
                $settings['comments_sorting'] == "ASC" ? $i++ : $i--;
            }
            if (iADMIN && checkrights("C")) {
                $c_arr['c_info']['admin_link'] = "<!--comment_admin-->\n";
                $c_arr['c_info']['admin_link'] .= "<a href='" . ADMIN . "comments.php" . $aidlink . "&amp;ctype=" . $comment_type . "&amp;comment_item_id=" . $comment_item_id . "'>" . $locale['c106'] . "</a>";
            }
        }
        opentable($locale['c102']);
        $comment_message = "";
        if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
            $eresult = dbquery("SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcu.user_name\n\t\t\t\tFROM " . DB_COMMENTS . " tcm\n\t\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "' AND comment_item_id='" . $comment_item_id . "'\n\t\t\t\tAND comment_type='" . $comment_type . "' AND comment_hidden='0'");
            if (dbrows($eresult) > 0) {
                $edata = dbarray($eresult);
                if (iADMIN && checkrights("C") || iMEMBER && $edata['comment_name'] == $userdata['user_id'] && isset($edata['user_name'])) {
                    $clink .= "&amp;c_action=edit&amp;comment_id=" . $edata['comment_id'];
                    $comment_message = $edata['comment_message'];
                }
            } else {
                $comment_message = "";
            }
        }
        if (iMEMBER || $settings['guestposts'] == "1") {
            require_once INCLUDES . "bbcode_include.php";
            echo "<a id='edit_comment' name='edit_comment'></a>\n";
            echo openform('inputform', 'post', $clink, array('class' => 'm-b-20', 'max_tokens' => 1));
            if (iGUEST) {
                echo form_text('comment_name', $locale['c104'], '', array('max_length' => 30));
            }
            echo form_textarea('comment_message', '', $comment_message, array('required' => 1, 'autosize' => 1, 'form_name' => 'inputform', 'bbcode' => 1));
            if (iGUEST && (!isset($_CAPTCHA_HIDE_INPUT) || isset($_CAPTCHA_HIDE_INPUT) && !$_CAPTCHA_HIDE_INPUT)) {
                $_CAPTCHA_HIDE_INPUT = FALSE;
                echo "<div style='width:360px; margin:10px auto;'>";
                echo $locale['global_150'] . "<br />\n";
                include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_display.php";
                if (!$_CAPTCHA_HIDE_INPUT) {
                    echo "<br />\n<label for='captcha_code'>" . $locale['global_151'] . "</label>";
                    echo "<br />\n<input type='text' id='captcha_code' name='captcha_code' class='textbox' autocomplete='off' style='width:100px' />\n";
                }
                echo "</div>\n";
            }
            echo form_button('post_comment', $comment_message ? $locale['c103'] : $locale['c102'], $comment_message ? $locale['c103'] : $locale['c102'], array('class' => 'btn-success m-t-10'));
            echo closeform();
        } else {
            echo "<div class='well'>\n";
            echo $locale['c105'] . "\n";
            echo "</div>\n";
        }
        closetable();
        echo "<a id='comments' name='comments'></a>";
        render_comments($c_arr['c_con'], $c_arr['c_info']);
    }
}
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:101,代码来源:comments_include.php

示例7: render_admin_panel

function render_admin_panel()
{
    global $locale, $userdata, $defender, $pages, $aidlink, $admin;
    $languages = fusion_get_enabled_languages();
    // Admin panel page
    echo "<div id='admin-panel' class='clearfix in'>\n";
    // Top header section
    echo "<section id='acp-header' class='pull-left affix clearfix' data-offset-top='0' data-offset-bottom='0'>\n";
    // Top left logo
    echo "<div class='brand'>\n";
    echo "<div class='pull-right'>\n";
    echo "</div>\n</div>\n";
    // Top navigation
    echo "<nav>\n";
    // Top side panel toggler
    echo "<ul class='venus-toggler'>\n";
    echo "<li><a id='toggle-canvas' class='pointer' style='border-left:none;'><i class='fa fa-bars fa-lg'></i></a></li>\n";
    echo "</ul>\n";
    echo $admin->horiziontal_admin_nav(true);
    // Top right menu links
    echo "<ul class='top-right-menu pull-right m-r-15'>\n";
    echo "<li class='dropdown'>\n";
    echo "<a class='dropdown-toggle pointer' data-toggle='dropdown'>" . display_avatar($userdata, '25px', '', '', '') . " " . $locale['logged'] . "<strong>" . $userdata['user_name'] . "</strong> <span class='caret'></span>\n</a>\n";
    echo "<ul class='dropdown-menu' role='menu'>\n";
    echo "<li><a class='display-block' href='" . BASEDIR . "edit_profile.php'>" . $locale['edit'] . " " . $locale['profile'] . "</a></li>\n";
    echo "<li><a class='display-block' href='" . BASEDIR . "profile.php?lookup=" . $userdata['user_id'] . "'>" . $locale['view'] . " " . $locale['profile'] . "</a></li>\n";
    echo "<li class='divider'> </li>\n";
    echo "<li><a class='display-block' href='" . FUSION_REQUEST . "&amp;logout'>" . $locale['admin-logout'] . "</a></li>\n";
    echo "<li><a class='display-block' href='" . BASEDIR . "index.php?logout=yes'>" . $locale['logout'] . "</a></li>\n";
    echo "</ul>\n";
    echo "</li>\n";
    echo "<li><a title='" . $locale['settings'] . "' href='" . ADMIN . "settings_main.php" . $aidlink . "'><i class='fa fa-cog fa-lg'></i></a></li>\n";
    echo "<li><a title='" . fusion_get_settings('sitename') . "' href='" . BASEDIR . "index.php'><i class='fa fa-home fa-lg'></i></a>\n</li>\n";
    echo "<li><a title='" . $locale['message'] . "' href='" . BASEDIR . "messages.php'><i class='fa fa-envelope-o fa-lg'></i></a>\n</li>\n";
    if (count($languages) > 1) {
        echo "<li class='dropdown'><a class='dropdown-toggle pointer' data-toggle='dropdown' title='" . $locale['282'] . "'><i class='fa fa-globe fa-lg fa-fw'></i> " . translate_lang_names(LANGUAGE) . "<span class='caret'></span></a>\n";
        echo "<ul class='dropdown-menu'>\n";
        foreach ($languages as $language_folder => $language_name) {
            echo "<li><a class='display-block' href='" . clean_request("lang=" . $language_folder, array("lang"), FALSE) . "'><img class='m-r-5' src='" . BASEDIR . "locale/{$language_folder}/{$language_folder}-s.png'> {$language_name}</a></li>\n";
        }
        echo "</ul>\n";
        echo "</li>\n";
    }
    echo "</ul>\n";
    // .top-right-menu
    echo "</nav>\n";
    echo "</section>\n";
    // Content section
    echo "<div class='content-wrapper display-table pull-left'>\n";
    // Left side panel
    echo "<div id='acp-left' class='pull-left affix' data-offset-top='0' data-offset-bottom='0'>\n";
    // collapse to top menu on sm and xs
    echo "<div class='panel panel-default admin'><div class='panel-body clearfix'>\n";
    echo "<div class='pull-left m-r-10'>\n" . display_avatar($userdata, '50px', '', '', '') . "</div>\n";
    echo "<span class='overflow-hide m-t-10'><h4 class='m-b-0 text-stronger'>\n" . $userdata['user_name'] . "</h4>\n" . getuserlevel($userdata['user_level']) . "</span></div>\n";
    echo "</div>\n";
    echo $admin->vertical_admin_nav();
    echo "</div>\n";
    // #acp-left
    // Control panel content wrapper
    echo "<div id='acp-main' class='clearfix' style='vertical-align:top;'>\n";
    // Main content wrapper
    echo "<div id='acp-content' class='m-t-20 col-xs-12 col-sm-12 col-md-12 col-lg-12'>\n";
    // Render breadcrumbs
    echo render_breadcrumbs();
    // Get and render notices
    $notices = getNotices();
    echo renderNotices($notices);
    // Render the content
    echo CONTENT;
    echo "</div>\n";
    // #acp-content
    // Footer section
    echo "<footer class='m-l-20 display-inline-block m-t-20 m-b-20'>\n";
    // Copyright
    echo "Venus Admin &copy; " . date("Y") . " created by <a href='https://www.php-fusion.co.uk'><strong>PHP-Fusion Inc.</strong></a>\n";
    echo showcopyright();
    // Render time
    if (fusion_get_settings('rendertime_enabled')) {
        echo "<br /><br />";
        // Make showing of queries and memory usage separate settings
        echo showrendertime();
        echo showMemoryUsage();
    }
    echo "</footer>\n";
    echo "</div>\n";
    // .acp-main
    echo "</div>\n";
    // .content-wrapper
    echo "</div>\n";
    // #admin-panel
    add_to_footer("<script src='" . THEMES . "admin_themes/Venus/includes/jquery.slimscroll.min.js'></script>");
    if (!isset($_COOKIE['acp_sidemenu'])) {
        setcookie("acp_sidemenu", 1, 64800);
    }
    add_to_jquery("\n\t// Initialize slimscroll\n\t\$('#adl').slimScroll({\n\t\theight: null\n\t});\n\n\t// Function to toggle side menu\n\tfunction toggleSideMenu(state) {\n\t\tvar panel_state = null;\n\t\tif (state == 'show') {\n\t\t\t\$('#admin-panel').addClass('in');\n\t\t\tvar panel_state = 1;\n\t\t} else if (state == 'hide') {\n\t\t\t\$('#admin-panel').removeClass('in');\n\t\t\tvar panel_state = 0;\n\t\t} else {\n\t\t\t\$('#admin-panel').toggleClass('in');\n\t\t\tvar panel_state = \$('#admin-panel').hasClass('in');\n\t\t}\n\t\tif (panel_state) {\n\t\t\t\$.cookie('" . COOKIE_PREFIX . "acp_sidemenu', '1', {expires: 164800});\n\t\t} else {\n\t\t\t\$.cookie('" . COOKIE_PREFIX . "acp_sidemenu', '0', {expires: 164800});\n\t\t}\n\t}\n\n\t// Adjust side menu height on page load, resize or orientation change\n\t\$(window).on('load resize orientationchange', function(event) {\n\t\tvar init_hgt = \$(window).height();\n\t\tvar small = \$('.brand-text').is(':visible');\n\t\tvar panel_height = (small ? init_hgt-125 : init_hgt-80);\n\t\tvar hgt = \$(this).height();\n\t\t\$('#acp-left').css('height', hgt);\n\t\t\$('.admin-vertical-link').css('height', panel_height);\n\t\t// Hide side menu on orientation change\n\t\t//if (event.type === 'orientationchange') {\n\t\t//\ttoggleSideMenu('show');\n\t\t//}\n\t});\n\t// Side menu toggler\n\t\$('#toggle-canvas').on('click', toggleSideMenu);\n\t");
}
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:97,代码来源:acp_theme.php

示例8: redirect

        redirect(FUSION_SELF . $aidlink . "&amp;show_faq=" . $data['faq_cat_id'] . "&amp;faq_start=" . $faq_start);
    }
}
$cat_opts = array();
$result2 = dbquery("SELECT faq_cat_id, faq_cat_name, faq_cat_language\n\tFROM " . DB_FAQ_CATS . " " . (multilang_table("FQ") ? "WHERE faq_cat_language='" . LANGUAGE . "'" : "") . " ORDER BY faq_cat_name");
if (dbrows($result2) != 0) {
    while ($data2 = dbarray($result2)) {
        $cat_opts[$data2['faq_cat_id']] = $data2['faq_cat_name'];
    }
    echo openform('inputform', 'post', FUSION_REQUEST, array("class" => "m-t-20"));
    echo "<div class='row'>\n";
    echo "<div class='col-xs-12 col-sm-8'>\n";
    openside("");
    echo form_hidden("faq_id", "", $data['faq_id']);
    echo form_text('faq_question', $locale['faq_0301'], $data['faq_question'], array('required' => TRUE));
    echo form_textarea('faq_answer', $locale['faq_0302'], $data['faq_answer'], $fusion_mce);
    closeside();
    echo "</div>\n";
    echo "<div class='col-xs-12 col-sm-4'>\n";
    openside("");
    echo form_select("faq_cat_id", $locale['faq_0300'], $data['faq_cat_id'], array('options' => $cat_opts, "width" => "100%"));
    closeside();
    echo "</div>\n";
    echo "</div>\n";
    echo form_button('save_faq', $locale['faq_0303'], $locale['faq_0303'], array('class' => 'btn-primary m-t-10'));
    echo closeform();
} else {
    echo "<div class='well text-center m-t-20'>\n";
    echo str_replace(array("[LINK]", "[/LINK]"), array("<a href='" . clean_request("section=faq-category", array("aid"), TRUE) . "'>", "</a>"), $locale['faq_0304']);
    echo "</div>\n";
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:faqs.php

示例9: array_push

            if (!$tin[$id]) {
                array_push($tab, $req);
                $tin[$id] = 1;
            }
        }
    }
    return $tab;
}
if (!$_REQUEST['node_id']) {
    exit(1);
}
$matches = null;
if (!preg_match("/^([\\d]{1,5},?){1,20}\$/", $_REQUEST['node_id'], $matches)) {
    exit(1);
}
$tab = clean_request($_REQUEST['node_id']);
if (!$tab) {
    print "Empty tab<br>";
    exit(1);
}
ShoCKDB_db::$db_backend = 'sqlite';
ShoCKDB_db::$db_path = 'data/feedNodi.sl3';
$db = new ShoCKDB_db();
if (!$db->open()) {
    print "Impossible d'ouvrir la db!<br>";
    exit(1);
}
header('Content-Type: application/json');
$res = new ShoCKDB_response($db);
for ($i = 0; $i < sizeof($tab); $i++) {
    //print "id: " . $tab[$i] . "<br>";
开发者ID:showi,项目名称:prog,代码行数:31,代码来源:index.php

示例10: breadcrumb_page_arrays

 function breadcrumb_page_arrays($tree_index, $tree_full, $id_col, $title_col, $getname, $id)
 {
     $crumb =& $crumb;
     if (isset($tree_index[get_parent($tree_index, $id)])) {
         $_name = get_parent_array($tree_full, $id);
         $crumb = array('link' => isset($_name[$id_col]) ? clean_request($getname . "=" . $_name[$id_col], array("aid"), TRUE) : "", 'title' => isset($_name[$title_col]) ? \PHPFusion\QuantumFields::parse_label($_name[$title_col]) : "");
         if (get_parent($tree_index, $id) == 0) {
             return $crumb;
         }
         $crumb_1 = breadcrumb_page_arrays($tree_index, $tree_full, $id_col, $title_col, $getname, get_parent($tree_index, $id));
         if (!empty($crumb_1)) {
             $crumb = array_merge_recursive($crumb, $crumb_1);
         }
     }
     return $crumb;
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:16,代码来源:core_functions_include.php

示例11: set_ForumInfo


//.........这里部分代码省略.........
                             break;
                         case '4':
                             $forum_icon = "<i class='" . Functions::get_forumIcons('question') . " fa-fw m-r-10'></i>";
                             $forum_icon_lg = "<i class='" . Functions::get_forumIcons('question') . " fa-3x fa-fw m-r-10'></i>";
                             break;
                         default:
                             $forum_icon = "";
                             $forum_icon_lg = "";
                     }
                     $row += array("forum_moderators" => Functions::parse_forumMods($row['forum_mods']), "forum_new_status" => $newStatus, "forum_link" => array("link" => INFUSIONS . "forum/index.php?viewforum&amp;forum_id=" . $row['forum_id'] . "&amp;parent_id=" . $row['forum_cat'], "title" => $row['forum_name']), "forum_description" => nl2br(parseubb($row['forum_description'])), "forum_postcount_word" => format_word($row['forum_postcount'], $locale['fmt_post']), "forum_threadcount_word" => format_word($row['forum_threadcount'], $locale['fmt_thread']), "last_post" => $lastPostInfo, "forum_icon" => $forum_icon, "forum_icon_lg" => $forum_icon_lg, "forum_image" => $row['forum_image'] && file_exists(FORUM . "images/" . $row['forum_image']) ? $row['forum_image'] : "");
                     $this->forum_info['forum_moderators'] = $row['forum_moderators'];
                     // child hierarchy data.
                     $thisref =& $refs[$row['forum_id']];
                     $thisref = $row;
                     if ($row['forum_cat'] == $this->forum_info['parent_id']) {
                         $this->forum_info['item'][$row['forum_id']] =& $thisref;
                         // will push main item out.
                     } else {
                         $refs[$row['forum_cat']]['child'][$row['forum_id']] =& $thisref;
                     }
                     /**
                      * The current forum
                      */
                     if ($row['forum_id'] == $this->forum_info['forum_id']) {
                         require_once INCLUDES . "mimetypes_include.php";
                         define_forum_mods($row);
                         // do the full string of checks for forums access
                         $this->setForumPermission($row);
                         // Generate Links
                         if ($this->getForumPermission("can_post")) {
                             $this->forum_info['new_thread_link'] = INFUSIONS . "forum/newthread.php?forum_id=" . $row['forum_id'];
                         }
                         /**
                          * Get threads with filter conditions
                          */
                         //xss
                         $count = dbarray(dbquery("SELECT\n\t\t\t\t\t\t\t\tcount(t.thread_id) 'thread_max_rows',\n\t\t\t\t\t\t\t\tcount(a1.attach_id) 'attach_image',\n\t\t\t\t\t\t\t\tcount(a2.attach_id) 'attach_files'\n\n\t\t\t\t\t\t\t\tFROM " . DB_FORUM_THREADS . " t\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUMS . " tf ON tf.forum_id = t.forum_id\n\t\t\t\t\t\t\t\tINNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id #issue 323\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_POSTS . " p1 ON p1.thread_id = t.thread_id and p1.post_id = t.thread_lastpostid\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND p1.post_id = v.post_id\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t\t\t\t\t\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\t\t\t\t\t\tWHERE t.forum_id='" . $this->forum_info['forum_id'] . "' AND t.thread_hidden='0' AND " . groupaccess('tf.forum_access') . " {$sql_condition}\n\t\t\t\t\t\t\t\t##GROUP BY t.thread_id {$sql_order}\n\t\t\t\t\t\t"));
                         $this->forum_info['thread_max_rows'] = $count['thread_max_rows'];
                         if ($this->forum_info['thread_max_rows'] > 0) {
                             $this->forum_info['threads']['pagenav'] = "";
                             $this->forum_info['threads']['pagenav2'] = "";
                             // anti-XSS filtered rowstart
                             $_GET['thread_rowstart'] = isset($_GET['thread_rowstart']) && isnum($_GET['thread_rowstart']) && $_GET['thread_rowstart'] <= $this->forum_info['thread_max_rows'] ? $_GET['thread_rowstart'] : 0;
                             $t_result = dbquery("\n                                SELECT t.*, tu1.user_name AS author_name, tu1.user_status AS author_status, tu1.user_avatar as author_avatar,\n\t\t\t\t\t\t\t\ttu2.user_name AS last_user_name, tu2.user_status AS last_user_status, tu2.user_avatar AS last_user_avatar,\n\t\t\t\t\t\t\t\tp1.post_datestamp, p1.post_message,\n\t\t\t\t\t\t\t\tp.forum_poll_title,\n\t\t\t\t\t\t\t\tcount(v.post_id) AS vote_count,\n\t\t\t\t\t\t\t\ta1.attach_name, a1.attach_id,\n\t\t\t\t\t\t\t\ta2.attach_name, a2.attach_id,\n\t\t\t\t\t\t\t\tcount(a1.attach_mime) 'attach_image',\n\t\t\t\t\t\t\t\tcount(a2.attach_mime) 'attach_files'\n\t\t\t\t\t\t\t\tFROM " . DB_FORUM_THREADS . " t\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUMS . " tf ON tf.forum_id = t.forum_id\n\t\t\t\t\t\t\t\tINNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id #issue 323\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_POSTS . " p1 ON p1.thread_id = t.thread_id and p1.post_id = t.thread_lastpostid\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND p1.post_id = v.post_id\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t\t\t\t\t\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\t\t\t\t\t\tWHERE t.forum_id='" . $this->forum_info['forum_id'] . "' AND t.thread_hidden='0' AND " . groupaccess('tf.forum_access') . " {$sql_condition}\n\t\t\t\t\t\t\t\tGROUP BY t.thread_id {$sql_order} LIMIT " . intval($_GET['thread_rowstart']) . ", " . $this->forum_info['threads_per_page']);
                             $thread_rows = dbrows($t_result);
                             if ($thread_rows > 0) {
                                 while ($threads = dbarray($t_result)) {
                                     $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" => $row['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>"));
                                     //if ($threads['thread_status']['reads']) $threads['thread_status']['icon'] = $threads['thread_status']['reads'];
                                     //if ($threads['thread_status']['hot']) $threads['thread_status']['icon'] = $threads['thread_status']['hot'];
                                     //if ($threads['thread_status']['sticky']) $threads['thread_status']['icon'] = $threads['thread_status']['sticky'];
                                     //if ($threads['thread_status']['lock']) $threads['thread_status']['icon'] = $threads['thread_status']['lock'];
                                     // Threads Customized Output
                                     /*
                                     										$attach_image = 0;
                                     										$attach_file = 0;
                                     										$a_result = dbquery("SELECT attach_id, attach_mime FROM ".DB_FORUM_ATTACHMENTS." WHERE thread_id ='".$threads['thread_id']."'");
                                     										if (dbrows($a_result) > 0) {
                                     											require_once INCLUDES."mimetypes_include.php";
                                     											while ($adata = dbarray($a_result)) {
                                     												if (in_array($adata['attach_mime'], img_mimeTypes())) {
                                     													$attach_image = $attach_image+1;
                                     												} else {
                                     													$attach_file = $attach_file+1;
                                     												}
                                     											}
                                     										}*/
                                     if ($threads['thread_sticky']) {
                                         $this->forum_info['threads']['sticky'][$threads['thread_id']] = $threads;
                                     } else {
                                         $this->forum_info['threads']['item'][$threads['thread_id']] = $threads;
                                     }
                                 }
                             }
                             if ($this->forum_info['thread_max_rows'] > $this->forum_info['threads_per_page']) {
                                 $this->forum_info['threads']['pagenav'] = makepagenav($_GET['thread_rowstart'], $this->forum_info['threads_per_page'], $this->forum_info['thread_max_rows'], 3, clean_request("", array("thread_rowstart"), FALSE) . "&amp;", "thread_rowstart");
                                 $this->forum_info['threads']['pagenav2'] = makepagenav($_GET['thread_rowstart'], $this->forum_info['threads_per_page'], $this->forum_info['thread_max_rows'], 3, clean_request("", array("thread_rowstart"), FALSE) . "&amp;", "thread_rowstart", TRUE);
                             }
                         }
                     }
                 }
             } else {
                 redirect(INFUSIONS . 'forum/index.php');
             }
         } else {
             $this->forum_info['forums'] = Functions::get_forum();
         }
     }
 }
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:101,代码来源:Forum.php

示例12: displayTagForm

 protected function displayTagForm()
 {
     global $aidlink;
     if (isset($_POST['cancel_tag'])) {
         redirect(clean_request("", array("tag_id", "ref"), FALSE));
     }
     $this->data['rank_language'] = LANGUAGE;
     // Special Select
     $groups_arr = getusergroups();
     $groups_except = array(USER_LEVEL_PUBLIC, USER_LEVEL_MEMBER, USER_LEVEL_ADMIN, USER_LEVEL_SUPER_ADMIN);
     $group_opts = array();
     foreach ($groups_arr as $group) {
         if (!in_array($group[0], $groups_except)) {
             $group_opts[$group[0]] = $group[1];
         }
     }
     $language_opts = fusion_get_enabled_languages();
     $this->post_tags();
     $form_action = FUSION_SELF . $aidlink . '&amp;section=ft&amp;ref=tag_form';
     if (isset($_GET['tag_id']) && isnum($_GET['tag_id'])) {
         $result = dbquery("SELECT * FROM " . DB_FORUM_TAGS . " WHERE tag_id='" . intval($_GET['tag_id']) . "'");
         if (dbrows($result) > 0) {
             $this->data = dbarray($result);
             $form_action = FUSION_SELF . $aidlink . "&amp;section=ft&amp;ref=tag_form&amp;tag_id=" . $_GET['tag_id'];
         } else {
             redirect(clean_request("", array("rank_id", "ref"), FALSE));
         }
     }
     $button_locale = $this->data['tag_id'] ? self::$locale['forum_tag_0208'] : self::$locale['forum_tag_0207'];
     $html = openform('tag_form', 'post', $form_action, array('class' => 'm-t-20')) . form_text('tag_title', self::$locale['forum_tag_0200'], $this->data['tag_title'], array('required' => 1, 'error_text' => self::$locale['414'], "inline" => TRUE)) . form_textarea('tag_description', self::$locale['forum_tag_0201'], $this->data['tag_description'], array('inline' => TRUE, 'type' => 'bbcode', 'autosize' => TRUE, 'preview' => TRUE)) . form_colorpicker('tag_color', self::$locale['forum_tag_0202'], $this->data['tag_color'], array('inline' => TRUE, 'required' => TRUE));
     if (multilang_table("FR")) {
         $html .= form_select('tag_language', self::$locale['forum_tag_0203'], $this->data['tag_language'], array('options' => $language_opts, 'placeholder' => self::$locale['choose'], "inline" => TRUE));
     } else {
         $html .= form_hidden('tag_language', '', $this->data['tag_language']);
     }
     $html .= form_checkbox('tag_status', self::$locale['forum_tag_0204'], $this->data['tag_status'], array("options" => array(1 => self::$locale['forum_tag_0205'], 0 => self::$locale['forum_tag_0206']), "type" => "radio", "inline" => TRUE)) . form_button('save_tag', $button_locale, $button_locale, array('class' => 'btn-primary m-r-10')) . form_button('cancel_tag', self::$locale['cancel'], self::$locale['cancel'], array('class' => 'btn-default')) . closeform();
     return $html;
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:38,代码来源:tags.php

示例13: display_theme_editor

 /** The Theme Editor - Manage UI */
 public static function display_theme_editor($theme_name)
 {
     global $aidlink, $locale;
     // sanitize theme exist
     $theme_name = self::verify_theme($theme_name) ? $theme_name : "";
     if (!$theme_name) {
         redirect(clean_request("", array("aid"), TRUE));
     }
     add_breadcrumb(array('link' => '', 'title' => $locale['theme_1018']));
     // go with tabs
     $tab['title'] = array($locale['theme_1022'], $locale['theme_1023'], $locale['theme_1024']);
     $tab['id'] = array("dashboard", "widgets", "css");
     $tab['icon'] = array("fa fa-edit fa-fw", "fa fa-cube fa-fw", "fa fa-css3 fa-fw");
     if (isset($_GET['action'])) {
         $tab['title'][] = $locale['theme_1029'];
         $tab['id'][] = "close";
         $tab['icon'][] = "fa fa-close fa-fw";
     }
     if (isset($_POST['close_theme'])) {
         redirect(FUSION_SELF . $aidlink);
     }
     $_GET['section'] = isset($_GET['section']) && in_array($_GET['section'], $tab['id']) ? $_GET['section'] : "dashboard";
     $tab_active = $_GET['section'];
     $atom = new \PHPFusion\Atom\Atom();
     $atom->target_folder = $theme_name;
     $atom->theme_name = $theme_name;
     echo opentab($tab, $tab_active, "theme_admin", TRUE);
     // now include the thing as necessary
     switch ($_GET['section']) {
         case "dashboard":
             /**
              * Delete preset
              */
             if (isset($_GET['delete_preset']) && isnum($_GET['delete_preset'])) {
                 if (empty($_GET['theme'])) {
                     redirect(FUSION_SELF . $aidlink);
                 }
                 $theme_name = stripinput($_GET['theme']);
                 $file = dbarray(dbquery("SELECT theme_file FROM " . DB_THEME . " WHERE theme_name='" . $theme_name . "'\n\t\t\t\t\tand theme_id='" . intval($_GET['delete_preset']) . "'"));
                 if (file_exists(THEMES . $theme_name . "/" . $file['theme_file'])) {
                     unlink(THEMES . $theme_name . "/" . $file['theme_file']);
                 }
                 dbquery("DELETE FROM " . DB_THEME . " WHERE theme_id='" . intval($_GET['delete_preset']) . "'");
                 addNotice('success', $locale['theme_success_002']);
                 redirect(clean_request("", array("section", "aid", "action", "theme"), TRUE));
             }
             /**
              * Set active presets
              */
             if (isset($_POST['load_preset']) && isnum($_POST['load_preset'])) {
                 $result = dbquery("select theme_id FROM " . DB_THEME . " WHERE theme_active='1'");
                 if (dbrows($result) > 0) {
                     $data = dbarray($result);
                     $data = array("theme_id" => $data['theme_id'], "theme_active" => 0);
                     dbquery_insert(DB_THEME, $data, "update");
                 }
                 $data = array("theme_id" => $_POST['load_preset'], "theme_active" => 1);
                 dbquery_insert(DB_THEME, $data, "update");
                 redirect(clean_request("", array("section", "aid", "action", "theme"), TRUE));
             }
             $atom->display_theme_overview();
             break;
         case "widgets":
             $atom->display_theme_widgets();
             break;
         case "css":
             $atom->theme_editor();
             break;
         case "close":
             redirect(FUSION_SELF . $aidlink);
             break;
         default:
             break;
     }
     echo closetab();
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:77,代码来源:Admin.php

示例14: gallery_photo_listing

/**
 * Gallery Photo Listing UI
 */
function gallery_photo_listing()
{
    global $locale, $gll_settings, $aidlink;
    // xss
    $photoRows = dbcount("(photo_id)", DB_PHOTOS, "album_id='" . intval($_GET['album_id']) . "'");
    $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $photoRows ? $_GET['rowstart'] : 0;
    if (!empty($photoRows)) {
        $result = dbquery("\n\t\tselect photos.*,\n\t\talbum.*,\n\t\tphotos.photo_user as user_id, u.user_name, u.user_status, u.user_avatar,\n\t\tcount(comment_id) as comment_count,\n\t\tsum(rating_vote) as total_votes,\n\t\tcount(rating_id) as rating_count\n\t\tFROM " . DB_PHOTOS . " photos\n\t\tINNER JOIN " . DB_PHOTO_ALBUMS . " album on photos.album_id = album.album_id\n\t\tINNER JOIN " . DB_USERS . " u on u.user_id = photos.photo_user\n\t\tLEFT JOIN " . DB_COMMENTS . " comment on comment.comment_item_id= photos.photo_id AND comment_type = 'PH'\n\t\tLEFT JOIN " . DB_RATINGS . " rating on rating.rating_item_id = photos.photo_id AND rating_type = 'PH'\n\t\tWHERE " . groupaccess('album.album_access') . " and photos.album_id = '" . intval($_GET['album_id']) . "'\n\t\tGROUP BY photo_id\n\t\tORDER BY photos.photo_order ASC, photos.photo_datestamp DESC LIMIT " . intval($_GET['rowstart']) . ", " . intval($gll_settings['gallery_pagination']) . "\n\t\t");
        $rows = dbrows($result);
        // Photo Album header
        echo "<aside class='text-left' style='border-bottom:1px solid #ddd; padding-bottom:15px;'>\n";
        $album_data = dbarray(dbquery("select album_id, album_title, album_description, album_datestamp, album_access from " . DB_PHOTO_ALBUMS . " WHERE album_id='" . intval($_GET['album_id']) . "'"));
        add_breadcrumb(array('link' => clean_request("album_id=" . $album_data['album_id'], array("aid"), FALSE), "title" => $album_data['album_title']));
        echo "<h2><strong>\n" . $album_data['album_title'] . "</strong></h2>\n";
        echo $locale['album_0003'] . " " . $album_data['album_description'];
        echo "<div class='clearfix m-t-10'>\n";
        echo "<div class='pull-right text-right col-xs-6 col-sm-6'>" . sprintf($locale['gallery_0019'], $rows, $photoRows) . "</div>\n";
        echo "<span class='m-r-15'>" . $locale['gallery_0020'] . " " . timer($album_data['album_datestamp']) . "</span>\n";
        echo "<span class='m-r-15'>" . $locale['gallery_0021'] . " " . getgroupname($album_data['album_access']) . "</span>\n";
        if ($photoRows > $rows) {
            echo "<div class='display-inline-block m-b-10'>\n";
            echo makepagenav($_GET['rowstart'], $gll_settings['gallery_pagination'], $photoRows, 3, FUSION_SELF . $aidlink . "&amp;album_id=" . $_GET['album_id'] . "&amp;");
            echo "</div>\n";
        }
        echo "</div>\n";
        echo "</aside>\n";
        if ($rows > 0) {
            echo "<a class='m-t-10 btn btn-danger' href='" . FUSION_SELF . $aidlink . "&amp;section=actions&amp;action=purge&amp;cat_id=" . $_GET['album_id'] . "'>" . $locale['photo_0025'] . "</a>\n";
            echo "<div class='row m-t-20'>\n";
            $i = 1;
            while ($data = dbarray($result)) {
                echo "<div style='width:" . ($gll_settings['thumb_w'] + 15) . "px; float:left; padding-left:10px; padding-right:10px;'>\n";
                echo "<div class='panel panel-default'>\n";
                echo "<div class='overflow-hide' style='background: #ccc; height: " . ($gll_settings['thumb_h'] - 15) . "px'>\n";
                echo displayPhotoImage($data['photo_filename'], $data['photo_thumb1'], $data['photo_thumb2'], IMAGES_G . $data['photo_filename']);
                echo "</div>\n";
                echo "<div class='panel-body'>\n";
                echo "<div class='dropdown'>\n";
                echo "<button data-toggle='dropdown' class='btn btn-default dropdown-toggle btn-block' type='button'> " . $locale['gallery_0013'] . " <span class='caret'></span></button>\n";
                echo "<ul class='dropdown-menu'>\n";
                echo "<li><a href='" . FUSION_SELF . $aidlink . "&amp;section=photo_form&amp;action=edit&amp;photo_id=" . $data['photo_id'] . "'><i class='fa fa-edit fa-fw'></i> " . $locale['gallery_0016'] . "</a></li>\n";
                echo $i > 1 ? "<li><a href='" . FUSION_SELF . $aidlink . "&amp;section=actions&amp;action=pu&amp;photo_id=" . $data['photo_id'] . "&amp;album_id=" . $data['album_id'] . "&amp;order=" . ($data['photo_order'] - 1) . "'><i class='fa fa-arrow-left fa-fw'></i> " . $locale['gallery_0014'] . "</a></li>\n" : "";
                echo $i !== $rows ? "<li><a href='" . FUSION_SELF . $aidlink . "&amp;section=actions&amp;action=pd&amp;photo_id=" . $data['photo_id'] . "&amp;album_id=" . $data['album_id'] . "&amp;order=" . ($data['photo_order'] + 1) . "'><i class='fa fa-arrow-right fa-fw'></i> " . $locale['gallery_0015'] . "</a></li>\n" : "";
                echo "<li class='divider'></li>\n";
                echo "<li><a href='" . FUSION_SELF . $aidlink . "&amp;section=actions&amp;action=delete&amp;photo_id=" . $data['photo_id'] . "'><i class='fa fa-trash fa-fw'></i> " . $locale['gallery_0017'] . "</a></li>\n";
                echo "</ul>\n";
                echo "</div>\n";
                echo "</div>\n";
                echo "<div class='panel-footer'>\n";
                echo "<span class='m-r-10'>\n<i class='fa fa-comments-o' title='" . $locale['comments'] . "'></i> " . $data['comment_count'] . "</span>\n";
                echo "<span class='m-r-5'>\n<i class='fa fa-star' title='" . $locale['ratings'] . "'></i> " . ($data['rating_count'] > 0 ? $data['total_votes'] / $data['rating_count'] * 10 : 0) . " /10</span>\n";
                echo "</div>\n</div>\n";
                echo "</div>\n";
                $i++;
            }
            echo "</div>\n";
        } else {
            redirect(FUSION_SELF . $aidlink);
        }
    } else {
        redirect(FUSION_SELF . $aidlink);
    }
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:66,代码来源:gallery_admin.php

示例15: array

     $categoryNameCheck = array("when_updating" => "weblink_cat_name='" . $data['weblink_cat_name'] . "' and weblink_cat_id !='" . $data['weblink_cat_id'] . "'", "when_saving" => "weblink_cat_name='" . $data['weblink_cat_name'] . "'");
     if (defender::safe()) {
         if ($weblinkCat_edit && dbcount("(weblink_cat_id)", DB_WEBLINK_CATS, "weblink_cat_id='" . intval($data['weblink_cat_id']) . "'")) {
             if (!dbcount("(weblink_cat_id)", DB_WEBLINK_CATS, $categoryNameCheck['when_updating'])) {
                 dbquery_insert(DB_WEBLINK_CATS, $data, "update");
                 addNotice("success", $locale['wl_0305']);
                 redirect(clean_request("", array("section", "aid"), TRUE));
             } else {
                 $defender->stop();
                 addNotice("danger", $locale['wl_0309']);
             }
         } else {
             if (!dbcount("(weblink_cat_id)", DB_WEBLINK_CATS, $categoryNameCheck['when_saving'])) {
                 dbquery_insert(DB_WEBLINK_CATS, $data, "save");
                 addNotice("success", $locale['wl_0304']);
                 redirect(clean_request("", array("section", "aid"), TRUE));
             } else {
                 $defender->stop();
                 addNotice("danger", $locale['wl_0309']);
             }
         }
     }
 }
 if ($weblinkCat_edit) {
     $result = dbquery("SELECT * FROM " . DB_WEBLINK_CATS . " " . (multilang_table("WL") ? "WHERE weblink_cat_language='" . LANGUAGE . "' AND" : "WHERE") . " weblink_cat_id='" . intval($_GET['cat_id']) . "'");
     if (dbrows($result)) {
         $data = dbarray($result);
         $cat_hidden = array($data['weblink_cat_id']);
         $cat_sorting = explode(" ", $data['weblink_cat_sorting']);
         if ($cat_sorting[0] == "weblink_id") {
             $data['cat_sort_by'] = "1";
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:weblinks_cats.php


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