function kbank_print_table_start($echobr = true, $width = '90%', $cellspacing = 0, $id = '') { if (VB_AREA == 'AdminCP') { //back-end print_table_start($echobr, $width, $cellspacing, $id); } else { //front-end print_table_start($echobr, '100%', $cellspacing, $id); } }
// tell the datastore to update $changes = true; } } } //update the datastore bookmarksite cache if ($changes) { build_bookmarksite_datastore(); } $_REQUEST['do'] = 'modify'; } // ######################################################################## // we want to display the bookmark list - this is the default action if ($_REQUEST['do'] == 'modify') { if (!$vbulletin->options['socialbookmarks']) { print_table_start(); print_description_row(fetch_error('social_bookmarks_disabled')); print_table_footer(2, '', '', false); } // display the form and table header print_form_header('bookmarksite', 'quickupdate'); print_table_header($vbphrase['social_bookmarking_manager'], 3); $bookmarksites_result = $db->query_read("\n\t\tSELECT * FROM " . TABLE_PREFIX . "bookmarksite AS bookmarksite\n\t\tORDER BY displayorder, title\n\t"); $bookmarksite_count = $db->num_rows($bookmarksites_result); if ($bookmarksite_count) { print_description_row('<label><input type="checkbox" id="allbox" checked="checked" />' . $vbphrase['toggle_active_status_for_all'] . '</label><input type="image" src="../' . $vbulletin->options['cleargifurl'] . '" name="normalsubmit" />', false, 3, 'thead" style="font-weight:normal; padding:0px 4px 0px 4px'); print_column_style_code(array('width:20%; white-space:nowrap', 'width:60%', "width:20%; white-space:nowrap; text-align:{$stylevar['right']}")); while ($bookmarksite = $db->fetch_array($bookmarksites_result)) { print_cells_row(array('<label class="smallfont"><input type="checkbox" name="active[' . $bookmarksite['bookmarksiteid'] . ']" value="1"' . ($bookmarksite['active'] ? ' checked="checked"' : '') . ' />' . $vbphrase['active'] . '</label> ' . '<input type="image" src="../cpstyles/' . $vbulletin->options['cpstylefolder'] . '/move_down.gif" name="displayorderswap[' . $bookmarksite['bookmarksiteid'] . ',higher]" />' . '<input type="text" name="displayorder[' . $bookmarksite['bookmarksiteid'] . ']" value="' . $bookmarksite['displayorder'] . '" class="bginput" size="4" title="' . $vbphrase['display_order'] . '" style="text-align:' . $stylevar['right'] . '" />' . '<input type="image" src="../cpstyles/' . $vbulletin->options['cpstylefolder'] . '/move_up.gif" name="displayorderswap[' . $bookmarksite['bookmarksiteid'] . ',lower]" />', '<a href="bookmarksite.php?' . $vbulletin->session->vars['sessionurl'] . 'do=edit&bookmarksiteid=' . $bookmarksite['bookmarksiteid'] . '" title="' . $vbphrase['edit'] . '">' . $bookmarksite['title'] . '</a>', construct_link_code($vbphrase['edit'], 'bookmarksite.php?' . $vbulletin->session->vars['sessionurl'] . 'do=edit&bookmarksiteid=' . $bookmarksite['bookmarksiteid']) . construct_link_code($vbphrase['delete'], 'bookmarksite.php?' . $vbulletin->session->vars['sessionurl'] . 'do=delete&bookmarksiteid=' . $bookmarksite['bookmarksiteid'])), false, '', -1); } $db->free_result($bookmarksites_result);
/** * Prints the standard form header, setting target script and action to perform * * @param string PHP script to which the form will submit (ommit file suffix) * @param string 'do' action for target script * @param boolean Whether or not to include an encoding type for the form (for file uploads) * @param boolean Whether or not to add a <table> to give the form structure * @param string Name for the form - <form name="$name" ... > * @param string Width for the <table> - default = '90%' * @param string Value for 'target' attribute of form * @param boolean Whether or not to place a <br /> before the opening form tag * @param string Form method (GET / POST) * @param integer CellSpacing for Table */ function print_form_header($phpscript = '', $do = '', $uploadform = false, $addtable = true, $name = 'cpform', $width = '90%', $target = '', $echobr = true, $method = 'post', $cellspacing = 0, $border_collapse = false) { global $vbulletin, $tableadded; if (($quote_pos = strpos($name, '"')) !== false) { $clean_name = substr($name, 0, $quote_pos); } else { $clean_name = $name; } echo "\n<!-- form started:" . $vbulletin->db->querycount . " queries executed -->\n"; echo "<form action=\"{$phpscript}.php?do={$do}\"" . iif($uploadform, ' enctype="multipart/form-data"') . " method=\"{$method}\"" . iif($target, " target=\"{$target}\"") . " name=\"{$clean_name}\" id=\"{$name}\">\n"; if (!empty($vbulletin->session->vars['sessionhash'])) { //construct_hidden_code('s', $vbulletin->session->vars['sessionhash']); echo "<input type=\"hidden\" name=\"s\" value=\"" . htmlspecialchars_uni($vbulletin->session->vars['sessionhash']) . "\" />\n"; } //construct_hidden_code('do', $do); echo "<input type=\"hidden\" name=\"do\" value=\"" . htmlspecialchars_uni($do) . "\" />\n"; if (strtolower(substr($method, 0, 4)) == 'post') { echo "<input type=\"hidden\" name=\"adminhash\" value=\"" . ADMINHASH . "\" />\n"; echo "<input type=\"hidden\" name=\"securitytoken\" value=\"" . $vbulletin->userinfo['securitytoken'] . "\" />\n"; } if ($addtable) { print_table_start($echobr, $width, $cellspacing, $clean_name . '_table', $border_collapse); } else { $tableadded = 0; } }
$errnote = "<dfn><font color=\"red\">{$vbphrase['ame_import_error_missing_values']}</font><dfn>"; } elseif ($value['existing_char_key']) { $errnote = "<dfn><font color=\"red\">"; if ($existing["{$value['provider']}"]['id']) { $errnote .= $vbphrase['ame_import_error_duplicates_in_db']; } else { $errnote .= $vbphrase['ame_import_error_duplicates_in_xml']; } $errnote = "{$errnote}</font></dfn>"; } else { $errnote = ""; } $bgcounter++; print_description_row("<div ondblclick=\"ame_toggle_group('import_{$x}'); return false;\">\n \t<div style=\"float: " . $vbulletin->stylevars['right']['string'] . "\">" . (!$errnote ? "<input type=\"checkbox\" name=\"import[{$x}]\" id=\"import_{$x}\" value=\"1\" " . ($errnote == '' ? "checked=\"checked\"" : "") . " />" : "<img src=\"../cpstyles/" . $vbulletin->options['cpstylefolder'] . "/colorpicker_close.gif\" alt=\"Cannot Import\" border=\"0\" />") . "</div>\n \t<a style=\"cursor: pointer;\" onclick=\"ame_toggle_group('import_{$x}'); return false;\"><img src=\"../cpstyles/" . $vbulletin->options['cpstylefolder'] . "/cp_collapse.gif\" title=\"Expand\" id=\"collapse_import_{$x}\" alt=\"Expand\" border=\"0\" /></a> <strong><a style=\"cursor: pointer;\" onclick=\"ame_toggle_group('import_{$x}'); return false;\">{$value['provider']}</a>{$errnote}</strong></div>\n\t"); echo "<tr>\n\t<td cellspacing=\"0\" cellpadding=\"0\" colspan=\"2\" style=\"display: none\" id=\"td_import_{$x}\">\n\t"; print_table_start(false, '100%', "0", "table_import_{$x}"); print_input_row($vbphrase['ame_provider'], "provider[{$x}]", $value['provider']); print_label_row($vbphrase['ame_tagoption'], $value['tagoption']); construct_hidden_code("tagoption[{$x}]", $value['tagoption']); print_input_row($vbphrase['ame_url'], "url[{$x}]", $value['url']); print_input_row($vbphrase['ame_priority'], "priority[{$x}]", $value['priority']); print_input_row($vbphrase['ame_regex_url'], "regex_url[{$x}]", $value['regex_url']); print_textarea_row($vbphrase['ame_regex_scrape'], "regex_scrape[{$x}]", $value['regex_scrape']); print_textarea_row($vbphrase['ame_embed'], "embed[{$x}]", $value['embed']); $x++; echo "</table></td></tr>"; } print_table_break(); } elseif (sizeof($arr['item'])) { print_stop_message('ame_import_error_old_format'); } else {
$specialtemplates = array('products'); // ########################## REQUIRE BACK-END ############################ require_once './global.php'; require_once DIR . '/includes/adminfunctions_template.php'; // ######################## CHECK ADMIN PERMISSIONS ####################### if (!can_administer('canadminpermissions')) { print_cp_no_permission(); } print_cp_header($vbphrase['ei_header']); if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'list'; } // ###################### Start list ####################### if ($_REQUEST['do'] == 'list') { $getusergroups = $db->query_read("\r\n\t\tSELECT usergroupid, title, ei_forumid\r\n\t\tFROM " . TABLE_PREFIX . "usergroup\r\n\t\tWHERE ei_auto = 1\r\n\t\tORDER BY `usergroupid`\r\n\t"); print_table_start('admin_ei'); print_table_header($vbphrase['ei_header_auto'], 2); print_description_row($vbphrase['ei_auto_how_to'], 0, 2); while ($getusergroup = $db->fetch_array($getusergroups)) { print_table_header($getusergroup['title'], 2); $forumlist = explode(",", $getusergroup['ei_forumid']); foreach ($forumlist as $key => $forumupdateid) { $getforuminfo = $db->query_read("SELECT title FROM " . TABLE_PREFIX . "forum WHERE forumid = {$forumupdateid}"); while ($foruminfo = $db->fetch_array($getforuminfo)) { $bg = fetch_row_bgclass(); echo "<tr><td class=\"" . $bg . "\">" . $foruminfo['title'] . "</td><td class=\"" . $bg . "\"><a href=\"admin_ei.php?" . $vbulletin->session->vars['sessionurl'] . "do=autosub&f=" . $forumupdateid . "&ug=" . $getusergroup['usergroupid'] . "\">" . $vbphrase['ei_update_sub'] . "</a></td></tr>"; } } } print_table_footer(2, '', '', 0); }
if ($_REQUEST['do'] == 'start') { print_form_header('admin_ei_search_settings', 'test'); print_table_header($vbphrase['ei_header_search_settings'], 2); print_description_row($vbphrase['ei_search_settings_how_to'], 0, 2); print_table_header($vbphrase['ei_help_enter'], 2); print_input_row($vbphrase['ei_help_hostname'], 'hostname'); print_input_row($vbphrase['ei_help_username'], 'username'); print_input_row($vbphrase['ei_help_password'], 'password'); print_input_row($vbphrase['ei_help_inbox'], 'inbox', 'INBOX'); print_submit_row("Submit!"); print_table_footer(2, '', '', 0); } // ###################### Start list ####################### if ($_POST['do'] == 'test') { $vbulletin->input->clean_array_gpc('p', array('hostname' => TYPE_STR, 'username' => TYPE_STR, 'password' => TYPE_STR, 'inbox' => TYPE_STR)); print_table_start('admin_ei_search_settings'); print_table_header($vbphrase['ei_header_search_settings'], 2); $success = 0; $pass = $vbulletin->GPC['password']; $host = ''; $user = ''; $connect = ''; $box = ''; $connecttypes = array(':110/pop3/notls', ':143/novalidate-cert', ':993/pop3/ssl', ':995/php3/ssl/novalidate-cert', ':993/imap/ssl', ':995/imap/ssl/novalidate-cert'); $connectphrases = array($vbphrase['ei_pop3'], $vbphrase['ei_imap'], $vbphrase['ei_pop3_ssl_of'], $vbphrase['ei_pop3_ssl_ss'], $vbphrase['ei_imap_ssl_of'], $vbphrase['ei_imap_ssl_ss']); $hosttypes = array($vbulletin->GPC['hostname'], "mail." . $vbulletin->GPC['hostname'] . "", "localhost"); $usertypes = array($vbulletin->GPC['username'], $vbulletin->GPC['username'] . "@" . $vbulletin->GPC['hostname']); if (!preg_match("/inbox/i", $vbulletin->GPC['inbox'])) { $boxnumber = 2; $boxtypes = array($vbulletin->GPC['inbox'], "INBOX"); } else {
function photoplog_maintain_postbitcounts($photoplog_start, $photoplog_perpage, $photoplog_phase, $header_phrase, $redirect) { global $vbulletin, $vbphrase; $photoplog_stop = intval($photoplog_start + $photoplog_perpage); print_table_start(); print_table_header($header_phrase, 1); print_cells_row(array('<nobr>' . $vbphrase['photoplog_postbit_file_and_comment_counts'] . '</nobr>'), 1, '', -1); $photoplog_table_name = $photoplog_phase ? 'photoplog_ratecomment' : 'photoplog_fileuploads'; $photoplog_msg = $vbphrase['photoplog_updating'] . ' ' . $photoplog_table_name . ' - ' . $vbphrase['photoplog_table'] . ' ' . TABLE_PREFIX . 'user: '******' - ' . $photoplog_stop; photoplog_update_postbit_counts_interval($photoplog_start, $photoplog_stop, $photoplog_phase); print_description_row($photoplog_msg, 0, 1); @flush(); @ob_flush(); if ($photoplog_phase == 0) { print_table_footer(); if ($photoplog_morecheck = $vbulletin->db->query_first("SELECT userid\r\n\t\t\t\tFROM " . PHOTOPLOG_PREFIX . "photoplog_fileuploads\r\n\t\t\t\tWHERE userid >= " . intval($photoplog_stop) . "\r\n\t\t\t\tORDER BY userid ASC\r\n\t\t\t\tLIMIT 1")) { $photoplog_stop = intval($photoplog_morecheck['userid']); print_cp_redirect($redirect . "?" . $vbulletin->session->vars['sessionurl'] . "do=postbitcounts&phase=0&start=" . $photoplog_stop . "&perpage=" . $photoplog_perpage, 1); } else { print_cp_redirect($redirect . "?" . $vbulletin->session->vars['sessionurl'] . "do=postbitcounts&phase=1&start=0&perpage=" . $photoplog_perpage, 1); } } else { if ($photoplog_morecheck = $vbulletin->db->query_first("SELECT userid\r\n\t\t\t\tFROM " . PHOTOPLOG_PREFIX . "photoplog_ratecomment\r\n\t\t\t\tWHERE userid >= " . intval($photoplog_stop) . "\r\n\t\t\t\tORDER BY userid ASC\r\n\t\t\t\tLIMIT 1")) { print_table_footer(); $photoplog_stop = intval($photoplog_morecheck['userid']); print_cp_redirect($redirect . "?" . $vbulletin->session->vars['sessionurl'] . "do=postbitcounts&phase=1&start=" . $photoplog_stop . "&perpage=" . $photoplog_perpage, 1); } else { print_description_row('<strong>' . $vbphrase['photoplog_done'] . '</strong>', 0, 1); print_table_footer(); } } }
<?php function print_table_start($farg) { echo "<table style=\"background-color:{$farg}\">"; } function print_table_row($cell1, $cell2) { echo "<tr>\n <td>{$cell1}</td><td>{$cell2}</td>\n </tr>"; } function print_table_end() { echo "</table>"; } ?> <!DOCTYPE html> <html lang="sv"> <head> <meta charset="utf-8"> <title></title> <link rel="stylesheet" href=""> </head> <body> <?php print_table_start("red"); print_table_row("Fredag", "Lördag"); print_table_end(); ?> </body> </html>
/** * Prints the standard form header, setting target script and action to perform * * @param string PHP script to which the form will submit (ommit file suffix) * @param string 'do' action for target script * @param boolean Whether or not to include an encoding type for the form (for file uploads) * @param boolean Whether or not to add a <table> to give the form structure * @param string Name for the form - <form name="$name" ... > * @param string Width for the <table> - default = '90%' * @param string Value for 'target' attribute of form * @param boolean Whether or not to place a <br /> before the opening form tag * @param string Form method (GET / POST) * @param integer CellSpacing for Table */ function print_form_header($phpscript = '', $do = '', $uploadform = false, $addtable = true, $name = 'cpform', $width = '90%', $target = '', $echobr = true, $method = 'post', $cellspacing = 0, $border_collapse = false, $formid = '') { global $vbulletin, $tableadded; if (($quote_pos = strpos($name, '"')) !== false) { $clean_name = substr($name, 0, $quote_pos); } else { $clean_name = $name; } echo "\n<!-- form started:" . $vbulletin->db->querycount . " queries executed -->\n"; echo "<form action=\"$phpscript.php?do=$do\"" . ($uploadform ? " enctype=\"multipart/form-data\"" : "") . " method=\"$method\"" . ($target ? " target=\"$target\"" : "") . " name=\"$clean_name\" id=\"" . ($formid ? $formid : $clean_name) . "\">\n"; if (!empty($vbulletin->session->vars['sessionhash'])) { //construct_hidden_code('s', $vbulletin->session->vars['sessionhash']); echo "<input type=\"hidden\" name=\"s\" value=\"" . htmlspecialchars_uni($vbulletin->session->vars['sessionhash']) . "\" />\n"; } //construct_hidden_code('do', $do); echo "<input type=\"hidden\" name=\"do\" id=\"do\" value=\"" . htmlspecialchars_uni($do) . "\" />\n"; if (strtolower(substr($method, 0, 4)) == 'post') // do this because we now do things like 'post" onsubmit="bla()' and we need to just know if the string BEGINS with POST { echo "<input type=\"hidden\" name=\"adminhash\" value=\"" . ADMINHASH . "\" />\n"; echo "<input type=\"hidden\" name=\"securitytoken\" value=\"" . $vbulletin->userinfo['securitytoken'] . "\" />\n"; } if ($addtable) { print_table_start($echobr, $width, $cellspacing, $clean_name . '_table', $border_collapse); } else { $tableadded = 0; } }
<input type="submit" name="submit_diff" class="submit" value="<?php echo $vbphrase['update']; ?> " accesskey="u" /> <?php } ?> </td> </tr> <?php construct_hidden_code('left_template', $vbulletin->GPC['left_template']); construct_hidden_code('right_template', $vbulletin->GPC['right_template']); construct_hidden_code('wrap', $wrap); construct_hidden_code('inline', $inline); print_table_footer(1); print_table_start(true, '90%', '', '', true); print_table_header(construct_phrase($vbphrase['comparing_versions_of_x'], htmlspecialchars_uni($left_template['title'])), 4); if (!$inline) { // side by side print_cells_row(array($vbphrase['old_version'], $vbphrase['new_version']), true, false, 1); foreach ($entries as $diff_entry) { // possible classes: unchanged, notext, deleted, added, changed echo "<tr>\n\t"; echo '<td width="50%" valign="top" class="diff-' . $diff_entry->fetch_data_old_class() . '" dir="ltr">'; foreach ($diff_entry->fetch_data_old() as $content) { echo $diff_entry->prep_diff_text($content, $wrap) . "<br />\n"; } echo '</td><td width="50%" valign="top" class="diff-' . $diff_entry->fetch_data_new_class() . '" dir="ltr">'; foreach ($diff_entry->fetch_data_new() as $content) { echo $diff_entry->prep_diff_text($content, $wrap) . "<br />\n"; }
/** * Conditionally displays begining output for displaying progress */ protected function display_begin() { global $vbphrase; if ($this->options['output_progress']) { print_table_start(); print_table_header($vbphrase['generate_vbulletin_4_style'], 1); echo '<tr><td class="alt1"><div style="padding:4px;">'; } }
/** * Prints a standard table with a warning/notice * * @param Message to print */ function print_warning_table($message) { print_table_start(); print_description_row($message, false, 2, 'warning'); print_table_footer(2, '', '', false); }
$logs = $result['downloads']; $totalpages = ceil($result['downloads'] / $vbulletin->GPC['perpage']); if ($vbulletin->GPC['pagenumber'] < 1) { $vbulletin->GPC['pagenumber'] = 1; } $startat = ($vbulletin->GPC['pagenumber'] - 1) * $vbulletin->GPC['perpage']; $result = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "dl_downloads ORDER BY `id` DESC LIMIT {$startat}, " . $vbulletin->GPC['perpage'] . " "); if ($db->num_rows($result)) { if ($vbulletin->GPC['pagenumber'] != 1) { $prv = $vbulletin->GPC['pagenumber'] - 1; $firstpage = "<input type=\"button\" class=\"button\" value=\"« " . $vbphrase['first_page'] . "\" tabindex=\"1\" onclick=\"window.location='downloadadmin.php?do=downloads&page=1'\" />"; $prevpage = "<input type=\"button\" class=\"button\" value=\"< " . $vbphrase['prev_page'] . "\" tabindex=\"1\" onclick=\"window.location='downloadadmin.php?do=downloads&page={$prv}'\" />"; } if ($vbulletin->GPC['pagenumber'] != $totalpages) { $nxt = $vbulletin->GPC['pagenumber'] + 1; $nextpage = "<input type=\"button\" class=\"button\" value=\"" . $vbphrase['next_page'] . " >\" tabindex=\"1\" onclick=\"window.location='downloadadmin.php?do=downloads&page={$nxt}'\" />"; $lastpage = "<input type=\"button\" class=\"button\" value=\"" . $vbphrase['last_page'] . " »\" tabindex=\"1\" onclick=\"window.location='downloadadmin.php?do=downloads&page={$totalpages}'\" />"; } } $page = $vbulletin->GPC['pagenumber']; print_cp_header('Downloads'); print_table_start('downloadadmin'); print_table_header("Downloads - Total log entries: {$logs} - Page: {$page} of {$totalpages}", 5); echo '<tr><td class="thead">User</td><td class="thead">File</td><td class="thead">Date</td><td class="thead">File Size</td><td class="thead">IP Address</td></tr>'; while ($download = $db->fetch_array($result)) { $class = fetch_row_bgclass(); echo '<tr><td class="' . $class . '"><a href="user.php?' . $vbulletin->session->vars['sessionurl'] . 'do=edit&u=' . $download['userid'] . '">' . $download['user'] . '</a></td><td class="' . $class . '"><a href="../downloads.php?do=file&id=' . $download['fileid'] . '">' . $download['file'] . '</a></td><td class="' . $class . '"><span class="smallfont">' . vbdate($vbulletin->options['logdateformat'], $download['time']) . '</span></td><td class="' . $class . '">' . vb_number_format($download['filesize'], 0, true) . '</td><td class="' . $class . '"><span class="smallfont"><a href="usertools.php?' . $vbulletin->session->vars['sessionurl'] . 'do=gethost&ip=' . $download['clientip'] . '">' . $download['clientip'] . '</a></span></td></tr>'; } print_table_footer(5, "{$firstpage} {$prevpage} {$nextpage} {$lastpage}"); print_cp_footer(); }
function admincp_search_displaysearch_results($results, $pagingInfo, $terms) { global $vbphrase; print_table_start(); print_table_header(construct_phrase($vbphrase['showing_x_to_y_of_z_results_for_t'], $pagingInfo['startcount'], $pagingInfo['endcount'], $pagingInfo['totalcount'], $terms), 2); foreach ($results as $result) { print_cells_row(array('<a href="' . $result['url'] . '">' . $result['title'] . '</a>')); } print_table_footer(); }