function print_diagnostic_test_result($status, $reasons = array(), $exit = 1) { // $status values = -1: indeterminate; 0: failed; 1: passed // $reasons a list of reasons why the test passed/failed // $exit values = 0: continue execution; 1: stop here global $vbphrase; print_form_header('', ''); print_table_header($vbphrase['results']); if (is_array($reasons)) { foreach ($reasons AS $reason) { print_description_row($reason); } } else if (!empty($reasons)) { print_description_row($reasons); } print_table_footer(); if ($exit == 1) { print_cp_footer(); } }
function rpm_print_stop_back($text = 'error') { global $vbphrase; if (!defined('DONE_CPHEADER')) { print_cp_header($vbphrase['vbulletin_message']); } echo '<p> </p><p> </p>'; print_form_header('', '', 0, 1, 'messageform', '65%'); print_table_header($vbphrase['vbulletin_message']); print_description_row("<blockquote><br />{$text}<br /><br /></blockquote>"); print_table_footer(2, construct_button_code($vbphrase['go_back'], 'javascript:history.back(1)')); rpm_print_footer(); print_cp_footer(); }
//in any of the tables in our result set) and we'll catch it on redirect. //Plus the admincp isn't a big SEO issue -- we just want to get the links //on the classes so that they work and centralize logic for future changes. $postlink = fetch_seo_url('thread|bburl', $comment, array('p' => $comment['postid'])) . "#post{$comment['postid']}"; } $cell = array(); $cell[] = "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&u={$comment['whoadded']}\"><b>{$comment['leftby_username']}</b></a>"; $cell[] = "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&u={$comment['userid']}\"><b>{$comment['leftfor_username']}</b></a>"; $cell[] = '<span class="smallfont">' . vbdate($vbulletin->options['logdateformat'], $comment['dateline']) . '</span>'; $cell[] = $comment['reputation']; $cell[] = !empty($comment['reason']) ? '<span class="smallfont">' . htmlspecialchars_uni($comment['reason']) . '</span>' : ''; $cell[] = $postlink ? construct_link_code(htmlspecialchars_uni($vbphrase['post']), $postlink, true, '', true) : ' '; $cell[] = construct_link_code($vbphrase['edit'], "adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=editreputation&reputationid={$comment['reputationid']}", false, '', true) . ' ' . construct_link_code($vbphrase['delete'], "adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=deletereputation&reputationid={$comment['reputationid']}", false, '', true); print_cells_row($cell); } print_table_footer(7, "{$firstpage} {$prevpage} {$nextpage} {$lastpage}"); } // ************************************************************************************************* if ($_REQUEST['do'] == 'editreputation') { $vbulletin->input->clean_array_gpc('r', array('reputationid' => TYPE_INT)); if ($repinfo = $db->query_first("\n\t\tSELECT rep.*, whoadded.username as whoadded_username, user.username, thread.title, thread.threadid\n\t\tFROM " . TABLE_PREFIX . "reputation AS rep\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (rep.userid = user.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS whoadded ON (rep.whoadded = whoadded.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "post AS post ON (rep.postid = post.postid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid = post.threadid)\n\t\tWHERE reputationid = " . $vbulletin->GPC['reputationid'])) { print_form_header('adminreputation', 'doeditreputation'); print_table_header($vbphrase['edit_reputation']); print_label_row($vbphrase['thread'], $repinfo['title'] ? "<a href=\"" . fetch_seo_url('thread|bburl', $repinfo, array('p' => $repinfo['postid'])) . "#post{$repinfo['postid']}" . "\">{$repinfo['title']}</a>" : ''); print_label_row($vbphrase['leftby'], $repinfo['whoadded_username']); print_label_row($vbphrase['leftfor'], $repinfo['username']); print_input_row($vbphrase['comment'], 'reputation[reason]', $repinfo['reason']); print_input_row($vbphrase['reputation'], 'reputation[reputation]', $repinfo['reputation'], 0, 5); construct_hidden_code('reputationid', $vbulletin->GPC['reputationid']); construct_hidden_code('oldreputation', $repinfo[reputation]); construct_hidden_code('userid', $repinfo['userid']);
/** * Halts execution and shows the specified message * * @param string Message to display * @param mixed If specified, a redirect will be performed to the URL in this parameter * @param integer If redirect is specified, this is the time in seconds to delay before redirect * @param string If specified, will provide a specific URL for "Go Back". If empty, no button will be displayed! * @param bool If true along with redirect, 'CONTINUE' button will be used instead of automatic redirect */ function print_cp_message($text = '', $redirect = NULL, $delay = 1, $backurl = NULL, $continue = false) { global $vbulletin, $vbphrase; if ($redirect and $vbulletin->session->vars['sessionurl']) { if (strpos($redirect, '?') === false) { $redirect .= '?'; } $redirect .= '&' . $vbulletin->session->vars['sessionurl']; } if (!defined('DONE_CPHEADER')) { print_cp_header($vbphrase['vbulletin_message']); } echo '<p> </p><p> </p>'; print_form_header('', '', 0, 1, 'messageform', '65%'); print_table_header($vbphrase['vbulletin_message']); print_description_row("<blockquote><br />{$text}<br /><br /></blockquote>"); if ($redirect and $redirect !== NULL) { // redirect to the new page if ($continue) { $continueurl = str_replace('&', '&', $redirect); print_table_footer(2, construct_button_code($vbphrase['continue'], create_full_url($continueurl))); } else { print_table_footer(); $redirect_click = create_full_url($redirect); $redirect_click = str_replace('"', '', $redirect_click); echo '<p align="center" class="smallfont">' . construct_phrase($vbphrase['if_you_are_not_automatically_redirected_click_here_x'], $redirect_click) . "</p>\n"; print_cp_redirect($redirect, $delay); } } else { // end the table and halt if ($backurl === NULL) { $backurl = 'javascript:history.back(1)'; } if (strpos($backurl, 'history.back(') !== false) { //if we are attempting to run a history.back(1), check we have a history to go back to, otherwise attempt to close the window. $back_button = ' <input type="button" id="backbutton" class="button" value="' . $vbphrase['go_back'] . '" title="" tabindex="1" onclick="if (history.length) { history.back(1); } else { self.close(); }"/> <script type="text/javascript"> <!-- if (history.length < 1 || ((is_saf || is_moz) && history.length <= 1)) // safari + gecko start at 1 { document.getElementById("backbutton").parentNode.removeChild(document.getElementById("backbutton")); } //--> </script>'; } else { if ($backurl !== '') { // regular window.location=url call $backurl = create_full_url($backurl); $backurl = str_replace(array('"', "'"), '', $backurl); $back_button = '<input type="button" class="button" value="' . $vbphrase['go_back'] . '" title="" tabindex="1" onclick="window.location=\'' . $backurl . '\';"/>'; } else { $back_button = ''; } } print_table_footer(2, $back_button); } // and now terminate the script print_cp_footer(); }
$phrasetypes = fetch_phrasetypes_array(); foreach($phrasetypes AS $fieldname => $type) { $typeoptions["$fieldname"] = construct_phrase($vbphrase['x_phrases'], $type['title']); } */ print_form_header('language', 'add'); construct_hidden_code('goto', "language.php?" . $vbulletin->session->vars['sessionurl']); print_table_header($vbphrase['language_manager'], 4); print_cells_row(array($vbphrase['language'], '', '', $vbphrase['default']), 1); if ($vbulletin->debug) { print_language_row(array('languageid' => -1, 'title' => "<i>{$vbphrase['master_language']}</i>")); } $languages = fetch_languages_array(); foreach ($languages as $_languageid => $language) { print_language_row($language); } print_description_row(construct_link_code($vbphrase['search_phrases'], "phrase.php?" . $vbulletin->session->vars['sessionurl'] . "do=search") . construct_link_code($vbphrase['view_quickref'], "javascript:js_open_phrase_ref(0,0);") . construct_link_code($vbphrase['rebuild_all_languages'], "language.php?" . $vbulletin->session->vars['sessionurl'] . "do=rebuild&goto=language.php?" . $vbulletin->session->vars['sessionurl']), 0, 4, 'thead" style="text-align:center; font-weight:normal'); print_table_footer(4, ' <input type="submit" class="button" value="' . $vbphrase['add_new_language'] . '" tabindex="1" /> <input type="button" class="button" value="' . $vbphrase['download_upload_language'] . '" tabindex="1" onclick="window.location=\'language.php?do=files\';" /> '); print_phrase_ref_popup_javascript(); } print_cp_footer(); /*======================================================================*\ || #################################################################### || # Downloaded: 12:56, Sat Oct 11th 2008 || # CVS: $RCSfile$ - $Revision: 26900 $ || #################################################################### \*======================================================================*/
function print_reminder($event) { global $vbulletin, $vbphrase; print_form_header('reminder', 'redirecter'); construct_hidden_code('reminderid', $event['reminderid']); print_table_header(construct_phrase($vbphrase['adminfunctions_reminder_showevent_adminreminderdue'], vbdate($vbphrase['adminfunctions_reminder_showevent_date'], $event['duedate']), $event[reminderid])); print_label_row($vbphrase['adminfunctions_reminder_showevent_postedby'], "<a href=\"../member.php?" . $vbulletin->session->vars['sessionurl'] . "u={$event['userid']}\" target=\"_blank\">{$event['username']}</a>"); print_label_row($vbphrase['title'], $event['title']); if (!empty($event['text'])) { print_label_row($vbphrase['adminfunctions_reminder_showevent_extrainfo'], nl2br(htmlspecialchars_uni($event['text']))); } print_label_row($vbphrase['status'], fetch_reminder_status($event)); print_table_footer(2, ' <input type="button" class="button" value="' . $vbphrase['completed'] . '" onclick="js_confirm_completion(' . $event['reminderid'] . ')" tabindex="1" /> <input type="submit" class="button" name="dodelete" value="' . $vbphrase['delete'] . '" tabindex="1" /> <input type="submit" class="button" name="doedit" value="' . construct_phrase($vbphrase['edit_x'], $vbphrase['event']) . '" tabindex="1" /> <input type="button" class="button" value="' . $vbphrase['adminfunctions_reminder_showevent_newevent'] . '" tabindex="1" onclick="' . "window.location='reminder.php?" . $vbulletin->session->vars['sessionurl'] . "do=add&year=" . vbdate('Y', $event['duedate']) . "&month=" . vbdate('n', $event['duedate']) . "&add_day=" . vbdate('j', $event['duedate']) . "';" . '" /> '); }
function displaytags() { global $vbulletin, $vbphrase, $db; if ($vbulletin->GPC['pagenumber'] < 1) { $vbulletin->GPC['pagenumber'] = 1; } if ($vbulletin->GPC['sort'] == 'dateline') { $where = 'WHERE canonicaltagid = 0'; $order = 'dateline DESC'; $synonyms_in_list = false; } else if ($vbulletin->GPC['sort'] == 'alphaall') { $where = ''; $order = 'tagtext ASC'; $synonyms_in_list = true; } else { $where = 'WHERE canonicaltagid = 0'; $order = 'tagtext ASC'; $synonyms_in_list = false; } $column_count = 3; $max_per_column = 15; $perpage = $column_count * $max_per_column; list($tag_count) = $db->query_first( "SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "tag $where", DBARRAY_NUM ); $start = ($vbulletin->GPC['pagenumber'] - 1) * $perpage; if ($start >= $tag_count) { $start = max(0, $tag_count - $perpage); } $tags = $db->query_read(" SELECT * FROM " . TABLE_PREFIX . "tag $where ORDER BY $order LIMIT $start, $perpage "); print_form_header('tag', '', false, true, 'tagsform'); print_table_header($vbphrase['tag_list'], 3); if ($db->num_rows($tags)) { $columns = array(); $counter = 0; // build page navigation $pagenav = tagcp_build_page_nav($vbulletin->GPC['pagenumber'], ceil($tag_count / $perpage), $vbulletin->GPC['sort']); $sort_links[''] = '<a href="tag.php?do=tags">' . $vbphrase['display_alphabetically'] . '</a>'; $sort_links['dateline'] = '<a href="tag.php?do=tags&sort=dateline">' . $vbphrase['display_newest'] . '</a>'; $sort_links['alphaall'] = '<a href="tag.php?do=tags&sort=alphaall">' . $vbphrase['display_alphabetically_all'] . '</a>'; //dont show the current sort unset($sort_links[$vbulletin->GPC['sort']]); print_description_row( "<div style=\"float: " . vB_Template_Runtime::fetchStyleVar('left') . "\">" . implode(" " , $sort_links) . "</div>$pagenav", false, 3, 'thead', 'right' ); // build columns while ($tag = $db->fetch_array($tags)) { $columnid = floor($counter++ / $max_per_column); $columns["$columnid"][] = tagcp_format_tag_entry($tag, $synonyms_in_list); } // make column values printable $cells = array(); for ($i = 0; $i < $column_count; $i++) { if ($columns["$i"]) { $cells[] = implode("<br />\n", $columns["$i"]); } else { $cells[] = ' '; } } print_column_style_code(array( 'width: 33%', 'width: 33%', 'width: 34%' )); print_cells_row($cells, false, false, -3); ?> <tr> <td colspan="<?php echo $column_count; ?>" align="center" class="tfoot"> <select id="select_tags" name="do"> <option value="tagmerge" id="select_tags_merge"><?php echo $vbphrase['merge_selected_synonym']; ?></option> <option value="tagdopromote" id="select_tags_delete"><?php echo $vbphrase['promote_synonyms_selected']; ?></option> <option value="tagkill" id="select_tags_delete"><?php echo $vbphrase['delete_selected']; ?></option> <optgroup label="____________________"> <option value="tagclear"><?php echo $vbphrase[deselect_all_tags]; ?></option> </optgroup> </select> <input type="hidden" name="page" value="<?php echo $vbulletin->GPC['pagenumber']; ?>" /> <input type="hidden" name="sort" value="<?php echo $vbulletin->GPC['sort']; ?>" /> <input type="submit" value="<?php echo $vbphrase[go]; ?>" id="tag_inlinego" class="button" /> </td> </tr> </table> <script type="text/javascript" src="../clientscript/vbulletin_inlinemod.js?v=<?php echo $vboptions[simpleversion]; ?>"></script> <script type="text/javascript"> <!-- inlineMod_tags = new vB_Inline_Mod('inlineMod_tags', 'tag', 'tagsform', '<?php echo $vbphrase[go_x]; ?>', 'vbulletin_inline', 'tag'); /* vBmenu.register("inlinemodsel"); */ //--> function js_show_synlist(trigger, listid) { list = document.getElementById(listid); list.style.display = 'block'; trigger.onclick = function() {return js_hide_synlist(trigger, listid)}; trigger.getElementsByTagName('img')[0].src = '../cpstyles/<?php echo $vbulletin->options['cpstylefolder'] ?>/collapse_generic.gif'; return false; } function js_hide_synlist(trigger, listid) { list = document.getElementById(listid); list.style.display = 'none'; trigger.onclick = function() {return js_show_synlist(trigger, listid)}; trigger.getElementsByTagName('img')[0].src = '../cpstyles/<?php echo $vbulletin->options['cpstylefolder'] ?>/collapse_generic_collapsed.gif'; return false; } </script> </form> <?php } else { print_description_row($vbphrase['no_tags_defined'], false, 3, '', 'center'); print_table_footer(); } construct_hidden_code('page', $vbulletin->GPC['pagenumber']); construct_hidden_code('sort', $vbulletin->GPC['sort']); print_form_header('tag', 'taginsert'); print_input_row($vbphrase['add_tag'], 'tagtext'); print_submit_row(); }
$headings[] = "<a href=\"javascript:js_open_phrase_ref({$language['languageid']},'{$_fieldname}');\" title=\"" . $vbphrase['view_quickref'] . ": {$language['title']}\">{$language['title']}</a>"; } $headings[] = ''; print_cells_row($headings, 0, 'thead'); ksort($varnames); foreach ($varnames as $varname => $phrase) { $cell = array(construct_wrappable_varname($varname, 'font-weight:bold;', 'smallfont', 'span')); if (isset($phrase['-1'])) { $phraseid = $phrase['-1']; $custom = 0; } else { $phraseid = $phrase['0']; $custom = 1; } foreach (array_keys($languages) as $_languageid) { $cell[] = "<img src=\"../cpstyles/" . $vbulletin->options['cpstylefolder'] . "/cp_tick_" . iif(isset($phrase["{$_languageid}"]), 'yes', 'no') . ".gif\" alt=\"\" />"; } $cell[] = '<span class="smallfont">' . construct_link_code(fetch_tag_wrap($vbphrase['edit'], 'span class="col-i"', $custom == 1), "phrase.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&phraseid={$phraseid}&page=" . $vbulletin->GPC['pagenumber'] . "&pp=" . $vbulletin->GPC['perpage'] . "&fieldname=" . $vbulletin->GPC['fieldname']) . iif($custom or $vbulletin->debug, construct_link_code(fetch_tag_wrap($vbphrase['delete'], 'span class="col-i"', $custom == 1), "phrase.php?" . $vbulletin->session->vars['sessionurl'] . "do=delete&phraseid={$phraseid}&page=" . $vbulletin->GPC['pagenumber'] . "&pp=" . $vbulletin->GPC['perpage'] . "&fieldname=" . $vbulletin->GPC['fieldname']), '') . '</span>'; print_cells_row($cell, 0, 0, 0, 'top', 0); } } print_table_footer($colspan, "\n\t\t<input type=\"button\" class=\"button\" value=\"" . $vbphrase['search_in_phrases'] . "\" tabindex=\"1\" onclick=\"window.location='phrase.php?" . $vbulletin->session->vars['sessionurl'] . "&do=search';\" />\n\t\t \n\t\t<input type=\"button\" class=\"button\" value=\"" . $vbphrase['add_new_phrase'] . "\" tabindex=\"1\" onclick=\"window.location='phrase.php?" . $vbulletin->session->vars['sessionurl'] . "do=add&fieldname=" . $vbulletin->GPC['fieldname'] . "&page=" . $vbulletin->GPC['pagenumber'] . "&pp=" . $vbulletin->GPC['perpage'] . "';\" />\n\t\t \n\t\t<input type=\"button\" class=\"button\" value=\"" . $vbphrase['find_orphan_phrases'] . "\" tabindex=\"1\" onclick=\"window.location='phrase.php?" . $vbulletin->session->vars['sessionurl'] . "do=findorphans';\" />\n\t"); } // ############################################################################# print_cp_footer(); /*======================================================================*\ || #################################################################### || # Downloaded: 09:39, Wed Nov 5th 2008 || # CVS: $RCSfile$ - $Revision: 27619 $ || #################################################################### \*======================================================================*/
print_table_footer(4, "<input type=\"submit\" class=\"button\" tabindex=\"1\" value=\"" . $vbphrase['save_display_order'] . "\" accesskey=\"s\" />" . construct_button_code($vbphrase['add_new_forum_gforum'], "forum.php?" . vB::getCurrentSession()->get('sessionurl') . "do=add")); if ($vbulletin->options['cp_collapse_forums']) { echo '<p class="smallfont" align="center">' . construct_link_code($vbphrase['expand_all'], "forum.php?" . vB::getCurrentSession()->get('sessionurl') . "do=modify&expandid=-2") . '</p>'; } } else { print_form_header('forum', 'doorder'); print_table_header($vbphrase['channel_manager_gforum'], 2); print_cells_row(array($vbphrase['channel'], $vbphrase['controls']), 1, 'tcat'); $cell = array(); $select = '<select name="nodeid" id="sel_foruid" tabindex="1" class="bginput">'; $select .= construct_channel_chooser($vbulletin->GPC['nodeid'], true); $select .= "</select>\n"; $cell[] = $select; $cell[] = "\n\t<select name=\"controls\" class=\"bginput\">\n" . construct_select_options($channeloptions) . "\t</select><input type=\"button\" class=\"button\" value=\"" . $vbphrase['go'] . "\" onclick=\"js_channel_jump(js_returnid());\" />\n\t"; print_cells_row($cell); print_table_footer(2, construct_button_code($vbphrase['add_new_forum_gforum'], "forum.php?" . vB::getCurrentSession()->get('sessionurl') . "do=add")); } } // ###################### Start update ####################### if ($_REQUEST['do'] == 'view') { $vbulletin->input->clean_array_gpc('r', array('nodeid' => vB_Cleaner::TYPE_UINT)); $channel = vB_Api::instanceInternal('node')->getNode($vbulletin->GPC['nodeid']); if (empty($channel)) { print_stop_message2('invalid_channel_specified'); } $path = vB_Api::instanceInternal('route')->getUrl($channel['routeid'], array(), array()); $baseurl = vB::getDatastore()->getOption('frontendurl'); print_cp_redirect($baseurl . $path); } print_cp_footer(); /*=========================================================================*\
function printUpload($sessionid) { global $vbphrase; print_cp_header($vbphrase['verticalresponse']); require_once DIR . '/includes/adminfunctions_user.php'; require_once DIR . '/includes/adminfunctions_profilefield.php'; print_form_header('verticalresponse', 'confirm_upload', false, true, 'verticalresponse'); print_table_header($vbphrase['upload_list'], 2); //get the current lists if ($sessionid) { $client = new vB_VerticalResponse(); if (!$client->checkStatus($sessionid)) { printLogin($vbphrase['vr_login_first_desc']); return; } $lists = $client->enumerateLists($sessionid); } if ($lists) { $current_lists = ''; foreach ($lists as $list) { if ($list->status == 'active') { $current_lists .= "<option value=\"" . $list->id . "\">" . htmlspecialchars_uni($list->name) . '- ' . '- ' . $list->size . "</option>" . "\n"; } } if (!empty($current_lists)) { $current_lists = "<option value=\"\"> </option>" . "\n" . $current_lists; print_cells_row(array($vbphrase['select_vr_list_desc'], "<select id=\"listid\" name=\"listid\"/>{$current_lists}</select>")); } } print_cells_row(array($vbphrase['verticalresponse_list_desc'], "<input id=\"listname\" type=\"text\" name=\"listname\"/ value=\"\">")); print_cells_row(array($vbphrase['vr_dopercycle_desc'], "<input id=\"do_percycle\" type=\"text\" name=\"do_percycle\"/ value=\"1000\">")); print_table_break(); print_user_search_rows(true); print_submit_row($vbphrase['submit']); print_table_footer(); }
for ($i = 1; $i <= $totalpages; $i++) { $pagebuttons .= "\t<input type=\"submit\" class=\"button\" name=\"pagesub\" value=\" {$i} \"" . iif($i == $page, ' disabled="disabled"') . " tabindex=\"1\" />\n"; } $pagebuttons .= "\t "; } else { $pagebuttons = ''; } if ($vbulletin->GPC['massmove']) { $categories = '<option value="0"></option>'; $categories .= construct_select_options(fetch_image_categories_array($catid)); $categories = '<select name="selectall" class="bginput" onchange="js_select_all(this.form);">' . $categories . '</select>'; $buttontext = $vbphrase['mass_move']; } else { $buttontext = $vbphrase['save_display_order']; } print_table_footer($img_per_row, "\n\t{$categories} <input type=\"submit\" class=\"button\" name=\"doorder\" value=\"" . $buttontext . "\" tabindex=\"1\" />\n\t {$pagebuttons}\n\t" . $vbphrase['per_page'] . "\n\t<input type=\"text\" name=\"perpage\" value=\"" . $vbulletin->GPC['perpage'] . "\" size=\"3\" tabindex=\"1\" />\n\t<input type=\"submit\" class=\"button\" value=\"" . $vbphrase['go'] . "\" tabindex=\"1\" />\n\t"); echo "<p align=\"center\">" . construct_link_code($vbphrase["add_{$itemtype}"], "image.php?" . $vbulletin->session->vars['sessionurl'] . "do=add&table=" . $vbulletin->GPC['table']) . construct_link_code($vbphrase["edit_{$itemtype}_categories"], "image.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify&table=" . $vbulletin->GPC['table']) . "</p>"; } // ###################### Start Modify Categories ####################### if ($_REQUEST['do'] == 'modify') { $categories = $db->query_read("\n\t\tSELECT imagecategory.*, COUNT(" . $vbulletin->GPC['table'] . ".{$itemid}) AS items\n\t\tFROM " . TABLE_PREFIX . "imagecategory AS imagecategory\n\t\tLEFT JOIN " . TABLE_PREFIX . $vbulletin->GPC['table'] . " AS " . $vbulletin->GPC['table'] . " USING(imagecategoryid)\n\t\tWHERE imagetype = {$catid}\n\t\tGROUP BY imagecategoryid\n\t\tORDER BY displayorder\n\t"); if ($db->num_rows($categories)) { print_form_header('image', 'docategorydisplayorder'); construct_hidden_code('table', $vbulletin->GPC['table']); print_table_header($vbphrase["edit_{$itemtype}_categories"], 4); print_cells_row(array($vbphrase['title'], $vbphrase['contains'], $vbphrase['display_order'], $vbphrase['controls']), 1); while ($category = $db->fetch_array($categories)) { $cell = array(); $cell[] = "<a href=\"image.php?" . $vbulletin->session->vars['sessionurl'] . "do=viewimages&table=" . $vbulletin->GPC['table'] . "&imagecategoryid={$category['imagecategoryid']}\">{$category['title']}</a>"; $cell[] = vb_number_format($category['items']) . ' ' . $vbphrase["{$itemtypeplural}"]; $cell[] = "<input type=\"text\" class=\"bginput\" name=\"order[{$category['imagecategoryid']}]\" value=\"{$category['displayorder']}\" tabindex=\"1\" size=\"3\" />";
print_cp_header($vbphrase['market_maintenance']); print_form_header('market', ''); print_table_header($vbphrase['market_error_checker'], 4); echo '<tr> <td class="thead" width="15%">' . $vbphrase['market_version'] . '</td> <td class="thead" width="5%" align="center"><img src="' . $icon1 . '"></td> <td class="thead" width="15%">' . $currentVersion . ' / ' . $latestVersion . '</td> <td class="thead" width="65%" align="left">' . $text1 . '</td> </tr>'; echo '<tr> <td class="thead">' . $vbphrase['market_point_field'] . '</td> <td class="thead" align="center"><img src="' . $icon2 . '"></td> <td class="thead">' . $vbulletin->options['market_point_name'] . '</td> <td class="thead" align="left">' . $text2 . '</td> </tr>'; print_table_footer(4, "", 0); // Update Purchase Count print_form_header('market', 'updatecount'); print_table_header($vbphrase['market_transaction_count'], 2); print_description_row($vbphrase['market_transaction_count_desc'], 0, 2); print_input_row($vbphrase['market_user_cycle'], 'user_cycle', 50); print_submit_row($vbphrase['update'], $vbphrase['reset'], 2); // Update Refund Count print_form_header('market', 'updaterefund'); print_table_header($vbphrase['market_refund_count'], 2); print_description_row($vbphrase['market_transaction_refund_desc'], 0, 2); print_input_row($vbphrase['market_user_cycle'], 'user_cycle', 50); print_submit_row($vbphrase['update'], $vbphrase['reset'], 2); // Update Use Titles print_form_header('market', 'updateusertitle'); print_table_header($vbphrase['market_usertitle_fix'], 2);
function displaytags() { global $vbulletin, $vbphrase, $vboptions; $assertor = vB::getDbAssertor(); if ($vbulletin->GPC['pagenumber'] < 1) { $vbulletin->GPC['pagenumber'] = 1; } $synonyms_in_list = $vbulletin->GPC['sort'] == 'alphaall' ? true : false; $column_count = 3; $max_per_column = 15; $perpage = $column_count * $max_per_column; $tag_counts = $assertor->getRow('vBForum:getTagCountSort', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_METHOD, 'sort' => $vbulletin->GPC['sort'])); $tag_count = $tag_counts['total']; $start = ($vbulletin->GPC['pagenumber'] - 1) * $perpage; if ($start >= $tag_count) { $start = max(0, $tag_count - $perpage); } $tags = $assertor->assertQuery('vBForum:getTagsSort', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_METHOD, 'sort' => $vbulletin->GPC['sort'], 'start' => $start, vB_dB_Query::PARAM_LIMIT => $perpage)); print_form_header('tag', '', false, true, 'tagsform'); print_table_header($vbphrase['tag_list'], 3); if ($tags and $tags->valid()) { $columns = array(); $counter = 0; // build page navigation $pagenav = tagcp_build_page_nav($vbulletin->GPC['pagenumber'], ceil($tag_count / $perpage), $vbulletin->GPC['sort']); $sort_links[''] = '<a href="tag.php?do=tags">' . $vbphrase['display_alphabetically'] . '</a>'; $sort_links['dateline'] = '<a href="tag.php?do=tags&sort=dateline">' . $vbphrase['display_newest'] . '</a>'; $sort_links['alphaall'] = '<a href="tag.php?do=tags&sort=alphaall">' . $vbphrase['display_alphabetically_all'] . '</a>'; //dont show the current sort unset($sort_links[$vbulletin->GPC['sort']]); print_description_row("<div style=\"float: " . vB_Template_Runtime::fetchStyleVar('left') . "\">" . implode(" ", $sort_links) . "</div>{$pagenav}", false, 3, 'thead', 'right'); // build columns foreach ($tags as $tag) { $columnid = floor($counter++ / $max_per_column); $columns["{$columnid}"][] = tagcp_format_tag_entry($tag, $synonyms_in_list); } // make column values printable $cells = array(); for ($i = 0; $i < $column_count; $i++) { if ($columns["{$i}"]) { $cells[] = implode("<br />\n", $columns["{$i}"]); } else { $cells[] = ' '; } } print_column_style_code(array('width: 33%', 'width: 33%', 'width: 34%')); print_cells_row($cells, false, false, -3); ?> <tr> <td colspan="<?php echo $column_count; ?> " align="center" class="tfoot"> <select id="select_tags" name="do"> <option value="tagmerge" id="select_tags_merge"><?php echo $vbphrase['merge_selected_synonym']; ?> </option> <option value="tagdopromote" id="select_tags_delete"><?php echo $vbphrase['promote_synonyms_selected']; ?> </option> <option value="tagkill" id="select_tags_delete"><?php echo $vbphrase['delete_selected']; ?> </option> <optgroup label="____________________"> <option value="tagclear"><?php echo $vbphrase[deselect_all_tags]; ?> </option> </optgroup> </select> <input type="hidden" name="page" value="<?php echo $vbulletin->GPC['pagenumber']; ?> " /> <input type="hidden" name="sort" value="<?php echo $vbulletin->GPC['sort']; ?> " /> <input type="submit" value="<?php echo $vbphrase[go]; ?> " id="tag_inlinego" class="button" /> </td> </tr> <?php echo '</table>'; ?> <script type="text/javascript" src="<?php echo $vboptions['bburl']; ?> /clientscript/vbulletin_inlinemod.js?v=<?php echo $vboptions['simpleversion']; ?> "></script> <script type="text/javascript"> <!-- inlineMod_tags = new vB_Inline_Mod('inlineMod_tags', 'tag', 'tagsform', '<?php echo $vbphrase[go_x]; ?> ', 'vbulletin_inline', 'tag'); /* vBmenu.register("inlinemodsel"); */ //--> function js_show_synlist(trigger, listid) { list = document.getElementById(listid); list.style.display = 'block'; trigger.onclick = function() {return js_hide_synlist(trigger, listid)}; trigger.getElementsByTagName('img')[0].src = '<?php echo $vbulletin->options['bburl']; ?> /cpstyles/<?php echo $vbulletin->options['cpstylefolder']; ?> /collapse_generic.gif'; return false; } function js_hide_synlist(trigger, listid) { list = document.getElementById(listid); list.style.display = 'none'; trigger.onclick = function() {return js_show_synlist(trigger, listid)}; trigger.getElementsByTagName('img')[0].src = '<?php echo $vbulletin->options['bburl']; ?> /cpstyles/<?php echo $vbulletin->options['cpstylefolder']; ?> /collapse_generic_collapsed.gif'; return false; } </script> <?php echo '</form>'; } else { print_description_row($vbphrase['no_tags_defined'], false, 3, '', 'center'); print_table_footer(); } construct_hidden_code('page', $vbulletin->GPC['pagenumber']); construct_hidden_code('sort', $vbulletin->GPC['sort']); print_form_header('tag', 'taginsert'); print_input_row($vbphrase['add_tag'], 'tagtext'); print_submit_row(); }
if ($_REQUEST['do'] == 'modify') { print_form_header('block', 'doorder'); print_column_style_code(array('width:25%', 'width:50%', 'width:10%', 'width:15%')); print_table_header($vbphrase['forum_blocks'], 4); print_cells_row(array($vbphrase['block'], $vbphrase['description'], $vbphrase['display_order'], $vbphrase['controls']), 1, false, -1); $blocks = $blockmanager->getBlocks(false, false); foreach ($blocks as $blockid => $block) { $cell = array(); $cell[] = $block['active'] ? htmlspecialchars_uni($block['title']) : '<strike>' . htmlspecialchars_uni($block['title']) . '</strike>'; $cell[] = $block['active'] ? htmlspecialchars_uni($block['description']) : '<strike>' . htmlspecialchars_uni($block['description']) . '</strike>'; $cell[] = '<input type="text" name="order[' . $blockid . ']" value="' . $block['displayorder'] . '" size="2" title="' . $vbphrase['display_order'] . '" />'; $cell[] = construct_link_code($vbphrase['edit'], "block.php?" . $vbulletin->session->vars['sessionurl'] . "do=editblock&blockid=" . $block['blockid'], false) . construct_link_code($vbphrase['delete'], "block.php?" . $vbulletin->session->vars['sessionurl'] . "do=deleteblock&blockid=" . $block['blockid'], false); print_cells_row($cell, false, false, -1); } print_table_footer(4, ' <input type="submit" class="button" value="' . $vbphrase['save_display_order'] . '" tabindex="1" /> <input type="button" class="button" value="' . $vbphrase['add_block'] . '" tabindex="1" onclick="window.location=\'block.php?' . $vbulletin->session->vars['sessionurl'] . 'do=addblock\';" /> '); echo '<p align="center" class="smallfont">' . construct_link_code($vbphrase['reload_block_types'], "block.php?" . $vbulletin->session->vars['sessionurl'] . "do=reload", false, $vbphrase['do_this_when_upload_block']) . construct_link_code($vbphrase['purge_cache'], "block.php?" . $vbulletin->session->vars['sessionurl'] . "do=purgecache", false); echo "</p>\n"; } // ############################################################################# // Reload block types from disk and insert into db if ($_REQUEST['do'] == 'reload') { $vbulletin->input->clean_array_gpc('r', array('raction' => TYPE_STR)); if ($vbulletin->GPC['raction']) { $raction = $vbulletin->GPC['raction']; } else { $raction = 'modify'; } $blockmanager->reloadBlockTypes(true); print_cp_message($vbphrase['block_type_reloaded'], "block.php?" . $vbulletin->session->vars['sessionurl'] . "do=" . rawurlencode($raction), 1, null, true);
$_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); } // ###################### Start list ####################### if ($_REQUEST['do'] == 'autosub') { $vbulletin->input->clean_array_gpc('r', array('f' => TYPE_UINT, 'ug' => TYPE_UINT)); $users = $db->query_read("\r\n\t\tSELECT userid, username\r\n\t\tFROM " . TABLE_PREFIX . "user\r\n\t\tWHERE usergroupid = '" . $vbulletin->GPC['ug'] . "' OR membergroupids REGEXP '^" . $vbulletin->GPC['ug'] . "\$|^" . $vbulletin->GPC['ug'] . ",|," . $vbulletin->GPC['ug'] . ",|," . $vbulletin->GPC['ug'] . "\$'\r\n\t\tORDER BY `userid`\r\n\t"); while ($user = $db->fetch_array($users)) { $db->query_write("\r\n\t\t\t\t\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "subscribeforum (userid, emailupdate, forumid)\r\n\t\t\t\t\t\t\t\tVALUES ('" . $user['userid'] . "', 1, '" . $vbulletin->GPC['f'] . "')\r\n\t\t\t\t\t\t\t"); echo $vbphrase['ei_auto_updated'] . $user['username'] . "<br>"; } } print_cp_footer();
$nextpage = "<input type=\"button\" class=\"button\" value=\"" . $vbphrase['next_page'] . " >\" tabindex=\"1\" onclick=\"window.location='downloads2.php?do=stats&page={$nxt}'\" />"; $lastpage = "<input type=\"button\" class=\"button\" value=\"" . $vbphrase['last_page'] . " »\" tabindex=\"1\" onclick=\"window.location='downloads2.php?do=stats&page={$totalpages}'\" />"; } } print_cp_header($vbphrase['dl2_download_stats']); print_table_start(); print_table_header(construct_phrase($vbphrase['dl2_download_stats_viewer_page_x_y_there_are_z_total_log_entries'], vb_number_format($vbulletin->GPC['pagenumber']), vb_number_format($totalpages), vb_number_format($counter['total'])), 6); echo '<tr> <td class="thead">' . $vbphrase['date'] . '</td> <td class="thead">' . $vbphrase['dl2_downloads'] . '</td> <td class="thead">' . $vbphrase['dl2_bandwidth'] . '<a href="#bandwidth">*</a></td> </tr>'; while ($stat = $db->fetch_array($result)) { $date = vbdate($vbulletin->options['dateformat'], $stat['day'] * 86400, true); $bandwidth = (int) ($stat['bandwidth'] / 1000); if ($bandwidth == 0) { $bandwidth = $vbphrase['dl2_unknown']; } else { $bandwidth .= ' KB'; } $class = fetch_row_bgclass(); echo '<tr> <td class="' . $class . '">' . $date . '</td> <td class="' . $class . '">' . $stat['downloads'] . '</td> <td class="' . $class . '">' . $bandwidth . '</td> </tr>'; } print_description_row('* <a name="bandwidth"></a>' . $vbphrase['dl2_bandwidth_note'], 0, 3); print_table_footer(6, "{$firstpage} {$prevpage} {$nextpage} {$lastpage}", '', 0); print_cp_footer(); }
// Output the line. print_cells_row($cell, false, false, 0, 'top', false, false, $navelement['navtype'] . 'row'); if ($navelement['navtype'] == 'tab' and $navelement['navid'] == $vbulletin->GPC['tabid'] and !$navelement['links']) { print_description_row($vbphrase['tab_has_no_elements'], 0, 6); } if ($navelement['active'] != 1 or $vbulletin->products[$navelement['productid']] != 1) { if ($navelement['navtype'] == 'tab') { $tabstate = 1; } else { if ($navelement['navtype'] == 'menu') { $menustate = 1; } } } } print_table_footer(6, "<input type=\"submit\" class=\"button\" tabindex=\"1\" value=\"" . $vbphrase['save'] . "\" accesskey=\"s\" />" . construct_button_code($vbphrase['add_new_tab'], "navigation.php?" . $vbulletin->session->vars['sessionurl'] . "do=add&type=tab")); ($hook = vBulletinHook::fetch_hook('navigation_admin_list')) ? eval($hook) : false; } if ($_REQUEST['do'] == 'update') { $vbulletin->input->clean_array_gpc('r', array('order' => TYPE_ARRAY_INT, 'active' => TYPE_ARRAY_BOOL, 'vactive' => TYPE_ARRAY)); $active = array(); $display = array(); foreach ($vbulletin->GPC['order'] as $key => $order) { $display[$order][] = $key; /* Deal with missing active values. This could be because the checkbox is unticked or disabled, we try and track this state in vactive */ if (!isset($vbulletin->GPC['active'][$key])) { $vbulletin->GPC['active'][$key] = 0; switch ($vbulletin->GPC['vactive'][$key]) { case 1:
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(); } } }
', '', 'top', NULL, false); print_label_row($vbphrase['mysql_language_lookup'], ' <form action="http://www.mysql.com/search/" method="get" style="display:inline"> <input type="hidden" name="doc" value="1" /> <input type="hidden" name="m" value="o" /> <input type="text" class="bginput" name="q" size="30" tabindex="1" /> <input type="submit" value=" ' . $vbphrase['find'] . ' " class="button" tabindex="1" /> </form> ', '', 'top', NULL, false); print_label_row($vbphrase['useful_links'], ' <form style="display:inline"> <select onchange="if (this.options[this.selectedIndex].value != \'\') { window.open(this.options[this.selectedIndex].value); } return false;" tabindex="1" class="bginput"> <option value="">-- ' . $vbphrase['useful_links'] . ' --</option>' . construct_select_options(array('vBulletin' => array('http://www.vbulletin.com/' => $vbphrase['home_page'] . ' (vBulletin.com)', 'http://members.vbulletin.com/' => $vbphrase['members_area'], 'http://www.vbulletin.com/forum/' => $vbphrase['community_forums'], 'http://www.vbulletin.com/manual/' => $vbphrase['reference_manual']), 'PHP' => array('http://www.ph' . 'p.net/' => $vbphrase['home_page'] . ' (PHP.net)', 'http://www.ph' . 'p.net/manual/' => $vbphrase['reference_manual'], 'http://www.ph' . 'p.net/downloads.ph' . 'p' => $vbphrase['download_latest_version']), 'MySQL' => array('http://www.mysql.com/' => $vbphrase['home_page'] . ' (MySQL.com)', 'http://www.mysql.com/documentation/' => $vbphrase['reference_manual'], 'http://www.mysql.com/downloads/' => $vbphrase['download_latest_version']))) . '</select> </form> ', '', 'top', NULL, false); print_table_footer(2, '', '', false); // ************************************* // vBULLETIN CREDITS require_once DIR . '/includes/vbulletin_credits.php'; print_cp_footer(); } if ($_REQUEST['do'] == 'nav') { require_once DIR . '/includes/adminfunctions_navpanel.php'; print_cp_header(); ?> <script type="text/javascript"> <!-- function nobub() { window.event.cancelBubble = true; }
while ($comment = $db->fetch_array($comments)) { $cell = array(); $cell[] = "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&u=$comment[whoadded]\"><b>$comment[leftby_username]</b></a>"; $cell[] = "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&u=$comment[userid]\"><b>$comment[leftfor_username]</b></a>"; $cell[] = '<span class="smallfont">' . vbdate($vbulletin->options['logdateformat'], $comment['dateline']) . '</span>'; $cell[] = $comment['reputation']; $cell[] = !empty($comment['reason']) ? '<span class="smallfont">' . htmlspecialchars_uni($comment['reason']) . '</span>' : ''; $cell[] = !empty($comment['postid']) ? construct_link_code(htmlspecialchars_uni($vbphrase['post']), "../showthread.php?" . $vbulletin->session->vars['sessionurl'] . "postid=$comment[postid]#post$comment[postid]", true, '', true) : ' '; $cell[] = construct_link_code($vbphrase['edit'], "adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=editreputation&reputationid=$comment[reputationid]", false, '', true) . ' ' . construct_link_code($vbphrase['delete'], "adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=deletereputation&reputationid=$comment[reputationid]", false, '', true); print_cells_row($cell); } print_table_footer(7, "$firstpage $prevpage $nextpage $lastpage"); } // ************************************************************************************************* if ($_REQUEST['do'] == 'editreputation') { $vbulletin->input->clean_array_gpc('r', array( 'reputationid' => TYPE_INT )); if ($repinfo = $db->query_first(" SELECT rep.*, whoadded.username as whoadded_username, user.username, thread.title FROM " . TABLE_PREFIX . "reputation AS rep LEFT JOIN " . TABLE_PREFIX . "user AS user ON (rep.userid = user.userid) LEFT JOIN " . TABLE_PREFIX . "user AS whoadded ON (rep.whoadded = whoadded.userid) LEFT JOIN " . TABLE_PREFIX . "post AS post ON (rep.postid = post.postid)
$photoplog_category = array(); foreach ($photoplog_list_categories as $photoplog_key => $photoplog_value) { if ($photoplog_key > 0) { $photoplog_catid = $photoplog_key; $photoplog_dashes = ''; $photoplog_title = htmlspecialchars_uni(trim($photoplog_value)); if (eregi("^([-]+[ ])(.*)", $photoplog_title, $photoplog_regs)) { $photoplog_dashes = $photoplog_regs[1]; $photoplog_title = $photoplog_regs[2]; } $photoplog_category['displayorder'] = $photoplog_ds_catopts[$photoplog_catid]['displayorder']; $bgclass = fetch_row_bgclass(); echo "\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"{$bgclass}\" width=\"100%\">" . $photoplog_dashes . "<a href=\"photoplog_category.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&catid=" . $photoplog_catid . "\">" . $photoplog_title . "</a></td>\r\n\t\t\t\t\t<td class=\"{$bgclass}\"><input type=\"text\" class=\"bginput\" name=\"photoplog_category[" . $photoplog_catid . "]\" value=\"" . $photoplog_category['displayorder'] . "\" size=\"5\" /></td>\r\n\t\t\t\t\t<td class=\"{$bgclass}\"><nobr><a href=\"photoplog_category.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&catid=" . $photoplog_catid . "\">" . $vbphrase['photoplog_edit'] . "</a> <a href=\"photoplog_category.php?" . $vbulletin->session->vars['sessionurl'] . "do=delete&catid=" . $photoplog_catid . "\">" . $vbphrase['photoplog_delete'] . "</a></nobr></td>\r\n\t\t\t\t</tr>\r\n\t\t\t"; } } print_table_footer(3, "<input type=\"submit\" class=\"button\" tabindex=\"1\" value=\"" . $vbphrase['photoplog_save_display_order'] . "\" accesskey=\"s\" />" . construct_button_code($vbphrase['photoplog_add_new_category'], "photoplog_category.php?" . $vbulletin->session->vars['sessionurl'] . "do=add")); } if ($_REQUEST['do'] == 'doorder') { $vbulletin->input->clean_array_gpc('p', array('photoplog_category' => TYPE_ARRAY_UINT)); if (!empty($vbulletin->GPC['photoplog_category'])) { $photoplog_dscatopts = $photoplog_ds_catopts; $photoplog_sql = ''; foreach ($vbulletin->GPC['photoplog_category'] as $photoplog_catid => $photoplog_displayorder) { $photoplog_sql .= "WHEN " . intval($photoplog_catid) . " THEN " . intval($photoplog_displayorder) . "\n"; $photoplog_dscatopts["{$photoplog_catid}"]['displayorder'] = intval($photoplog_displayorder); } if ($db->query_write("UPDATE " . PHOTOPLOG_PREFIX . "photoplog_categories\r\n\t\t\t\tSET displayorder = CASE catid\r\n\t\t\t\t{$photoplog_sql} ELSE displayorder END\r\n\t\t\t")) { $db->query_write("ALTER TABLE " . PHOTOPLOG_PREFIX . "photoplog_categories\r\n\t\t\t\tORDER BY parentid, displayorder, catid\r\n\t\t\t"); build_datastore('photoplog_dscat', serialize($photoplog_dscatopts)); print_cp_redirect("photoplog_category.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify", 1); } else {
if ($vbulletin->options['cp_collapse_forums']) { echo '<p class="smallfont" align="center">' . construct_link_code($vbphrase['expand_all'], "forum.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify&expandid=-2") . '</p>'; } echo '<p class="smallfont" align="center">' . $vbphrase['forums_marked_asterisk_are_password_protected'] . '</p>'; } else { print_form_header('forum', 'doorder'); print_table_header($vbphrase['forum_manager'], 2); print_cells_row(array($vbphrase['forum'], $vbphrase['controls']), 1, 'tcat'); $cell = array(); $select = '<select name="forumid" id="sel_foruid" tabindex="1" class="bginput">'; $select .= construct_forum_chooser($vbulletin->GPC['forumid'], true); $select .= "</select>\n"; $cell[] = $select; $cell[] = "\n\t<select name=\"controls\" class=\"bginput\">\n" . construct_select_options($forumoptions1) . "\t</select><input type=\"button\" class=\"button\" value=\"" . $vbphrase['go'] . "\" onclick=\"js_forum_jump(js_returnid());\" />\n\t"; print_cells_row($cell); print_table_footer(2, construct_button_code($vbphrase['add_new_forum'], "forum.php?" . $vbulletin->session->vars['sessionurl'] . "do=add")); } } // ###################### Start add podcast ####################### if ($_REQUEST['do'] == 'podcast') { if (!($forum = fetch_foruminfo($vbulletin->GPC['forumid'], false))) { print_stop_message('invalid_forum_specified'); } require_once DIR . '/includes/adminfunctions_misc.php'; $forum['title'] = str_replace('&', '&', $forum['title']); $podcast = $db->query_first("\r\n\t\tSELECT *\r\n\t\tFROM " . TABLE_PREFIX . "podcast\r\n\t\tWHERE forumid = {$forum['forumid']}"); print_form_header('forum', 'updatepodcast'); print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['podcast_settings'], $forum['title'], $forum['forumid'])); construct_hidden_code('forumid', $forum['forumid']); print_yes_no_row($vbphrase['enabled'], 'enabled', $podcast['enabled']); print_podcast_chooser($vbphrase['category'], 'categoryid', $podcast['categoryid']);
/** * Processes a raw template for conditionals, phrases etc into PHP code for eval() * * @param string Template * * @return string */ function compile_template($template, &$errors = array()) { $orig_template = $template; $template = preg_replace('#[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]#', '', $template); $new_syntax = (strpos($template, '<vb:') !== false OR strpos($template, '{vb:') !== false); $old_syntax = (strpos($template, '<if') !== false OR strpos($template, '<phrase') !== false); $maybe_old_syntax = preg_match('/(^|[^{])\$[a-z0-9_]+\[?/si', $template); if (!$new_syntax AND ($old_syntax OR $maybe_old_syntax)) { $template = addslashes($template); $template = process_template_conditionals($template); $template = process_template_phrases('phrase', $template, 'parse_phrase_tag'); $template = process_seo_urls($template); if (!function_exists('replace_template_variables') OR !function_exists('validate_string_for_interpolation')) { require_once(DIR . '/includes/functions_misc.php'); } //only check the old style syntax, the new style doesn't use string interpolation and isn't affected //by this exploit. The new syntax doesn't 100% pass this check. if(!validate_string_for_interpolation($template)) { global $vbphrase; echo "<p> </p><p> </p>"; print_form_header('', '', 0, 1, '', '65%'); print_table_header($vbphrase['vbulletin_message']); print_description_row($vbphrase['template_text_not_safe']); print_table_footer(2, construct_button_code($vbphrase['go_back'], 'javascript:history.back(1)')); print_cp_footer(); exit; } $template = replace_template_variables($template, false); $template = str_replace('\\\\$', '\\$', $template); if (function_exists('token_get_all')) { $tokens = @token_get_all('<?php $var = "' . $template . '"; ?>'); foreach ($tokens AS $token) { if (is_array($token)) { switch ($token[0]) { case T_INCLUDE: case T_INCLUDE_ONCE: case T_REQUIRE: case T_REQUIRE_ONCE: { global $vbphrase; echo "<p> </p><p> </p>"; print_form_header('', '', 0, 1, '', '65%'); print_table_header($vbphrase['vbulletin_message']); print_description_row($vbphrase['file_inclusion_not_permitted']); print_table_footer(2, construct_button_code($vbphrase['go_back'], 'javascript:history.back(1)')); print_cp_footer(); exit; } } } } } } else { require_once(DIR . '/includes/class_template_parser.php'); $parser = new vB_TemplateParser($orig_template); try { $parser->validate($errors); } catch (vB_Exception_TemplateFatalError $e) { global $vbphrase; echo "<p> </p><p> </p>"; print_form_header('', '', 0, 1, '', '65%'); print_table_header($vbphrase['vbulletin_message']); print_description_row($vbphrase[$e->getMessage()]); print_table_footer(2, construct_button_code($vbphrase['go_back'], 'javascript:history.back(1)')); print_cp_footer(); exit; } $template = $parser->compile(); // TODO: Reimplement these - if done, $session[], $bbuserinfo[], $vboptions will parse in the template without using {vb:raw, which isn't what we // necessarily want to happen /* if (!function_exists('replace_template_variables')) { require_once(DIR . '/includes/functions_misc.php'); } $template = replace_template_variables($template, false); */ } if (function_exists('verify_demo_template')) { verify_demo_template($template); } ($hook = vBulletinHook::fetch_hook('template_compile')) ? eval($hook) : false; return $template; }
$grids_cache = array(); // in case if we need to re-use it later? $have_grid = false; while ($grid = $db->fetch_array($grids_result)) { $have_grid = true; $grids_cache[] = $grid; print_grid_row($grid); } if (!$have_grid) { // print no grid in db message? } print_table_footer(2, ' <input type="submit" class="button" value="' . $vbphrase['add_new_grid'] . '" tabindex="1" /> <input type="button" class="button" value="' . $vbphrase['download_upload_grids'] . '" tabindex="1" onclick="window.location=\'cms_admin.php?do=grid_files\';" /> '); } if ($_POST['do'] == 'grid_upload') { $vbulletin->input->clean_array_gpc('p', array( 'allowoverwrite' => TYPE_BOOL, 'serverfile' => TYPE_STR, )); $vbulletin->input->clean_array_gpc('f', array( 'gridfile' => TYPE_FILE, )); // got an uploaded file?
function docompare3_print_control_form($inline, $wrap) { global $vbphrase, $vbulletin; $editlink = '?do=edit&templateid=' . $vbulletin->GPC['templateid'] . '&group=&searchstring=&expandset=5&showmerge=1'; print_form_header('template', 'docompare3', false, true, 'cpform', '90%', '', false); construct_hidden_code('templateid', $vbulletin->GPC['templateid']); construct_hidden_code('wrap', $wrap); construct_hidden_code('inline', $inline); print_table_header($vbphrase['display_options']); print_table_footer(2, '<div style="float:' . vB_Template_Runtime::fetchStyleVar('right') . '"><a href="' . $editlink . '" style="font-weight: bold">' . $vbphrase['merge_edit_link'] . '</a></div> <div align="' . vB_Template_Runtime::fetchStyleVar('left') . '"><input type="submit" name="switch_inline" class="submit" value="' . ($inline ? $vbphrase['view_side_by_side'] : $vbphrase['view_inline']) . '" accesskey="r" /> <input type="submit" name="switch_wrapping" class="submit" value="' . ($wrap ? $vbphrase['disable_wrapping'] : $vbphrase['enable_wrapping']) . '" accesskey="s" /></div>' ); }
$emailline = $vbphrase['email'] . ": " . $pm['touseremail']; if (verify_id('user', $pm['touserid'], false)) { print_label_row($vbphrase['rcd_pm_log_dump_to'], "<a target=\"_blank\" href=\"" . $admincpdir . "/user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&u=" . $pm['touserid'] . "\"><b>" . $pm['tousername'] . "</b></a> (" . $emailline . ")"); } else { print_label_row($vbphrase['rcd_pm_log_dump_to'], "<b>" . $pm['tousername'] . " (" . $emailline . ")</b>"); } print_label_row($vbphrase['rcd_pm_log_sent_date'], vbdate($vbulletin->options['logdateformat'], $pm['dateline'])); print_label_row($vbphrase['subject'], $pm['title']); require_once DIR . '/includes/class_bbcode.php'; $bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list()); // force to not allow html and images print_description_row(html_entity_decode($bbcode_parser->parse($pm['message'], 'privatemessage')), false, 2); /* print_description_row( $pm['message'], true, 2 ); */ print_table_footer(2); } print_cp_footer(); // ############## SOME FUNCTIONS ########################################## function user_name_cell($user_name, $user_id = 0) { global $vbulletin, $usermenus, $vbphrase, $user_name_tags; static $users; if (empty($users) or is_array($users) and !array_key_exists($user_name, $users)) { $users[$user_name] = verify_id('user', $user_id, false); } // show linked username only for existing users if (!$users[$user_name] or 0 > $user_id) { return " <b>" . $user_name . "</b>"; } $elid = rand() . '_' . rand() . '_' . $user_id;
/** * Processes a raw template for conditionals, phrases etc into PHP code for eval() * * @param string Template * * @return string */ function compile_template($template) { $orig_template = $template; $template = addslashes($template); $template = process_template_conditionals($template); $template = process_template_phrases('phrase', $template, 'parse_phrase_tag'); if (!function_exists('replace_template_variables')) { require_once DIR . '/includes/functions_misc.php'; } $template = replace_template_variables($template, false); ($hook = vBulletinHook::fetch_hook('template_compile')) ? eval($hook) : false; $template = str_replace('\\\\$', '\\$', $template); if (function_exists('token_get_all')) { $tokens = @token_get_all('<?php $var = "' . $template . '"; ?>'); foreach ($tokens as $token) { if (is_array($token)) { switch ($token[0]) { case T_INCLUDE: case T_INCLUDE_ONCE: case T_REQUIRE: case T_REQUIRE_ONCE: global $vbphrase; echo "<p> </p><p> </p>"; print_form_header('', '', 0, 1, '', '65%'); print_table_header($vbphrase['vbulletin_message']); print_description_row($vbphrase['file_inclusion_not_permitted']); print_table_footer(2, construct_button_code($vbphrase['go_back'], 'javascript:history.back(1)')); print_cp_footer(); exit; } } } } if (function_exists('verify_demo_template')) { verify_demo_template($template); } return $template; }
if (!sizeof($results)) { //print_array($results); print_stop_message('no_matches_found'); } // we'll need a poll image $style = $db->query_first("\n\t\tSELECT styleid, newstylevars FROM " . TABLE_PREFIX . "style\n\t\tWHERE styleid = " . $vbulletin->options['styleid'] . "\n\t\tLIMIT 1\n\t"); $vbulletin->stylevars = unserialize($style['newstylevars']); fetch_stylevars($style, $vbulletin->userinfo); print_form_header(''); print_table_header($vbphrase['results'], 3); print_cells_row(array($vbphrase['date'], ' ', $vbphrase['total']), 1); $maxvalue = max($results); foreach ($results as $key => $value) { $i++; $bar = $i % 6 + 1; if ($maxvalue == 0) { $percentage = 100; } else { $percentage = ceil($value / $maxvalue * 100); } print_statistic_result($dates["{$key}"], $bar, $value, $percentage); } print_table_footer(3); } print_cp_footer(); /*======================================================================*\ || #################################################################### || # Downloaded: 03:13, Sat Sep 7th 2013 || # CVS: $RCSfile$ - $Revision: 40911 $ || #################################################################### \*======================================================================*/
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); } echo '<tr> <td class="tfoot">' . ($bookmarksite_count ? '<input type="submit" class="button" accesskey="s" value="' . $vbphrase['save'] . '" /> <input type="reset" class="button" accesskey="r" value="' . $vbphrase['reset'] . '" />' : ' ') . '</td> <td class="tfoot" align="' . $stylevar['right'] . '" colspan="2"><input type="button" class="button" value="' . $vbphrase['add_new_social_bookmarking_site'] . '" onclick="window.location=\'bookmarksite.php?' . $vbulletin->session->vars['sessionurl'] . 'do=add\';" /></td> </tr>'; print_table_footer(); ?> <script type="text/javascript"> <!-- function toggle_all_active(e) { for (var i = 0; i < this.form.elements.length; i++) { if (this.form.elements[i].type == "checkbox" && this.form.elements[i].name.substr(0, 6) == "active") { this.form.elements[i].checked = this.checked; } } } YAHOO.util.Event.on("allbox", "click", toggle_all_active);
$globaltemplates = array(); $actiontemplates = array(); include_once dirname(__FILE__) . '/../includes/functions_vbseo.php'; require_once './global.' . VBSEO_VB_EXT; if (!can_administer('canadminplugins')) { print_cp_no_permission(); } print_cp_header('vBSEO Installation'); if ($_REQUEST['keepdata']) { print_form_header(); print_table_header('vBSEO data has been left in database unchanged for further usage', 2, 0, '', 'center', 0); print_table_footer(2, construct_button_code($vbphrase['click_here_to_continue_processing'], 'index.' . VBSEO_VB_EXT . '?' . $vbulletin->session->vars['sessionurl'] . 'do=buildbitfields')); } else { if ($_REQUEST['do'] == 'kill') { $db->query_write("ALTER TABLE " . vbseo_tbl_prefix('forum') . " DROP COLUMN vbseo_moderatepingbacks"); $db->query_write("ALTER TABLE " . vbseo_tbl_prefix('forum') . " DROP COLUMN vbseo_moderatetrackbacks"); $db->query_write("ALTER TABLE " . vbseo_tbl_prefix('forum') . " DROP COLUMN vbseo_moderaterefbacks"); $db->query_write("ALTER TABLE " . vbseo_tbl_prefix('thread') . " DROP COLUMN vbseo_linkbacks_no"); $db->query_write("DROP TABLE IF EXISTS " . vbseo_tbl_prefix('trackback') . ""); $db->query_write("DROP TABLE IF EXISTS " . vbseo_tbl_prefix('vbseo_linkback') . ""); $db->query_write("DROP TABLE IF EXISTS " . vbseo_tbl_prefix('vbseo_blacklist') . ""); $db->query_write("DROP TABLE IF EXISTS " . vbseo_tbl_prefix('vbseo_serviceupdate') . ""); require_once DIR . '/includes/class_bitfield_builder.' . VBSEO_VB_EXT; vB_Bitfield_Builder::save($db); build_forum_permissions(); print_form_header(); print_table_header('vBSEO data has been cleaned up successfully', 2, 0, '', 'center', 0); print_table_footer(2, construct_button_code($vbphrase['click_here_to_continue_processing'], 'index.' . VBSEO_VB_EXT . '?' . $vbulletin->session->vars['sessionurl'] . 'do=buildbitfields')); } } print_cp_footer();