Exemple #1
0
        $db->free_result($phrases);
        construct_hidden_code('orig[script]', $helpdata['script']);
        construct_hidden_code('orig[action]', $helpdata['action']);
        construct_hidden_code('orig[optionname]', $helpdata['optionname']);
        construct_hidden_code('orig[product]', $helpdata['product']);
        construct_hidden_code('orig[title]', $helpphrase["{$titlephrase}"]);
        construct_hidden_code('orig[text]', $helpphrase["{$textphrase}"]);
        print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['topic'], $helpdata['title'], $helpdata['adminhelpid']));
    }
    print_input_row($vbphrase['script'], 'help[script]', $helpdata['script']);
    print_input_row($vbphrase['action_leave_blank'], 'help[action]', $helpdata['action']);
    print_select_row($vbphrase['product'], 'help[product]', fetch_product_list(), $helpdata['product']);
    print_input_row($vbphrase['option'], 'help[optionname]', $helpdata['optionname']);
    print_input_row($vbphrase['display_order'], 'help[displayorder]', $helpdata['displayorder']);
    print_input_row($vbphrase['title'], 'title', $helpphrase["{$titlephrase}"]);
    print_textarea_row($vbphrase['text'], 'text', $helpphrase["{$textphrase}"], 10, '50" style="width:100%');
    if ($vbulletin->debug) {
        print_yes_no_row($vbphrase['vbulletin_default'], 'help[volatile]', $helpdata['volatile']);
    } else {
        construct_hidden_code('help[volatile]', $helpdata['volatile']);
    }
    construct_hidden_code('adminhelpid', $vbulletin->GPC['adminhelpid']);
    print_submit_row($vbphrase['save']);
}
// ############################### start actually adding/editing help topics ##############
if ($_POST['do'] == 'doedit') {
    $vbulletin->input->clean_array_gpc('r', array('adminhelpid' => TYPE_INT, 'help' => TYPE_ARRAY_STR, 'orig' => TYPE_ARRAY_STR, 'title' => TYPE_STR, 'text' => TYPE_STR));
    if (!$vbulletin->GPC['help']['script']) {
        print_stop_message('please_complete_required_fields');
    }
    $newphrasename = $db->escape_string(fetch_help_phrase_short_name($vbulletin->GPC['help']));
Exemple #2
0
                $productcodes_versions["{$productcode['version']}"] = 1;
                $productcodes_grouped["{$productcode['version']}"][] = $productcode;
            }
            $productcodes_versions = array_keys($productcodes_versions);
            usort($productcodes_versions, 'version_sort');
            foreach ($productcodes_versions as $version) {
                foreach ($productcodes_grouped["{$version}"] as $productcode) {
                    print_cells_row(array("<input type=\"text\" name=\"productcode[{$productcode['productcodeid']}][version]\" value=\"" . htmlspecialchars_uni($productcode['version']) . "\" style=\"width:100%\" size=\"10\" />", "<textarea name=\"productcode[{$productcode['productcodeid']}][installcode]\" rows=\"5\" cols=\"40\" style=\"width:100%\" wrap=\"virtual\" tabindex=\"1\">" . htmlspecialchars($productcode['installcode']) . "</textarea>", "<textarea name=\"productcode[{$productcode['productcodeid']}][uninstallcode]\" rows=\"5\" cols=\"40\" style=\"width:100%\" wrap=\"virtual\" tabindex=\"1\">" . htmlspecialchars($productcode['uninstallcode']) . "</textarea>", "<input type=\"checkbox\" name=\"productcode[{$productcode['productcodeid']}][delete]\" value=\"1\" />"));
                }
            }
            print_table_break();
        }
        print_table_header($vbphrase['add_new_install_uninstall_code']);
        print_input_row($vbphrase['version'], 'version');
        print_textarea_row($vbphrase['install_code'], 'installcode', '', 5, '70" style="width:100%');
        print_textarea_row($vbphrase['uninstall_code'], 'uninstallcode', '', 5, '70" style="width:100%');
        print_submit_row();
    }
}
// #############################################################################
if ($_POST['do'] == 'productsave') {
    // Check to see if it is a duplicate.
    $vbulletin->input->clean_array_gpc('p', array('productid' => TYPE_STR, 'editing' => TYPE_BOOL, 'title' => TYPE_STR, 'version' => TYPE_STR, 'description' => TYPE_STR, 'url' => TYPE_STR, 'versioncheckurl' => TYPE_STR, 'confirm' => TYPE_BOOL));
    if ($vbulletin->GPC['url'] and !preg_match('#^[a-z0-9]+:#i', $vbulletin->GPC['url'])) {
        $vbulletin->GPC['url'] = 'http://' . $vbulletin->GPC['url'];
    }
    if ($vbulletin->GPC['versioncheckurl'] and !preg_match('#^[a-z0-9]+:#i', $vbulletin->GPC['versioncheckurl'])) {
        $vbulletin->GPC['versioncheckurl'] = 'http://' . $vbulletin->GPC['versioncheckurl'];
    }
    if (!$vbulletin->GPC['productid'] or !$vbulletin->GPC['title'] or !$vbulletin->GPC['version']) {
        print_stop_message('please_complete_required_fields');
Exemple #3
0
                $time_before = microtime();
                $db->query_write($query);
                $time_taken = fetch_microtime_difference($time_before);
                print_form_header('queries', 'doquery');
                print_table_header($vbphrase['vbulletin_message']);
                if ($errornum = $db->errno()) {
                    print_description_row(construct_phrase($vbphrase['an_error_occured_while_attempting_to_run_your_query'], $errornum, nl2br(htmlspecialchars_uni($db->error()))));
                } else {
                    print_description_row(construct_phrase($vbphrase['affected_rows'], vb_number_format($db->affected_rows()), vb_number_format($time_taken, 4)));
                }
                print_table_footer();
            }
            break;
    }
}
// ##################### START MODIFY #####################
if ($_REQUEST['do'] == 'modify') {
    print_form_header('queries', 'doquery');
    print_table_header($vbphrase['execute_sql_query']);
    print_select_row($vbphrase['auto_query'], 'autoquery', $queryoptions, -1);
    print_textarea_row($vbphrase['manual_query'], 'query', '', 10, 55);
    print_input_row($vbphrase['results_to_show_per_page'], 'perpage', 20);
    print_submit_row($vbphrase['continue']);
}
print_cp_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
|| # CVS: $RCSfile$ - $Revision: 37230 $
|| ####################################################################
\*======================================================================*/
Exemple #4
0
         }
         construct_hidden_code('extension', $type['extension']);
         print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['attachment_type'], $type['extension'], $type['extension']));
     }
 } else {
     $type = null;
 }
 if (!$type) {
     $type = array('enabled' => 1);
     print_table_header($vbphrase['add_new_extension']);
 }
 print_input_row($vbphrase['extension'], 'type[extension]', $type['extension']);
 print_input_row(construct_phrase($vbphrase['maximum_filesize_dfn']), 'type[size]', $type['size']);
 print_input_row($vbphrase['max_width_dfn'], 'type[width]', $type['width']);
 print_input_row($vbphrase['max_height_dfn'], 'type[height]', $type['height']);
 print_textarea_row($vbphrase['mime_type_dfn'], 'type[mimetype]', $type['mimetype']);
 ($hook = vBulletinHook::fetch_hook('admin_attachmenttype')) ? eval($hook) : false;
 $existing = @unserialize($type['contenttypes']);
 print_table_break();
 print_table_header($vbphrase['content_type'], 4);
 print_cells_row(array($vbphrase['product'], $vbphrase['location'], $vbphrase['new_window'], $vbphrase['enabled']), 1, 'tcat');
 $indexed_types = array();
 $collection = new vB_Collection_ContentType();
 $collection->filterAttachable(true);
 foreach ($collection as $type) {
     $value['package'] = $type->getPackageClass();
     $value['class'] = $type->getClass();
     $indexed_types[$type->getID()] = $value;
 }
 foreach ($indexed_types as $contenttypeid => $content) {
     if (!isset($existing["{$contenttypeid}"]['e'])) {
/**
* Prints a row containing a textarea for editing one of the 'common templates'
*
* @param	string	Template variable name
*/
function print_common_template_row($varname)
{
    global $template_cache, $vbphrase, $vbulletin;
    $template = $template_cache['template']["{$varname}"];
    $description = $vbphrase["{$varname}_desc"];
    $color = fetch_inherited_color($template['styleid'], $vbulletin->GPC['dostyleid']);
    $revertcode = construct_revert_code($template['styleid'], 'template', $varname);
    print_textarea_row("<b>{$varname}</b> <dfn>{$description}</dfn><span class=\"smallfont\"><br /><br />{$revertcode['info']}<br /><br />{$revertcode['revertcode']}</span>", "commontemplate[{$varname}]", $template['template_un'], 8, 70, 1, 0, 'ltr', "{$color}\" style=\"font: 9pt courier new");
}
     $trans_link = "phrase.php?" . vB::getCurrentSession()->get('sessionurl') . "do=edit&fieldname=cron&t=1&varname=";
     // has varname appended
     if (!$cron['volatile'] or $vb5_config['Misc']['debug']) {
         // non volatile or in debug mode -- always editable (custom created)
         print_input_row($vbphrase['title'] . '<dfn>' . construct_link_code($vbphrase['translations'], $trans_link . $cron['titlevarname'], 1) . '</dfn>', 'title', $cron['title']);
         print_textarea_row($vbphrase['description_gcpglobal'] . '<dfn>' . construct_link_code($vbphrase['translations'], $trans_link . $cron['descvarname'], 1) . '</dfn>', 'description', $cron['description']);
         print_textarea_row($vbphrase['log_phrase'] . '<dfn>' . construct_link_code($vbphrase['translations'], $trans_link . $cron['logvarname'], 1) . '</dfn>', 'logphrase', $cron['logphrase']);
     } else {
         print_label_row($vbphrase['title'] . '<dfn>' . construct_link_code($vbphrase['translations'], $trans_link . $cron['titlevarname'], 1) . '</dfn>', htmlspecialchars_uni($cron['title']));
         print_label_row($vbphrase['description_gcpglobal'] . '<dfn>' . construct_link_code($vbphrase['translations'], $trans_link . $cron['descvarname'], 1) . '</dfn>', htmlspecialchars_uni($cron['description']));
         print_label_row($vbphrase['log_phrase'] . '<dfn>' . construct_link_code($vbphrase['translations'], $trans_link . $cron['logvarname'], 1) . '</dfn>', htmlspecialchars_uni($cron['logphrase']));
     }
 } else {
     print_input_row($vbphrase['title'], 'title');
     print_textarea_row($vbphrase['description_gcpglobal'], 'description');
     print_textarea_row($vbphrase['log_phrase'], 'logphrase');
 }
 print_select_row($vbphrase['day_of_week'], 'weekday', $weekdays, $cron['weekday']);
 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]);
Exemple #7
0
 }
 // PROFILE SECTION
 unset($user['salt']);
 construct_hidden_code('olduser', sign_client_string(serialize($user)));
 //For consistent Edits
 print_table_header($vbphrase['profile'] . ($haschangehistory ? '<span class="smallfont">' . construct_link_code($vbphrase['view_change_history'], 'user.php?' . $vbulletin->session->vars['sessionurl'] . 'do=changehistory&amp;userid=' . $vbulletin->GPC['userid']) . '</span>' : ''));
 print_input_row($vbphrase['username'], 'user[username]', $user['username'], 0);
 print_input_row($vbphrase['password'], 'password');
 print_input_row($vbphrase['email'], 'user[email]', $user['email']);
 print_select_row($vbphrase['language'], 'user[languageid]', array('0' => $vbphrase['use_forum_default']) + fetch_language_titles_array('', 0), $user['languageid']);
 print_input_row($vbphrase['user_title'], 'user[usertitle]', $user['usertitle']);
 print_select_row($vbphrase['custom_user_title'], 'user[customtitle]', array(0 => $vbphrase['no'], 2 => $vbphrase['user_set'], 1 => $vbphrase['admin_set_html_allowed']), $user['customtitle']);
 print_input_row($vbphrase['personal_home_page'], 'user[homepage]', $user['homepage'], 0);
 print_time_row($vbphrase['birthday'], 'user[birthday]', $user['birthday'], 0, 1);
 print_select_row($vbphrase['privacy'], 'user[showbirthday]', array(0 => $vbphrase['hide_age_and_dob'], 1 => $vbphrase['display_age'], 3 => $vbphrase['display_day_and_month'], 2 => $vbphrase['display_age_and_dob']), $user['showbirthday']);
 print_textarea_row($vbphrase['signature'], 'user[signature]', $user['signature'], 8, 45);
 print_input_row($vbphrase['icq_uin'], 'user[icq]', $user['icq'], 0);
 print_input_row($vbphrase['aim_screen_name'], 'user[aim]', $user['aim'], 0);
 print_input_row($vbphrase['yahoo_id'], 'user[yahoo]', $user['yahoo'], 0);
 print_input_row($vbphrase['msn_id'], 'user[msn]', $user['msn'], 0);
 print_input_row($vbphrase['skype_name'], 'user[skype]', $user['skype'], 0);
 print_yes_no_row($vbphrase['coppa_user'], 'options[coppauser]', $user['coppauser']);
 print_input_row($vbphrase['parent_email_address'], 'user[parentemail]', $user['parentemail'], 0);
 if ($user['referrerid']) {
     $referrername = $db->query_first("SELECT username FROM " . TABLE_PREFIX . "user WHERE userid = {$user['referrerid']}");
     $user['referrer'] = $referrername['username'];
 }
 print_input_row($vbphrase['referrer'], 'user[referrerid]', $user['referrer'], 0);
 print_input_row($vbphrase['ip_address'], 'user[ipaddress]', $user['ipaddress']);
 print_input_row($vbphrase['post_count'], 'user[posts]', $user['posts'], 0, 7);
 print_table_break('', $INNERTABLEWIDTH);
     print_yes_no_row($vbphrase['set_default_if_yes_first'], 'profilefield[def]', $profilefield['def']);
 }
 if ($vbulletin->GPC['type'] == 'checkbox') {
     print_input_row($vbphrase['limit_selection'], 'profilefield[size]', $profilefield['limit']);
     print_input_row($vbphrase['items_per_line'], 'profilefield[perline]', $profilefield['perline']);
     if ($_REQUEST['do'] == 'add') {
         print_textarea_row(construct_phrase($vbphrase['x_enter_the_options_that_the_user_can_choose_from'], $vbphrase['options']) . "<br /><dfn>{$vbphrase['note_max_31_options']}</dfn>", 'profilefield[data]', '', 10, 40, 0);
     } else {
         print_label_row($vbphrase['fields'], '<input type="image" src="../' . $vbulletin->options['cleargifurl'] . '"><input type="submit" class="button" value="' . $vbphrase['modify'] . '" tabindex="1" name="modifyfields">');
     }
 }
 if ($vbulletin->GPC['type'] == 'select_multiple') {
     print_input_row($vbphrase['limit_selection'], 'profilefield[size]', $profilefield['limit']);
     print_input_row($vbphrase['box_height'], 'profilefield[height]', $profilefield['boxheight']);
     if ($_REQUEST['do'] == 'add') {
         print_textarea_row(construct_phrase($vbphrase['x_enter_the_options_that_the_user_can_choose_from'], $vbphrase['options']) . "<br /><dfn>{$vbphrase['note_max_31_options']}</dfn>", 'profilefield[data]', '', 10);
     } else {
         print_label_row($vbphrase['fields'], '<input type="image" src="../' . $vbulletin->options['cleargifurl'] . '"><input type="submit" class="button" value="' . $vbphrase['modify'] . '" tabindex="1" name="modifyfields">');
     }
 }
 if ($_REQUEST['do'] == 'edit') {
     if ($vbulletin->GPC['type'] == 'input' or $vbulletin->GPC['type'] == 'textarea') {
         if ($vbulletin->GPC['type'] == 'input') {
             $inputchecked = 'checked="checked"';
         } else {
             $textareachecked = 'checked="checked"';
         }
         print_label_row($vbphrase['profile_field_type'], "\n\t\t\t\t<label for=\"newtype_input\"><input type=\"radio\" name=\"newtype\" value=\"input\" id=\"newtype_input\" tabindex=\"1\" {$inputchecked}>" . $vbphrase['single_line_text_box'] . "</label><br />\n\t\t\t\t<label for=\"newtype_textarea\"><input type=\"radio\" name=\"newtype\" value=\"textarea\" id=\"newtype_textarea\" {$textareachecked}>" . $vbphrase['multiple_line_text_box'] . "</label>\n\t\t\t", '', 'top', 'newtype');
     } else {
         if ($vbulletin->GPC['type'] == 'checkbox' or $vbulletin->GPC['type'] == 'select_multiple') {
             if ($vbulletin->GPC['type'] == 'checkbox') {
function print_profilefield_row($basename, $profilefield, $userfield = '')
{
    global $vbphrase;
    $data = unserialize($profilefield['data']);
    $fieldname = 'field' . $profilefield['profilefieldid'];
    $profilefieldname = $basename . '[field' . $profilefield['profilefieldid'] . ']';
    $optionalname = $basename . '[field' . $profilefield['profilefieldid'] . '_opt]';
    $output = '';
    $profilefield['title'] = htmlspecialchars_uni($vbphrase[$fieldname . '_title']);
    if (!is_array($userfield)) {
        $userfield = array($fieldname => '');
    }
    if ($profilefield['type'] == 'input') {
        print_input_row($profilefield['title'], $profilefieldname, $userfield["{$fieldname}"], 0);
    } else {
        if ($profilefield['type'] == 'textarea') {
            print_textarea_row($profilefield['title'], $profilefieldname, $userfield["{$fieldname}"], $profilefield['height'], 40, 0);
        } else {
            if ($profilefield['type'] == 'select') {
                foreach ($data as $key => $val) {
                    $key++;
                    $selected = '';
                    if ($userfield["{$fieldname}"]) {
                        if (trim($val) == $userfield["{$fieldname}"]) {
                            $selected = 'selected="selected"';
                            $foundselect = 1;
                        }
                    } else {
                        if ($key == 0) {
                            $selected = 'selected="selected"';
                            $foundselect = 1;
                        }
                    }
                    $selectbits .= "<option value=\"{$key}\" {$selected}>{$val}</option>";
                }
                if ($profilefield['optional']) {
                    if (!$foundselect and $userfield["{$fieldname}"]) {
                        $optional = $userfield["{$fieldname}"];
                    }
                    $optionalfield = "<dfn>{$vbphrase['other_please_specify']}:</dfn><input type=\"text\" name=\"{$optionalname}\" class=\"bginput\" value=\"{$optional}\" size=\"{$profilefield['size']}\" maxlength=\"{$profilefield['maxlength']}\" tabindex=\"1\" />";
                }
                if (!$foundselect) {
                    $selected = 'selected="selected"';
                } else {
                    $selected = '';
                }
                $output = "<select name=\"{$profilefieldname}\" tabindex=\"1\" class=\"bginput\">\n\t\t\t<option value=\"0\" {$selected}></option>\n\t\t\t{$selectbits}\n\t\t\t</select>\n\t\t\t{$optionalfield}";
                print_label_row($profilefield['title'], $output);
            } else {
                if ($profilefield['type'] == 'radio') {
                    $radiobits = '';
                    $foundfield = 0;
                    $perline = 0;
                    foreach ($data as $key => $val) {
                        $key++;
                        $checked = '';
                        if (!$userfield["{$fieldname}"] and $key == 1 and $profilefield['def'] == 1) {
                            $checked = 'checked="checked"';
                        } else {
                            if (trim($val) == $userfield["{$fieldname}"]) {
                                $checked = 'checked="checked"';
                                $foundfield = 1;
                            }
                        }
                        $radiobits .= "<label for=\"rb_{$key}_{$profilefieldname}\"><input type=\"radio\" name=\"{$profilefieldname}\" value=\"{$key}\" id=\"rb_{$key}_{$profilefieldname}\" tabindex=\"1\" {$checked}>{$val}</label>";
                        $perline++;
                        if ($profilefield['perline'] > 0 and $perline >= $profilefield['perline']) {
                            $radiobits .= '<br />';
                            $perline = 0;
                        }
                    }
                    if ($profilefield['optional']) {
                        if (!$foundfield and $userfield["{$fieldname}"]) {
                            $optional = $userfield["{$fieldname}"];
                        }
                        $optionalfield = "<dfn>{$vbphrase['other_please_specify']}:</dfn><input type=\"text\" name=\"{$optionalname}\" class=\"bginput\" value=\"{$optional}\" size=\"{$profilefield['size']}\" maxlength=\"{$profilefield['maxlength']}\" tabindex=\"1\" />";
                    }
                    print_label_row($profilefield['title'], "{$radiobits}{$optionalfield}");
                } else {
                    if ($profilefield['type'] == 'checkbox') {
                        $checkboxbits = '';
                        $perline = 0;
                        foreach ($data as $key => $val) {
                            if ($userfield["{$fieldname}"] & pow(2, $key)) {
                                $checked = 'checked="checked"';
                            } else {
                                $checked = '';
                            }
                            $key++;
                            $checkboxbits .= "<label for=\"cb_{$key}_{$profilefieldname}\"><input type=\"checkbox\" name=\"{$profilefieldname}[]\" value=\"{$key}\" id=\"cb_{$key}_{$profilefieldname}\" tabindex=\"1\" {$checked}>{$val}</label> ";
                            $perline++;
                            if ($profilefield['perline'] > 0 and $perline >= $profilefield['perline']) {
                                $checkboxbits .= '<br />';
                                $perline = 0;
                            }
                        }
                        print_label_row($profilefield['title'], $checkboxbits);
                    } else {
                        if ($profilefield['type'] == 'select_multiple') {
                            $selectbits = '';
                            foreach ($data as $key => $val) {
                                if ($userfield["{$fieldname}"] & pow(2, $key)) {
                                    $selected = 'selected="selected"';
                                } else {
                                    $selected = '';
                                }
                                $key++;
                                $selectbits .= "<option value=\"{$key}\" {$selected}>{$val}</option>";
                            }
                            $output = "<select name=\"{$profilefieldname}[]\" multiple=\"multiple\" size=\"{$profilefield['height']}\" tabindex=\"1\" class=\"bginput\">\n\t\t\t{$selectbits}\n\t\t\t</select>";
                            print_label_row($profilefield['title'], $output);
                        }
                    }
                }
            }
        }
    }
}
Exemple #10
0
}
</script>
<?php 
    if ($_REQUEST['do'] == 'start') {
        print_form_header('email', 'dosendmail');
        print_table_header($vbphrase['email_manager']);
        print_yes_no_row($vbphrase['test_email_only'], 'test', 0);
        print_input_row($vbphrase['email_to_send_at_once'], 'perpage', 500);
        print_input_row($vbphrase['from'], 'from', $vbulletin->options['webmasteremail']);
        print_input_row($vbphrase['subject'], 'subject');
        print_textarea_row($vbphrase['message_email'], 'message', '', 10, 50);
        $text = $vbphrase['send'];
    } else {
        print_form_header('email', 'makelist');
        print_table_header($vbphrase['generate_mailing_list']);
        print_textarea_row($vbphrase['text_to_separate_addresses_by'], 'septext', ' ');
        $text = $vbphrase['go'];
    }
    print_table_break();
    print_table_header($vbphrase['search_criteria']);
    print_user_search_rows(true);
    print_table_break();
    print_submit_row($text);
}
print_cp_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:39, Wed May 30th 2012
|| # CVS: $RCSfile$ - $Revision: 39862 $
|| ####################################################################
\*======================================================================*/
/**
* Prints a setting row for use in options.php?do=options
*
* @param	array	Settings array
* @param	array	Phrases
*/
function print_setting_row($setting, $settingphrase)
{
    global $vbulletin, $vbphrase, $bgcounter, $settingphrase, $stylevar;
    $settingid = $setting['varname'];
    echo '<tbody>';
    print_description_row(iif($vbulletin->debug, '<div class="smallfont" style="float:' . $stylevar['right'] . '">' . construct_link_code($vbphrase['edit'], "options.php?" . $vbulletin->session->vars['sessionurl'] . "do=editsetting&amp;varname={$setting['varname']}") . construct_link_code($vbphrase['delete'], "options.php?" . $vbulletin->session->vars['sessionurl'] . "do=removesetting&amp;varname={$setting['varname']}") . '</div>') . '<div>' . $settingphrase["setting_{$setting['varname']}_title"] . "<a name=\"{$setting['varname']}\"></a></div>", 0, 2, 'optiontitle' . ($vbulletin->debug ? "\" title=\"\$vbulletin->options['" . $setting['varname'] . "']" : ''));
    echo "</tbody><tbody id=\"tbody_{$settingid}\">\r\n";
    // make sure all rows use the alt1 class
    $bgcounter--;
    $description = "<div class=\"smallfont\"" . ($vbulletin->debug ? "title=\"\$vbulletin->options['{$setting['varname']}']\"" : '') . ">" . $settingphrase["setting_{$setting['varname']}_desc"] . '</div>';
    $name = "setting[{$setting['varname']}]";
    $right = "<span class=\"smallfont\">{$vbphrase['error']}</span>";
    $width = 40;
    $rows = 8;
    if (preg_match('#^input:?(\\d+)$#s', $setting['optioncode'], $matches)) {
        $width = $matches[1];
        $setting['optioncode'] = '';
    } else {
        if (preg_match('#^textarea:?(\\d+)(,(\\d+))?$#s', $setting['optioncode'], $matches)) {
            $rows = $matches[1];
            if ($matches[2]) {
                $width = $matches[3];
            }
            $setting['optioncode'] = 'textarea';
        } else {
            if (preg_match('#^bitfield:(.*)$#siU', $setting['optioncode'], $matches)) {
                $setting['optioncode'] = 'bitfield';
                $setting['bitfield'] =& fetch_bitfield_definitions($matches[1]);
            } else {
                if (preg_match('#^(select|radio):(piped|eval)(\\r\\n|\\n|\\r)(.*)$#siU', $setting['optioncode'], $matches)) {
                    $setting['optioncode'] = "{$matches['1']}:{$matches['2']}";
                    $setting['optiondata'] = trim($matches[4]);
                } else {
                    if (preg_match('#^usergroup:?(\\d+)$#s', $setting['optioncode'], $matches)) {
                        $size = intval($matches[1]);
                        $setting['optioncode'] = 'usergroup';
                    } else {
                        if (preg_match('#^(usergroupextra)(\\r\\n|\\n|\\r)(.*)$#siU', $setting['optioncode'], $matches)) {
                            $setting['optioncode'] = 'usergroupextra';
                            $setting['optiondata'] = trim($matches[3]);
                        }
                    }
                }
            }
        }
    }
    switch ($setting['optioncode']) {
        // input type="text"
        case '':
            print_input_row($description, $name, $setting['value'], 1, $width);
            break;
            // input type="radio"
        // input type="radio"
        case 'yesno':
            print_yes_no_row($description, $name, $setting['value']);
            break;
            // textarea
        // textarea
        case 'textarea':
            print_textarea_row($description, $name, $setting['value'], $rows, "{$width}\" style=\"width:90%");
            break;
            // bitfield
        // bitfield
        case 'bitfield':
            $setting['value'] = intval($setting['value']);
            $setting['html'] = '';
            if ($setting['bitfield'] === NULL) {
                print_label_row($description, construct_phrase("<strong>{$vbphrase['settings_bitfield_error']}</strong>", implode(',', vB_Bitfield_Builder::fetch_errors())), '', 'top', $name, 40);
            } else {
                #$setting['html'] .= "<fieldset><legend>$vbphrase[yes] / $vbphrase[no]</legend>";
                $setting['html'] .= "<div id=\"ctrl_setting[{$setting['varname']}]\" class=\"smallfont\">\r\n";
                $setting['html'] .= "<input type=\"hidden\" name=\"setting[{$setting['varname']}][0]\" value=\"0\" />\r\n";
                foreach ($setting['bitfield'] as $key => $value) {
                    $value = intval($value);
                    $setting['html'] .= "<table style=\"width:175px; float:{$stylevar['left']}\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr valign=\"top\">\n\t\t\t\t\t<td><input type=\"checkbox\" name=\"setting[{$setting['varname']}][{$value}]\" id=\"setting[{$setting['varname']}]_{$key}\" value=\"{$value}\"" . ($setting['value'] & $value ? ' checked="checked"' : '') . " /></td>\n\t\t\t\t\t<td width=\"100%\" style=\"padding-top:4px\"><label for=\"setting[{$setting['varname']}]_{$key}\" class=\"smallfont\">" . fetch_phrase_from_key($key) . "</label></td>\r\n</tr></table>\r\n";
                }
                $setting['html'] .= "</div>\r\n";
                #$setting['html'] .= "</fieldset>";
                print_label_row($description, $setting['html'], '', 'top', $name, 40);
            }
            break;
            // select:piped
        // select:piped
        case 'select:piped':
            print_select_row($description, $name, fetch_piped_options($setting['optiondata']), $setting['value']);
            break;
            // radio:piped
        // radio:piped
        case 'radio:piped':
            print_radio_row($description, $name, fetch_piped_options($setting['optiondata']), $setting['value'], 'smallfont');
            break;
            // select:eval
        // select:eval
        case 'select:eval':
            $options = null;
            eval($setting['optiondata']);
            if (is_array($options) and !empty($options)) {
                print_select_row($description, $name, $options, $setting['value']);
            } else {
                print_input_row($description, $name, $setting['value']);
            }
            break;
            // radio:eval
        // radio:eval
        case 'radio:eval':
            $options = null;
            eval($setting['optiondata']);
            if (is_array($options) and !empty($options)) {
                print_radio_row($description, $name, $options, $setting['value'], 'smallfont');
            } else {
                print_input_row($description, $name, $setting['value']);
            }
            break;
        case 'username':
            if (intval($setting['value']) and $userinfo = $vbulletin->db->query_first("SELECT username FROM " . TABLE_PREFIX . "user WHERE userid = " . intval($setting['value']))) {
                print_input_row($description, $name, $userinfo['username'], false);
            } else {
                print_input_row($description, $name);
            }
            break;
        case 'usergroup':
            $usergrouplist = array();
            foreach ($vbulletin->usergroupcache as $usergroup) {
                $usergrouplist["{$usergroup['usergroupid']}"] = $usergroup['title'];
            }
            if ($size > 1) {
                print_select_row($description, $name . '[]', array(0 => '') + $usergrouplist, unserialize($setting['value']), false, $size, true);
            } else {
                print_select_row($description, $name, $usergrouplist, $setting['value']);
            }
            break;
        case 'usergroupextra':
            $usergrouplist = fetch_piped_options($setting['optiondata']);
            foreach ($vbulletin->usergroupcache as $usergroup) {
                $usergrouplist["{$usergroup['usergroupid']}"] = $usergroup['title'];
            }
            print_select_row($description, $name, $usergrouplist, $setting['value']);
            break;
            // arbitrary number of <input type="text" />
        // arbitrary number of <input type="text" />
        case 'multiinput':
            $setting['html'] = "<div id=\"ctrl_{$setting['varname']}\"><fieldset id=\"multi_input_fieldset_{$setting['varname']}\" style=\"padding:4px\">";
            $setting['values'] = unserialize($setting['value']);
            $setting['values'] = is_array($setting['values']) ? $setting['values'] : array();
            $setting['values'][] = '';
            foreach ($setting['values'] as $key => $value) {
                $setting['html'] .= "<div id=\"multi_input_container_{$setting['varname']}_{$key}\">" . ($key + 1) . " <input type=\"text\" class=\"bginput\" name=\"setting[{$setting['varname']}][{$key}]\" id=\"multi_input_{$setting['varname']}_{$key}\" size=\"40\" value=\"" . htmlspecialchars_uni($value) . "\" tabindex=\"1\" /></div>";
            }
            $i = sizeof($setting['values']);
            if ($i == 0) {
                $setting['html'] .= "<div><input type=\"text\" class=\"bginput\" name=\"setting[{$setting['varname']}][{$i}]\" size=\"40\" tabindex=\"1\" /></div>";
            }
            $setting['html'] .= "\n\t\t\t\t</fieldset>\n\t\t\t\t<div class=\"smallfont\"><a href=\"#\" onclick=\"return multi_input['{$setting['varname']}'].add()\">Add Another Option</a></div>\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t<!--\n\t\t\t\tmulti_input['{$setting['varname']}'] = new vB_Multi_Input('{$setting['varname']}', {$i}, '" . $vbulletin->options['cpstylefolder'] . "');\n\t\t\t\t//-->\n\t\t\t\t</script>\n\t\t\t";
            print_label_row($description, $setting['html']);
            break;
            // default registration options
        // default registration options
        case 'defaultregoptions':
            $setting['value'] = intval($setting['value']);
            $checkbox_options = array('receiveemail' => 'display_email', 'adminemail' => 'receive_admin_emails', 'invisiblemode' => 'invisible_mode', 'vcard' => 'allow_vcard_download', 'signature' => 'display_signatures', 'avatar' => 'display_avatars', 'image' => 'display_images', 'showreputation' => 'display_reputation', 'enablepm' => 'receive_private_messages', 'emailonpm' => 'send_notification_email_when_a_private_message_is_received', 'pmpopup' => 'pop_up_notification_box_when_a_private_message_is_received');
            $setting['value'] = intval($setting['value']);
            $setting['html'] = '';
            #$setting['html'] .= "<fieldset><legend>$vbphrase[yes] / $vbphrase[no]</legend>";
            $setting['html'] .= "<div id=\"ctrl_setting[{$setting['varname']}]\" class=\"smallfont\">\r\n";
            $setting['html'] .= "<input type=\"hidden\" name=\"setting[{$setting['varname']}][0]\" value=\"0\" />\r\n";
            foreach ($checkbox_options as $key => $phrase) {
                $value = $vbulletin->bf_misc_regoptions["{$key}"];
                $setting['html'] .= "<table style=\"width:175px; float:{$stylevar['left']}\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr valign=\"top\">\n\t\t\t\t<td><input type=\"checkbox\" name=\"setting[{$setting['varname']}][{$value}]\" id=\"setting[{$setting['varname']}]_{$key}\" value=\"{$value}\"" . ($setting['value'] & $value ? ' checked="checked"' : '') . " /></td>\n\t\t\t\t<td width=\"100%\" style=\"padding-top:4px\"><label for=\"setting[{$setting['varname']}]_{$key}\" class=\"smallfont\">" . fetch_phrase_from_key($phrase) . "</label></td>\r\n</tr></table>\r\n";
            }
            #$setting['html'] .= "</fieldset>";
            print_label_row($description, $setting['html'], '', 'top', $name, 40);
            break;
            // cp folder options
        // cp folder options
        case 'cpstylefolder':
            if ($folders = fetch_cpcss_options() and !empty($folders)) {
                print_select_row($description, $name, $folders, $setting['value'], 1, 6);
            } else {
                print_input_row($description, $name, $setting['value'], 1, 40);
            }
            break;
            // cookiepath / cookiedomain options
        // cookiepath / cookiedomain options
        case 'cookiepath':
        case 'cookiedomain':
            $func = 'fetch_valid_' . $setting['optioncode'] . 's';
            $cookiesettings = $func($setting['optioncode'] == 'cookiepath' ? $vbulletin->script : $_SERVER['HTTP_HOST'], $vbphrase['blank']);
            $setting['found'] = in_array($setting['value'], array_keys($cookiesettings));
            $setting['html'] = "\n\t\t\t<div id=\"ctrl_{$setting['varname']}\">\n\t\t\t<fieldset>\n\t\t\t\t<legend>{$vbphrase['suggested_settings']}</legend>\n\t\t\t\t<div style=\"padding:4px\">\n\t\t\t\t\t<select name=\"setting[{$setting['varname']}]\" tabindex=\"1\" class=\"bginput\">" . construct_select_options($cookiesettings, $setting['value']) . "\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\t\t\t<br />\n\t\t\t<fieldset>\n\t\t\t\t<legend>{$vbphrase['custom_setting']}</legend>\n\t\t\t\t<div style=\"padding:4px\">\n\t\t\t\t\t<label for=\"{$settingid}o\"><input type=\"checkbox\" id=\"{$settingid}o\" name=\"setting[{$settingid}_other]\" tabindex=\"1\" value=\"1\"" . ($setting['found'] ? '' : ' checked="checked"') . " />{$vbphrase['use_custom_setting']}\n\t\t\t\t\t</label><br />\n\t\t\t\t\t<input type=\"text\" class=\"bginput\" size=\"25\" name=\"setting[{$settingid}_value]\" value=\"" . ($setting['found'] ? '' : $setting['value']) . "\" />\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\t\t\t</div>";
            print_label_row($description, $setting['html'], '', 'top', $name, 50);
            break;
            // just a label
        // just a label
        default:
            $handled = false;
            ($hook = vBulletinHook::fetch_hook('admin_options_print')) ? eval($hook) : false;
            if (!$handled) {
                eval("\$right = \"<div id=\\\"ctrl_setting[{$setting['varname']}]\\\">{$setting['optioncode']}</div>\";");
                print_label_row($description, $right, '', 'top', $name, 50);
            }
            break;
    }
    echo "</tbody>\r\n";
    $valid = exec_setting_validation_code($setting['varname'], $setting['value'], $setting['validationcode']);
    echo "<tbody id=\"tbody_error_{$settingid}\" style=\"display:" . (($valid === 1 or $valid === true) ? 'none' : '') . "\"><tr><td class=\"alt1 smallfont\" colspan=\"2\"><div style=\"padding:4px; border:solid 1px red; background-color:white; color:black\"><strong>{$vbphrase['error']}</strong>:<div id=\"span_error_{$settingid}\">{$valid}</div></div></td></tr></tbody>";
}
Exemple #12
0
        print_stop_message('no_threads_matched_your_query');
    }
}
// ############### do unsubscribe threads ####################
if ($_POST['do'] == 'killsubscription') {
    $idarray = unserialize(fetch_adminutil_text('subscribe'));
    $threadids = trim($idarray['threadids']);
    $db->query_write("\n\t\tDELETE FROM " . TABLE_PREFIX . "subscribethread\n\t\tWHERE threadid IN ({$threadids}) AND\n\t\t\temailupdate <> 0\n\t\t" . iif($idarray['userid'], " AND userid = {$idarray['userid']}") . "\n\t");
    define('CP_REDIRECT', 'thread.php?do=unsubscribe');
    print_stop_message('deleted_subscriptions_successfully');
}
// ############### unsubscribe threads ####################
if ($_REQUEST['do'] == 'unsubscribe') {
    print_form_header('thread', 'dospecificunsubscribe');
    print_table_header($vbphrase['unsubsribe_all_users_from_specific_threads']);
    print_textarea_row($vbphrase['enter_the_threadids_of_the_threads'], 'ids');
    print_submit_row($vbphrase['go']);
    print_form_header('thread', 'domassunsubscribe');
    print_table_header($vbphrase['unsubsribe_all_threads_from_specific_users']);
    print_input_row($vbphrase['username_leave_blank_to_remove_all'], 'username');
    print_input_row($vbphrase['find_all_threads_older_than_days'], 'daysprune', 30);
    print_forum_chooser($vbphrase['forum'], 'forumid', -1, $vbphrase['all_forums']);
    print_submit_row($vbphrase['go']);
}
print_cp_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 09:39, Wed Nov 5th 2008
|| # CVS: $RCSfile$ - $Revision: 26900 $
|| ####################################################################
\*======================================================================*/
Exemple #13
0
				<option value="1"' . ($criteria_cache['is_date']['condition2'] == 1 ? ' selected="selected"' : '') . '>' . $vbphrase['utc_universal_time'] . '</option>
			</select>'), 'is_time' => array('<input type="text" name="criteria[is_time][condition1]" size="5" class="bginput" tabindex="1" value="' . (empty($criteria_cache['is_time']['condition1']) ? vbdate('H:i', TIMENOW, false, false) : $criteria_cache['is_time']['condition1']) . '" />', '<input type="text" name="criteria[is_time][condition2]" size="5" class="bginput" tabindex="1" value="' . (empty($criteria_cache['is_time']['condition2']) ? intval(vbdate('H', TIMENOW, false, false)) + 1 . vbdate(':i', TIMENOW, false, false) : $criteria_cache['is_time']['condition2']) . '" />', '<select name="criteria[is_time][condition3]" tabindex="1">
				<option value="0"' . (empty($criteria_cache['is_time']['condition3']) ? ' selected="selected"' : '') . '>' . $vbphrase['user_timezone'] . '</option>
				<option value="1"' . ($criteria_cache['is_time']['condition3'] == 1 ? ' selected="selected"' : '') . '>' . $vbphrase['utc_universal_time'] . '</option>
			</select>'));
    if (!empty($notice_name_cache)) {
        $criteria_options['notice_x_not_displayed'] = array('<select name="criteria[notice_x_not_displayed][condition1]" tabindex="1">' . construct_select_options($notice_name_cache, $criteria_cache['notice_x_not_displayed']['condition1']) . '</select>');
    }
    // hook to allow third-party additions of criteria
    ($hook = vBulletinHook::fetch_hook('notices_list_criteria')) ? eval($hook) : false;
    // build the editor form
    print_form_header('notice', 'update');
    construct_hidden_code('noticeid', $vbulletin->GPC['noticeid']);
    print_table_header($table_title);
    print_input_row($vbphrase['title'] . '<dfn>' . $vbphrase['notice_title_description'] . '</dfn>', 'title', $notice['title'], 0, 60);
    print_textarea_row($vbphrase['notice_html'] . '<dfn>' . $vbphrase['notice_html_description'] . '</dfn>' . ($vbulletin->GPC['noticeid'] ? '<div class="smallfont" style="margin-top:6px"><a href="phrase.php?do=edit&amp;fieldname=global&amp;phraseid=' . $notice['html_phraseid'] . '" target="translate">' . $vbphrase['translations'] . '</a></div>' : ''), 'html', $notice['html'], 8, 60, true, false);
    print_input_row($vbphrase['display_order'], 'displayorder', $notice['displayorder'], 0, 10);
    print_yes_no_row($vbphrase['active'] . '<dfn>' . $vbphrase['notice_active_description'] . '</dfn>', 'active', $notice['active']);
    print_yes_no_row($vbphrase['persistent'] . '<dfn>' . $vbphrase['persistent_description'] . '</dfn>', 'persistent', $notice['persistent']);
    print_yes_no_row($vbphrase['dismissible'], 'dismissible', $notice['dismissible']);
    print_description_row('<strong>' . $vbphrase['display_notice_if_elipsis'] . '</strong>', false, 2, 'tcat', '', 'criteria');
    if ($display_active_criteria_first) {
        function print_notice_criterion($criteria_option_id, &$criteria_options, $criteria_cache)
        {
            global $vbphrase;
            $criteria_option = $criteria_options["{$criteria_option_id}"];
            print_description_row("<label><input type=\"checkbox\" id=\"cb_{$criteria_option_id}\" tabindex=\"1\" name=\"criteria[{$criteria_option_id}][active]\" title=\"{$vbphrase['criterion_is_active']}\" value=\"1\"" . (empty($criteria_cache["{$criteria_option_id}"]) ? '' : ' checked="checked"') . " />" . "<span id=\"span_{$criteria_option_id}\">" . construct_phrase($vbphrase[$criteria_option_id . '_criteria'], $criteria_option[0], $criteria_option[1], $criteria_option[2]) . '</span></label>');
            unset($criteria_options["{$criteria_option_id}"]);
        }
        foreach (array_keys($criteria_cache) as $id) {
            print_notice_criterion($id, $criteria_options, $criteria_cache);
Exemple #14
0
     for ($depth = 0; $depth < 5; $depth++) {
         $jumpbits[] = construct_forumjump_css_row(construct_phrase($vbphrase['depth_x_items'], $depth), ".fjdpth{$depth}");
     }
     $i = 0;
     while ($i < sizeof($jumpbits)) {
         print_label_row($jumpbits[$i++], $jumpbits[$i++], 'alt2');
     }
     print_table_break(' ');
     // additional css
     print_table_header($vbphrase['additional_css']);
     print_textarea_row($vbphrase['additional_css_description'], 'css[EXTRA][all]', $css['EXTRA']['all'], 10, 80, true, false, 'ltr', fetch_inherited_color($css_info['EXTRA'], $vbulletin->GPC['dostyleid']) . '" style="font:9pt \'courier new\', monospace');
     $revertcode = construct_revert_code($css_info['EXTRA'], 'css', 'EXTRA');
     if ($revertcode['info']) {
         print_description_row("<span style=\"float:{$stylevar['right']}\">{$revertcode['revertcode']}</span>{$revertcode['info']}", 0, 2, 'tfoot" align="center');
     }
     print_textarea_row('', 'css[EXTRA2][all]', $css['EXTRA2']['all'], 10, 80, true, false, 'ltr', fetch_inherited_color($css_info['EXTRA2'], $vbulletin->GPC['dostyleid']) . '" style="font:9pt \'courier new\', monospace');
     $revertcode = construct_revert_code($css_info['EXTRA2'], 'css', 'EXTRA2');
     if ($revertcode['info']) {
         print_description_row("<span style=\"float:{$stylevar['right']}\">{$revertcode['revertcode']}</span>{$revertcode['info']}", 0, 2, 'tfoot" align="center');
     }
     print_table_break(' ');
 }
 // #############################################################################
 // POST EDITOR
 if ($vbulletin->GPC['dowhat'] == 'posteditor' or $vbulletin->GPC['dowhat'] == 'all') {
     construct_hidden_code('dowhat[posteditor]', 1);
     print_table_header($vbphrase['text_editor_control_styles']);
     print_description_row($vbphrase['text_editor_control_desc']);
     $out = array();
     foreach ($_query_special_templates as $varname) {
         if (substr($varname, 0, 13) == 'editor_styles') {
Exemple #15
0
 unset($photoplog_category_info);
 if ($_REQUEST['do'] == 'edit') {
     print_form_header('photoplog_category', 'doedit');
     construct_hidden_code('s', $vbulletin->session->vars['sessionhash']);
     construct_hidden_code('catid', $photoplog_catid);
     print_table_header($vbphrase['photoplog_edit_this_category']);
 } else {
     if ($_REQUEST['do'] == 'review') {
         print_form_header('photoplog_category', 'doadd');
         construct_hidden_code('s', $vbulletin->session->vars['sessionhash']);
         construct_hidden_code('suggestid', $photoplog_suggestid);
         print_table_header($vbphrase['photoplog_add_new_category']);
     }
 }
 print_input_row($vbphrase['photoplog_title'], 'photoplog_category[title]', $photoplog_category['title']);
 print_textarea_row($vbphrase['photoplog_description'], 'photoplog_category[description]', $photoplog_category['description']);
 print_input_row("{$vbphrase['photoplog_display_order']}<dfn>{$vbphrase['photoplog_zero_equals_no_display']}</dfn>", 'photoplog_category[displayorder]', $photoplog_category['displayorder']);
 print_select_row($vbphrase['photoplog_parent_category'], 'photoplog_category[parentid]', $photoplog_list_categories, $photoplog_category['parentid'], true, 0, false);
 print_table_header($vbphrase['photoplog_enable_disable_features']);
 print_yes_no_row($vbphrase['photoplog_allow_html'], 'photoplog_category[options][allowhtml]', $photoplog_category_options['allowhtml']);
 print_yes_no_row($vbphrase['photoplog_allow_smilies'], 'photoplog_category[options][allowsmilies]', $photoplog_category_options['allowsmilies']);
 print_yes_no_row($vbphrase['photoplog_allow_bbcode'], 'photoplog_category[options][allowbbcode]', $photoplog_category_options['allowbbcode']);
 print_yes_no_row($vbphrase['photoplog_allow_img_code'], 'photoplog_category[options][allowimgcode]', $photoplog_category_options['allowimgcode']);
 print_yes_no_row($vbphrase['photoplog_allow_parse_url'], 'photoplog_category[options][allowparseurl]', $photoplog_category_options['allowparseurl']);
 print_yes_no_row($vbphrase['photoplog_allow_comments'], 'photoplog_category[options][allowcomments]', $photoplog_category_options['allowcomments']);
 print_yes_no_row($vbphrase['photoplog_is_searchable'], 'photoplog_category[options][issearchable]', $photoplog_category_options['issearchable']);
 print_yes_no_row($vbphrase['photoplog_is_members_folder'], 'photoplog_category[options][ismembersfolder]', $photoplog_category_options['ismembersfolder']);
 print_yes_no_row($vbphrase['photoplog_act_as_divider'], 'photoplog_category[options][actasdivider]', $photoplog_category_options['actasdivider']);
 print_yes_no_row($vbphrase['photoplog_allow_desc_html'], 'photoplog_category[options][allowdeschtml]', $photoplog_category_options['allowdeschtml']);
 print_yes_no_row($vbphrase['photoplog_open_for_subcats'], 'photoplog_category[options][openforsubcats]', $photoplog_category_options['openforsubcats']);
 if ($_REQUEST['do'] == 'edit') {
					' . ((can_moderate(0, 'candeleteposts') or can_moderate(0, 'canremoveposts')) ? '&nbsp;
					<input type="button" value="' . $vbphrase['delete'] . '" onclick="js_check_all_option(this.form, -1);" class="button" title="' . $vbphrase['delete'] . '" />' : '') . '
					&nbsp;
					<input type="button" value="' . $vbphrase['ignore'] . '" onclick="js_check_all_option(this.form, 0);" class="button" title="' . $vbphrase['ignore'] . '" />
				', 0, 2, 'thead', 'center');
            }
            if (!($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])) {
                print_label_row('<b>' . $vbphrase['posted_by'] . '</b>', iif($post['userid'], '<a href="user.php?' . $vbulletin->session->vars['sessionurl'] . "do=viewuser&u={$post['userid']}\" target=\"_blank\">{$post['username']}</a>", $vbphrase['guest']));
            } else {
                print_label_row('<b>' . $vbphrase['posted_by'] . '</b>', iif($post['userid'], '<a href="../' . $vbulletin->config['Misc']['admincpdir'] . '/user.php?' . $vbulletin->session->vars['sessionurl'] . "do=edit&u={$post['userid']}\" target=\"_blank\">{$post['username']}</a>", $vbphrase['guest']));
            }
            print_label_row('<b>' . $vbphrase['thread'] . '</b>', '<a href="../showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$post['threadid']}\" target=\"_blank\">{$post['thread_title']}</a>");
            print_label_row('<b>' . $vbphrase['forum'] . '</b> ', '<a href="../forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f={$post['forumid']}\" target=\"_blank\">" . $vbulletin->forumcache["{$post['forumid']}"]['title'] . "</a>");
            if (can_moderate(0, 'caneditposts')) {
                print_input_row($vbphrase['title'], "posttitle[{$post['postid']}]", $post['post_title'], 0, 70);
                print_textarea_row($vbphrase['message'], "postpagetext[{$post['postid']}]", $post['pagetext'], 15, 70);
            } else {
                print_label_row($vbphrase['title'], $post['post_title']);
                print_label_row($vbphrase['message'], nl2br(htmlspecialchars_uni($post['pagetext'])));
                construct_hidden_code("posttitle[{$post['postid']}]", $post['post_title'], false);
                construct_hidden_code("postpagetext[{$post['postid']}]", $post['pagetext']);
            }
            if (!isset($hasdelperm["{$post['forumid']}"])) {
                $hasdelperm["{$post['forumid']}"] = (can_moderate($post['forumid'], 'candeleteposts') or can_moderate($post['forumid'], 'canremoveposts'));
            }
            print_label_row($vbphrase['action'], "\n\t\t\t\t<label for=\"val_{$post['postid']}\"><input type=\"radio\" name=\"postaction[{$post['postid']}]\" value=\"1\" id=\"val_{$post['postid']}\" tabindex=\"1\" />" . $vbphrase['validate'] . "</label>\n\t\t\t\t" . ($hasdelperm["{$post['forumid']}"] ? "<label for=\"del_{$post['postid']}\"><input type=\"radio\" name=\"postaction[{$post['postid']}]\" value=\"-1\" id=\"del_{$post['postid']}\" tabindex=\"1\" />" . $vbphrase['delete'] . "</label>" : '') . "\n\t\t\t\t<label for=\"ign_{$post['postid']}\"><input type=\"radio\" name=\"postaction[{$post['postid']}]\" value=\"0\" id=\"ign_{$post['postid']}\" tabindex=\"1\"  checked=\"checked\" />" . $vbphrase['ignore'] . "</label>\n\t\t\t", '', 'top', 'postaction');
            $haveposts = true;
        }
    }
    if (!$haveposts) {
        print_description_row($vbphrase['no_posts_awaiting_moderation']);
Exemple #17
0
        $altclass = iif($class == 'alt1', 'alt2', 'alt1');
        $parsed_code = $parser->do_parse($bbcode['bbcodeexample'], false, false, true, false, true);
        $cell = array("<b>{$bbcode['title']}</b>", "<div class=\"{$altclass}\" style=\"padding:2px; border:solid 1px; width:200px; height:75px; overflow:auto\"><span class=\"smallfont\">" . htmlspecialchars_uni($bbcode['bbcodeexample']) . '</span></div>', "<div class=\"{$altclass}\" style=\"padding:2px; border:solid 1px; width:200px; height:75px; overflow:auto\"><span class=\"smallfont\">" . htmlspecialchars_uni($parsed_code) . '</span></div>', '<iframe src="bbcode.php?do=previewbbcode&amp;bbcodeid=' . $bbcode['bbcodeid'] . '" style="width:200px; height:75px;"></iframe>');
        if ($bbcode['buttonimage']) {
            $src = $bbcode['buttonimage'];
            if (!preg_match('#^[a-z]+://#i', $src) and $src[0] != '/') {
                $src = "../{$src}";
            }
            $cell[] = "<img style=\"background:buttonface; border:solid 1px highlight\" src=\"{$src}\" alt=\"\" />";
        } else {
            $cell[] = $vbphrase['n_a'];
        }
        $cell[] = construct_link_code($vbphrase['edit'], "bbcode.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;bbcodeid={$bbcode['bbcodeid']}") . construct_link_code($vbphrase['delete'], "bbcode.php?" . $vbulletin->session->vars['sessionurl'] . "do=remove&amp;bbcodeid={$bbcode['bbcodeid']}");
        print_cells_row($cell, 0, $class, -4);
    }
    print_submit_row($vbphrase['add_new_bb_code'], false, 6);
    if (empty($donetest)) {
        print_form_header('bbcode', 'test');
        print_table_header($vbphrase['test_your_bb_code']);
        print_textarea_row($vbphrase['enter_text_with_bb_code'], 'text', '', 15, 60);
        print_submit_row($vbphrase['go']);
    }
}
// ########################################################################
print_cp_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:39, Wed May 30th 2012
|| # CVS: $RCSfile$ - $Revision: 39862 $
|| ####################################################################
\*======================================================================*/
Exemple #18
0
		<input type="hidden" name="options[searchboth]" value="0" />
		<input type="hidden" name="options[matchall]" value="0" />
		<div class="smallfont">
			<label for="cb_searchboth"><input type="checkbox" name="options[searchboth]" id="cb_searchboth" value="1" tabindex="1"' . $checked['searchboth'] . ' />' . $vbphrase['search_item_body'] . '</label>
			<label for="cb_matchall"><input type="checkbox" name="options[matchall]" id="cb_matchall" value="1" tabindex="1"' . $checked['matchall'] . ' />' . $vbphrase['match_all_words'] . '</label>
		</div>
	', '', 'top', 'searchwords');
    print_input_row($vbphrase['username'], 'username', $feed['username'], false, 50);
    print_forum_chooser($vbphrase['forum'], 'forumid', $feed['forumid'], null, true, false, '[%s]');
    print_yes_no_row($vbphrase['allow_smilies'], 'options[allowsmilies]', $feed['options']['allowsmilies']);
    print_yes_no_row($vbphrase['display_signature'], 'options[showsignature]', $feed['options']['showsignature']);
    print_yes_no_row($vbphrase['convert_html_to_bbcode'], 'options[html2bbcode]', $feed['options']['html2bbcode']);
    print_table_header($vbphrase['templates']);
    print_description_row('<div class="smallfont">' . $vbphrase['rss_templates_description'] . '</div>');
    print_input_row($vbphrase['title_template'], 'titletemplate', $feed['titletemplate'], true, 50);
    print_textarea_row($vbphrase['body_template'], 'bodytemplate', $feed['bodytemplate'], 10, 50);
    print_description_row('<label for="rb_itemtype_thread"><input type="radio" name="itemtype" value="thread" id="rb_itemtype_thread"' . $checked['itemtype']['thread'] . "  />{$vbphrase['post_items_as_threads']}</label>", false, 2, 'thead', 'left', 'itemtype');
    if ($prefix_options = construct_prefix_options(0, $feed['prefixid'])) {
        print_label_row($vbphrase['prefix'] . '<dfn>' . $vbphrase['note_prefix_must_allowed_forum'] . '</dfn>', '<select name="prefixid" class="bginput">' . $prefix_options . '</select>', '', 'top', 'prefixid');
    }
    // build thread icon picker
    $icons = array();
    $icons_result = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "icon ORDER BY imagecategoryid, displayorder");
    $icons_total = $db->num_rows($icons_result);
    while ($icon = $db->fetch_array($icons_result)) {
        $icons[] = $icon;
    }
    $db->free_result($icons_result);
    $icon_count = 0;
    $icon_cols = 7;
    $icon_rows = ceil($icons_total / $icon_cols);
                    $errnote = "{$errnote}</font></dfn>";
                } else {
                    $errnote = "";
                }
                $bgcounter++;
                print_description_row("<div ondblclick=\"ame_toggle_group('import_{$x}'); return false;\">\n            \t<div style=\"float: " . $vbulletin->stylevars['right']['string'] . "\">" . (!$errnote ? "<input type=\"checkbox\" name=\"import[{$x}]\" id=\"import_{$x}\" value=\"1\" " . ($errnote == '' ? "checked=\"checked\"" : "") . " />" : "<img src=\"../cpstyles/" . $vbulletin->options['cpstylefolder'] . "/colorpicker_close.gif\" alt=\"Cannot Import\" border=\"0\" />") . "</div>\n            \t<a style=\"cursor: pointer;\"  onclick=\"ame_toggle_group('import_{$x}'); return false;\"><img src=\"../cpstyles/" . $vbulletin->options['cpstylefolder'] . "/cp_collapse.gif\" title=\"Expand\" id=\"collapse_import_{$x}\" alt=\"Expand\" border=\"0\" /></a> <strong><a style=\"cursor: pointer;\" onclick=\"ame_toggle_group('import_{$x}'); return false;\">{$value['provider']}</a>{$errnote}</strong></div>\n\t");
                echo "<tr>\n\t<td cellspacing=\"0\" cellpadding=\"0\" colspan=\"2\" style=\"display: none\" id=\"td_import_{$x}\">\n\t";
                print_table_start(false, '100%', "0", "table_import_{$x}");
                print_input_row($vbphrase['ame_provider'], "provider[{$x}]", $value['provider']);
                print_label_row($vbphrase['ame_tagoption'], $value['tagoption']);
                construct_hidden_code("tagoption[{$x}]", $value['tagoption']);
                print_input_row($vbphrase['ame_url'], "url[{$x}]", $value['url']);
                print_input_row($vbphrase['ame_priority'], "priority[{$x}]", $value['priority']);
                print_input_row($vbphrase['ame_regex_url'], "regex_url[{$x}]", $value['regex_url']);
                print_textarea_row($vbphrase['ame_regex_scrape'], "regex_scrape[{$x}]", $value['regex_scrape']);
                print_textarea_row($vbphrase['ame_embed'], "embed[{$x}]", $value['embed']);
                $x++;
                echo "</table></td></tr>";
            }
            print_table_break();
        } elseif (sizeof($arr['item'])) {
            print_stop_message('ame_import_error_old_format');
        } else {
            print_stop_message('ame_import_error_empty');
        }
    } else {
        print_stop_message('ame_invalid_xml');
    }
    print_submit_row($vbphrase['import']);
}
/**
Exemple #20
0
    print_select_row($vbphrase['phrase_type'], 'phrasetype[]', $phrasetypes, $vbulletin->GPC['phrasetype'], false, 10, true);
    $where = array("{$vbulletin->GPC['searchwhere']}" => ' checked="checked"');
    print_label_row(construct_phrase($vbphrase['search_in_x'], '...'), '
		<label for="rb_sw_0"><input type="radio" name="searchwhere" id="rb_sw_0" value="0" tabindex="1"' . $where[0] . ' />' . $vbphrase['phrase_text_only'] . '</label><br />
		<label for="rb_sw_1"><input type="radio" name="searchwhere" id="rb_sw_1" value="1" tabindex="1"' . $where[1] . ' />' . $vbphrase['phrase_name_only'] . '</label><br />
		<label for="rb_sw_10"><input type="radio" name="searchwhere" id="rb_sw_10" value="10" tabindex="1"' . $where[10] . ' />' . $vbphrase['phrase_text_and_phrase_name'] . '</label>', '', 'top', 'searchwhere');
    print_yes_no_row($vbphrase['case_sensitive'], 'casesensitive', $vbulletin->GPC['casesensitive']);
    print_yes_no_row($vbphrase['exact_match'], 'exactmatch', $vbulletin->GPC['exactmatch']);
    print_submit_row($vbphrase['find']);
    unset($languageselect[-10], $languageselect[-1], $languageselect[0]);
    // search & replace
    print_form_header('phrase', 'replace', 0, 1, 'srform');
    print_table_header($vbphrase['find_and_replace_in_languages']);
    print_select_row($vbphrase['search_in_language'], 'languageid', $languageselect);
    print_textarea_row($vbphrase['search_for_text'], 'searchstring', '', 5, 60, 1, 0);
    print_textarea_row($vbphrase['replace_with_text'], 'replacestring', '', 5, 60, 1, 0);
    print_submit_row($vbphrase['replace']);
}
// #############################################################################
if ($_POST['do'] == 'doreplace') {
    $vbulletin->input->clean_array_gpc('p', array('replace' => TYPE_ARRAY_UINT, 'searchstring' => TYPE_STR, 'replacestring' => TYPE_STR, 'languageid' => TYPE_INT));
    if (empty($vbulletin->GPC['replace'])) {
        print_stop_message('please_complete_required_fields');
    }
    $phraseids = array_keys($vbulletin->GPC['replace']);
    $phrases = $db->query_read("\n\t\tSELECT *\n\t\tFROM " . TABLE_PREFIX . "phrase\n\t\tWHERE phraseid IN (" . implode(',', $phraseids) . ")\n\t");
    while ($phrase = $db->fetch_array($phrases)) {
        $phrase['product'] = empty($phrase['product']) ? 'vbulletin' : $phrase['product'];
        $phrase['text'] = str_replace($vbulletin->GPC['searchstring'], $vbulletin->GPC['replacestring'], $phrase['text']);
        if ($phrase['languageid'] == $vbulletin->GPC['languageid']) {
            // update
Exemple #21
0
     while ($attachment = $db->fetch_array($attachments)) {
         $select_options[$attachment['id']] = $attachment['filename'];
     }
     for ($i = 1; $i < 100; $i++) {
         $select_options_days[$i] = $i;
     }
     print_form_header('qhvbmailer', 'manage_newsletters', false, true);
     print_table_header('Add/Edit Newsletter');
     construct_hidden_code('act', '3');
     construct_hidden_code('template_id', $template['id']);
     print_input_row('Varname', 'varname', $template['varname']);
     print_select_row('Send Every (amount of days)', 'nl_every', $select_options_days, $template['nl_every']);
     print_input_row('Subject', 'subject', $template_phrases["nl_" . $template['id'] . "_" . $template['varname'] . "_subject"]);
     print_select_row('Attachment', 'attachment_id', $select_options, $template['attachment_id']);
     print_textarea_row('Text Body', 'text', $template_phrases["nl_" . $template['id'] . "_" . $template['varname'] . "_text"], 8, 80);
     print_textarea_row('HTML Body', 'html', $template_phrases["nl_" . $template['id'] . "_" . $template['varname'] . "_html"], 24, 80, false, false, '', false, 'elm1');
     print_submit_row('Add/Edit Newsletter');
 } elseif ($_GET['act'] == 3) {
     $vbulletin->input->clean_array_gpc('p', array('template_id' => TYPE_UINT, 'varname' => TYPE_STR, 'nl_every' => TYPE_UINT, 'subject' => TYPE_STR, 'attachment_id' => TYPE_INT, 'text' => TYPE_STR, 'html' => TYPE_STR));
     if ($vbulletin->GPC['nl_every'] > 0) {
         if ($vbulletin->GPC['template_id'] > 0) {
             //Edit
             $sql = "SELECT * FROM " . TABLE_PREFIX . "qhvbmailer_templates WHERE id='" . $vbulletin->GPC['template_id'] . "'";
             $template = $db->query_first($sql);
             if ($db->query_write("UPDATE " . TABLE_PREFIX . "qhvbmailer_templates SET nl_every='" . $vbulletin->GPC['nl_every'] . "', attachment_id='" . $vbulletin->GPC['attachment_id'] . "' WHERE id='" . $vbulletin->GPC['template_id'] . "'")) {
                 $db->query_write("UPDATE " . TABLE_PREFIX . "phrase SET text='" . $db->escape_string($vbulletin->GPC['subject']) . "' WHERE varname='nl_" . $template['id'] . "_" . $template['varname'] . "_subject'");
                 $db->query_write("UPDATE " . TABLE_PREFIX . "phrase SET text='" . $db->escape_string($vbulletin->GPC['text']) . "' WHERE varname='nl_" . $template['id'] . "_" . $template['varname'] . "_text'");
                 $db->query_write("UPDATE " . TABLE_PREFIX . "phrase SET text='" . $db->escape_string($vbulletin->GPC['html']) . "' WHERE varname='nl_" . $template['id'] . "_" . $template['varname'] . "_html'");
                 print_cp_message('Newsletter edited!', 'qhvbmailer.php?do=manage_newsletters', 1);
             } else {
                 print_cp_message('Error editing newsletter!', 'qhvbmailer.php?do=manage_newsletters', 2);
Exemple #22
0
        print_label_row($vbphrase['text'], nl2br(htmlspecialchars($faqphrase["{$defaultlang}"]['text'])));
    }
    print_input_row($vbphrase['display_order'], 'displayorder', $faq['displayorder']);
    if ($vbulletin->debug) {
        print_yes_no_row($vbphrase['vbulletin_default'], 'volatile', $faq['volatile']);
    } else {
        construct_hidden_code('volatile', $faq['volatile']);
    }
    print_select_row($vbphrase['product'], 'product', fetch_product_list(), $faq['product']);
    print_table_header($vbphrase['translations']);
    $languages = fetch_languages_array();
    foreach ($languages as $languageid => $lang) {
        print_input_row("{$vbphrase['title']} <dfn>(" . construct_phrase($vbphrase['x_translation'], "<b>{$lang['title']}</b>") . ")</dfn>", "title[{$languageid}]", $faqphrase["{$languageid}"]['title'], 1, 69, 0, $lang['direction']);
        // reset bgcounter so that both entries are the same colour
        $bgcounter--;
        print_textarea_row("{$vbphrase['text']} <dfn>(" . construct_phrase($vbphrase['x_translation'], "<b>{$lang['title']}</b>") . ")</dfn>", "text[{$languageid}]", $faqphrase["{$languageid}"]['text'], 4, 70, 1, 1, $lang['direction']);
        print_description_row('<img src="../' . $vbulletin->options['cleargifurl'] . '" width="1" height="1" alt="" />', 0, 2, 'thead');
    }
    print_submit_row($vbphrase['save']);
}
// #############################################################################
if ($_POST['do'] == 'updateorder') {
    $vbulletin->input->clean_array_gpc('p', array('order' => TYPE_NOCLEAN, 'faqparent' => TYPE_STR));
    if (empty($vbulletin->GPC['order']) or !is_array($vbulletin->GPC['order'])) {
        print_stop_message('invalid_array_specified');
    }
    $faqnames = array();
    foreach ($vbulletin->GPC['order'] as $faqname => $displayorder) {
        $vbulletin->GPC['order']["{$faqname}"] = intval($displayorder);
        $faqnames[] = "'" . $db->escape_string($faqname) . "'";
    }
Exemple #23
0
			</select>'));
    if (sizeof($ad_name_cache)) {
        $criteria_options['ad_x_not_displayed'] = array('<select name="criteria[ad_x_not_displayed][condition1]" tabindex="1">' . construct_select_options($ad_name_cache, $criteria_cache['ad_x_not_displayed']['condition1']) . '</select>');
    }
    // hook to allow third-party additions of criteria
    ($hook = vBulletinHook::fetch_hook('ads_list_criteria')) ? eval($hook) : false;
    // build the editor form
    print_form_header('ad', 'update');
    construct_hidden_code('adid', $vbulletin->GPC['adid']);
    if ($vbulletin->GPC['ad_location_orig']) {
        construct_hidden_code('ad_location_orig', $vbulletin->GPC['ad_location_orig']);
    }
    print_table_header($table_title);
    print_input_row($vbphrase['title'] . '<dfn>' . $vbphrase['ad_title_description'] . '</dfn>', 'title', $ad['title'], 0, 60);
    print_select_row($vbphrase['ad_location'] . '<dfn>' . $vbphrase['ad_location_description'] . '</dfn>', 'ad_location', $location_options, $vbulletin->GPC['ad_location'] ? $vbulletin->GPC['ad_location'] : $ad['adlocation']);
    print_textarea_row($vbphrase['ad_html'] . '<dfn>' . $vbphrase['ad_html_description'] . '</dfn>', 'ad_html', $ad['html'] ? $ad['html'] : $ad['snippet'], 8, 60, true, false);
    print_input_row($vbphrase['display_order'], 'displayorder', $ad['displayorder'], 0, 10);
    print_yes_no_row($vbphrase['active'] . '<dfn>' . $vbphrase['ad_active_description'] . '</dfn>', 'active', $ad['active']);
    print_description_row('<strong>' . $vbphrase['display_ad_if_elipsis'] . '</strong>', false, 2, 'tcat', '', 'criteria');
    if ($display_active_criteria_first) {
        function print_ad_criterion($criteria_option_id, &$criteria_options, $criteria_cache)
        {
            global $vbphrase;
            $criteria_option = $criteria_options["{$criteria_option_id}"];
            print_description_row("<label><input type=\"checkbox\" id=\"cb_{$criteria_option_id}\" tabindex=\"1\" name=\"criteria[{$criteria_option_id}][active]\" title=\"{$vbphrase['criterion_is_active']}\" value=\"1\"" . (empty($criteria_cache["{$criteria_option_id}"]) ? '' : ' checked="checked"') . " />" . "<span id=\"span_{$criteria_option_id}\">" . construct_phrase($vbphrase[$criteria_option_id . '_criteria'], $criteria_option[0], $criteria_option[1], $criteria_option[2]) . '</span></label>');
            unset($criteria_options["{$criteria_option_id}"]);
        }
        foreach (array_keys($criteria_cache) as $id) {
            print_ad_criterion($id, $criteria_options, $criteria_cache);
        }
        foreach ($criteria_options as $id => $criteria_option) {
Exemple #24
0
        print_stop_message('no_matches_found');
    }
}
// ###################### Start Reputation Edit Form #######################
if ($_REQUEST['do'] == 'editreputation') {
    $vbulletin->input->clean_array_gpc('r', array('reputationid' => TYPE_INT));
    if (!can_moderate(0, 'caneditreputation') or !$vbulletin->options['reputationenable']) {
        print_stop_message('no_permission');
    }
    $reputation = $db->query_first("\n\t\tSELECT reason, dateline, userid\n\t\tFROM " . TABLE_PREFIX . "reputation\n\t\tWHERE reputationid = " . $vbulletin->GPC['reputationid'] . "\n\t");
    print_form_header('user', 'doeditreputation');
    construct_hidden_code('reputationid', $vbulletin->GPC['reputationid']);
    construct_hidden_code('userid', $reputation['userid']);
    print_table_header($vbphrase['edit_reputation_comment']);
    print_label_row($vbphrase['date'], vbdate($vbulletin->options['logdateformat'], $reputation['dateline']));
    print_textarea_row($vbphrase['reason'], 'reason', $reputation['reason'], 4, 40, 1, 0);
    print_submit_row($vbphrase['update'], 0);
}
// ###################### Start Actual Reputation Editing #######################
if ($_POST['do'] == 'doeditreputation') {
    $vbulletin->input->clean_array_gpc('p', array('reputationid' => TYPE_INT, 'reason' => TYPE_STR));
    if (!can_moderate(0, 'caneditreputation') or !$vbulletin->options['reputationenable']) {
        print_stop_message('no_permission');
    }
    $db->query_write("\n\t\tUPDATE " . TABLE_PREFIX . "reputation\n\t\tSET reason = '" . $db->escape_string($vbulletin->GPC['reason']) . "'\n\t\tWHERE reputationid = " . $vbulletin->GPC['reputationid'] . "\n\t");
    define('CP_REDIRECT', 'user.php?do=reputation&amp;u=' . $vbulletin->GPC['userid']);
    print_stop_message('updated_reason_successfully');
}
print_cp_footer();
/*======================================================================*\
|| ####################################################################
Exemple #25
0
// #############################################################################
// confirmation for template deletion
if ($_REQUEST['do'] == 'delete') {
    $vbulletin->input->clean_array_gpc('r', array('group' => TYPE_STR));
    $hidden = array();
    $hidden['group'] = $vbulletin->GPC['group'];
    print_delete_confirmation('template', $vbulletin->GPC['templateid'], 'template', 'kill', 'template', $hidden, $vbphrase['please_be_aware_template_is_inherited']);
}
// #############################################################################
// lets the user see the original template
if ($_REQUEST['do'] == 'view') {
    $vbulletin->input->clean_array_gpc('r', array('title' => TYPE_STR));
    $template = $db->query_first("\n\t\tSELECT templateid, styleid, title, template_un\n\t\tFROM " . TABLE_PREFIX . "template\n\t\tWHERE styleid = -1 AND title = '" . $db->escape_string($vbulletin->GPC['title']) . "'\n\t");
    print_form_header('', '');
    print_table_header($vbphrase['show_default']);
    print_textarea_row($template['title'], '--[-ORIGINAL-TEMPLATE-]--', $template['template_un'], 20, 80, true, true, 'ltr', 'code');
    print_table_footer();
}
// #############################################################################
// update display order values
if ($_POST['do'] == 'dodisplayorder') {
    $vbulletin->input->clean_array_gpc('p', array('displayorder' => TYPE_ARRAY_INT, 'userselect' => TYPE_ARRAY_INT));
    $styles = $db->query_read("SELECT styleid, parentid, title, displayorder, userselect FROM " . TABLE_PREFIX . "style");
    if ($db->num_rows($styles)) {
        while ($style = $db->fetch_array($styles)) {
            $order = $vbulletin->GPC['displayorder']["{$style['styleid']}"];
            $uperm = intval($vbulletin->GPC['userselect']["{$style['styleid']}"]);
            if ($style['displayorder'] != $order or $style['userselect'] != $uperm) {
                $db->query_write("\n\t\t\t\t\tUPDATE " . TABLE_PREFIX . "style\n\t\t\t\t\tSET displayorder = {$order},\n\t\t\t\t\tuserselect = {$uperm}\n\t\t\t\t\tWHERE styleid = {$style['styleid']}\n\t\t\t\t");
            }
        }
        print_input_row($vbphrase['title'], 'title');
    }
    if ($infraction['infr_user_msg']) {
        print_textarea_row($vbphrase['rcd_infraction_user_msg'] . '<dfn>' . construct_link_code($vbphrase['translations'], "phrase.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&fieldname=infractionlevel&varname={$infr_user_msg_id}&t=1", 1) . '</dfn>', 'infr_user_msg', $infraction['infr_user_msg']);
    } else {
        print_textarea_row($vbphrase['rcd_infraction_user_msg'], 'infr_user_msg');
    }
    $periods = array('H' => $vbphrase['hours'], 'D' => $vbphrase['days'], 'M' => $vbphrase['months'], 'N' => $vbphrase['never']);
    $input = '<input type="text" class="bginput" name="expires" size="5" dir="ltr" tabindex="1" value="' . $infraction['expires'] . '"' . ($vbulletin->debug ? ' title="name=&quot;expires&quot;"' : '') . " />\r\n";
    $input .= '<select name="period" class="bginput" tabindex="1"' . ($vbulletin->debug ? ' title="name=&quot;period&quot;"' : '') . '>' . construct_select_options($periods, $infraction['period']) . '</select>';
    print_label_row($vbphrase['expires'], $input, '', 'top', 'expires');
    print_input_row($vbphrase['points'], 'points', $infraction['points'], true, 5);
    print_yes_no_row($vbphrase['warning'], 'warning', $infraction['warning']);
    print_yes_no_row($vbphrase['extend'], 'extend', $infraction['extend']);
    print_textarea_row($vbphrase['rcd_infraction_hook_start'], 'hook_start', $infraction['hook_start']);
    print_textarea_row($vbphrase['rcd_infraction_hook_end'], 'hook_end', $infraction['hook_end']);
    print_submit_row($vbphrase['save']);
}
// ###################### Start do update #######################
if ($_POST['do'] == 'updatelevel') {
    $vbulletin->input->clean_array_gpc('p', array('title' => TYPE_STR, 'points' => TYPE_UINT, 'expires' => TYPE_UINT, 'period' => TYPE_NOHTML, 'warning' => TYPE_BOOL, 'extend' => TYPE_BOOL, 'hook_start' => TYPE_STR, 'hook_end' => TYPE_STR, 'infr_user_msg' => TYPE_STR));
    if (empty($vbulletin->GPC['title']) or empty($vbulletin->GPC['expires']) and $vbulletin->GPC['period'] != 'N') {
        print_stop_message('please_complete_required_fields');
    }
    if (empty($vbulletin->GPC['infractionlevelid'])) {
        $db->query_write("INSERT INTO " . TABLE_PREFIX . "infractionlevel (points) VALUES (0)");
        $vbulletin->GPC['infractionlevelid'] = $db->insert_id();
    }
    if ($vbulletin->GPC['period'] == 'N') {
        $vbulletin->GPC['expires'] = 0;
    }
            print_stop_message('infraction_already_reversed');
        }
        print_form_header('admininfraction', 'doreverse');
        print_table_header($vbphrase['reverse_infraction']);
        print_label_row($vbphrase['user_name'], $infraction['username']);
        print_label_row($vbphrase['left_by'], $infraction['whoadded_username']);
        $title = !empty($vbphrase['infractionlevel' . $infraction['infractionlevelid'] . '_title']) ? $vbphrase['infractionlevel' . $infraction['infractionlevelid'] . '_title'] : (!empty($infraction['customreason']) ? unhtmlspecialchars($infraction['customreason']) : $vbphrase['n_a']);
        if ($infraction['points']) {
            print_label_row($infraction['action'] == 0 ? construct_phrase($vbphrase['active_infraction_x_points'], $infraction['points']) : construct_phrase($vbphrase['expired_infraction_x_points'], $infraction['points']), htmlspecialchars_uni($title));
        } else {
            print_label_row($infraction['action'] == 0 ? $vbphrase['active_warning'] : $vbphrase['expired_warning'], htmlspecialchars_uni($title));
        }
        if (!empty($infraction['reason'])) {
            print_label_row($vbphrase['infraction_reason'], $infraction['reason']);
        }
        print_textarea_row($vbphrase['reversal_reason'] . '<dfn>' . construct_phrase($vbphrase['maximum_chars_x'], 255) . '</dfn>', 'reason', '', 0, 40, 2);
        construct_hidden_code('infractionid', $vbulletin->GPC['infractionid']);
        construct_hidden_code('pp', $vbulletin->GPC['perpage']);
        construct_hidden_code('page', $vbulletin->GPC['pagenumber']);
        construct_hidden_code('orderby', $vbulletin->GPC['orderby']);
        construct_hidden_code('status', $vbulletin->GPC['status']);
        construct_hidden_code('userid', $vbulletin->GPC['userid']);
        construct_hidden_code('whoadded', $vbulletin->GPC['whoadded']);
        construct_hidden_code('startstamp', $vbulletin->GPC['startstamp']);
        construct_hidden_code('endstamp', $vbulletin->GPC['endstamp']);
        construct_hidden_code('infractionlevelid', $vbulletin->GPC['infractionlevelid']);
        print_submit_row();
    } else {
        print_stop_message('no_matches_found');
    }
}
Exemple #28
0
        }
        print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['holiday'], $holidayinfo['title'], $holidayinfo['holidayid']));
    } 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 {
Exemple #29
0
 } else {
     if ($_REQUEST['do'] == 'bitfields') {
         require_once DIR . '/includes/class_bitfield_builder.php';
         vB_Bitfield_Builder::save($db);
         build_forum_permissions();
         define('SCRIPT_REDIRECT', true);
     } else {
         if ($_REQUEST['do'] == 'mysql') {
             $vbulletin->input->clean_array_gpc('p', array('query' => TYPE_STR, 'tables' => TYPE_ARRAY));
             switch ($vbulletin->GPC['type']) {
                 case 'query':
                     if (empty($vbulletin->GPC['query']) or !preg_match('#^(Alter|Update)#si', $vbulletin->GPC['query'])) {
                         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'))) {
Exemple #30
0
				print_table_header($vbphrase['no_permission_announcement']);
				print_table_break();
			}
		}

		construct_hidden_code('announcementid', $vbulletin->GPC['announcementid']);
		print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['announcement'], htmlspecialchars_uni($announcement['title']), $announcement['announcementid']));
	}

	print_forum_chooser($vbphrase['forum_and_children'], 'forumid', $announcement['forumid'], $vbphrase['all_forums']);
	print_input_row($vbphrase['title'], 'title', $announcement['title']);

	print_time_row($vbphrase['start_date'], 'startdate', $announcement['startdate'], 0);
	print_time_row($vbphrase['end_date'], 'enddate', $announcement['enddate'], 0);

	print_textarea_row($vbphrase['text'], 'pagetext', $announcement['pagetext'], 20, '75" style="width:100%');

	if ($vbulletin->GPC['announcementid'])
	{
		print_yes_no_row($vbphrase['reset_views_counter'], 'reset_views', 0);
	}

	print_yes_no_row($vbphrase['allow_bbcode'], 'announcementoptions[allowbbcode]', ($announcement['announcementoptions'] & $vbulletin->bf_misc_announcementoptions['allowbbcode'] ? 1 : 0));
	print_yes_no_row($vbphrase['allow_smilies'], 'announcementoptions[allowsmilies]', ($announcement['announcementoptions'] & $vbulletin->bf_misc_announcementoptions['allowsmilies'] ? 1 : 0));
	print_yes_no_row($vbphrase['allow_html'], 'announcementoptions[allowhtml]', ($announcement['announcementoptions'] & $vbulletin->bf_misc_announcementoptions['allowhtml'] ? 1 : 0));
	print_yes_no_row($vbphrase['automatically_parse_links_in_text'], 'announcementoptions[parseurl]', ($announcement['announcementoptions'] & $vbulletin->bf_misc_announcementoptions['parseurl'] ? 1 : 0));
	print_yes_no_row($vbphrase['show_your_signature'], 'announcementoptions[signature]', ($announcement['announcementoptions'] & $vbulletin->bf_misc_announcementoptions['signature'] ? 1 : 0));

	print_submit_row($vbphrase['save']);
}