Exemple #1
0
             print_description_row('<a href="#help' . $topic['adminhelpid'] . '">' . $helpphrase[fetch_help_phrase_short_name($topic, '_title')] . '</a>', 0, 1);
         }
     }
     print_table_footer();
 }
 if (sizeof($specific)) {
     reset($specific);
     print_form_header('', '');
     if ($resultcount != 1) {
         print_table_header($vbphrase['action_specific_topics'], 1);
     }
     foreach ($specific as $topic) {
         print_description_row("<a name=\"help{$topic['adminhelpid']}\">" . $helpphrase[fetch_help_phrase_short_name($topic, '_title')] . "</a>", 0, 1, 'thead');
         print_description_row($helpphrase[fetch_help_phrase_short_name($topic, '_text')], 0, 1, 'alt1');
         if ($vbulletin->debug) {
             print_description_row("<div style=\"float:{$stylevar['right']}\">" . construct_button_code($vbphrase['edit'], "help.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;adminhelpid={$topic['adminhelpid']}") . "</div><div>action = {$topic['action']} | optionname = {$topic['optionname']} | displayorder = {$topic['displayorder']}</div>", 0, 1, 'alt2 smallfont');
         }
     }
     print_table_footer();
 }
 if (sizeof($general)) {
     reset($general);
     print_form_header('', '');
     if ($resultcount != 1) {
         print_table_header($vbphrase['general_topics'], 1);
     }
     foreach ($general as $topic) {
         print_description_row("<a name=\"help{$topic['adminhelpid']}\">" . $helpphrase[fetch_help_phrase_short_name($topic, '_title')] . "</a>", 0, 1, 'thead');
         print_description_row($helpphrase[fetch_help_phrase_short_name($topic, '_text')]);
     }
     print_table_footer();
Exemple #2
0
        // Output the line.
        print_cells_row($cell, false, false, 0, 'top', false, false, $navelement['navtype'] . 'row');
        if ($navelement['navtype'] == 'tab' and $navelement['navid'] == $vbulletin->GPC['tabid'] and !$navelement['links']) {
            print_description_row($vbphrase['tab_has_no_elements'], 0, 6);
        }
        if ($navelement['active'] != 1 or $vbulletin->products[$navelement['productid']] != 1) {
            if ($navelement['navtype'] == 'tab') {
                $tabstate = 1;
            } else {
                if ($navelement['navtype'] == 'menu') {
                    $menustate = 1;
                }
            }
        }
    }
    print_table_footer(6, "<input type=\"submit\" class=\"button\" tabindex=\"1\" value=\"" . $vbphrase['save'] . "\" accesskey=\"s\" />" . construct_button_code($vbphrase['add_new_tab'], "navigation.php?" . $vbulletin->session->vars['sessionurl'] . "do=add&type=tab"));
    ($hook = vBulletinHook::fetch_hook('navigation_admin_list')) ? eval($hook) : false;
}
if ($_REQUEST['do'] == 'update') {
    $vbulletin->input->clean_array_gpc('r', array('order' => TYPE_ARRAY_INT, 'active' => TYPE_ARRAY_BOOL, 'vactive' => TYPE_ARRAY));
    $active = array();
    $display = array();
    foreach ($vbulletin->GPC['order'] as $key => $order) {
        $display[$order][] = $key;
        /* Deal with missing active values.
        		This could be because the checkbox is unticked or
        		disabled, we try and track this state in vactive */
        if (!isset($vbulletin->GPC['active'][$key])) {
            $vbulletin->GPC['active'][$key] = 0;
            switch ($vbulletin->GPC['vactive'][$key]) {
                case 1:
     foreach ($queryoptions as $query_group => $queries) {
         if (!is_array($queries)) {
             continue;
         }
         foreach ($queries as $query_id => $query_title) {
             if ($query_id == $vbulletin->GPC['autoquery']) {
                 $auto_query_text = " ({$query_title})";
                 break 2;
             }
         }
     }
 }
 print_form_header('', '');
 print_table_header($vbphrase['query'] . $auto_query_text);
 print_description_row('<code>' . nl2br(htmlspecialchars_uni($query)) . '</code>', 0, 2, '');
 print_description_row(construct_button_code($vbphrase['restart'], 'queries.php?' . vB::getCurrentSession()->get('sessionurl')), 0, 2, 'tfoot', 'center');
 print_table_footer();
 $query_stripped = preg_replace('@/\\*.*?\\*/@s', '', $query);
 $query_stripped = preg_replace('@(#|--).*?$@m', '', $query_stripped);
 preg_match('#^([A-Z]+)\\s#si', trim($query_stripped), $regs);
 $querytype = strtoupper($regs[1]);
 switch ($querytype) {
     // EXPLAIN, SELECT, DESCRIBE & SHOW **********************************************************
     case 'EXPLAIN':
     case 'SELECT':
     case 'DESCRIBE':
     case 'SHOW':
         $query_mod = preg_replace('#\\sLIMIT\\s+(\\d+(\\s*,\\s*\\d+)?)#i', '', $query);
         $counter = $vbulletin->db->query_write($query_mod);
         print_form_header('queries', 'doquery', 0, 1, 'queryform');
         construct_hidden_code('do', 'doquery');
Exemple #4
0
        if ($vbulletin->options['cp_collapse_forums']) {
            echo '<p class="smallfont" align="center">' . construct_link_code($vbphrase['expand_all'], "forum.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify&amp;expandid=-2") . '</p>';
        }
        echo '<p class="smallfont" align="center">' . $vbphrase['forums_marked_asterisk_are_password_protected'] . '</p>';
    } else {
        print_form_header('forum', 'doorder');
        print_table_header($vbphrase['forum_manager'], 2);
        print_cells_row(array($vbphrase['forum'], $vbphrase['controls']), 1, 'tcat');
        $cell = array();
        $select = '<select name="forumid" id="sel_foruid" tabindex="1" class="bginput">';
        $select .= construct_forum_chooser($vbulletin->GPC['forumid'], true);
        $select .= "</select>\n";
        $cell[] = $select;
        $cell[] = "\n\t<select name=\"controls\" class=\"bginput\">\n" . construct_select_options($forumoptions1) . "\t</select><input type=\"button\" class=\"button\" value=\"" . $vbphrase['go'] . "\" onclick=\"js_forum_jump(js_returnid());\" />\n\t";
        print_cells_row($cell);
        print_table_footer(2, construct_button_code($vbphrase['add_new_forum'], "forum.php?" . $vbulletin->session->vars['sessionurl'] . "do=add"));
    }
}
// ###################### Start add podcast #######################
if ($_REQUEST['do'] == 'podcast') {
    if (!($forum = fetch_foruminfo($vbulletin->GPC['forumid'], false))) {
        print_stop_message('invalid_forum_specified');
    }
    require_once DIR . '/includes/adminfunctions_misc.php';
    $forum['title'] = str_replace('&amp;', '&', $forum['title']);
    $podcast = $db->query_first("\r\n\t\tSELECT *\r\n\t\tFROM " . TABLE_PREFIX . "podcast\r\n\t\tWHERE forumid = {$forum['forumid']}");
    print_form_header('forum', 'updatepodcast');
    print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['podcast_settings'], $forum['title'], $forum['forumid']));
    construct_hidden_code('forumid', $forum['forumid']);
    print_yes_no_row($vbphrase['enabled'], 'enabled', $podcast['enabled']);
    print_podcast_chooser($vbphrase['category'], 'categoryid', $podcast['categoryid']);
 */
if ($do == "export") {
    $results = $db->query_read_slave("SELECT providerid id, provider title, url description from " . TABLE_PREFIX . "bbcode_video ORDER BY priority, provider ASC");
    print_form_header('ame', 'doexport');
    badhook_check();
    if ($db->num_rows($results)) {
        print_table_header($vbphrase['ame_installed_definitions'], 2);
        print_cells_row(array($vbphrase['title'], "<label for=\"export_toggle\">{$vbphrase['export']}</label> <input type=\"checkbox\" id=\"export_toggle\" onclick=\"tick_all(this.form, 'items', this.checked)\" checked=\"checked\" />"), true);
        while ($result = $db->fetch_array($results)) {
            print_checkbox_row("{$result['title']}<dfn>{$result['description']}</dfn>", "items[{$result['id']}]");
        }
        print_submit_row();
    } else {
        print_table_header($vbphrase['ame_installed_definitions'], 2);
        print_description_row($vbphrase['ame_no_definitions']);
        print_table_footer(2, construct_button_code("Add new", "ame.php?do=edit"));
    }
}
/**
 * Spits out an XML file of the exported items
 */
if ($do == "doexport") {
    $items = $vbulletin->input->clean_gpc('p', 'items', TYPE_ARRAY_UINT);
    if (sizeof($items)) {
        foreach ($items as $key => $value) {
            if ($value) {
                $ids .= ($ids ? "," : "") . $key;
            }
        }
        $results = $db->query_read_slave("SELECT * FROM " . TABLE_PREFIX . "bbcode_video WHERE providerid IN ({$ids})");
        while ($result = $db->fetch_array($results)) {
/**
* Processes a raw template for conditionals, phrases etc into PHP code for eval()
*
* @param	string	Template
*
* @return	string
*/
function compile_template($template)
{
    $orig_template = $template;
    $template = addslashes($template);
    $template = process_template_conditionals($template);
    $template = process_template_phrases('phrase', $template, 'parse_phrase_tag');
    if (!function_exists('replace_template_variables')) {
        require_once DIR . '/includes/functions_misc.php';
    }
    $template = replace_template_variables($template, false);
    ($hook = vBulletinHook::fetch_hook('template_compile')) ? eval($hook) : false;
    $template = str_replace('\\\\$', '\\$', $template);
    if (function_exists('token_get_all')) {
        $tokens = @token_get_all('<?php $var = "' . $template . '"; ?>');
        foreach ($tokens as $token) {
            if (is_array($token)) {
                switch ($token[0]) {
                    case T_INCLUDE:
                    case T_INCLUDE_ONCE:
                    case T_REQUIRE:
                    case T_REQUIRE_ONCE:
                        global $vbphrase;
                        echo "<p>&nbsp;</p><p>&nbsp;</p>";
                        print_form_header('', '', 0, 1, '', '65%');
                        print_table_header($vbphrase['vbulletin_message']);
                        print_description_row($vbphrase['file_inclusion_not_permitted']);
                        print_table_footer(2, construct_button_code($vbphrase['go_back'], 'javascript:history.back(1)'));
                        print_cp_footer();
                        exit;
                }
            }
        }
    }
    if (function_exists('verify_demo_template')) {
        verify_demo_template($template);
    }
    return $template;
}
            }
            // active
            $cells[] = iif(!$ta_cache["{$subscription['subscriptionid']}"], 0, "<a href=\"subscriptions.php?do=find&amp;subscriptionid={$subscription['subscriptionid']}&amp;status=1\"><span style=\"color: green;\">" . $ta_cache["{$subscription['subscriptionid']}"] . "</span></a>");
            // completed
            $completed = intval($t_cache["{$subscription['subscriptionid']}"] - $ta_cache["{$subscription['subscriptionid']}"]);
            $cells[] = iif(!$completed, 0, "<a href=\"subscriptions.php?do=find&amp;subscriptionid={$subscription['subscriptionid']}&amp;status=0\"><span style=\"color: red;\">" . $completed . "</span></a>");
            // total
            $cells[] = iif(!$t_cache["{$subscription['subscriptionid']}"], 0, "<a href=\"subscriptions.php?do=find&amp;subscriptionid={$subscription['subscriptionid']}&amp;status=-1\">" . $t_cache["{$subscription['subscriptionid']}"] . "</a>");
            // display order
            $cells[] = "<input type=\"text\" class=\"bginput\" name=\"order[{$subscription['subscriptionid']}]\" value=\"{$subscription['displayorder']}\" tabindex=\"1\" size=\"3\" title=\"" . $vbphrase['edit_display_order'] . "\" />";
            // controls
            $cells[] = "\n\t<select name=\"s{$subscription['subscriptionid']}\" onchange=\"js_forum_jump({$subscription['subscriptionid']});\" class=\"bginput\">\n" . construct_select_options($options) . "\t</select>\n\t<input type=\"button\" class=\"button\" value=\"" . $vbphrase['go'] . "\" onclick=\"js_forum_jump({$subscription['subscriptionid']});\" />\n\t";
            print_cells_row($cells, 0, '', 1);
        }
    }
    print_table_footer(6, "<input type=\"submit\" class=\"button\" tabindex=\"1\" value=\"" . $vbphrase['save_subscription_manager'] . "\" accesskey=\"s\" />" . construct_button_code($vbphrase['add_new_subscription_gsubscription'], "subscriptions.php?" . vB::getCurrentSession()->get('sessionurl') . "do=add"));
}
// ###################### Start do order #######################
if ($_POST['do'] == 'doorder') {
    $vbulletin->input->clean_array_gpc('p', array('order' => vB_Cleaner::TYPE_ARRAY));
    if (is_array($vbulletin->GPC['order'])) {
        $subobj->cache_user_subscriptions();
        if (is_array($subobj->subscriptioncache) and (!empty($vbulletin->GPC['order']) and !empty($subobj->subscriptioncache))) {
            $assertor->assertQuery('vBForum:doSubscriptionLogOrder', array('subscriptions' => $subobj->subscriptioncache, 'displayorder' => $vbulletin->GPC['order']));
        }
    }
    print_stop_message2('saved_display_order_successfully', 'subscriptions', array('do' => 'modify'));
}
// ###################### Start Remove #######################
if ($_REQUEST['do'] == 'apirem') {
    if (!vB::getUserContext()->hasAdminPermission('cansetserverconfig')) {
Exemple #8
0
    $photoplog_category = array();
    foreach ($photoplog_list_categories as $photoplog_key => $photoplog_value) {
        if ($photoplog_key > 0) {
            $photoplog_catid = $photoplog_key;
            $photoplog_dashes = '';
            $photoplog_title = htmlspecialchars_uni(trim($photoplog_value));
            if (eregi("^([-]+[ ])(.*)", $photoplog_title, $photoplog_regs)) {
                $photoplog_dashes = $photoplog_regs[1];
                $photoplog_title = $photoplog_regs[2];
            }
            $photoplog_category['displayorder'] = $photoplog_ds_catopts[$photoplog_catid]['displayorder'];
            $bgclass = fetch_row_bgclass();
            echo "\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"{$bgclass}\" width=\"100%\">" . $photoplog_dashes . "<a href=\"photoplog_category.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;catid=" . $photoplog_catid . "\">" . $photoplog_title . "</a></td>\r\n\t\t\t\t\t<td class=\"{$bgclass}\"><input type=\"text\" class=\"bginput\" name=\"photoplog_category[" . $photoplog_catid . "]\" value=\"" . $photoplog_category['displayorder'] . "\" size=\"5\" /></td>\r\n\t\t\t\t\t<td class=\"{$bgclass}\"><nobr><a href=\"photoplog_category.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;catid=" . $photoplog_catid . "\">" . $vbphrase['photoplog_edit'] . "</a> <a href=\"photoplog_category.php?" . $vbulletin->session->vars['sessionurl'] . "do=delete&amp;catid=" . $photoplog_catid . "\">" . $vbphrase['photoplog_delete'] . "</a></nobr></td>\r\n\t\t\t\t</tr>\r\n\t\t\t";
        }
    }
    print_table_footer(3, "<input type=\"submit\" class=\"button\" tabindex=\"1\" value=\"" . $vbphrase['photoplog_save_display_order'] . "\" accesskey=\"s\" />" . construct_button_code($vbphrase['photoplog_add_new_category'], "photoplog_category.php?" . $vbulletin->session->vars['sessionurl'] . "do=add"));
}
if ($_REQUEST['do'] == 'doorder') {
    $vbulletin->input->clean_array_gpc('p', array('photoplog_category' => TYPE_ARRAY_UINT));
    if (!empty($vbulletin->GPC['photoplog_category'])) {
        $photoplog_dscatopts = $photoplog_ds_catopts;
        $photoplog_sql = '';
        foreach ($vbulletin->GPC['photoplog_category'] as $photoplog_catid => $photoplog_displayorder) {
            $photoplog_sql .= "WHEN " . intval($photoplog_catid) . " THEN " . intval($photoplog_displayorder) . "\n";
            $photoplog_dscatopts["{$photoplog_catid}"]['displayorder'] = intval($photoplog_displayorder);
        }
        if ($db->query_write("UPDATE " . PHOTOPLOG_PREFIX . "photoplog_categories\r\n\t\t\t\tSET displayorder = CASE catid\r\n\t\t\t\t{$photoplog_sql} ELSE displayorder END\r\n\t\t\t")) {
            $db->query_write("ALTER TABLE " . PHOTOPLOG_PREFIX . "photoplog_categories\r\n\t\t\t\tORDER BY parentid, displayorder, catid\r\n\t\t\t");
            build_datastore('photoplog_dscat', serialize($photoplog_dscatopts));
            print_cp_redirect("photoplog_category.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify", 1);
        } else {
Exemple #9
0
$globaltemplates = array();
$actiontemplates = array();
include_once dirname(__FILE__) . '/../includes/functions_vbseo.php';
require_once './global.' . VBSEO_VB_EXT;
if (!can_administer('canadminplugins')) {
    print_cp_no_permission();
}
print_cp_header('vBSEO Installation');
if ($_REQUEST['keepdata']) {
    print_form_header();
    print_table_header('vBSEO data has been left in database unchanged for further usage', 2, 0, '', 'center', 0);
    print_table_footer(2, construct_button_code($vbphrase['click_here_to_continue_processing'], 'index.' . VBSEO_VB_EXT . '?' . $vbulletin->session->vars['sessionurl'] . 'do=buildbitfields'));
} else {
    if ($_REQUEST['do'] == 'kill') {
        $db->query_write("ALTER TABLE " . vbseo_tbl_prefix('forum') . " DROP COLUMN vbseo_moderatepingbacks");
        $db->query_write("ALTER TABLE " . vbseo_tbl_prefix('forum') . " DROP COLUMN vbseo_moderatetrackbacks");
        $db->query_write("ALTER TABLE " . vbseo_tbl_prefix('forum') . " DROP COLUMN vbseo_moderaterefbacks");
        $db->query_write("ALTER TABLE " . vbseo_tbl_prefix('thread') . " DROP COLUMN vbseo_linkbacks_no");
        $db->query_write("DROP TABLE IF EXISTS " . vbseo_tbl_prefix('trackback') . "");
        $db->query_write("DROP TABLE IF EXISTS " . vbseo_tbl_prefix('vbseo_linkback') . "");
        $db->query_write("DROP TABLE IF EXISTS " . vbseo_tbl_prefix('vbseo_blacklist') . "");
        $db->query_write("DROP TABLE IF EXISTS " . vbseo_tbl_prefix('vbseo_serviceupdate') . "");
        require_once DIR . '/includes/class_bitfield_builder.' . VBSEO_VB_EXT;
        vB_Bitfield_Builder::save($db);
        build_forum_permissions();
        print_form_header();
        print_table_header('vBSEO data has been cleaned up successfully', 2, 0, '', 'center', 0);
        print_table_footer(2, construct_button_code($vbphrase['click_here_to_continue_processing'], 'index.' . VBSEO_VB_EXT . '?' . $vbulletin->session->vars['sessionurl'] . 'do=buildbitfields'));
    }
}
print_cp_footer();
Exemple #10
0
function rpm_print_stop_back($text = 'error')
{
    global $vbphrase;
    if (!defined('DONE_CPHEADER')) {
        print_cp_header($vbphrase['vbulletin_message']);
    }
    echo '<p>&nbsp;</p><p>&nbsp;</p>';
    print_form_header('', '', 0, 1, 'messageform', '65%');
    print_table_header($vbphrase['vbulletin_message']);
    print_description_row("<blockquote><br />{$text}<br /><br /></blockquote>");
    print_table_footer(2, construct_button_code($vbphrase['go_back'], 'javascript:history.back(1)'));
    rpm_print_footer();
    print_cp_footer();
}
Exemple #11
0
function photoplog_list_upload_fields($catid)
{
    global $vbulletin, $vbphrase;
    $catid = intval($catid);
    if ($catid != -1 && !photoplog_check_category($catid)) {
        print_stop_message('generic_error_x', $vbphrase['photoplog_bad_category']);
    }
    $photoplog_fields = $vbulletin->db->query_read("SELECT f1.inherited AS inherited1,\r\n\t\tf1.fieldid AS fieldid1, f1.groupid as groupid1, f1.displayorder AS displayorder1,\r\n\t\tf1.protected AS protected1, f1.parentid AS parentid1,\r\n\t\tf1.info AS info1 ,f2.info AS info2\r\n\t\tFROM " . PHOTOPLOG_PREFIX . "photoplog_customfields AS f1\r\n\t\tLEFT JOIN " . PHOTOPLOG_PREFIX . "photoplog_customfields AS f2\r\n\t\tON (f1.parentid = f2.catid AND f1.groupid = f2.groupid)\r\n\t\tWHERE f1.catid = " . intval($catid) . "\r\n\t\tORDER BY f1.displayorder ASC\r\n\t");
    print_form_header('photoplog_field', 'displayorder');
    construct_hidden_code('s', $vbulletin->session->vars['sessionhash']);
    construct_hidden_code('catid', $catid);
    $catname = $catid == -1 ? $vbphrase['photoplog_all_categories'] : photoplog_get_category_title($catid);
    print_table_header(htmlspecialchars_uni($catname), 3);
    if ($catid == -1) {
        print_description_row($vbphrase['photoplog_inherited_fields_cannot_be_modified_root'], 0, 3);
    } else {
        print_description_row($vbphrase['photoplog_inherited_fields_cannot_be_modified'], 0, 3);
    }
    print_cells_row(array($vbphrase['photoplog_field_title'], '<nobr>' . $vbphrase['photoplog_display_order'] . '</nobr>', $vbphrase['photoplog_controls']), 1, '', -1);
    while ($photoplog_field = $vbulletin->db->fetch_array($photoplog_fields)) {
        $photoplog_field['info'] = $photoplog_field['inherited1'] < 1 ? $photoplog_field['info1'] : $photoplog_field['info2'];
        // note: photoplog_field['info'] may be NULL
        $photoplog_field['info'] = empty($photoplog_field['info']) ? '' : unserialize($photoplog_field['info']);
        if (is_array($photoplog_field['info'])) {
            $photoplog_fieldid1 = $photoplog_field['fieldid1'];
            $photoplog_title1 = $photoplog_field['info']['title'];
            $photoplog_parentid1 = intval($photoplog_field['parentid1']);
            if ($photoplog_parentid1 == -2) {
                $photoplog_title1 = $vbphrase[$photoplog_title1];
            }
            $photoplog_protected1 = $photoplog_field['protected1'];
            $photoplog_edit_html = '' . $vbphrase['edit'] . '';
            $photoplog_delete_html = '' . $vbphrase['delete'] . '';
            $photoplog_title_link = htmlspecialchars_uni($photoplog_title1);
            if ($photoplog_protected1 == 0) {
                $photoplog_pre_ahref1 = "[<a href=\"photoplog_field.php?" . $vbulletin->session->vars['sessionurl'];
                $photoplog_pre_ahref2 = "<a href=\"photoplog_field.php?" . $vbulletin->session->vars['sessionurl'];
                $photoplog_post_ahref = "&amp;catid=" . intval($catid) . "&amp;fieldid=" . intval($photoplog_fieldid1) . "\">";
                $photoplog_edit_html = $photoplog_pre_ahref1 . "do=edit" . $photoplog_post_ahref . $photoplog_edit_html . "</a>]";
                $photoplog_delete_html = $photoplog_pre_ahref1 . "do=delete" . $photoplog_post_ahref . $photoplog_delete_html . "</a>]";
                $photoplog_title_link = $photoplog_pre_ahref2 . "do=edit" . $photoplog_post_ahref . $photoplog_title_link . "</a>";
            } else {
                $photoplog_edit_html = '[<del>' . $vbphrase['edit'] . '</del>]';
                $photoplog_delete_html = '[<del>' . $vbphrase['delete'] . '</del>]';
            }
            $bgclass = fetch_row_bgclass();
            if ($catid == -1) {
                echo "\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"{$bgclass}\" width=\"100%\">" . $photoplog_title_link . "</td>\r\n\t\t\t\t\t<td class=\"{$bgclass}\"><span class=\"smallfont\">" . $vbphrase['photoplog_na'] . "</span></td>\r\n\t\t\t\t\t<td class=\"{$bgclass}\"><nobr>" . $photoplog_edit_html . " " . $photoplog_delete_html . "</nobr></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t";
            } else {
                echo "\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"{$bgclass}\" width=\"100%\">" . $photoplog_title_link . "</td>\r\n\t\t\t\t\t<td class=\"{$bgclass}\"><input type=\"text\" class=\"bginput\" name=\"displayorder[" . $photoplog_fieldid1 . "]\" value=\"" . $photoplog_field['displayorder1'] . "\" size=\"5\" /></td>\r\n\t\t\t\t\t<td class=\"{$bgclass}\"><nobr>" . $photoplog_edit_html . " " . $photoplog_delete_html . "</nobr></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t";
            }
        }
    }
    $vbulletin->db->free_result($photoplog_fields);
    $photoplog_submit_button = $catid != -1 ? "<input type=\"submit\" class=\"button\" tabindex=\"1\" value=\"" . $vbphrase['save_display_order'] . "\" accesskey=\"s\" />" : "";
    print_table_footer(3, $photoplog_submit_button . construct_button_code($vbphrase['photoplog_add_new_field'], "photoplog_field.php?" . $vbulletin->session->vars['sessionurl'] . "do=add&amp;catid=" . intval($catid)) . construct_button_code($vbphrase['go_back'], "photoplog_field.php?" . $vbulletin->session->vars['sessionurl'] . "do=view"));
}
/**
* Halts execution and shows the specified message
*
* @param	string	Message to display
* @param	mixed	If specified, a redirect will be performed to the URL in this parameter
* @param	integer	If redirect is specified, this is the time in seconds to delay before redirect
* @param	string	If specified, will provide a specific URL for "Go Back". If empty, no button will be displayed!
* @param bool		If true along with redirect, 'CONTINUE' button will be used instead of automatic redirect
*/
function print_cp_message($text = '', $redirect = NULL, $delay = 1, $backurl = NULL, $continue = false)
{
    global $vbulletin, $vbphrase;
    if ($vbulletin->GPC['ajax']) {
        require_once DIR . '/includes/class_xml.php';
        $xml = new vB_XML_Builder_Ajax('text/xml');
        $xml->add_tag('error', $text);
        $xml->print_xml();
        exit;
    }
    if ($redirect) {
        if (($hashpos = strpos($redirect, '#')) !== false or ($hashpos = strpos($redirect, '%23')) !== false) {
            $hashsize = strpos($redirect, '#') !== false ? 1 : 3;
            $hash = substr($redirect, $hashpos + $hashsize);
            $redirect = substr($redirect, 0, $hashpos);
        }
        if ($session = vB::getCurrentSession()->get('sessionurl')) {
            if (strpos($redirect, $session) !== false) {
                if (strpos($redirect, '?') === false) {
                    $redirect .= '?' . $session;
                } else {
                    $redirect .= '&' . $session;
                }
            }
        }
    }
    if (!defined('DONE_CPHEADER')) {
        print_cp_header($vbphrase['vbulletin_message']);
    }
    print_form_header('', '', 0, 1, 'messageform', '65%');
    print_table_header(new vB_Phrase('global', 'vbulletin_message'));
    print_description_row("<blockquote><br />{$text}<br /><br /></blockquote>");
    if ($redirect) {
        // redirect to the new page
        if ($continue) {
            $continueurl = create_full_url(str_replace('&amp;', '&', $redirect));
            if (!empty($hash)) {
                $continueurl .= '#' . $hash;
            }
            print_table_footer(2, construct_button_code(new vB_Phrase('global', 'continue'), $continueurl));
        } else {
            print_table_footer();
            $redirect_click = create_full_url($redirect);
            if (!empty($hash)) {
                $redirect_click .= '#' . $hash;
                $redirect .= '#' . $hash;
            }
            $redirect_click = str_replace('"', '', $redirect_click);
            echo '<p align="center" class="smallfont">' . construct_phrase($vbphrase['if_you_are_not_automatically_redirected_click_here_x'], $redirect_click) . "</p>\n";
            print_cp_redirect($redirect, $delay);
        }
    } else {
        // end the table and halt
        if ($backurl === NULL) {
            $backurl = 'javascript:history.back(1)';
        }
        if (strpos($backurl, 'history.back(') !== false) {
            //if we are attempting to run a history.back(1), check we have a history to go back to, otherwise attempt to close the window.
            $back_button = '&nbsp;
				<input type="button" id="backbutton" class="button" value="' . $vbphrase['go_back'] . '" title="" tabindex="1" onclick="if (history.length) { history.back(1); } else { self.close(); }"/>
				&nbsp;
				<script type="text/javascript">
				<!--
				if (history.length < 1 || ((is_saf || is_moz) && history.length <= 1)) // safari + gecko start at 1
				{
					document.getElementById("backbutton").parentNode.removeChild(document.getElementById("backbutton"));
				}
				//-->
				</script>';
            // remove the back button if it leads back to the login redirect page
            if (strpos($vbulletin->url, 'login.php?do=login') !== false) {
                $back_button = '';
            }
        } else {
            if ($backurl !== '') {
                // regular window.location=url call
                $backurl = create_full_url($backurl);
                $backurl = str_replace(array('"', "'"), '', $backurl);
                $back_button = '<input type="button" class="button" value="' . new vB_Phrase('global', 'go_back') . '" title="" tabindex="1" onclick="window.location=\'' . $backurl . '\';"/>';
            } else {
                $back_button = '';
            }
        }
        print_table_footer(2, $back_button);
    }
    // and now terminate the script
    print_cp_footer();
}
Exemple #13
0
}
// #######################################################################
if ($_REQUEST['do'] == 'categories') {
    print_form_header('socialgroups', 'categoriesquickupdate');
    print_table_header($vbphrase['social_group_categories'], 5);
    print_cells_row(array("{$vbphrase['title']} / {$vbphrase['description']}", $vbphrase['social_groups'], $vbphrase['creator'], $vbphrase['display_order'], $vbphrase['controls']), true);
    $categories = fetch_socialgroup_category_options();
    $groupcounts = array();
    foreach ($categories as $category) {
        $groupcounts["{$category['socialgroupcategoryid']}"] = $category['groupcount'];
    }
    unset($categories);
    $categoriesresult = $db->query_read("\n\t\tSELECT socialgroupcategory.*, user.username\n\t\tFROM " . TABLE_PREFIX . "socialgroupcategory AS socialgroupcategory\n\t\tINNER JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = socialgroupcategory.creatoruserid)\n\t\tORDER BY socialgroupcategory.displayorder, socialgroupcategory.title\n\t");
    $category_count = $db->num_rows($categoriesresult);
    if ($category_count) {
        while ($category = $db->fetch_array($categoriesresult)) {
            $category['title'] = htmlspecialchars_uni($category['title']);
            $category['description'] = htmlspecialchars_uni($category['description']);
            print_cells_row(array("<a href=\"socialgroups.php?" . $vbulletin->session->vars['sessionurl'] . "do=editcategory&amp;socialgroupcategoryid={$category['socialgroupcategoryid']}\">{$category['title']}</a> <small>{$category['description']}</small>", "<a href=\"socialgroups.php?" . $vbulletin->session->vars['sessionurl'] . "do=dosearch&amp;category={$category['socialgroupcategoryid']}\">" . vb_number_format($groupcounts["{$category['socialgroupcategoryid']}"]) . "</a>", "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;userid={$category['creatoruserid']}\">{$category['username']}</a>", "<input type=\"text\" class=\"bginput\" name=\"order[{$category['socialgroupcategoryid']}]\" value=\"{$category['displayorder']}\" tabindex=\"1\" size=\"3\" title=\"" . $vbphrase['edit_display_order'] . "\" />", '<div class="smallfont">' . construct_link_code($vbphrase['edit'], "socialgroups.php?" . $vbulletin->session->vars['sessionurl'] . "do=editcategory&amp;socialgroupcategoryid=" . $category['socialgroupcategoryid']) . construct_link_code($vbphrase['delete'], "socialgroups.php?" . $vbulletin->session->vars['sessionurl'] . "do=deletecategory&amp;socialgroupcategoryid=" . $category['socialgroupcategoryid']) . '</div>'));
        }
    }
    print_table_footer(5, "<input type=\"submit\" class=\"button\" tabindex=\"1\" value=\"" . $vbphrase['save_display_order'] . "\" accesskey=\"s\" />" . construct_button_code($vbphrase['add_new_category'], "socialgroups.php?" . $vbulletin->session->vars['sessionurl'] . "do=editcategory"));
}
// Print Footer
print_cp_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
|| # SVN: $Revision: 62098 $
|| ####################################################################
\*======================================================================*/
            }
            // active
            $cells[] = iif(!$ta_cache["{$subscription['subscriptionid']}"], 0, "<a href=\"subscriptions.php?do=find&amp;subscriptionid={$subscription['subscriptionid']}&amp;status=1\"><span style=\"color: green;\">" . $ta_cache["{$subscription['subscriptionid']}"] . "</span></a>");
            // completed
            $completed = intval($t_cache["{$subscription['subscriptionid']}"] - $ta_cache["{$subscription['subscriptionid']}"]);
            $cells[] = iif(!$completed, 0, "<a href=\"subscriptions.php?do=find&amp;subscriptionid={$subscription['subscriptionid']}&amp;status=0\"><span style=\"color: red;\">" . $completed . "</span></a>");
            // total
            $cells[] = iif(!$t_cache["{$subscription['subscriptionid']}"], 0, "<a href=\"subscriptions.php?do=find&amp;subscriptionid={$subscription['subscriptionid']}&amp;status=-1\">" . $t_cache["{$subscription['subscriptionid']}"] . "</a>");
            // display order
            $cells[] = "<input type=\"text\" class=\"bginput\" name=\"order[{$subscription['subscriptionid']}]\" value=\"{$subscription['displayorder']}\" tabindex=\"1\" size=\"3\" title=\"" . $vbphrase['edit_display_order'] . "\" />";
            // controls
            $cells[] = "\n\t<select name=\"s{$subscription['subscriptionid']}\" onchange=\"js_forum_jump({$subscription['subscriptionid']});\" class=\"bginput\">\n" . construct_select_options($options) . "\t</select>\n\t<input type=\"button\" class=\"button\" value=\"" . $vbphrase['go'] . "\" onclick=\"js_forum_jump({$subscription['subscriptionid']});\" />\n\t";
            print_cells_row($cells, 0, '', 1);
        }
    }
    print_table_footer(6, "<input type=\"submit\" class=\"button\" tabindex=\"1\" value=\"" . $vbphrase['save_display_order'] . "\" accesskey=\"s\" />" . construct_button_code($vbphrase['add_new_subscription'], "subscriptions.php?" . $vbulletin->session->vars['sessionurl'] . "do=add"));
}
// ###################### Start do order #######################
if ($_POST['do'] == 'doorder') {
    $vbulletin->input->clean_array_gpc('p', array('order' => TYPE_ARRAY));
    if (is_array($vbulletin->GPC['order'])) {
        $subobj->cache_user_subscriptions();
        if (is_array($subobj->subscriptioncache)) {
            $casesql = '';
            $subscriptionids = '';
            foreach ($subobj->subscriptioncache as $sub) {
                if (!isset($vbulletin->GPC['order']["{$sub['subscriptionid']}"])) {
                    continue;
                }
                $displayorder = intval($vbulletin->GPC['order']["{$sub['subscriptionid']}"]);
                if ($sub['displayorder'] != $displayorder) {
Exemple #15
0
             print_description_row('<a href="#help' . $topic['adminhelpid'] . '">' . $helpphrase[fetch_help_phrase_short_name($topic, '_title')] . '</a>', 0, 1);
         }
     }
     print_table_footer();
 }
 if (sizeof($specific)) {
     reset($specific);
     print_form_header('', '');
     if ($resultcount != 1) {
         print_table_header($vbphrase['action_specific_topics'], 1);
     }
     foreach ($specific as $topic) {
         print_description_row("<a name=\"help{$topic['adminhelpid']}\">" . $helpphrase[fetch_help_phrase_short_name($topic, '_title')] . "</a>", 0, 1, 'thead');
         print_description_row($helpphrase[fetch_help_phrase_short_name($topic, '_text')], 0, 1, 'alt1');
         if ($vb5_config['Misc']['debug']) {
             print_description_row("<div style=\"float:" . vB_Template_Runtime::fetchStyleVar('right') . "\">" . construct_button_code($vbphrase['edit'], "help.php?" . vB::getCurrentSession()->get('sessionurl') . "do=edit&amp;adminhelpid={$topic['adminhelpid']}") . "</div><div>action = {$topic['action']} | optionname = {$topic['optionname']} | displayorder = {$topic['displayorder']}</div>", 0, 1, 'alt2 smallfont');
         }
     }
     print_table_footer();
 }
 if (sizeof($general)) {
     reset($general);
     print_form_header('', '');
     if ($resultcount != 1) {
         print_table_header($vbphrase['general_topics'], 1);
     }
     foreach ($general as $topic) {
         print_description_row("<a name=\"help{$topic['adminhelpid']}\">" . $helpphrase[fetch_help_phrase_short_name($topic, '_title')] . "</a>", 0, 1, 'thead');
         print_description_row($helpphrase[fetch_help_phrase_short_name($topic, '_text')]);
     }
     print_table_footer();
Exemple #16
0
    while ($calendar = $db->fetch_array($calendars)) {
        $cell = array();
        $cell[] = "&nbsp;<b><a href=\"admincalendar.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&c={$calendar['calendarid']}\">{$calendar['title']}</a></b>";
        $cell[] = "\n\t<select name=\"c{$calendar['calendarid']}\" onchange=\"js_calendar_jump({$calendar['calendarid']});\" class=\"bginput\">\n" . construct_select_options($calendaroptions) . "\t</select>\n\t<input type=\"button\" class=\"button\" value=\"" . $vbphrase['go'] . "\" onclick=\"js_calendar_jump({$calendar['calendarid']});\" />\n\t";
        $cell[] = "<input type=\"text\" class=\"bginput\" name=\"order[{$calendar['calendarid']}]\" value=\"{$calendar['displayorder']}\" tabindex=\"1\" size=\"3\" title=\"" . $vbphrase['order_by'] . 'ssss' . "\" />";
        $mods = array('no_value' => $vbphrase['moderators'] . ' (' . sizeof($cmodcache["{$calendar['calendarid']}"]) . ')');
        if (is_array($cmodcache["{$calendar['calendarid']}"])) {
            foreach ($cmodcache["{$calendar['calendarid']}"] as $moderator) {
                $mods["{$moderator['calendarmoderatorid']}"] = "&nbsp; &nbsp; {$moderator['username']}";
            }
        }
        $mods['Add'] = $vbphrase['add'];
        $cell[] = "\n\t<select name=\"m{$calendar['calendarid']}\" onchange=\"js_moderator_jump({$calendar['calendarid']});\" class=\"bginput\">\n" . construct_select_options($mods) . "\t</select>\n\t<input type=\"button\" class=\"button\" value=\"" . $vbphrase['go'] . "\" onclick=\"js_moderator_jump({$calendar['calendarid']});\" />\n\t";
        print_cells_row($cell);
    }
    print_table_footer(4, '<input type="submit" class="button" value="' . $vbphrase['save_display_order'] . '" accesskey="s" tabindex="1" />' . construct_button_code($vbphrase['add_new_calendar'], "admincalendar.php?" . $vbulletin->session->vars['sessionurl'] . "do=add"));
}
// ###################### Start do order #######################
if ($_POST['do'] == 'doorder') {
    $vbulletin->input->clean_array_gpc('p', array('order' => TYPE_ARRAY_UINT));
    if (!empty($vbulletin->GPC['order'])) {
        $calendars = $db->query_read("SELECT calendarid,displayorder FROM " . TABLE_PREFIX . "calendar");
        while ($calendar = $db->fetch_array($calendars)) {
            if ($calendar['displayorder'] != $vbulletin->GPC['order']["{$calendar['calendarid']}"]) {
                $db->query_write("UPDATE " . TABLE_PREFIX . "calendar SET displayorder=" . $vbulletin->GPC['order']["{$calendar['calendarid']}"] . " WHERE calendarid={$calendar['calendarid']}");
            }
        }
    }
    define('CP_REDIRECT', 'admincalendar.php?do=modify');
    print_stop_message('saved_display_order_successfully');
}
Exemple #17
0
    print_textarea_row($vbphrase['cms_category_description'], 'channel[description]', $channel['description']);
    print_select_row($vbphrase['cms_published'], 'channel[publish]', array(1 => $vbphrase['cms_published'], 0 => $vbphrase['unpublished']), $channel['showpublished']);
    if ($channelid != $articleChannelId) {
        print_select_row($vbphrase['cms_parent_category'], 'channel[parentid]', $categoriesList, $channel['parentid']);
    } else {
        print_select_row($vbphrase['cms_parent_category'], 'channel[parentid]', array($vbphrase['none']));
    }
    print_input_row($vbphrase['displayorder'], 'channel[displayorder]', intval($channel['displayorder']));
    construct_hidden_code('channelid', $channelid);
    construct_hidden_code('previous[parentid]', $channel['parentid']);
    construct_hidden_code('previous[title]', $channel['title']);
    construct_hidden_code('previous[description]', $channel['description']);
    construct_hidden_code('previous[showpublished]', $channel['showpublished']);
    construct_hidden_code('previous[displayorder]', $channel['displayorder']);
    $actioncell1 = construct_button_code($vbphrase['save'], "submit", false, '', false);
    $actioncellLast = construct_button_code($vbphrase['reset'], "reset", false, '', false);
    // print footer buttons
    print_table_footer(2, $actioncell1 . "\t" . $actioncellLast, '', true);
}
// ###################### Start save category #######################
if ($_REQUEST['do'] == 'savecategory') {
    $vbulletin->input->clean_array_gpc('r', array('channel' => vB_Cleaner::TYPE_NOCLEAN, 'channelid' => vB_Cleaner::TYPE_INT, 'previous' => vB_Cleaner::TYPE_NOCLEAN));
    $channelid = $vbulletin->GPC['channelid'];
    $data['title'] = htmlentities($vbulletin->GPC['channel']['title']);
    // convert html entities in the title to preserve them.
    $data['description'] = $vbulletin->GPC['channel']['description'];
    // should there be any html entities?
    $data['parentid'] = intval($vbulletin->GPC['channel']['parentid']);
    $data['showpublished'] = intval($vbulletin->GPC['channel']['publish']);
    $data['displayorder'] = intval($vbulletin->GPC['channel']['displayorder']);
    $previousData['title'] = $vbulletin->GPC['previous']['title'];
/**
* Processes a raw template for conditionals, phrases etc into PHP code for eval()
*
* @param	string	Template
*
* @return	string
*/
function compile_template($template, &$errors = array())
{
	$orig_template = $template;


	$template = preg_replace('#[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]#', '', $template);
	$new_syntax = (strpos($template, '<vb:') !== false OR strpos($template, '{vb:') !== false);
	$old_syntax = (strpos($template, '<if') !== false OR strpos($template, '<phrase') !== false);
	$maybe_old_syntax = preg_match('/(^|[^{])\$[a-z0-9_]+\[?/si', $template);

	if (!$new_syntax AND ($old_syntax OR $maybe_old_syntax))
	{
		$template = addslashes($template);
		$template = process_template_conditionals($template);
		$template = process_template_phrases('phrase', $template, 'parse_phrase_tag');
		$template = process_seo_urls($template);

		if (!function_exists('replace_template_variables') OR !function_exists('validate_string_for_interpolation'))
		{
			require_once(DIR . '/includes/functions_misc.php');
		}

		//only check the old style syntax, the new style doesn't use string interpolation and isn't affected
		//by this exploit.  The new syntax doesn't 100% pass this check.
		if(!validate_string_for_interpolation($template))
		{
			global $vbphrase;
			echo "<p>&nbsp;</p><p>&nbsp;</p>";
			print_form_header('', '', 0, 1, '', '65%');
			print_table_header($vbphrase['vbulletin_message']);
			print_description_row($vbphrase['template_text_not_safe']);
			print_table_footer(2, construct_button_code($vbphrase['go_back'], 'javascript:history.back(1)'));
			print_cp_footer();
			exit;
		}


		$template = replace_template_variables($template, false);

		$template = str_replace('\\\\$', '\\$', $template);

		if (function_exists('token_get_all'))
		{
			$tokens = @token_get_all('<?php $var = "' . $template . '"; ?>');

			foreach ($tokens AS $token)
			{
				if (is_array($token))
				{
					switch ($token[0])
					{
						case T_INCLUDE:
						case T_INCLUDE_ONCE:
						case T_REQUIRE:
						case T_REQUIRE_ONCE:
						{
							global $vbphrase;
							echo "<p>&nbsp;</p><p>&nbsp;</p>";
							print_form_header('', '', 0, 1, '', '65%');
							print_table_header($vbphrase['vbulletin_message']);
							print_description_row($vbphrase['file_inclusion_not_permitted']);
							print_table_footer(2, construct_button_code($vbphrase['go_back'], 'javascript:history.back(1)'));
							print_cp_footer();
							exit;
						}
					}
				}
			}
		}
	}
	else
	{
		require_once(DIR . '/includes/class_template_parser.php');
		$parser = new vB_TemplateParser($orig_template);

		try
		{
			$parser->validate($errors);
		}
		catch (vB_Exception_TemplateFatalError $e)
		{
			global $vbphrase;
			echo "<p>&nbsp;</p><p>&nbsp;</p>";
			print_form_header('', '', 0, 1, '', '65%');
			print_table_header($vbphrase['vbulletin_message']);
			print_description_row($vbphrase[$e->getMessage()]);
			print_table_footer(2, construct_button_code($vbphrase['go_back'], 'javascript:history.back(1)'));
			print_cp_footer();
			exit;
		}

		$template = $parser->compile();

		// TODO: Reimplement these - if done, $session[], $bbuserinfo[], $vboptions will parse in the template without using {vb:raw, which isn't what we
		// necessarily want to happen
		/*
		if (!function_exists('replace_template_variables'))
		{
			require_once(DIR . '/includes/functions_misc.php');
		}
		$template = replace_template_variables($template, false);
		*/
	}

	if (function_exists('verify_demo_template'))
	{
		verify_demo_template($template);
	}

	($hook = vBulletinHook::fetch_hook('template_compile')) ? eval($hook) : false;

	return $template;
}
Exemple #19
0
        print_table_footer(4, "<input type=\"submit\" class=\"button\" tabindex=\"1\" value=\"" . $vbphrase['save_display_order'] . "\" accesskey=\"s\" />" . construct_button_code($vbphrase['add_new_forum_gforum'], "forum.php?" . vB::getCurrentSession()->get('sessionurl') . "do=add"));
        if ($vbulletin->options['cp_collapse_forums']) {
            echo '<p class="smallfont" align="center">' . construct_link_code($vbphrase['expand_all'], "forum.php?" . vB::getCurrentSession()->get('sessionurl') . "do=modify&amp;expandid=-2") . '</p>';
        }
    } else {
        print_form_header('forum', 'doorder');
        print_table_header($vbphrase['channel_manager_gforum'], 2);
        print_cells_row(array($vbphrase['channel'], $vbphrase['controls']), 1, 'tcat');
        $cell = array();
        $select = '<select name="nodeid" id="sel_foruid" tabindex="1" class="bginput">';
        $select .= construct_channel_chooser($vbulletin->GPC['nodeid'], true);
        $select .= "</select>\n";
        $cell[] = $select;
        $cell[] = "\n\t<select name=\"controls\" class=\"bginput\">\n" . construct_select_options($channeloptions) . "\t</select><input type=\"button\" class=\"button\" value=\"" . $vbphrase['go'] . "\" onclick=\"js_channel_jump(js_returnid());\" />\n\t";
        print_cells_row($cell);
        print_table_footer(2, construct_button_code($vbphrase['add_new_forum_gforum'], "forum.php?" . vB::getCurrentSession()->get('sessionurl') . "do=add"));
    }
}
// ###################### Start update #######################
if ($_REQUEST['do'] == 'view') {
    $vbulletin->input->clean_array_gpc('r', array('nodeid' => vB_Cleaner::TYPE_UINT));
    $channel = vB_Api::instanceInternal('node')->getNode($vbulletin->GPC['nodeid']);
    if (empty($channel)) {
        print_stop_message2('invalid_channel_specified');
    }
    $path = vB_Api::instanceInternal('route')->getUrl($channel['routeid'], array(), array());
    $baseurl = vB::getDatastore()->getOption('frontendurl');
    print_cp_redirect($baseurl . $path);
}
print_cp_footer();
/*=========================================================================*\
/**
* Halts execution and shows the specified message
*
* @param	string	Message to display
* @param	mixed	If specified, a redirect will be performed to the URL in this parameter
* @param	integer	If redirect is specified, this is the time in seconds to delay before redirect
* @param	string	If specified, will provide a specific URL for "Go Back". If empty, no button will be displayed!
* @param bool		If true along with redirect, 'CONTINUE' button will be used instead of automatic redirect
*/
function print_cp_message($text = '', $redirect = NULL, $delay = 1, $backurl = NULL, $continue = false)
{
    global $vbulletin, $vbphrase;
    if ($redirect and $vbulletin->session->vars['sessionurl']) {
        if (strpos($redirect, '?') === false) {
            $redirect .= '?';
        }
        $redirect .= '&' . $vbulletin->session->vars['sessionurl'];
    }
    if (!defined('DONE_CPHEADER')) {
        print_cp_header($vbphrase['vbulletin_message']);
    }
    echo '<p>&nbsp;</p><p>&nbsp;</p>';
    print_form_header('', '', 0, 1, 'messageform', '65%');
    print_table_header($vbphrase['vbulletin_message']);
    print_description_row("<blockquote><br />{$text}<br /><br /></blockquote>");
    if ($redirect and $redirect !== NULL) {
        // redirect to the new page
        if ($continue) {
            $continueurl = str_replace('&amp;', '&', $redirect);
            print_table_footer(2, construct_button_code($vbphrase['continue'], create_full_url($continueurl)));
        } else {
            print_table_footer();
            $redirect_click = create_full_url($redirect);
            $redirect_click = str_replace('"', '', $redirect_click);
            echo '<p align="center" class="smallfont">' . construct_phrase($vbphrase['if_you_are_not_automatically_redirected_click_here_x'], $redirect_click) . "</p>\n";
            print_cp_redirect($redirect, $delay);
        }
    } else {
        // end the table and halt
        if ($backurl === NULL) {
            $backurl = 'javascript:history.back(1)';
        }
        if (strpos($backurl, 'history.back(') !== false) {
            //if we are attempting to run a history.back(1), check we have a history to go back to, otherwise attempt to close the window.
            $back_button = '&nbsp;
				<input type="button" id="backbutton" class="button" value="' . $vbphrase['go_back'] . '" title="" tabindex="1" onclick="if (history.length) { history.back(1); } else { self.close(); }"/>
				&nbsp;
				<script type="text/javascript">
				<!--
				if (history.length < 1 || ((is_saf || is_moz) && history.length <= 1)) // safari + gecko start at 1
				{
					document.getElementById("backbutton").parentNode.removeChild(document.getElementById("backbutton"));
				}
				//-->
				</script>';
        } else {
            if ($backurl !== '') {
                // regular window.location=url call
                $backurl = create_full_url($backurl);
                $backurl = str_replace(array('"', "'"), '', $backurl);
                $back_button = '<input type="button" class="button" value="' . $vbphrase['go_back'] . '" title="" tabindex="1" onclick="window.location=\'' . $backurl . '\';"/>';
            } else {
                $back_button = '';
            }
        }
        print_table_footer(2, $back_button);
    }
    // and now terminate the script
    print_cp_footer();
}
Exemple #21
0
		}
	}
	</script>
	<?php 
    $options = array('modifycat' => $vbphrase['edit'], 'killcat' => $vbphrase['delete']);
    fetch_ordered_categories(0);
    print_form_header('blog_admin', 'doordercat');
    print_table_header($vbphrase['blog_categories'], 3);
    if (!empty($vbulletin->vbblog['categorycache']["0"])) {
        print_cells_row(array($depthmark . $vbphrase['title'], $vbphrase['display_order'], $vbphrase['controls']), 1);
        foreach ($vbulletin->vbblog['categorycache']["0"] as $categoryid => $category) {
            $depthmark = str_pad('', 4 * $category['depth'], '- - ', STR_PAD_LEFT);
            print_cells_row(array($depthmark . $vbphrase['category' . $category['blogcategoryid'] . '_title'], "<input type=\"text\" class=\"bginput\" tabindex=\"1\" name=\"displayorder[{$category['blogcategoryid']}]\" value=\"{$category['displayorder']}\" size=\"2\" />", "<span style=\"white-space:nowrap\"><select name=\"c{$category['blogcategoryid']}\" onchange=\"js_jump({$category['blogcategoryid']}, this);\" class=\"bginput\">" . construct_select_options($options) . "</select><input type=\"button\" value=\"" . $vbphrase['go'] . "\" onclick=\"js_jump({$category['blogcategoryid']}, this.form.c{$category['blogcategoryid']});\" class=\"button\" /></span>"));
        }
    }
    print_table_footer(3, (!empty($vbulletin->vbblog['categorycache']["0"]) ? '<input type="submit" class="button" value="' . $vbphrase['save_display_order'] . '" accesskey="s" tabindex="1" />' : '') . construct_button_code($vbphrase['add_new_blog_category'], "blog_admin.php?" . $vbulletin->session->vars['sessionurl'] . "do=modifycat"));
}
// ###################### Start do order #######################
if ($_POST['do'] == 'doordercat') {
    $vbulletin->input->clean_array_gpc('p', array('displayorder' => TYPE_ARRAY_UINT));
    if (!empty($vbulletin->GPC['displayorder'])) {
        $categories = $db->query_read_slave("SELECT blogcategoryid, displayorder FROM " . TABLE_PREFIX . "blog_category WHERE userid = 0");
        while ($category = $db->fetch_array($categories)) {
            if ($category['displayorder'] != $vbulletin->GPC['displayorder']["{$category['blogcategoryid']}"]) {
                $db->query_write("\r\n\t\t\t\t\tUPDATE " . TABLE_PREFIX . "blog_category\r\n\t\t\t\t\tSET displayorder = " . $vbulletin->GPC['displayorder']["{$category['blogcategoryid']}"] . "\r\n\t\t\t\t\tWHERE blogcategoryid = {$category['blogcategoryid']}\r\n\t\t\t\t\t\tAND userid = 0\r\n\t\t\t\t");
            }
        }
    }
    // build category cache here
    build_category_permissions();
    define('CP_REDIRECT', 'blog_admin.php?do=listcat');
Exemple #22
0
     foreach ($queryoptions as $query_group => $queries) {
         if (!is_array($queries)) {
             continue;
         }
         foreach ($queries as $query_id => $query_title) {
             if ($query_id == $vbulletin->GPC['autoquery']) {
                 $auto_query_text = " ({$query_title})";
                 break 2;
             }
         }
     }
 }
 print_form_header('', '');
 print_table_header($vbphrase['query'] . $auto_query_text);
 print_description_row('<code>' . nl2br(htmlspecialchars_uni($query)) . '</code>', 0, 2, '');
 print_description_row(construct_button_code($vbphrase['restart'], 'queries.php?' . $vbulletin->session->vars['sessionurl']), 0, 2, 'tfoot', 'center');
 print_table_footer();
 $query_stripped = preg_replace('@/\\*.*?\\*/@s', '', $query);
 $query_stripped = preg_replace('@(#|--).*?$@m', '', $query_stripped);
 preg_match("#^([A-Z]+)\\s#si", trim($query_stripped), $regs);
 $querytype = strtoupper($regs[1]);
 switch ($querytype) {
     // EXPLAIN, SELECT, DESCRIBE & SHOW **********************************************************
     case 'EXPLAIN':
     case 'SELECT':
     case 'DESCRIBE':
     case 'SHOW':
         $query_mod = preg_replace('#\\sLIMIT\\s+(\\d+(\\s*,\\s*\\d+)?)#i', '', $query);
         $counter = $db->query_write($query_mod);
         print_form_header('queries', 'doquery', 0, 1, 'queryform');
         construct_hidden_code('do', 'doquery');
 * Display definitions for exporting
 */
if ($action == "export") {
    $results = $db->query_read_slave("SELECT id, title, description from " . TABLE_PREFIX . "automediaembed ORDER BY displayorder, title ASC");
    print_form_header('automediaembed_admin', 'doexport');
    if ($db->num_rows($results)) {
        print_table_header($vbphrase['automediaembed_media_definitions'], 2);
        print_cells_row(array($vbphrase['title'], "<label for=\"export_toggle\">{$vbphrase['export']}</label> <input type=\"checkbox\" id=\"export_toggle\" onclick=\"tick_all(this.form, 'items', this.checked)\" />"), true);
        while ($result = $db->fetch_array($results)) {
            print_checkbox_row("{$result['title']}<dfn>{$result['description']}</dfn>", "items[{$result['id']}]");
        }
        print_submit_row();
    } else {
        print_table_header($vbphrase['automediaembed_media_definitions'], 2);
        print_description_row($vbphrase['automediaembed_no_definitions']);
        print_table_footer(2, construct_button_code("Add new", "automediaembed_admin.php?do=edit"));
    }
}
/**
 * Do the export
 */
if ($action == "doexport") {
    $items = $vbulletin->input->clean_gpc('p', 'items', TYPE_ARRAY_UINT);
    if (sizeof($items)) {
        foreach ($items as $key => $value) {
            if ($value) {
                $ids .= ($ids ? "," : "") . $key;
            }
        }
        $results = $db->query_read_slave("SELECT * FROM " . TABLE_PREFIX . "automediaembed WHERE id IN ({$ids})");
        while ($result = $db->fetch_array($results)) {