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


PHP Table::output方法代码示例

本文整理汇总了PHP中Table::output方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::output方法的具体用法?PHP Table::output怎么用?PHP Table::output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Table的用法示例。


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

示例1: myalerts_acp_manage_alert_types

function myalerts_acp_manage_alert_types()
{
    global $mybb, $lang, $page, $db, $cache;
    $alertTypeManager = MybbStuff_MyAlerts_AlertTypeManager::getInstance();
    $alertTypes = $alertTypeManager->getAlertTypes();
    if (strtolower($mybb->request_method) == 'post') {
        if (!verify_post_check($mybb->get_input('my_post_key'))) {
            flash_message($lang->invalid_post_verify_key2, 'error');
            admin_redirect("index.php?module=config-myalerts_alert_types");
        }
        $enabledAlertTypes = $mybb->get_input('alert_types_enabled', MyBB::INPUT_ARRAY);
        $canBeUserDisabled = $mybb->get_input('alert_types_can_be_user_disabled', MyBB::INPUT_ARRAY);
        $enabledAlertTypes = array_map('intval', array_keys($enabledAlertTypes));
        $canBeUserDisabled = array_map('intval', array_keys($canBeUserDisabled));
        $updateArray = array();
        foreach ($alertTypes as $alertType) {
            $type = MybbStuff_MyAlerts_Entity_AlertType::unserialize($alertType);
            $type->setEnabled(in_array($type->getId(), $enabledAlertTypes));
            $type->setCanBeUserDisabled(in_array($type->getId(), $canBeUserDisabled));
            $updateArray[] = $type;
        }
        $alertTypeManager->updateAlertTypes($updateArray);
        flash_message($lang->myalerts_alert_types_updated, 'success');
        admin_redirect("index.php?module=config-myalerts_alert_types");
    } else {
        $page->output_header($lang->myalerts_alert_types);
        $form = new Form('index.php?module=config-myalerts_alert_types', 'post');
        $table = new Table();
        $table->construct_header($lang->myalerts_alert_type_code);
        $table->construct_header($lang->myalerts_alert_type_enabled, array('width' => '5%', 'class' => 'align_center'));
        $table->construct_header($lang->myalerts_alert_type_can_be_user_disabled, array('width' => '10%', 'class' => 'align_center'));
        $noResults = false;
        if (!empty($alertTypes)) {
            foreach ($alertTypes as $type) {
                $alertCode = htmlspecialchars_uni($type['code']);
                $table->construct_cell($alertCode);
                $table->construct_cell($form->generate_check_box('alert_types_enabled[' . $type['id'] . ']', '', '', array('checked' => $type['enabled'])));
                $table->construct_cell($form->generate_check_box('alert_types_can_be_user_disabled[' . $type['id'] . ']', '', '', array('checked' => $type['can_be_user_disabled'])));
                $table->construct_row();
            }
        } else {
            $table->construct_cell($lang->myalerts_no_alert_types, array('colspan' => 2));
            $table->construct_row();
            $noResults = true;
        }
        $table->output($lang->myalerts_alert_types);
        if (!$noResults) {
            $buttons[] = $form->generate_submit_button($lang->myalerts_update_alert_types);
            $form->output_submit_wrapper($buttons);
        }
        $form->end();
        $page->output_footer();
    }
}
开发者ID:harrygg,项目名称:MyAlerts,代码行数:54,代码来源:myalerts.php

示例2: jb_update_core

function jb_update_core()
{
    $auto = jb_download_core();
    if ($auto === false) {
        global $page;
        $page->output_header(JB_Lang::get("update_failed"));
        $table = new Table();
        $table->construct_header(JB_Lang::get("attention"));
        $table->construct_cell(JB_Lang::get("update_get"));
        $table->construct_row();
        $table->output(JB_Lang::get("update_failed"));
        $page->output_footer();
        exit;
    }
}
开发者ID:JN-Jones,项目名称:MyLikes,代码行数:15,代码来源:include.php

示例3: main_page

function main_page()
{
    global $cloudflare, $mybb;
    $request = $cloudflare->get_access_rules();
    $table = new Table();
    $table->construct_header("Mode");
    $table->construct_header("IP Address");
    $table->construct_header("Notes");
    $table->construct_header("Modify");
    foreach ($request->result as $rule) {
        $table->construct_cell($rule->mode);
        $table->construct_cell($rule->configuration->value);
        $table->construct_cell($rule->notes);
        $table->construct_cell("<a href=\"index.php?module=cloudflare-manage_firewall&action=modify_rule_by_ip&ip={$rule->configuration->value}&my_post_key={$mybb->post_code}&current_mode={$rule->mode}&current_notes={$rule->notes}\">Modify</a>&nbsp;/&nbsp;<a href=\"index.php?module=cloudflare-manage_firewall&action=delete_rule_by_id&rule_id={$rule->id}&ip_address={$rule->configuration->value}&my_post_key={$mybb->post_code}\">Delete</a>");
        $table->construct_row();
    }
    $table->output("Firewall Rules");
}
开发者ID:dequeues,项目名称:MyBB-CloudFlare-Manager,代码行数:18,代码来源:cloudflare_manage_firewall.php

示例4: array

            $attachment['postsubject'] = htmlspecialchars_uni($attachment['postsubject']);
            $attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
            $attachment['threadsubject'] = htmlspecialchars_uni($attachment['threadsubject']);
            $attachment['filesize'] = get_friendly_size($attachment['filesize']);
            $link = get_post_link($attachment['pid'], $attachment['tid']) . "#pid{$attachment['pid']}";
            $thread_link = get_thread_link($attachment['tid']);
            $profile_link = build_profile_link($attachment['username'], $attachment['uid']);
            $table->construct_cell("<a href=\"../attachment.php?aid={$attachment['aid']}\" target=\"_blank\">{$attachment['filename']}</a> ({$attachment['filesize']})<br /><small class=\"modqueue_meta\">{$lang->post} <a href=\"{$link}\">{$attachment['postsubject']}</a></small>");
            $table->construct_cell($profile_link, array("class" => "align_center"));
            $table->construct_cell("{$attachdate}, {$attachtime}", array("class" => "align_center"));
            $table->construct_cell($form->generate_radio_button("attachments[{$attachment['aid']}]", "ignore", $lang->ignore, array('class' => 'radio_ignore', 'checked' => true)), array("class" => "align_center"));
            $table->construct_cell($form->generate_radio_button("attachments[{$attachment['aid']}]", "delete", $lang->delete, array('class' => 'radio_delete', 'checked' => false)), array("class" => "align_center"));
            $table->construct_cell($form->generate_radio_button("attachments[{$attachment['aid']}]", "approve", $lang->approve, array('class' => 'radio_approve', 'checked' => false)), array("class" => "align_center"));
            $table->construct_row();
        }
        $table->output($lang->attachments_awaiting_moderation);
        echo $all_options;
        echo $pagination;
        $buttons[] = $form->generate_submit_button($lang->perform_action);
        $form->output_submit_wrapper($buttons);
        $form->end();
        $page->output_footer();
    } else {
        if ($mybb->input['type'] == "attachments") {
            $page->output_header($lang->moderation_queue);
            $page->output_nav_tabs($sub_tabs, "attachments");
            echo "<p class=\"notice\">{$lang->error_no_attachments}</p>";
            $page->output_footer();
        }
    }
}
开发者ID:benn0034,项目名称:SHIELDsite2.old,代码行数:31,代码来源:moderation_queue.php

示例5: array

     }
     if ($logitem['psubject']) {
         $information .= "<strong>{$lang->post}</strong> <a href=\"../" . get_post_link($logitem['pid']) . "#pid{$logitem['pid']}\">" . htmlspecialchars_uni($logitem['psubject']) . "</a>";
     }
     $table->construct_cell($logitem['profilelink']);
     $table->construct_cell($logitem['dateline'], array("class" => "align_center"));
     $table->construct_cell($logitem['action'], array("class" => "align_center"));
     $table->construct_cell($information);
     $table->construct_cell($logitem['ipaddress'], array("class" => "align_center"));
     $table->construct_row();
 }
 if ($table->num_rows() == 0) {
     $table->construct_cell($lang->no_modlogs, array("colspan" => "5"));
     $table->construct_row();
 }
 $table->output($lang->mod_logs);
 // Do we need to construct the pagination?
 if ($rescount > $perpage) {
     echo draw_admin_pagination($pagecnt, $perpage, $rescount, "index.php?module=tools/modlog&amp;perpage={$perpage}&amp;uid={$mybb->input['uid']}&amp;fid={$mybb->input['fid']}&amp;sortby={$mybb->input['sortby']}&amp;order={$order}") . "<br />";
 }
 // Fetch filter options
 $sortbysel[$mybb->input['sortby']] = "selected=\"selected\"";
 $ordersel[$mybb->input['order']] = "selected=\"selected\"";
 $user_options[''] = $lang->all_moderators;
 $user_options['0'] = '----------';
 $query = $db->query("\n\t\tSELECT DISTINCT l.uid, u.username\n\t\tFROM " . TABLE_PREFIX . "moderatorlog l\n\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (l.uid=u.uid)\n\t\tORDER BY u.username ASC\n\t");
 while ($user = $db->fetch_array($query)) {
     $selected = '';
     if ($mybb->input['uid'] == $user['uid']) {
         $selected = "selected=\"selected\"";
     }
开发者ID:benn0034,项目名称:SHIELDsite2.old,代码行数:31,代码来源:modlog.php

示例6: Table

         my_unsetcookie("inlinemod_useracp");
         flash_message($lang->success_mass_usergroups, 'success');
         admin_redirect("index.php?module=user-users" . $vid_url);
     } else {
         // They tried to edit super admins! Uh-oh!
         $errors[] = $lang->no_usergroup_changed;
     }
 }
 $page->output_header($lang->manage_users);
 $page->output_nav_tabs($sub_tabs, 'manage_users');
 // Display a table warning
 $table = new Table();
 $lang->usergroup_info = $lang->sprintf($lang->usergroup_info, count($selected));
 $table->construct_cell($lang->usergroup_info);
 $table->construct_row();
 $table->output($lang->important);
 if ($errors) {
     $page->output_inline_error($errors);
 }
 // Display the usergroup options
 $form = new Form("index.php?module=user-users", "post");
 echo $form->generate_hidden_field('action', 'inline_edit');
 echo $form->generate_hidden_field('inline_action', 'multiusergroup');
 echo $form->generate_hidden_field('processed', '1');
 $form_container = new FormContainer($lang->mass_usergroups);
 // Usergroups
 $display_group_options[0] = $lang->use_primary_user_group;
 $options = array();
 $query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
 while ($usergroup = $db->fetch_array($query)) {
     $options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:31,代码来源:users.php

示例7: akismet_admin

function akismet_admin()
{
    global $mybb, $db, $page, $lang;
    if ($page->active_action != "akismet") {
        return;
    }
    $page->add_breadcrumb_item($lang->akismet);
    if ($mybb->input['delete_all'] && $mybb->request_method == "post") {
        // User clicked no
        if ($mybb->input['no']) {
            admin_redirect("index.php?module=forum-akismet");
        }
        if ($mybb->request_method == "post") {
            // Delete the template
            $db->delete_query("posts", "visible = '-4'");
            // Log admin action
            log_admin_action();
            flash_message($lang->success_deleted_spam, 'success');
            admin_redirect("index.php?module=forum-akismet");
        } else {
            $page->output_confirm_action("index.php?module=forum-akismet&amp;delete_all=1", $lang->confirm_spam_deletion);
        }
    }
    if ($mybb->input['unmark'] && $mybb->request_method == "post") {
        $unmark = $mybb->input['akismet'];
        if (empty($unmark)) {
            flash_message($lang->error_unmark, 'error');
            admin_redirect("index.php?module=forum-akismet");
        }
        $posts_in = '';
        $comma = '';
        foreach ($unmark as $key => $val) {
            $posts_in .= $comma . intval($key);
            $comma = ',';
        }
        $query = $db->simple_select("posts", "pid, tid", "pid IN ({$posts_in}) AND replyto = '0'");
        while ($post = $db->fetch_array($query)) {
            $threadp[] = $post['tid'];
        }
        if (!is_array($threadp)) {
            $threadp = array();
        }
        $thread_list = implode(',', $threadp);
        $query = $db->query("\r\n\t\t\tSELECT p.tid, f.usepostcounts, p.uid, p.fid, p.dateline, p.replyto, t.lastpost, t.lastposter, t.lastposteruid, t.subject\r\n\t\t\tFROM " . TABLE_PREFIX . "posts p\r\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "threads t ON (t.tid=p.tid)\r\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "forums f ON (f.fid=p.fid)\r\n\t\t\tWHERE p.pid IN ({$posts_in}) AND p.visible = '-4'\r\n\t\t");
        while ($post = $db->fetch_array($query)) {
            // Fetch the last post for this forum
            $query2 = $db->query("\r\n\t\t\t\tSELECT tid, lastpost, lastposter, lastposteruid, subject\r\n\t\t\t\tFROM " . TABLE_PREFIX . "threads\r\n\t\t\t\tWHERE fid='{$post['fid']}' AND visible='1' AND closed NOT LIKE 'moved|%'\r\n\t\t\t\tORDER BY lastpost DESC\r\n\t\t\t\tLIMIT 0, 1\r\n\t\t\t");
            $lastpost = $db->fetch_array($query2);
            if ($post['lastpost'] > $lastpost['lastpost']) {
                $lastpost['lastpost'] = $post['lastpost'];
                $lastpost['lastposter'] = $post['lastposter'];
                $lastpost['lastposteruid'] = $post['lastposteruid'];
                $lastpost['subject'] = $post['subject'];
                $lastpost['tid'] = $post['tid'];
            }
            $update_count = array("lastpost" => intval($lastpost['lastpost']), "lastposter" => $db->escape_string($lastpost['lastposter']), "lastposteruid" => intval($lastpost['lastposteruid']), "lastposttid" => intval($lastpost['tid']), "lastpostsubject" => $db->escape_string($lastpost['subject']));
            $db->update_query("forums", $update_count, "fid='{$post['fid']}'");
            $query2 = $db->query("\r\n\t\t\t\tSELECT u.uid, u.username, p.username AS postusername, p.dateline\r\n\t\t\t\tFROM " . TABLE_PREFIX . "posts p\r\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid=p.uid)\r\n\t\t\t\tWHERE p.tid='{$post['tid']}' AND p.visible='1' OR p.pid = '{$post['pid']}'\r\n\t\t\t\tORDER BY p.dateline DESC\r\n\t\t\t\tLIMIT 1");
            $lastpost = $db->fetch_array($query2);
            $query2 = $db->query("\r\n\t\t\t\tSELECT u.uid, u.username, p.username AS postusername, p.dateline\r\n\t\t\t\tFROM " . TABLE_PREFIX . "posts p\r\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid=p.uid)\r\n\t\t\t\tWHERE p.tid='{$post['tid']}'\r\n\t\t\t\tORDER BY p.dateline ASC\r\n\t\t\t\tLIMIT 0,1\r\n\t\t\t");
            $firstpost = $db->fetch_array($query2);
            if (!$firstpost['username']) {
                $firstpost['username'] = $firstpost['postusername'];
            }
            if (!$lastpost['username']) {
                $lastpost['username'] = $lastpost['postusername'];
            }
            if (!$lastpost['dateline']) {
                $lastpost['username'] = $firstpost['username'];
                $lastpost['uid'] = $firstpost['uid'];
                $lastpost['dateline'] = $firstpost['dateline'];
            }
            $lastpost['username'] = $db->escape_string($lastpost['username']);
            $firstpost['username'] = $db->escape_string($firstpost['username']);
            $query2 = $db->simple_select("users", "akismetstopped", "uid='{$post['uid']}'");
            $akismetstopped = $db->fetch_field($query2, "akismetstopped") - 1;
            if ($akismetstopped < 0) {
                $akismetstopped = 0;
            }
            $db->update_query("users", array('akismetstopped' => $akismetstopped), "uid='{$post['uid']}'");
            $update_array = array('username' => $firstpost['username'], 'uid' => intval($firstpost['uid']), 'lastpost' => intval($lastpost['dateline']), 'lastposter' => $lastpost['username'], 'lastposteruid' => intval($lastpost['uid']));
            $db->update_query("threads", $update_array, "tid='{$post['tid']}'");
            if ($post['usepostcounts'] != 0) {
                $db->write_query("UPDATE " . TABLE_PREFIX . "users SET postnum=postnum+1 WHERE uid = '{$post['uid']}'");
            }
            $newthreads = $newreplies = 0;
            if ($post['replyto'] == 0) {
                ++$newthreads;
            } else {
                ++$newreplies;
            }
            update_thread_counters($post['tid'], array('replies' => '+' . $newreplies));
            update_forum_counters($post['fid'], array('threads' => '+' . $newthreads, 'posts' => '+1'));
        }
        $approve = array("visible" => 1);
        if ($thread_list) {
            $db->update_query("threads", $approve, "tid IN ({$thread_list})");
        }
        $db->update_query("posts", $approve, "pid IN ({$posts_in})");
        // Log admin action
//.........这里部分代码省略.........
开发者ID:ThinhNguyenVB,项目名称:Gradient-Studios-Website,代码行数:101,代码来源:akismet.php

示例8: restfulapi_admin_load

function restfulapi_admin_load()
{
    global $mybb, $db, $page, $lang, $cache;
    if ($page->active_action == RESTFULAPI_URL) {
        $page->add_breadcrumb_item($lang->restfulapi_title);
        $page->output_header($lang->restfulapi_title);
        $result = $db->simple_select("apisettings");
        $action = "config";
        if (isset($mybb->input["action"]) && in_array($mybb->input["action"], array("manage-keys", "add-key"))) {
            $action = $mybb->input["action"];
        }
        $navs = array("config" => array("link" => "index.php?module=config-" . RESTFULAPI_URL, "title" => $lang->restfulapi_config, "description" => $lang->restfulapi_config_description), "manage-keys" => array("link" => "index.php?module=config-" . RESTFULAPI_URL . "&amp;action=manage-keys", "title" => $lang->restfulapi_manage_api_keys, "description" => $lang->restfulapi_manage_api_keys_description), "add-key" => array("link" => "index.php?module=config-" . RESTFULAPI_URL . "&amp;action=add-key", "title" => $lang->restfulapi_add_api_key, "description" => $lang->restfulapi_add_api_key_description));
        $page->output_nav_tabs($navs, $action);
        switch ($action) {
            case "manage-keys":
                if (isset($mybb->input["do"]) && in_array($mybb->input["do"], array("regenerate", "edit", "delete"))) {
                    $do = $mybb->input["do"];
                    if ($do == "edit" && isset($mybb->input["key_id"]) && is_string($mybb->input["key_id"])) {
                        $key_id = (int) $db->escape_string($mybb->input["key_id"]);
                        $result = $db->simple_select("apikeys", "*", "id='{$key_id}'");
                        if ($result->num_rows != 1) {
                            flash_message($lang->restfulapi_key_not_found, "error");
                            admin_redirect("index.php?module=config-restfulapi&amp;action=manage-keys");
                            exit;
                        }
                        if ($mybb->request_method == "post" && isset($mybb->input["apicustomer"]) && is_string($mybb->input["apicustomer"]) && isset($mybb->input["apicomment"]) && is_string($mybb->input["apicomment"]) && isset($mybb->input["maxreq"]) && is_numeric($mybb->input["maxreq"]) && isset($mybb->input["maxreqrate"]) && in_array($mybb->input["maxreqrate"], array("m", "w", "d", "h"))) {
                            $update = array("apicustomer" => $db->escape_string(htmlspecialchars_uni($mybb->input["apicustomer"])), "apicomment" => $db->escape_string(htmlspecialchars_uni($mybb->input["apicomment"])), "maxreq" => (int) $mybb->input["maxreq"], "maxreqrate" => $db->escape_string(htmlspecialchars_uni($mybb->input["maxreqrate"])));
                            $db->update_query("apikeys", $update, "id='{$key_id}'");
                            $db->delete_query("apipermissions", "apikey='{$key_id}'");
                            if (isset($mybb->input["apinames"]) && is_array($mybb->input["apinames"])) {
                                $insert_allowed = array();
                                foreach ($mybb->input["apinames"] as $apiname) {
                                    $insert_allowed[] = array("apikey" => $key_id, "apiname" => $db->escape_string($apiname));
                                }
                                $db->insert_query_multiple("apipermissions", $insert_allowed);
                            }
                            restfulapi_cache_rebuild();
                            flash_message($lang->restfulapi_key_edited_successfully, "success");
                            admin_redirect("index.php?module=config-restfulapi&amp;action=manage-keys");
                        } else {
                            $keyset = $result->fetch_array();
                            $form = new Form("index.php?module=config-" . RESTFULAPI_URL . "&amp;action=manage-keys&amp;do=edit&amp;key_id={$key_id}", "post", "edit");
                            $form_container = new FormContainer($lang->restfulapi_edit_api_key);
                            $form_container->output_row($lang->restfulapi_customer_name . " <em>*</em>", $lang->restfulapi_customer_name_description, $form->generate_text_box('apicustomer', htmlspecialchars_uni($keyset["apicustomer"]), array('id' => 'apicustomer')), 'apicustomer');
                            $rate_types = array("h" => $lang->restfulapi_per_hour, "d" => $lang->restfulapi_per_day, "w" => $lang->restfulapi_per_week, "m" => $lang->restfulapi_per_month);
                            $form_container->output_row($lang->restfulapi_max_requests . " <em>*</em>", $lang->restfulapi_max_requests_description, $form->generate_text_box('maxreq', htmlspecialchars_uni($keyset["maxreq"]), array('id' => 'maxreq')) . " " . $form->generate_select_box('maxreqrate', $rate_types, htmlspecialchars_uni($keyset["maxreqrate"]), array('id' => 'maxreqrate')), 'maxreq');
                            $form_container->output_row($lang->restfulapi_comment, $lang->restfulapi_comment_description, $form->generate_text_area('apicomment', htmlspecialchars_uni($keyset["apicomment"]), array('id' => 'apicomment')), 'apicomment');
                            $apis = glob(RESTFULAPI_PATH . "api/*api.class.php");
                            $presentable_apis = array();
                            foreach ($apis as $key => $value) {
                                $value = htmlspecialchars_uni(str_replace(array(RESTFULAPI_PATH . "api/", "api.class.php"), "", $value));
                                $presentable_apis[$value] = $value;
                            }
                            $selected = array();
                            // reminder, $key_id has already been escaped!
                            $result = $db->simple_select("apipermissions", "*", "apikey='{$key_id}'");
                            while ($apipermission = $db->fetch_array($result)) {
                                $selected[] = $apipermission["apiname"];
                            }
                            $form_container->output_row($lang->restfulapi_select_allowed_apis, $lang->restfulapi_select_allowed_apis_description, $form->generate_select_box('apinames[]', $presentable_apis, $selected, array('id' => 'apinames', 'multiple' => true, 'size' => 10)), 'apinames');
                            $form_container->end();
                            $buttons[] = $form->generate_submit_button($lang->restfulapi_edit_api_key);
                            $form->output_submit_wrapper($buttons);
                            $form->end();
                        }
                    } elseif ($do == "delete" && isset($mybb->input["key_id"]) && isset($mybb->input["my_post_key"]) && verify_post_check($mybb->input["my_post_key"])) {
                        $key_id = $db->escape_string($mybb->input["key_id"]);
                        if ($db->simple_select("apikeys", "*", "id='{$key_id}'")->num_rows == 1) {
                            $db->delete_query("apipermissions", "apikey='{$key_id}'");
                            $db->delete_query("apikeys", "id='{$key_id}'");
                            restfulapi_cache_rebuild();
                            flash_message($lang->restfulapi_key_deleted_successfully, "success");
                        } else {
                            flash_message($lang->restfulapi_key_not_found, "error");
                        }
                        admin_redirect("index.php?module=config-restfulapi&amp;action=manage-keys");
                    } elseif ($do == "regenerate" && isset($mybb->input["key_id"]) && isset($mybb->input["my_post_key"]) && verify_post_check($mybb->input["my_post_key"])) {
                        $key_id = $db->escape_string($mybb->input["key_id"]);
                        if ($db->simple_select("apikeys", "*", "id='{$key_id}'")->num_rows == 1) {
                            $apikey = restfulapi_generate_key();
                            /* can't figure out a better way to generate a random yet never-generated-before API key than this one */
                            while ($db->simple_select("apikeys", "*", "apikey='{$apikey}'")->num_rows != 0) {
                                $apikey = restfulapi_generate_key();
                            }
                            $update = array("apikey" => $db->escape_string(htmlspecialchars_uni($apikey)));
                            $db->update_query("apikeys", $update, "id='{$key_id}'");
                            restfulapi_cache_rebuild();
                            flash_message($lang->restfulapi_key_regenerated_successfully, "success");
                        } else {
                            flash_message($lang->restfulapi_key_not_found, "error");
                        }
                        admin_redirect("index.php?module=config-restfulapi&amp;action=manage-keys");
                    }
                } else {
                    $restfulapi_cache = $cache->read("restfulapi");
                    $apikeysets = $restfulapi_cache["keys"];
                    $table = new Table();
                    $table->construct_header($lang->restfulapi_customer, array("width" => "15%"));
                    $table->construct_header($lang->restfulapi_api_key, array("class" => "align_center", "width" => "29%"));
                    $table->construct_header($lang->restfulapi_comment, array("class" => "align_center", "width" => "30%"));
//.........这里部分代码省略.........
开发者ID:Shade-,项目名称:MyBB-RESTful-API-System,代码行数:101,代码来源:restfulapi.php

示例9: Table

    }
    $table = new Table();
    $table->construct_header($lang->image, array("class" => "align_center", "width" => 1));
    $table->construct_header($lang->name, array("width" => "35%"));
    $table->construct_header($lang->text_replace, array("width" => "35%"));
    $table->construct_header($lang->controls, array("class" => "align_center", "colspan" => 2));
    $query = $db->simple_select("smilies", "*", "", array('limit_start' => $start, 'limit' => 20, 'order_by' => 'disporder'));
    while ($smilie = $db->fetch_array($query)) {
        $smilie['image'] = str_replace("{theme:imgdir}", $theme['imgdir'], $smilie['image']);
        if (my_strpos($smilie['image'], "p://") || substr($smilie['image'], 0, 1) == "/") {
            $image = $smilie['image'];
        } else {
            $image = "../" . $smilie['image'];
        }
        $table->construct_cell("<img src=\"{$image}\" alt=\"\" />", array("class" => "align_center"));
        $table->construct_cell(htmlspecialchars_uni($smilie['name']));
        $table->construct_cell(htmlspecialchars_uni($smilie['find']));
        $table->construct_cell("<a href=\"index.php?module=config-smilies&amp;action=edit&amp;sid={$smilie['sid']}\">{$lang->edit}</a>", array("class" => "align_center"));
        $table->construct_cell("<a href=\"index.php?module=config-smilies&amp;action=delete&amp;sid={$smilie['sid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_smilie_deletion}')\">{$lang->delete}</a>", array("class" => "align_center"));
        $table->construct_row();
    }
    if ($table->num_rows() == 0) {
        $table->construct_cell($lang->no_smilies, array('colspan' => 5));
        $table->construct_row();
    }
    $table->output($lang->manage_smilies);
    $query = $db->simple_select("smilies", "COUNT(sid) as smilies");
    $total_rows = $db->fetch_field($query, "smilies");
    echo "<br />" . draw_admin_pagination($pagenum, "20", $total_rows, "index.php?module=config-smilies&amp;page={page}");
    $page->output_footer();
}
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:31,代码来源:smilies.php

示例10: newpoints_shop_admin_stats

function newpoints_shop_admin_stats()
{
    global $form, $db, $lang, $mybb;
    newpoints_lang_load("newpoints_shop");
    echo "<br />";
    // table
    $table = new Table();
    $table->construct_header($lang->newpoints_shop_item, array('width' => '30%'));
    $table->construct_header($lang->newpoints_shop_username, array('width' => '30%'));
    $table->construct_header($lang->newpoints_shop_price, array('width' => '20%', 'class' => 'align_center'));
    $table->construct_header($lang->newpoints_shop_date, array('width' => '20%', 'class' => 'align_center'));
    $query = $db->simple_select('newpoints_log', '*', 'action=\'shop_purchase\'', array('order_by' => 'date', 'order_dir' => 'DESC', 'limit' => intval($mybb->settings['newpoints_shop_lastpurchases'])));
    while ($stats = $db->fetch_array($query)) {
        $data = explode('-', $stats['data']);
        $item = newpoints_shop_get_item($data[0]);
        $table->construct_cell(htmlspecialchars_uni($item['name']));
        $link = build_profile_link(htmlspecialchars_uni($stats['username']), intval($stats['uid']));
        $table->construct_cell($link);
        $table->construct_cell(newpoints_format_points($data[1]), array('class' => 'align_center'));
        $table->construct_cell(my_date($mybb->settings['dateformat'], intval($stats['date']), '', false) . ", " . my_date($mybb->settings['timeformat'], intval($stats['date'])), array('class' => 'align_center'));
        $table->construct_row();
    }
    if ($table->num_rows() == 0) {
        $table->construct_cell($lang->newpoints_error_gathering, array('colspan' => 4));
        $table->construct_row();
    }
    $table->output($lang->newpoints_stats_lastpurchases);
}
开发者ID:ambsalinas,项目名称:anima,代码行数:28,代码来源:newpoints_shop.php

示例11: elseif

        $basic = '';
        $simplified = 'selected=selected';
        $agg = '';
    } elseif (cloudflare_cache_lvl_setting() == 'agg') {
        $basic = '';
        $simplified = '';
        $agg = 'selected=selected';
    }
    $table->construct_cell('
	<strong>Adjust your caching level to modify CloudFlare\'s caching behavior.</strong><br /><br />
	<form action="index.php?module=cloudflare-cache_lvl&action=change" method="post">
	<input type="hidden" value="' . $mybb->post_code . '" name="my_post_key">
	Level: <select name="type">
  	<option name="agg"' . $agg . '>Aggressive</option> 
  	<option name="simplified"' . $simplified . '>Simplified</option> 
  	<option name="basic"' . $basic . '>Basic</option>
</select><br /><br />
The <strong>basic</strong> setting will cache most static resources (i.e., css, images, and JavaScript). The <strong>aggressive</strong> setting will cache all static resources, including ones with a query string.<br /><br />

<strong>Basic:</strong> http://' . $mybb->settings['cloudflare_domain'] . '/images/logo.gif<br /><br />
<strong>Simplified:</strong> http://' . $mybb->settings['cloudflare_domain'] . '/images/logo.gif<s>?ignore=this-query-string</s><br /><br />
<strong>Aggressive:</strong> http://' . $mybb->settings['cloudflare_domain'] . '/images/logo.gif?with=query 
<br /><br />
	<input type="submit" name="submit" value="Change">
	</form>

	');
    $table->construct_row();
    $table->output("Change Cache Level");
    $page->output_footer();
}
开发者ID:nmalcolm,项目名称:mybb-cloudflare-manager,代码行数:31,代码来源:cloudflare_cache_lvl.php

示例12: FeedParser

     $updated_cache['latest_version_code'] = $latest_code;
 } else {
     $version_warn = 0;
     $latest_version = "<span style=\"color: green;\">" . $latest_version . "</span>";
 }
 $cache->update("update_check", $updated_cache);
 require_once MYBB_ROOT . "inc/class_feedparser.php";
 $feed_parser = new FeedParser();
 $feed_parser->parse_feed("http://feeds.feedburner.com/MyBBDevelopmentBlog");
 $table = new Table();
 $table->construct_header($lang->your_version);
 $table->construct_header($lang->latest_version);
 $table->construct_cell("<strong>" . $mybb->version . "</strong> (" . $mybb->version_code . ")");
 $table->construct_cell($latest_version);
 $table->construct_row();
 $table->output($lang->version_check);
 if ($version_warn) {
     $page->output_error("<p><em>{$lang->error_out_of_date}</em> {$lang->update_forum}</p>");
 } else {
     $page->output_success("<p><em>{$lang->success_up_to_date}</em></p>");
 }
 if ($feed_parser->error == '') {
     foreach ($feed_parser->items as $item) {
         if ($item['date_timestamp']) {
             $stamp = my_date($mybb->settings['dateformat'], $item['date_timestamp']) . ", " . my_date($mybb->settings['timeformat'], $item['date_timestamp']);
         } else {
             $stamp = '';
         }
         if ($item['content']) {
             $content = $item['content'];
         } else {
开发者ID:ThinhNguyenVB,项目名称:Gradient-Studios-Website,代码行数:31,代码来源:version_check.php

示例13: array

            if ($doc['hid'] > 7) {
                $icon = "<img src=\"styles/default/images/icons/custom.gif\" title=\"{$lang->custom_doc_sec}\" alt=\"{$lang->custom_doc_sec}\" style=\"vertical-align: middle;\" />";
            } else {
                $icon = "<img src=\"styles/default/images/icons/default.gif\" title=\"{$lang->default_doc_sec}\" alt=\"{$lang->default_doc_sec}\" style=\"vertical-align: middle;\" />";
            }
            $table->construct_cell("<div style=\"padding-left: 40px;\"><div class=\"float_right\">{$icon}</div><div><strong><a href=\"index.php?module=config-help_documents&amp;action=edit&amp;hid={$doc['hid']}\">{$doc['name']}</a></strong><br /><small>{$doc['description']}</small></div></div>");
            $table->construct_cell("<a href=\"index.php?module=config-help_documents&amp;action=edit&amp;hid={$doc['hid']}\">{$lang->edit}</a>", array("class" => "align_center", "width" => '60'));
            // Only show delete if not a default document
            if ($doc['hid'] > 7) {
                $table->construct_cell("<a href=\"index.php?module=config-help_documents&amp;action=delete&amp;hid={$doc['hid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_document_deletion}')\">{$lang->delete}</a>", array("class" => "align_center", "width" => '90'));
            } else {
                $table->construct_cell("&nbsp;", array("width" => '90'));
            }
            $table->construct_row();
        }
    }
    // No documents message
    if ($table->num_rows() == 0) {
        $table->construct_cell($lang->no_help_documents, array('colspan' => 3));
        $table->construct_row();
    }
    $table->output($lang->help_documents);
    echo <<<LEGEND
\t<fieldset>
<legend>{$lang->legend}</legend>
<img src="styles/default/images/icons/custom.gif" alt="{$lang->custom_doc_sec}" style="vertical-align: middle;" /> {$lang->custom_doc_sec}<br />
<img src="styles/default/images/icons/default.gif" alt="{$lang->default_doc_sec}" style="vertical-align: middle;" /> {$lang->default_doc_sec}
</fieldset>
LEGEND;
    $page->output_footer();
}
开发者ID:ThinhNguyenVB,项目名称:Gradient-Studios-Website,代码行数:31,代码来源:help_documents.php

示例14: array

         $last_use = my_date($mybb->settings['dateformat'], $filter['lastuse']) . ", " . my_date($mybb->settings['timeformat'], $filter['lastuse']);
     } else {
         $last_use = $lang->never;
     }
     $date = my_date($mybb->settings['dateformat'], $filter['dateline']) . ", " . my_date($mybb->settings['timeformat'], $filter['dateline']);
     $table->construct_cell($filter['filter']);
     $table->construct_cell($date, array("class" => "align_center"));
     $table->construct_cell($last_use, array("class" => "align_center"));
     $table->construct_cell("<a href=\"index.php?module=config/banning&amp;action=delete&amp;fid={$filter['fid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_ban_deletion}');\"><img src=\"styles/{$page->style}/images/icons/delete.gif\" title=\"{$lang->delete}\" alt=\"{$lang->delete}\" /></a>", array("class" => "align_center"));
     $table->construct_row();
 }
 if ($table->num_rows() == 0) {
     $table->construct_cell($lang->no_bans, array("colspan" => 4));
     $table->construct_row();
 }
 $table->output($title);
 $form = new Form("index.php?module=config/banning&amp;action=add", "post", "add");
 if ($errors) {
     $page->output_inline_error($errors);
 }
 if ($mybb->input['type'] == "usernames") {
     $form_container = new FormContainer($lang->add_disallowed_username);
     $form_container->output_row($lang->username . " <em>*</em>", $lang->username_desc, $form->generate_text_box('filter', $mybb->input['filter'], array('id' => 'filter')), 'filter');
     $buttons[] = $form->generate_submit_button($lang->disallow_username);
 } else {
     if ($mybb->input['type'] == "emails") {
         $form_container = new FormContainer($lang->add_disallowed_email_address);
         $form_container->output_row($lang->email_address . " <em>*</em>", $lang->email_address_desc, $form->generate_text_box('filter', $mybb->input['filter'], array('id' => 'filter')), 'filter');
         $buttons[] = $form->generate_submit_button($lang->disallow_email_address);
     } else {
         $form_container = new FormContainer($lang->ban_ip_address);
开发者ID:benn0034,项目名称:SHIELDsite2.old,代码行数:31,代码来源:banning.php

示例15: array

         $popup->add_item($lang->downloads_dlmngr_delete, "index.php?module=dlmngr/manage&amp;action=delete&amp;dlid={$dlid}");
         if ($dlitem['public'] == 1) {
             $popup->add_item($lang->downloads_dlmngr_reject, "index.php?module=dlmngr/manage&amp;action=reject&amp;dlid={$dlid}");
         } else {
             $popup->add_item($lang->downloads_dlmngr_accept, "index.php?module=dlmngr/manage&amp;action=accept&amp;dlid={$dlid}");
         }
         // create the info cell
         // construct_cell(content, array(html modifiers))
         $table->construct_cell("<a href=\"index.php?module=dlmngr/manage&amp;action=edit&amp;dlid={$dlid}\"><strong>" . $projectname . "</strong></a><br /><span style=\"font-size: 75%;\">" . $desc_short . "</span>");
         // create the menu cell
         $table->construct_cell($popup->fetch(), array("class" => "align_center"));
         // output the row
         $table->construct_row();
     }
     // display the table with our title
     $table->output($lang->downloads_dlmngr_manage);
     // wrap up the page with the standard footer
     $page->output_footer();
 } else {
     if ($mybb->input['action'] == "edit") {
         // we're editing a project download
         // get the project ID
         $dlid = $mybb->input['dlid'];
         // check if the user just saved
         // DONE; refused; Add a function for save and exit
         if ($mybb->input['save'] == "save") {
             // error checking
             // TODO Change into several checks and set an boolean var / array for errors
             // FIXME extend check for external files
             // TODO Add a file browser here like in typolight to choose the file we want to
             if ((!file_exists(MYBB_ROOT . "/uploads/downloads/" . $mybb->input['filename']) or $mybb->input['filename'] == "") and (substr($mybb->input['filename'], 0, 6) != 'ftp://' and substr($mybb->input['filename'], 0, 7) != 'http://')) {
开发者ID:JanMalte,项目名称:MyBB-Download-Manager,代码行数:31,代码来源:manage.php


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