function print_move_prune_rows($permcheck = '') { global $vbphrase; print_description_row($vbphrase['date_options'], 0, 2, 'thead', 'center'); print_input_row($vbphrase['original_post_date_is_at_least_xx_days_ago'], 'thread[originaldaysolder]', 0, 1, 5); print_input_row($vbphrase['original_post_date_is_at_most_xx_days_ago'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '0') . '</dfn>', 'thread[originaldaysnewer]', 0, 1, 5); print_input_row($vbphrase['last_post_date_is_at_least_xx_days_ago'], 'thread[lastdaysolder]', 0, 1, 5); print_input_row($vbphrase['last_post_date_is_at_most_xx_days_ago'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '0') . '</dfn>', 'thread[lastdaysnewer]', 0, 1, 5); print_description_row($vbphrase['view_options'], 0, 2, 'thead', 'center'); print_input_row($vbphrase['thread_has_at_least_xx_replies'], 'thread[repliesleast]', 0, 1, 5); print_input_row($vbphrase['thread_has_at_most_xx_replies'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '-1') . '</dfn>', 'thread[repliesmost]', -1, 1, 5); print_input_row($vbphrase['thread_has_at_least_xx_views'], 'thread[viewsleast]', 0, 1, 5); print_input_row($vbphrase['thread_has_at_most_xx_views'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '-1') . '</dfn>', 'thread[viewsmost]', -1, 1, 5); print_description_row($vbphrase['status_options'], 0, 2, 'thead', 'center'); print_yes_no_other_row($vbphrase['thread_is_sticky'], 'thread[issticky]', $vbphrase['either'], 0); $state = array('visible' => $vbphrase['visible'], 'moderation' => $vbphrase['awaiting_moderation'], 'deleted' => $vbphrase['deleted'], 'any' => $vbphrase['any']); print_radio_row($vbphrase['thread_state'], 'thread[state]', $state, 'any'); $status = array('open' => $vbphrase['open'], 'closed' => $vbphrase['closed'], 'redirect' => $vbphrase['redirect'], 'not_redirect' => $vbphrase['not_redirect'], 'any' => $vbphrase['any']); print_radio_row($vbphrase['thread_status'], 'thread[status]', $status, 'not_redirect'); print_description_row($vbphrase['other_options'], 0, 2, 'thead', 'center'); print_input_row($vbphrase['username'], 'thread[posteduser]'); print_input_row($vbphrase['title'], 'thread[titlecontains]'); print_moderator_forum_chooser('thread[forumid]', -1, $vbphrase['all_forums'], $vbphrase['forum'], true, false, true, $permcheck); print_yes_no_row($vbphrase['include_child_forums'], 'thread[subforums]'); if ($prefix_options = construct_prefix_options(0, '', true, true)) { print_label_row($vbphrase['prefix'], '<select name="thread[prefixid]" class="bginput">' . $prefix_options . '</select>', '', 'top', 'prefixid'); } }
function print_channel_permission_rows($customword, $channelpermission = array(), $extra = '') { global $vbphrase; print_label_row("<b>{$customword}</b>", ' <input type="button" class="button" value="' . $vbphrase['all_yes'] . '" onclick="' . iif($extra != '', 'if (js_set_custom()) { ') . ' js_check_all_option(this.form, 1);' . iif($extra != '', ' }') . '" class="button" /> <input type="button" class="button" value=" ' . $vbphrase['all_no'] . ' " onclick="' . iif($extra != '', 'if (js_set_custom()) { ') . ' js_check_all_option(this.form, 0);' . iif($extra != '', ' }') . '" class="button" /> <!--<input type="submit" class="button" value="Okay" class="button" />--> ', 'tcat', 'middle'); // Load permissions require_once DIR . '/includes/class_bitfield_builder.php'; $bitvalues = array('forumpermissions', 'forumpermissions2', 'moderatorpermissions', 'createpermissions'); $permFields = vB_ChannelPermission::fetchPermFields(); $permPhrases = vB_ChannelPermission::fetchPermPhrases(); if (empty($channelpermission)) { // we need the defaults to be displayed $channelpermission = vB_ChannelPermission::instance()->fetchPermissions(1); $channelpermission = current($channelpermission); } foreach ($permFields as $permField => $type) { //Do the non-bitmap fields first. switch ($type) { case vB_ChannelPermission::TYPE_HOURS: case vB_ChannelPermission::TYPE_COUNT: $permvalue = $channelpermission[$permField]; print_input_row($vbphrase[$permPhrases[$permField]], $permField, $permvalue, true, 35, 0, '', false, 'channelPerm_' . $permField); break; case vB_ChannelPermission::TYPE_BOOL: $permvalue =& $channelpermission[$permField]; print_yes_no_row($vbphrase[$permPhrases[$permField]], $permField, $permvalue, $extra); break; } } //now do the bitmaps foreach ($permFields as $permField => $type) { if ($type == vB_ChannelPermission::TYPE_BITMAP) { if ($permField !== 'forumpermissions2') { print_table_header($vbphrase[$permPhrases[$permField]]); } foreach ($channelpermission['bitfields'][$permField] as $permBit) { if ($permBit['used']) { if (empty($permBit['phrase']) and $permField == 'moderatorpermissions') { $permBit['phrase'] = "moderator_add_edit_" . $permBit['name'] . "_title"; } if ($permField == 'moderatorpermissions' and $permBit['name'] == 'canopenclose') { $helpOptions = array('prefix' => $permField); } else { $helpOptions = array(); } print_yes_no_row(isset($vbphrase[$permBit['phrase']]) ? $vbphrase[$permBit['phrase']] : $permBit['phrase'], $permField . '[' . $permBit['name'] . ']', $permBit['set'], $extra, $helpOptions); } } } } // Legacy Hook 'admin_nperms_form' Removed // }
$usergroup = $db->query_first("SELECT title FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid = " . $vbulletin->GPC['usergroupid']); $permsgetter_ = 'usergroup permissions'; $getperms = $db->query_first("\n\t\t\tSELECT usergroup.title as grouptitle, calendarpermissions\n\t\t\tFROM " . TABLE_PREFIX . "usergroup AS usergroup\n\t\t\tWHERE usergroupid = " . $vbulletin->GPC['usergroupid']); construct_hidden_code('calendarpermission[usergroupid]', $vbulletin->GPC['usergroupid']); construct_hidden_code('calendarid', $vbulletin->GPC['calendarid']); } $calendarpermission = convert_bits_to_array($getperms['calendarpermissions'], $vbulletin->bf_ugp_calendarpermissions); print_table_header(construct_phrase($vbphrase['edit_calendar_permissions_for_usergroup_x_in_calendar_y'], $usergroup['title'], $calendar['title'])); print_description_row(' <label for="uug_1"><input type="radio" name="useusergroup" value="1" id="uug_1" tabindex="1" onclick="this.form.reset(); this.checked=true;"' . iif(!$vbulletin->GPC['calendarpermissionid'], ' checked="checked"', '') . ' />' . $vbphrase['use_default_permissions'] . '</label> <br /> <label for="uug_0"><input type="radio" name="useusergroup" value="0" id="uug_0" tabindex="1"' . iif($vbulletin->GPC['calendarpermissionid'], ' checked="checked"', '') . ' />' . $vbphrase['use_custom_permissions'] . '</label> ', 0, 2, 'tfoot', '', 'mode'); print_table_break(); print_label_row('<b>' . $vbphrase['custom_calendar_permissions'] . '</b>', ' <input type="button" value="' . $vbphrase['all_yes'] . '" onclick="if (js_set_custom()) { js_check_all_option(this.form, 1); }" class="button" /> <input type="button" value=" ' . $vbphrase['all_no'] . ' " onclick="if (js_set_custom()) { js_check_all_option(this.form, 0); }" class="button" /> ', 'tcat', 'middle'); // Load permissions require_once DIR . '/includes/class_bitfield_builder.php'; $groupinfo = vB_Bitfield_Builder::fetch_permission_group('calendarpermissions'); foreach ($groupinfo as $grouptitle => $group) { print_table_header($vbphrase["{$grouptitle}"]); foreach ($group as $permtitle => $permvalue) { print_yes_no_row($vbphrase["{$permvalue['phrase']}"], "calendarpermission[{$permtitle}]", $calendarpermission["{$permtitle}"], 'js_set_custom();'); } } print_submit_row($vbphrase['save']); } // ###################### Start do update ####################### if ($_POST['do'] == 'doupdate') { $vbulletin->input->clean_array_gpc('p', array('calendarpermissionid' => TYPE_INT, 'calendarid' => TYPE_INT, 'useusergroup' => TYPE_INT, 'calendarpermission' => TYPE_ARRAY));
print_form_header('tools', 'mysql'); construct_hidden_code('type', 'query'); print_table_header('Please paste alter / update query below'); print_textarea_row('Query to run', 'query', '', 6, 60, 0, 0); print_submit_row('Run', ''); } else { $db->query_write($vbulletin->GPC['query']); define('SCRIPT_REDIRECT', true); } break; case 'repair': if (empty($vbulletin->GPC['tables'])) { print_form_header('tools', 'mysql'); construct_hidden_code('type', 'repair'); print_table_header('Please select tables to repair'); print_label_row('Table', "<input type=\"checkbox\" name=\"allbox\" title=\"Check All\" onclick=\"js_check_all(this.form);\" />Check All", 'thead'); $result = $db->query_write("SHOW TABLE STATUS"); while ($currow = $db->fetch_array($result, DBARRAY_NUM)) { if (!in_array(strtolower($currow[1]), array('heap', 'memory'))) { print_checkbox_row($currow[0], "tables[{$currow['0']}]", 0); } } print_submit_row('Repair', ''); } else { foreach ($vbulletin->GPC['tables'] as $key => $val) { if ($val == 1) { echo "Repairing {$key}<br />\n"; flush(); $db->query_write("REPAIR TABLE {$key}"); echo "Repair Complete<br />\n"; }
$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']); print_submit_row(); } else { print_stop_message('no_matches_found'); } } // ************************************************************************************************* if ($_POST['do'] == 'doeditreputation') { $vbulletin->input->clean_array_gpc('p', array('reputation' => TYPE_ARRAY, 'reputationid' => TYPE_INT, 'oldreputation' => TYPE_INT, 'userid' => TYPE_INT)); $db->query_write(fetch_query_sql($vbulletin->GPC['reputation'], 'reputation', "WHERE reputationid=" . $vbulletin->GPC['reputationid'])); if ($vbulletin->GPC['oldreputation'] != $vbulletin->GPC['reputation']['reputation']) {
return true; } //--> </script> <?php print_form_header('plugin', 'productimport', 1, 1, 'uploadform" onsubmit="return js_confirm_upload(this, this.productfile);'); print_table_header($vbphrase['import_product']); print_upload_row($vbphrase['upload_xml_file'], 'productfile', 999999999); print_input_row($vbphrase['import_xml_file'], 'serverfile', './includes/xml/product.xml'); print_yes_no_row($vbphrase['allow_overwrite_upgrade_product'], 'allowoverwrite', 0); print_submit_row($vbphrase['import']); } print_form_header('plugin', 'productsave'); if ($product) { print_table_header(construct_phrase($vbphrase['edit_product_x'], $product['productid'])); print_label_row($vbphrase['product_id'], $product['productid']); construct_hidden_code('productid', $product['productid']); construct_hidden_code('editing', 1); } else { print_table_header($vbphrase['add_new_product']); print_input_row($vbphrase['product_id'], 'productid', '', true, 50, 25); // max length = 25 } print_input_row($vbphrase['title'], 'title', $product['title'], true, 50, 50); print_input_row($vbphrase['version'], 'version', $product['version'], true, 50, 25); print_input_row($vbphrase['description'], 'description', $product['description'], true, 50, 250); print_input_row($vbphrase['product_url'], 'url', $product['url'], true, 50, 250); print_input_row($vbphrase['version_check_url'], 'versioncheckurl', $product['versioncheckurl'], true, 50, 250); print_submit_row(); // if we're editing a product, show the install/uninstall code options if ($product) {
} ($hook = vBulletinHook::fetch_hook('admin_permissions_process')) ? eval($hook) : false; $admindm->set('cssprefs', $vbulletin->GPC['cssprefs']); $admindm->set('dismissednews', $vbulletin->GPC['dismissednews']); $admindm->save(); define('CP_REDIRECT', "adminpermissions.php?" . $vbulletin->session->vars['sessionurl'] . "#user{$user['userid']}"); print_stop_message('saved_administrator_permissions_successfully'); } // ############################################################################# if ($_REQUEST['do'] == 'edit') { echo "<p align=\"center\">{$vbphrase['give_admin_access_arbitrary_html']}</p>"; print_form_header('adminpermissions', 'update'); construct_hidden_code('userid', $vbulletin->GPC['userid']); construct_hidden_code('oldpermissions', $user['adminpermissions']); print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['administrator_permissions'], $user['username'], $user['userid'])); print_label_row("{$vbphrase['administrator']}: <a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&u=" . $vbulletin->GPC['userid'] . "\">{$user['username']}</a>", '<div align="' . $stylevar['right'] . '"><input type="button" class="button" value=" ' . $vbphrase['all_yes'] . ' " onclick="js_check_all_option(this.form, 1);" /> <input type="button" class="button" value=" ' . $vbphrase['all_no'] . ' " onclick="js_check_all_option(this.form, 0);" /></div>', 'thead'); foreach (convert_bits_to_array($user['adminpermissions'], $ADMINPERMISSIONS) as $field => $value) { print_yes_no_row($permsphrase["{$field}"] == '' ? $vbphrase['n_a'] : $permsphrase["{$field}"], "adminpermissions[{$field}]", $value); } ($hook = vBulletinHook::fetch_hook('admin_permissions_form')) ? eval($hook) : false; print_select_row($vbphrase['control_panel_style_choice'], 'cssprefs', array_merge(array('' => "({$vbphrase['default']})"), fetch_cpcss_options()), $user['cssprefs']); print_input_row($vbphrase['dismissed_news_item_ids'], 'dismissednews', $user['dismissednews']); print_submit_row(); } // ############################################################################# if ($_REQUEST['do'] == 'modify') { print_form_header('adminpermissions', 'edit'); print_table_header($vbphrase['administrator_permissions'], 3); $users = $db->query_read("\n\t\tSELECT user.username, usergroupid, membergroupids, infractiongroupids, administrator.*\n\t\tFROM " . TABLE_PREFIX . "administrator AS administrator\n\t\tINNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)\n\t\tORDER BY user.username\n\t"); while ($user = $db->fetch_array($users)) { $perms = fetch_permissions(0, $user['userid'], $user);
/** * Prints a row containing template search javascript controls */ function print_template_javascript() { global $stylevar, $vbphrase, $vbulletin; print_phrase_ref_popup_javascript(); echo '<script type="text/javascript" src="../clientscript/vbulletin_templatemgr.js"></script>'; echo '<script type="text/javascript"> <!-- var textarea_id = "' . $vbulletin->textarea_id . '"; var vbphrase = { \'not_found\' : "' . fetch_js_safe_string($vbphrase['not_found']) . '" }; // --> </script> '; print_label_row(iif(is_browser('ie') or is_browser('mozilla', '20040707'), $vbphrase['search_in_template'], $vbphrase['additional_functions']), iif(is_browser('ie') or is_browser('mozilla', '1.7'), ' <input type="text" class="bginput" name="string" accesskey="t" value="' . htmlspecialchars_uni($vbulletin->GPC['searchstring']) . '" size="20" onChange="n=0;" tabindex="1" /> <input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['find'] . ' " accesskey="f" onClick="findInPage(document.cpform.string.value);" tabindex="1" /> ') . '<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['copy'] . ' " accesskey="c" onclick="HighlightAll();" tabindex="1" /> <input type="button" class="button" style="font-weight:normal" value="' . $vbphrase['view_quickref'] . '" accesskey="v" onclick="js_open_phrase_ref(0, 0);" tabindex="1" /> '); }
function print_user_search_rows($email = false) { global $vbulletin, $vbphrase, $stylevar; print_label_row($vbphrase['username'], "\n\t\t<input type=\"text\" class=\"bginput\" name=\"user[username]\" tabindex=\"1\" size=\"35\"\n\t\t/><input type=\"image\" src=\"../" . $vbulletin->options['cleargifurl'] . "\" width=\"1\" height=\"1\"\n\t\t/><input type=\"submit\" class=\"button\" value=\"{$vbphrase['exact_match']}\" tabindex=\"1\" name=\"user[exact]\" />\n\t", '', 'top', 'user[username]'); if ($email) { global $iusergroupcache; $userarray = array('usergroupid' => 0, 'membergroupids' => ''); $iusergroupcache = array(); $usergroups = $vbulletin->db->query_read("SELECT usergroupid, title, (forumpermissions & " . $vbulletin->bf_ugp_forumpermissions['canview'] . ") AS CANVIEW FROM " . TABLE_PREFIX . "usergroup ORDER BY title"); while ($usergroup = $vbulletin->db->fetch_array($usergroups)) { if ($usergroup['CANVIEW']) { $userarray['membergroupids'] .= "{$usergroup['usergroupid']},"; } $iusergroupcache["{$usergroup['usergroupid']}"] = $usergroup['title']; } unset($usergroup); $vbulletin->db->free_result($usergroups); print_checkbox_row($vbphrase['all_usergroups'], 'usergroup_all', 0, -1, $vbphrase['all_usergroups'], 'check_all_usergroups(this.form, this.checked);'); print_membergroup_row($vbphrase['primary_usergroup'], 'user[usergroupid]', 2, $userarray); print_membergroup_row($vbphrase['additional_usergroups'], 'user[membergroup]', 2); print_yes_no_row($vbphrase['include_users_that_have_declined_email'], 'user[adminemail]', 0); } else { print_chooser_row($vbphrase['primary_usergroup'], 'user[usergroupid]', 'usergroup', -1, '-- ' . $vbphrase['all_usergroups'] . ' --'); print_membergroup_row($vbphrase['additional_usergroups'], 'user[membergroup]', 2); } print_description_row('<div align="' . $stylevar['right'] . '"><input type="submit" class="button" value=" ' . iif($email, $vbphrase['submit'], $vbphrase['find']) . ' " tabindex="1" /></div>'); print_input_row($vbphrase['email'], 'user[email]'); print_input_row($vbphrase['parent_email_address'], 'user[parentemail]'); print_yes_no_other_row($vbphrase['coppa_user'], 'user[coppauser]', $vbphrase['either'], -1); print_input_row($vbphrase['home_page'], 'user[homepage]'); print_input_row($vbphrase['icq_uin'], 'user[icq]'); print_input_row($vbphrase['aim_screen_name'], 'user[aim]'); print_input_row($vbphrase['yahoo_id'], 'user[yahoo]'); print_input_row($vbphrase['msn_id'], 'user[msn]'); print_input_row($vbphrase['skype_name'], 'user[skype]'); print_input_row($vbphrase['signature'], 'user[signature]'); print_input_row($vbphrase['user_title'], 'user[usertitle]'); print_input_row($vbphrase['join_date_is_after'] . '<dfn>(yyyy-mm-dd)</dfn>', 'user[joindateafter]'); print_input_row($vbphrase['join_date_is_before'] . '<dfn>(yyyy-mm-dd)</dfn>', 'user[joindatebefore]'); print_input_row($vbphrase['last_activity_is_after'] . '<dfn>(yyyy-mm-dd hh:mm:ss)</dfn>', 'user[lastactivityafter]'); print_input_row($vbphrase['last_activity_is_before'] . '<dfn>(yyyy-mm-dd hh:mm:ss)</dfn>', 'user[lastactivitybefore]'); print_input_row($vbphrase['last_post_is_after'] . '<dfn>(yyyy-mm-dd hh:mm:ss)</dfn>', 'user[lastpostafter]'); print_input_row($vbphrase['last_post_is_before'] . '<dfn>(yyyy-mm-dd hh:mm:ss)</dfn>', 'user[lastpostbefore]'); print_input_row($vbphrase['birthday_is_after'] . '<dfn>(yyyy-mm-dd)</dfn>', 'user[birthdayafter]'); print_input_row($vbphrase['birthday_is_before'] . '<dfn>(yyyy-mm-dd)</dfn>', 'user[birthdaybefore]'); print_input_row($vbphrase['posts_are_greater_than'], 'user[postslower]', '', 1, 7); print_input_row($vbphrase['posts_are_less_than'], 'user[postsupper]', '', 1, 7); print_input_row($vbphrase['reputation_is_greater_than'], 'user[reputationlower]', '', 1, 7); print_input_row($vbphrase['reputation_is_less_than'], 'user[reputationupper]', '', 1, 7); print_input_row($vbphrase['warnings_are_greater_than'], 'user[warningslower]', '', 1, 7); print_input_row($vbphrase['warnings_are_less_than'], 'user[warningsupper]', '', 1, 7); print_input_row($vbphrase['infractions_are_greater_than'], 'user[infractionslower]', '', 1, 7); print_input_row($vbphrase['infractions_are_less_than'], 'user[infractionsupper]', '', 1, 7); print_input_row($vbphrase['infraction_points_are_greater_than'], 'user[pointslower]', '', 1, 7); print_input_row($vbphrase['infraction_points_are_less_than'], 'user[pointsupper]', '', 1, 7); print_input_row($vbphrase['userid_is_greater_than'], 'user[useridlower]', '', 1, 7); print_input_row($vbphrase['userid_is_less_than'], 'user[useridupper]', '', 1, 7); print_input_row($vbphrase['registration_ip_address'], 'user[ipaddress]'); print_description_row('<div align="' . $stylevar['right'] . '"><input type="submit" class="button" value=" ' . iif($email, $vbphrase['submit'], $vbphrase['find']) . ' " tabindex="1" /></div>'); $forms = array(0 => $vbphrase['edit_your_details'], 1 => "{$vbphrase['options']}: {$vbphrase['log_in']} / {$vbphrase['privacy']}", 2 => "{$vbphrase['options']}: {$vbphrase['messaging']} / {$vbphrase['notification']}", 3 => "{$vbphrase['options']}: {$vbphrase['thread_viewing']}", 4 => "{$vbphrase['options']}: {$vbphrase['date']} / {$vbphrase['time']}", 5 => "{$vbphrase['options']}: {$vbphrase['other']}"); $currentform = -1; print_table_header($vbphrase['user_profile_fields']); $profilefields = $vbulletin->db->query_read("\n\t\tSELECT *\n\t\tFROM " . TABLE_PREFIX . "profilefield AS profilefield\n\t\tLEFT JOIN " . TABLE_PREFIX . "profilefieldcategory AS profilefieldcategory ON\n\t\t\t(profilefield.profilefieldcategoryid = profilefieldcategory.profilefieldcategoryid)\n\t\tORDER BY profilefield.form, profilefieldcategory.displayorder, profilefield.displayorder\n\t"); while ($profilefield = $vbulletin->db->fetch_array($profilefields)) { if ($profilefield['form'] != $currentform) { print_description_row(construct_phrase($vbphrase['fields_from_form_x'], $forms["{$profilefield['form']}"]), false, 2, 'optiontitle'); $currentform = $profilefield['form']; } $profilefield['def'] = 0; print_profilefield_row('profile', $profilefield); } print_description_row('<div align="' . $stylevar['right'] . '"><input type="submit" class="button" value=" ' . iif($email, $vbphrase['submit'], $vbphrase['find']) . ' " tabindex="1" /></div>'); }
print_select_row($vbphrase['day_of_month'], 'day', $days, $cron['day']); print_select_row($vbphrase['hour'], 'hour', $hours, $cron['hour']); $selects = ''; for ($x = 0; $x < 6; $x++) { if ($x == 1) { $minutes = array(-2 => '-') + $minutes; unset($minutes[-1]); } if (!isset($cron['minute'][$x])) { $cron['minute'][$x] = -2; } $selects .= "<select name=\"minute[{$x}]\" tabindex=\"1\" class=\"bginput\">\n"; $selects .= construct_select_options($minutes, $cron['minute'][$x]); $selects .= "</select>\n"; } print_label_row($vbphrase['minute'], $selects, '', 'top', 'minute'); print_yes_no_row($vbphrase['active_gcron'], 'active', $cron['active']); print_yes_no_row($vbphrase['log_entries'], 'loglevel', $cron['loglevel']); print_input_row($vbphrase['filename_gcpglobal'], 'filename', $cron['filename'], true, 35, 0, 'ltr'); print_select_row($vbphrase['product'], 'product', fetch_product_list(), $cron['product']); if ($vb5_config['Misc']['debug']) { print_yes_no_row($vbphrase['vbulletin_default'], 'volatile', $cron['volatile']); } else { construct_hidden_code('volatile', $cron['volatile']); } print_submit_row($vbphrase['save']); } // ###################### Start do update ####################### if ($_POST['do'] == 'update') { $vbulletin->input->clean_array_gpc('p', array('cronid' => vB_Cleaner::TYPE_INT, 'varname' => vB_Cleaner::TYPE_STR, 'filename' => vB_Cleaner::TYPE_STR, 'title' => vB_Cleaner::TYPE_STR, 'description' => vB_Cleaner::TYPE_STR, 'logphrase' => vB_Cleaner::TYPE_STR, 'weekday' => vB_Cleaner::TYPE_STR, 'day' => vB_Cleaner::TYPE_STR, 'hour' => vB_Cleaner::TYPE_STR, 'minute' => vB_Cleaner::TYPE_ARRAY, 'active' => vB_Cleaner::TYPE_INT, 'loglevel' => vB_Cleaner::TYPE_INT, 'filename' => vB_Cleaner::TYPE_STR, 'product' => vB_Cleaner::TYPE_STR, 'volatile' => vB_Cleaner::TYPE_INT)); try {
} // ######################################## KILL ##################################### if ($_POST['do'] == 'kill') { $vbulletin->input->clean_array_gpc('p', array('bbcodeid' => TYPE_INT)); $db->query_write("DELETE FROM " . TABLE_PREFIX . "bbcode WHERE bbcodeid = " . $vbulletin->GPC['bbcodeid']); build_bbcode_cache(); $_REQUEST['do'] = 'modify'; } // ######################################### TEST ###################################### if ($_POST['do'] == 'test') { $vbulletin->input->clean_array_gpc('p', array('text' => TYPE_STR)); $parser = new vB_BbCodeParser($vbulletin, fetch_tag_list()); $parsed_code = $parser->do_parse($vbulletin->GPC['text'], false, false, true, false, true); print_form_header('bbcode', 'test'); print_table_header($vbphrase['test_your_bb_code']); print_label_row($vbphrase['this_is_how_your_test_appeard_after_bb_code_formatting'], '<table border="0" cellspacing="0" cellpadding="4" width="100%" class="tborder"><tr class="alt2"><td>' . iif(!empty($parsed_code), $parsed_code, '<i>' . $vbphrase['n_a'] . '</i>') . '</td></tr></table>'); print_textarea_row($vbphrase['enter_text_with_bb_code'], 'text', $vbulletin->GPC['text'], 15, 60); print_submit_row($vbphrase['go']); $donetest = 1; $_REQUEST['do'] = 'modify'; } // ######################################################################## if ($_REQUEST['do'] == 'previewbbcode') { define('NO_CP_COPYRIGHT', true); $vbulletin->input->clean_array_gpc('r', array('bbcodeid' => TYPE_UINT)); if ($bbcode = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "bbcode WHERE bbcodeid = " . $vbulletin->GPC['bbcodeid'])) { $parser = new vB_BbCodeParser($vbulletin, fetch_tag_list()); $parsed_code = $parser->do_parse($bbcode['bbcodeexample'], false, false, true, false, true); echo $parsed_code; } }
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']) . "';" . '" /> '); }
print_input_row($vbphrase['find_users_by_ip_address'], 'ipaddress', $vbulletin->GPC['ipaddress'], 0); print_input_row($vbphrase['find_ip_addresses_for_user'], 'username', $vbulletin->GPC['username']); print_select_row($vbphrase['depth_to_search'], 'depth', array(1 => 1, 2 => 2), $vbulletin->GPC['depth']); print_submit_row($vbphrase['find']); } // ############################# start gethost ######################### if ($_REQUEST['do'] == 'gethost') { $vbulletin->input->clean_array_gpc('r', array('ip' => vB_Cleaner::TYPE_NOHTML)); print_form_header('', ''); print_table_header($vbphrase['ip_address']); print_label_row($vbphrase['ip_address'], $vbulletin->GPC['ip']); $resolvedip = @gethostbyaddr($vbulletin->GPC['ip']); if ($resolvedip == $vbulletin->GPC['ip']) { print_label_row($vbphrase['host_name'], '<i>' . $vbphrase['n_a'] . '</i>'); } else { print_label_row($vbphrase['host_name'], "<b>{$resolvedip}</b>"); } // Legacy Hook 'useradmin_gethost' Removed // print_table_footer(); } // ############################# start referrers ######################### if ($_REQUEST['do'] == 'referrers') { print_form_header('usertools', 'showreferrers'); print_table_header($vbphrase['referrals_guser']); print_description_row($vbphrase['please_input_referral_dates']); print_time_row($vbphrase['start_date'], 'startdate', TIMENOW - 24 * 60 * 60 * 31, 1, 0, 'middle'); print_time_row($vbphrase['end_date'], 'enddate', TIMENOW, 1, 0, 'middle'); print_submit_row($vbphrase['find']); } // ############################# start show referrers ######################### if ($_POST['do'] == 'showreferrers') {
} else { $holidayinfo = array('allowsmilies' => 1); $checked = array(6 => 'checked="checked"'); print_table_header($vbphrase['add_new_holiday']); } if ($holidayinfo['title']) { print_input_row($vbphrase['title'] . '<dfn>' . construct_link_code($vbphrase['translations'], "phrase.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&fieldname=holiday&varname={$title}&t=1", 1) . '</dfn>', 'title', $holidayinfo['title']); } else { print_input_row($vbphrase['title'], 'title'); } if ($holidayinfo['description']) { print_textarea_row($vbphrase['description'] . '<dfn>' . construct_link_code($vbphrase['translations'], "phrase.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&fieldname=holiday&varname={$desc}&t=1", 1) . '</dfn>', 'description', $holidayinfo['description']); } else { print_textarea_row($vbphrase['description'], 'description'); } print_label_row($vbphrase['recurring_option'], '<input type="radio" name="holidayinfo[recurring]" value="6" tabindex="1" ' . $checked[6] . '/>' . construct_phrase($vbphrase['every_x_y'], construct_month_select_html($options[0], 'month1'), construct_day_select_html($options[1], 'day1')) . ' <br /><input type="radio" name="holidayinfo[recurring]" value="7" tabindex="1" ' . $checked[7] . '/>' . construct_phrase($vbphrase['the_x_y_of_z'], '<select name="period" tabindex="1" class="bginput">' . construct_select_options($periodarray, $options[0]) . '</select>', '<select name="day2" tabindex="1" class="bginput">' . construct_select_options($daysarray, $options[1]) . '</select>', construct_month_select_html($options[2], 'month2')), '', 'top', 'recurring'); print_yes_no_row($vbphrase['allow_smilies'], 'holidayinfo[allowsmilies]', $holidayinfo['allowsmilies']); print_submit_row($vbphrase['save']); } // ################# Save or Create a Holiday ################### if ($_POST['do'] == 'saveholiday') { $vbulletin->input->clean_array_gpc('p', array('holidayid' => TYPE_INT, 'holidayinfo' => TYPE_ARRAY, 'month1' => TYPE_INT, 'day1' => TYPE_INT, 'month2' => TYPE_INT, 'day2' => TYPE_INT, 'period' => TYPE_INT, 'title' => TYPE_STR, 'description' => TYPE_STR)); if (empty($vbulletin->GPC['title'])) { print_stop_message('please_complete_required_fields'); } if ($vbulletin->GPC['holidayinfo']['recurring'] == 6) { $vbulletin->GPC['holidayinfo']['recuroption'] = $vbulletin->GPC['month1'] . '|' . $vbulletin->GPC['day1']; } else { $vbulletin->GPC['holidayinfo']['recuroption'] = $vbulletin->GPC['period'] . '|' . $vbulletin->GPC['day2'] . '|' . $vbulletin->GPC['month2']; } if (empty($vbulletin->GPC['holidayid'])) {
print_table_header($vbphrase['transaction_details']); print_table_break(); if (!empty($request['vb_error_code'])) { print_table_header('API'); print_label_row('vb_error_code', htmlspecialchars_uni($request['vb_error_code'])); } if ($get = unserialize($request['GET'])) { print_table_header('GET'); foreach ($get as $key => $value) { print_label_row(htmlspecialchars_uni($key), htmlspecialchars_uni($value)); } } if ($post = unserialize($request['POST'])) { print_table_header('POST'); foreach ($post as $key => $value) { print_label_row(htmlspecialchars_uni($key), htmlspecialchars_uni($value)); } } print_table_footer(); } } // ###################### Start find ####################### if ($_REQUEST['do'] == 'transactions') { $vbulletin->input->clean_array_gpc('r', array('state' => TYPE_INT, 'orderby' => TYPE_NOHTML, 'limitstart' => TYPE_INT, 'limitnumber' => TYPE_INT, 'paymentapiid' => TYPE_UINT, 'transactionid' => TYPE_STR, 'currency' => TYPE_NOHTML, 'exact' => TYPE_BOOL, 'start' => TYPE_ARRAY_UINT, 'end' => TYPE_ARRAY_UINT, 'type' => TYPE_NOHTML, 'scope' => TYPE_NOHTML, 'subscriptionid' => TYPE_UINT, 'userid' => TYPE_UINT, 'username' => TYPE_NOHTML)); $userinfo = array(); if ($vbulletin->GPC['username']) { if (!($userinfo = $db->query_first("SELECT username, userid FROM " . TABLE_PREFIX . "user WHERE username = '******'username']) . "'"))) { print_stop_message('invalid_user_specified'); } } else { if ($vbulletin->GPC['userid']) {
print_input_row($vbphrase['filename'], 'search[filename]'); print_input_row($vbphrase['attached_by'], 'search[attachedby]'); print_input_row($vbphrase['attached_before'], 'search[datelinebefore]'); print_input_row($vbphrase['attached_after'], 'search[datelineafter]'); print_input_row($vbphrase['downloads_greater_than'], 'search[downloadsmore]'); print_input_row($vbphrase['downloads_less_than'], 'search[downloadsless]'); print_input_row($vbphrase['filesize_greater_than'], 'search[sizemore]'); print_input_row($vbphrase['filesize_less_than'], 'search[sizeless]'); print_yes_no_other_row($vbphrase['attachment_is_visible'], 'search[visible]', $vbphrase['either'], -1); print_label_row($vbphrase['order_by'], ' <select name="search[orderby]" tabindex="1" class="bginput"> <option value="username">' . $vbphrase['attached_by'] . '</option> <option value="counter">' . $vbphrase['downloads'] . '</option> <option value="filename" selected="selected">' . $vbphrase['filename'] . '</option> <option value="filesize">' . $vbphrase['filesize'] . '</option> <option value="dateline">' . $vbphrase['time'] . '</option> <option value="state">' . $vbphrase['visible'] . '</option> </select> <select name="search[ordering]" tabindex="1" class="bginput"> <option value="DESC">' . $vbphrase['descending'] . '</option> <option value="ASC">' . $vbphrase['ascending'] . '</option> </select> ', '', 'top', 'orderby'); print_input_row($vbphrase['attachments_to_show_per_page'], 'search[results]', 20); print_submit_row($vbphrase['search'], 0); } // ###################### File Types #################### if ($_REQUEST['do'] == 'types') { $types = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "attachmenttype ORDER BY extension"); // a little javascript for the options menus ?> <script type="text/javascript">
/** * Prints a row containing a number of <input type="radio" /> buttons * * @param string Title for row * @param string Name for radio buttons * @param array Array of value => text pairs representing '<input type="radio" value="$key" />$value' fields * @param string Selected radio button value * @param string CSS class for <span> surrounding radio buttons * @param boolean Whether or not to htmlspecialchars the text for the buttons */ function print_radio_row($title, $name, $array, $checked = '', $class = 'normal', $htmlise = false) { $radios = "<div class=\"{$class}\">\n"; $radios .= construct_radio_options($name, $array, $checked, $htmlise); $radios .= "\t</div>"; print_label_row($title, $radios, '', 'top', $name); }
if (ceil($postcount['total'] / $perpage) == 1) { $return = false; } } } echo "</ul>"; } else { redirect('tools', 'ame_no_results'); } } else { redirect('tools', 'ame_no_results'); } print_form_header('ame', 'dorebuild', false, true, 'cpform', '90%', '', true, 'get'); print_table_header($vbphrase['ame_rebuild_title']); if ($return) { print_label_row($vbphrase['ame_rebuild_seconds_till_next'], "<input type=\"text\" name=\"timer\" id=\"timer\" readonly=\"true\" value=\"{$delay}\" />"); construct_hidden_code("cont", true); construct_hidden_code("perpage", $perpage); construct_hidden_code("seconds", $seconds); construct_hidden_code("length", $length); construct_hidden_code("test", $test); construct_hidden_code("verbose", $verbose); construct_hidden_code("start", $start + 1); construct_hidden_code("zone", $zone); construct_hidden_code("ameup", $ameup); print_submit_row($vbphrase['next'], ''); echo "<script language=\"javascript\"><!--\n\n\t\t\t\tvar countdown = " . $seconds . ";\n\n\t\t\t function submit_form()\n\t\t\t {\n\t\t\t document.cpform.submit();\n\t\t\t }\n\n\t\t\t function count_down()\n\t\t\t {\n\t\t\t countdown = countdown-1;\n\t\t\t \t document.cpform.timer.value=countdown+ ' {$vbphrase['ame_rebuild_seconds_remaining']}';\n\t\t\t \t if (countdown == 0)\n\t\t\t \t {\n\t\t\t \t \tsubmit_form();\n\t\t\t \t }\n\t\t\t \t else\n\t\t\t \t {\n\t\t\t \t \tsetTimeout('count_down()',1000);\n\t\t\t \t }\n\t\t\t }\n\t\t\t //-->\n\t\t\tsetTimeout('count_down()',1000);\n\t\t </script>"; } else { $inp = $in ? $in . "_" : ""; print_description_row($vbphrase['ame_rebuild_completed']); print_table_footer();
} // ############################################################################# // list existing ads if ($_REQUEST['do'] == 'modify') { print_form_header('ad', 'quickupdate'); print_column_style_code(array('width:100%', 'white-space:nowrap')); print_table_header($vbphrase['ad_manager']); $ad_result = $db->query("SELECT * FROM " . TABLE_PREFIX . "ad ORDER BY displayorder, title"); $ad_count = $db->num_rows($ad_result); if ($ad_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, 2, 'thead" style="font-weight:normal; padding:0px 4px 0px 4px'); while ($ad = $db->fetch_array($ad_result)) { print_label_row('<a href="ad.php?' . $vbulletin->session->vars['sessionurl'] . 'do=locate&editloc=1&ad_location=' . $ad['adlocation'] . '&adid=' . $ad['adid'] . '" title="' . $vbphrase['edit_ad'] . '">' . $ad['title'] . '</a>', '<div style="white-space:nowrap">' . '<label class="smallfont"><input type="checkbox" name="active[' . $ad['adid'] . ']" value="1"' . ($ad['active'] ? ' checked="checked"' : '') . ' />' . $vbphrase['active'] . '</label> ' . '<input type="image" src="../cpstyles/' . $vbulletin->options['cpstylefolder'] . '/move_down.gif" name="displayorderswap[' . $ad['adid'] . ',higher]" />' . '<input type="text" name="displayorder[' . $ad['adid'] . ']" value="' . $ad['displayorder'] . '" class="bginput" size="4" title="' . $vbphrase['display_order'] . '" style="text-align:' . vB_Template_Runtime::fetchStyleVar('right') . '" />' . '<input type="image" src="../cpstyles/' . $vbulletin->options['cpstylefolder'] . '/move_up.gif" name="displayorderswap[' . $ad['adid'] . ',lower]" />' . construct_link_code($vbphrase['edit'], 'ad.php?' . $vbulletin->session->vars['sessionurl'] . 'do=locate&editloc=1&ad_location=' . $ad['adlocation'] . '&adid=' . $ad['adid']) . construct_link_code($vbphrase['delete'], 'ad.php?' . $vbulletin->session->vars['sessionurl'] . 'do=delete&adid=' . $ad['adid']) . '</div>'); } } print_label_row('<input type="button" class="button" value="' . $vbphrase['add_new_ad'] . '" onclick="window.location=\'ad.php?' . $vbulletin->session->vars['sessionurl'] . 'do=locate\';" />', $ad_count ? '<div align="' . vB_Template_Runtime::fetchStyleVar('right') . '"><input type="submit" class="button" accesskey="s" value="' . $vbphrase['save'] . '" /> <input type="reset" class="button" accesskey="r" value="' . $vbphrase['reset'] . '" /></div>' : ' ', 'tfoot'); 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; } } }
function print_forum_permission_rows($customword, $forumpermission = array(), $extra = '') { global $vbphrase; print_label_row("<b>{$customword}</b>", ' <input type="button" class="button" value="' . $vbphrase['all_yes'] . '" onclick="' . iif($extra != '', 'if (js_set_custom()) { ') . ' js_check_all_option(this.form, 1);' . iif($extra != '', ' }') . '" class="button" /> <input type="button" class="button" value=" ' . $vbphrase['all_no'] . ' " onclick="' . iif($extra != '', 'if (js_set_custom()) { ') . ' js_check_all_option(this.form, 0);' . iif($extra != '', ' }') . '" class="button" /> <!--<input type="submit" class="button" value="Okay" class="button" />--> ', 'tcat', 'middle'); // Load permissions require_once DIR . '/includes/class_bitfield_builder.php'; $groupinfo = vB_Bitfield_Builder::fetch_permission_group('forumpermissions'); foreach ($groupinfo as $grouptitle => $group) { print_table_header($vbphrase["{$grouptitle}"]); foreach ($group as $permtitle => $permvalue) { print_yes_no_row($vbphrase["{$permvalue['phrase']}"], "forumpermission[{$permtitle}]", $forumpermission["{$permtitle}"], $extra); } //print_table_break(); //print_column_style_code(array('width: 70%', 'width: 30%')); } ($hook = vBulletinHook::fetch_hook('admin_fperms_form')) ? eval($hook) : false; }
$vbulletin->GPC['rgb'] = preg_split('#\\s*,\\s*#si', $vbulletin->GPC['rgb'], -1, PREG_SPLIT_NO_EMPTY); $vbulletin->GPC['hex'] = '#'; foreach ($vbulletin->GPC['rgb'] as $i => $value) { $vbulletin->GPC['hex'] .= strtoupper(str_pad(dechex($value), 2, '0', STR_PAD_LEFT)); } $vbulletin->GPC['rgb'] = implode(',', $vbulletin->GPC['rgb']); } else { if ($vbulletin->GPC['hexdec']) { if (preg_match('/#?([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/siU', $vbulletin->GPC['hex'], $matches)) { $vbulletin->GPC['rgb'] = array(); for ($i = 1; $i <= 3; $i++) { $vbulletin->GPC['rgb'][] = hexdec($matches["{$i}"]); } $vbulletin->GPC['rgb'] = implode(',', $vbulletin->GPC['rgb']); $vbulletin->GPC['hex'] = strtoupper("#{$matches['1']}{$matches['2']}{$matches['3']}"); } } } print_form_header('template', 'colorconverter'); print_table_header('Color Converter'); print_label_row('Hexadecimal Color (#xxyyzz)', "<span style=\"padding:4px; background-color:" . $vbulletin->GPC['hex'] . "\"><input type=\"text\" class=\"bginput\" name=\"hex\" value=\"" . $vbulletin->GPC['hex'] . "\" size=\"20\" maxlength=\"7\" /> <input type=\"submit\" class=\"button\" name=\"hexdec\" value=\"Hex » RGB\" /></span>"); print_label_row('RGB Color (r,g,b)', "<span style=\"padding:4px; background-color:rgb(" . $vbulletin->GPC['rgb'] . ")\"><input type=\"text\" class=\"bginput\" name=\"rgb\" value=\"" . $vbulletin->GPC['rgb'] . "\" size=\"20\" maxlength=\"11\" /> <input type=\"submit\" class=\"button\" name=\"dechex\" value=\"RGB » Hex\" /></span>"); print_table_footer(); } print_cp_footer(); /*======================================================================*\ || #################################################################### || # Downloaded: 22:41, Fri Oct 10th 2008 || # CVS: $RCSfile$ - $Revision: 27113 $ || #################################################################### \*======================================================================*/
$db->free_result($getusergroups); // if there are any invalid requests, zap them now if (!empty($badgroups)) { $badgroups = implode(', ', $badgroups); DEVDEBUG("Deleting requests from the following invalid usergroups: {$badgroups}"); $db->query_write("DELETE FROM " . TABLE_PREFIX . "usergrouprequest WHERE usergroupid IN ({$badgroups})"); } // create array to hold options for the menu $groupsmenu = array(); foreach ($vbulletin->usergroupcache as $id => $usergroup) { if ($usergroup['ispublicgroup']) { $groupsmenu["{$id}"] = htmlspecialchars_uni($usergroup['title']) . " ({$vbphrase['join_requests']}: " . vb_number_format($usergroup['joinrequests']) . ")"; } } print_form_header('usergroup', 'viewjoinrequests', 0, 1, 'chooser'); print_label_row($vbphrase['usergroup'], '<select name="usergroupid" onchange="this.form.submit();" class="bginput">' . construct_select_options($groupsmenu, $vbulletin->GPC['usergroupid']) . '</select><input type="submit" class="button" value="' . $vbphrase['go'] . '" />', 'thead'); print_table_footer(); unset($groupsmenu); // now if we are being asked to display a particular usergroup, do so. if ($vbulletin->GPC['usergroupid']) { // check this is a valid usergroup if (!is_array($vbulletin->usergroupcache["{$vbulletin->GPC['usergroupid']}"])) { print_stop_message('invalid_usergroup_specified'); } // check that this usergroup has some join requests if ($vbulletin->usergroupcache["{$vbulletin->GPC['usergroupid']}"]['joinrequests']) { // everything seems okay, so make a total record for this usergroup $usergroup =& $vbulletin->usergroupcache["{$vbulletin->GPC['usergroupid']}"]; // query the usergroup leaders of this usergroup $leaders = array(); $getleaders = $db->query_read("\n\t\t\t\tSELECT usergroupleader.userid, user.username\n\t\t\t\tFROM " . TABLE_PREFIX . "usergroupleader AS usergroupleader\n\t\t\t\tINNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)\n\t\t\t\tWHERE usergroupleader.usergroupid = " . $vbulletin->GPC['usergroupid'] . "\n\t\t\t");
// fetch existing prefix set if we want to edit if ($vbulletin->GPC['prefixsetid']) { $prefixset = $db->query_first("\r\n\t\t\tSELECT *\r\n\t\t\tFROM " . TABLE_PREFIX . "prefixset\r\n\t\t\tWHERE prefixsetid = '" . $db->escape_string($vbulletin->GPC['prefixsetid']) . "'\r\n\t\t"); if ($prefixset) { $phrase = $db->query_first("\r\n\t\t\t\tSELECT text\r\n\t\t\t\tFROM " . TABLE_PREFIX . "phrase\r\n\t\t\t\tWHERE varname = '" . $db->escape_string("prefixset_{$prefixset['prefixsetid']}_title") . "'\r\n\t\t\t\t\tAND fieldname = 'prefix'\r\n\t\t\t\t\tAND languageid = 0\r\n\t\t\t"); $prefixset['title'] = $phrase['text']; } } // if not editing a set, setup the default for a new set if (empty($prefixset)) { $prefixset = array('prefixsetid' => '', 'title' => '', 'displayorder' => 10); } print_form_header('prefix', 'insertset'); if ($prefixset['prefixsetid']) { print_table_header($vbphrase['editing_prefix_set']); print_label_row($vbphrase['prefix_set_id_alphanumeric_note'], $prefixset['prefixsetid'], '', 'top', 'prefixsetid'); construct_hidden_code('origprefixsetid', $prefixset['prefixsetid']); } else { print_table_header($vbphrase['adding_prefix_set']); print_input_row($vbphrase['prefix_set_id_alphanumeric_note'], 'prefixsetid', '', true, 35, 25); } $trans_link = "phrase.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&fieldname=prefix&t=1&varname="; // has varname appended print_input_row($vbphrase['title'] . ($prefixset['prefixsetid'] ? '<dfn>' . construct_link_code($vbphrase['translations'], $trans_link . "prefixset_{$prefixset['prefixsetid']}_title", 1) . '</dfn>' : ''), 'title', $prefixset['title']); print_input_row($vbphrase['display_order'], 'displayorder', $prefixset['displayorder']); $enabled_forums = array(); if ($prefixset['prefixsetid']) { $forums_sql = $db->query_read("\r\n\t\t\tSELECT forumid\r\n\t\t\tFROM " . TABLE_PREFIX . "forumprefixset\r\n\t\t\tWHERE prefixsetid = '" . $db->escape_string($prefixset['prefixsetid']) . "'\r\n\t\t"); while ($forum = $db->fetch_array($forums_sql)) { $enabled_forums[] = $forum['forumid']; }
print_table_footer(); $sqltable = array('all tables' => $upgradecore_phrases['dump_all_tables']); $tables = $db->query_write("SHOW TABLES"); while ($table = $db->fetch_array($tables, DBARRAY_NUM)) { $sqltable["{$table['0']}"] = $table[0]; } print_form_header('upgrade_300b3', 'sqltable'); print_table_header($upgradecore_phrases['dump_data_to_sql']); construct_hidden_code('step', 'backup'); print_label_row($upgradecore_phrases['choose_table_to_dump'], '<select name="table" class="bginput">' . construct_select_options($sqltable) . '</select>'); print_submit_row($upgradecore_phrases['dump_tables'], 0); unset($sqltable['all tables']); print_form_header('upgrade_300b3', 'csvtable'); print_table_header($upgradecore_phrases['dump_data_to_csv']); construct_hidden_code('step', 'backup'); print_label_row($upgradecore_phrases['backup_individual_table'], '<select name="table" class="bginput">' . construct_select_options($sqltable) . '</select>'); print_input_row($upgradecore_phrases['field_seperator'], 'separator', ',', 0, 15); print_input_row($upgradecore_phrases['quote_character'], 'quotes', "'", 0, 15); print_yes_no_row($upgradecore_phrases['show_column_names'], 'showhead', 1); print_submit_row($upgradecore_phrases['dump_table'], 0); define('NO_LOG', true); $vbulletin->GPC['step'] = 0; print_next_step(); } } // *************************************************************************************************************************** // ######################################################################### // ############# GENERIC UPGRADE / INSTALL FUNCTIONS PROTOTYPES ############ // ######################################################################### // ######################################################################### // checks the environment for vB3 conditions
} print_table_footer(); } else { print_stop_message('no_matches_found'); } } if ($_REQUEST['do'] == 'list') { $infractions = $db->query_read("\n\t\tSELECT COUNT(*) AS count, infractionlevelid\n\t\tFROM " . TABLE_PREFIX . "infraction\n\t\tGROUP BY infractionlevelid\n\t\tORDER BY count DESC\n\t"); if ($db->num_rows($infractions)) { print_form_header('', ''); print_table_header($vbphrase['infraction_statistics']); print_cells_row(array($vbphrase['title'], $vbphrase['infractions']), 1); } while ($infraction = $db->fetch_array($infractions)) { $title = $infraction['infractionlevelid'] ? !empty($vbphrase['infractionlevel' . $infraction['infractionlevelid'] . '_title']) ? $vbphrase['infractionlevel' . $infraction['infractionlevelid'] . '_title'] : $vbphrase['n_a'] : '<em>' . $vbphrase['custom_infraction'] . '</em>'; print_label_row($title, construct_link_code($infraction['count'], "admininfraction.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist&infractionlevelid={$infraction['infractionlevelid']}&startstamp=1&endstamp=" . TIMENOW, false, '', true)); } if ($db->num_rows($infractions)) { print_table_footer(); } } if ($_REQUEST['do'] == 'list' or $_REQUEST['do'] == 'dolist') { $vbulletin->input->clean_array_gpc('r', array('leftby' => TYPE_NOHTML, 'leftfor' => TYPE_NOHTML, 'userid' => TYPE_UINT, 'whoadded' => TYPE_UINT, 'pagenumber' => TYPE_UINT, 'perpage' => TYPE_UINT, 'orderby' => TYPE_NOHTML, 'start' => TYPE_ARRAY_UINT, 'end' => TYPE_ARRAY_UINT, 'startstamp' => TYPE_UINT, 'endstamp' => TYPE_UINT, 'status' => TYPE_NOHTML, 'infractionlevelid' => TYPE_INT)); $vbulletin->GPC['start'] = iif($vbulletin->GPC['startstamp'], $vbulletin->GPC['startstamp'], $vbulletin->GPC['start']); $vbulletin->GPC['end'] = iif($vbulletin->GPC['endstamp'], $vbulletin->GPC['endstamp'], $vbulletin->GPC['end']); if ($whoaddedinfo = verify_id('user', $vbulletin->GPC['whoadded'], 0, 1)) { $vbulletin->GPC['leftby'] = $whoaddedinfo['username']; } else { $vbulletin->GPC['whoadded'] = 0; } if ($userinfo = verify_id('user', $vbulletin->GPC['userid'], 0, 1)) {
} } // ############################# start prune users ######################### if ($_REQUEST['do'] == 'prune') { $vbulletin->input->clean_array_gpc('r', array('usergroupid' => TYPE_UINT, 'daysprune' => TYPE_INT, 'joindateunix' => TYPE_INT, 'minposts' => TYPE_INT)); print_form_header('user', 'pruneusers'); print_table_header($vbphrase['user_moving_pruning_system']); print_description_row('<blockquote>' . $vbphrase['this_system_allows_you_to_mass_move_delete_users'] . '</blockquote>'); print_chooser_row($vbphrase['usergroup'], 'usergroupid', 'usergroup', iif($vbulletin->GPC['usergroupid'], $vbulletin->GPC['usergroupid'], -1), $vbphrase['all_usergroups']); print_input_row($vbphrase['has_not_logged_on_for_xx_days'], 'daysprune', iif($vbulletin->GPC['daysprune'], $vbulletin->GPC['daysprune'], 365)); print_time_row($vbphrase['join_date_is_before'], 'joindate', $vbulletin->GPC['joindateunix'], false, false, 'middle'); print_input_row($vbphrase['posts_is_less_than'], 'minposts', iif($vbulletin->GPC['minposts'], $vbulletin->GPC['minposts'], '0')); print_label_row($vbphrase['order_by'], '<select name="order" tabindex="1" class="bginput"> <option value="username">' . $vbphrase['username'] . '</option> <option value="email">' . $vbphrase['email'] . '</option> <option value="usergroup">' . $vbphrase['usergroup'] . '</option> <option value="posts">' . $vbphrase['post_count'] . '</option> <option value="lastactivity">' . $vbphrase['last_activity'] . '</option> <option value="joindate">' . $vbphrase['join_date'] . '</option> </select>', '', 'top', 'order'); print_submit_row($vbphrase['find']); } // ############################# user change history ######################### if ($_REQUEST['do'] == 'changehistory') { require_once DIR . '/includes/class_userchangelog.php'; require_once DIR . '/includes/functions_misc.php'; $vbulletin->input->clean_array_gpc('r', array('userid' => TYPE_UINT)); if ($vbulletin->GPC['userid']) { // initalize the $user storage $users = false; // create the vb_UserChangeLog instance and set the execute flag (we want to do the query, not just to build) $userchangelog = new vb_UserChangeLog($vbulletin);
{ print_stop_message('no_permission_ban_users'); } if (!($oldban = $db->query_first("SELECT user.userid, user.username, userban.reason FROM " . TABLE_PREFIX . "userban AS userban INNER JOIN " . TABLE_PREFIX . "user AS user ON(user.userid=userban.userid) WHERE user.userid = " . $vbulletin->GPC['userid']))) { print_stop_message('invalid_user_specified'); } $vbulletin->GPC['username'] = $oldban['username']; print_form_header('banning', 'updatereason'); print_table_header($vbphrase['ban_user']); construct_hidden_code('userid', $oldban['userid']); print_label_row($vbphrase['username'], $vbulletin->GPC['username']); print_input_row($vbphrase['user_ban_reason'], 'reason', $oldban['reason'], false, 50, 250); print_submit_row($vbphrase['ban_user']); } // ############################################################################# // display users from 'banned' usergroups if ($_REQUEST['do'] == 'modify') { $vbulletin->input->clean_array_gpc('r', array( 'pagenumber' => TYPE_UINT, )); $perpage = 100;
} $result = vB::getDbAssertor()->assertQuery('permission', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_DELETE, 'permissionid' => $removeids)); build_channel_permissions(); print_stop_message2('deleted_forum_permissions_successfully', 'forumpermission', array('do' => 'modify')); } // ###################### Start quick forum setup ####################### if ($_REQUEST['do'] == 'quickforum') { $usergrouplist = array(); foreach ($vbulletin->usergroupcache as $usergroupid => $usergroup) { $usergrouplist[] = "<input type=\"checkbox\" name=\"usergrouplist[{$usergroup['usergroupid']}]\" id=\"usergrouplist_{$usergroup['usergroupid']}\" value=\"1\" tabindex=\"1\" /><label for=\"usergrouplist_{$usergroup['usergroupid']}\">{$usergroup['title']}</label>"; } $usergrouplist = implode('<br />', $usergrouplist); print_form_header('forumpermission', 'doquickforum'); print_table_header($vbphrase['quick_channel_permission_setup']); print_channel_chooser($vbphrase['apply_permissions_to_channel'], 'nodeid', 0); print_label_row($vbphrase['apply_permissions_to_usergroup'], "<span class=\"smallfont\">{$usergrouplist}</span>", '', 'top', 'usergrouplist'); print_description_row($vbphrase['permission_overwrite_notice']); print_table_break(); print_channel_permission_rows($vbphrase['permissions']); print_submit_row(); } // ###################### Start do quick forum ####################### if ($_POST['do'] == 'doquickforum') { $vbulletin->input->clean_array_gpc('p', array('usergrouplist' => vB_Cleaner::TYPE_ARRAY, 'nodeid' => vB_Cleaner::TYPE_INT, 'forumpermissions' => vB_Cleaner::TYPE_ARRAY_INT, 'moderatorpermissions' => vB_Cleaner::TYPE_ARRAY_INT, 'createpermissions' => vB_Cleaner::TYPE_ARRAY_INT, 'edit_time' => vB_Cleaner::TYPE_INT, 'require_moderate' => vB_Cleaner::TYPE_INT, 'maxtags' => vB_Cleaner::TYPE_INT, 'maxstartertags' => vB_Cleaner::TYPE_INT, 'maxothertags' => vB_Cleaner::TYPE_INT, 'maxattachments' => vB_Cleaner::TYPE_INT)); if (sizeof($vbulletin->GPC['usergrouplist']) == 0) { print_stop_message2('invalid_usergroup_specified'); } require_once DIR . '/includes/functions_misc.php'; $bf_ugp_forumpermissions = vB::getDatastore()->getValue('bf_ugp_forumpermissions'); $bf_misc_moderatorpermissions = vB::getDatastore()->getValue('bf_misc_moderatorpermissions'); $bf_ugp_createpermissions = vB::getDatastore()->getValue('bf_ugp_createpermissions');
print_form_header('', ''); print_table_header($userinfo['username'] . " <span class=\"normal\">(userid: $userinfo[userid])</span>"); foreach ($userinfo['forumpermissions'] AS $forumid => $forumperms) { print_table_header($vbulletin->forumcache["$forumid"]['title'] . " <span class=\"normal\">(forumid: $forumid)</span>"); foreach ($vbulletin->bf_ugp_forumpermissions AS $key => $val) { if (bitwise($userinfo['forumpermissions']["$forumid"], $val)) { print_label_row($bitfieldnames["$val"], '<b>' . $vbphrase['yes'] . '</b>'); } else { print_label_row($bitfieldnames["$val"], '<b>' . $vbphrase['no'] . '</b>'); } } } print_table_footer(); } print_cp_footer(); /*======================================================================*\ || #################################################################### || # || # CVS: $RCSfile$ - $Revision: 32878 $ || #################################################################### \*======================================================================*/ ?>
} for ($i; $i < $endat and $i < $totalphrases; $i++) { $printers["{$i}"] =& $standard_phrases["{$i}"]; } } // ****************** print_form_header('language', 'update'); construct_hidden_code('dolanguageid', $vbulletin->GPC['dolanguageid']); construct_hidden_code('fieldname', $vbulletin->GPC['fieldname']); construct_hidden_code('page', $vbulletin->GPC['pagenumber']); print_table_header(construct_phrase($vbphrase['edit_translate_x_y_phrases'], $languages["{$vbulletin->GPC['dolanguageid']}"]['title'], "<span class=\"normal\">" . $phrasetypes["{$vbulletin->GPC['fieldname']}"][title] . "</span>") . ' <span class="normal">' . construct_phrase($vbphrase['page_x_of_y'], $vbulletin->GPC['pagenumber'], $numpages) . '</span>'); print_column_style_code(array('', '" width="20')); $lasttype = ''; foreach ($printers as $key => $blarg) { if ($lasttype != $blarg['type']) { print_label_row($vbphrase['varname'], $vbphrase['text'], 'thead'); } print_phrase_row($blarg, $phrasetypes["{$vbulletin->GPC['fieldname']}"]['editrows'], $key, $language['direction']); $lasttype = $blarg['type']; } print_submit_row(); // ****************** if ($numpages > 1) { print_form_header('language', 'edit', 0, 1, 'qform', '90%', '', 1, 'get'); construct_hidden_code('dolanguageid', $vbulletin->GPC['dolanguageid']); construct_hidden_code('fieldname', $vbulletin->GPC['fieldname']); $pagebuttons = ''; for ($p = 1; $p <= $numpages; $p++) { $pagebuttons .= "\n\t\t\t\t<input type=\"submit\" class=\"button\" style=\"font:10px verdana\" name=\"page\" value=\"{$p}\" tabindex=\"1\" title=\"{$vbphrase['page']} {$p}\"" . iif($p == $vbulletin->GPC['pagenumber'], ' disabled="disabled"') . ' />'; } echo '