Ejemplo n.º 1
0
 function admin_login_error($error, array $args = array())
 {
     global $vbulletin;
     if ($vbulletin->GPC['logintype'] === 'cplogin' or $vbulletin->GPC['logintype'] === 'modcplogin') {
         require_once DIR . '/includes/adminfunctions.php';
         $url = unhtmlspecialchars($vbulletin->url);
         $urlarr = vB_String::parseUrl($url);
         $urlquery = $urlarr['query'];
         $oldargs = array();
         if ($urlquery) {
             parse_str($urlquery, $oldargs);
         }
         $args = array_merge($oldargs, $args);
         unset($args['loginerror']);
         $argstr = http_build_query($args);
         $url = "/{$urlarr['path']}?loginerror=" . $error;
         if ($argstr) {
             $url .= '&' . $argstr;
         }
         print_cp_redirect($url);
     }
 }
Ejemplo n.º 2
0
	$runner = new vB_SiteMapRunner_Admin($vbulletin);

	$status = $runner->check_environment();
	if ($status['error'])
	{
		print_stop_message($status['error']);
	}

	echo '<div>' . construct_phrase($vbphrase['processing_x'], '...') . '</div>';
	vbflush();

	$runner->generate();

	if ($runner->is_finished)
	{
		print_cp_redirect('sitemap.php?do=buildsitemap&success=1');
	}
	else
	{
		echo '<div>' . construct_phrase($vbphrase['processing_x'], $runner->written_filename) . '</div>';

		print_form_header('sitemap', 'dobuildsitemap', false, true, 'cpform_dobuildsitemap');
		print_submit_row($vbphrase['next_page'], 0);
		print_form_auto_submit('cpform_dobuildsitemap');
	}
}

// ########################################################################

print_cp_footer();
Ejemplo n.º 3
0
        $vbulletin->db->query_write("TRUNCATE TABLE " . TABLE_PREFIX . "postparsed");
    }
    ?>
	<script type="text/javascript">
	<!--

	// refresh the opening window (used for the revert updated default templates action)
	if (window.opener && String(window.opener.location).indexOf("template.php?do=findupdates") != -1)
	{
		window.opener.window.location = window.opener.window.location;
	}

	//-->
	</script>
	<?php 
    print_cp_redirect("template.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify&amp;expandset={$template['styleid']}&amp;group=" . $vbulletin->GPC['group'], 1);
}
// #############################################################################
// 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('', '');
Ejemplo n.º 4
0
     require_once DIR . '/includes/class_template_merge.php';
     $merge_data = new vB_Template_Merge_Data($vbulletin);
     $merge_data->start_offset = $vbulletin->GPC['startat'];
     $merge_data->add_condition("tnewmaster.product IN ('', 'vbulletin')");
     $merge = new vB_Template_Merge($vbulletin);
     $merge->time_limit = 5;
     $completed = $merge->merge_templates($merge_data);
     if ($completed) {
         // completed
         $vbphrase['style'] = 'Style';
         $vbphrase['please_wait'] = 'Please Wait';
         build_all_styles();
         define('SCRIPT_REDIRECT', true);
     } else {
         // more templates to merge
         print_cp_redirect('tools.php?do=templatemerge&startat=' . ($merge_data->start_offset + $merge->fetch_processed_count()));
     }
 } else {
     if ($_REQUEST['do'] == 'cache') {
         switch ($vbulletin->GPC['type']) {
             case 'forum':
                 build_forum_permissions();
                 define('SCRIPT_REDIRECT', true);
                 break;
             case 'options':
                 build_options();
                 define('SCRIPT_REDIRECT', true);
                 break;
         }
     } else {
         if ($_REQUEST['do'] == 'cookie') {
Ejemplo n.º 5
0
             $path = $vbulletin->options['sigpicpath'] . "/sigpic{$image['userid']}_{$image['sigpicrevision']}.gif";
             if ($filedata = @file_get_contents($path)) {
                 $userpic =& datamanager_init('Userpic_Sigpic', $vbulletin, ERRTYPE_CP, 'userpic');
                 $userpic->set_existing($image);
                 $userpic->setr('filedata', $filedata);
                 $userpic->save();
                 unset($userpic);
             }
             #@unlink($path);
         }
         $vbulletin->options['usefileavatar'] = true;
     }
     $lastuser = $image['userid'];
 }
 if ($lastuser and $db->query_first("\n\t\tSELECT user.userid\n\t\tFROM " . TABLE_PREFIX . "user AS user\n\t\tLEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON (user.userid = customavatar.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "sigpic AS sigpic ON (user.userid = sigpic.userid)\n\t\tWHERE user.userid > {$lastuser}\n\t\t\tAND (NOT ISNULL(customavatar.userid) OR NOT ISNULL(customprofilepic.userid) OR NOT ISNULL(sigpic.userid))\n\t\tLIMIT 1\n\t")) {
     print_cp_redirect("avatar.php?" . $vbulletin->session->vars['sessionurl'] . "do=domoveavatar&startat={$finishat}&pp=" . $vbulletin->GPC['perpage']);
     echo "<p><a href=\"avatar.php?" . $vbulletin->session->vars['sessionurl'] . "do=domoveavatar&amp;startat={$finishat}&amp;pp=" . $vbulletin->GPC['perpage'] . "\">" . $vbphrase['click_here_to_continue_processing'] . "</a></p>";
 } else {
     define('CP_REDIRECT', 'avatar.php?do=storage');
     if (!$vbulletin->options['usefileavatar']) {
         // Update $vboptions[]
         $db->query_write("UPDATE " . TABLE_PREFIX . "setting SET value = 1 WHERE varname = 'usefileavatar'");
         build_options();
         $db->query_write("UPDATE " . TABLE_PREFIX . "customavatar SET filedata = '', filedata_thumb = ''");
         $db->query_write("UPDATE " . TABLE_PREFIX . "customprofilepic SET filedata = ''");
         $db->query_write("UPDATE " . TABLE_PREFIX . "sigpic SET filedata = ''");
         $db->hide_errors();
         $db->query_write("OPTIMIZE TABLE " . TABLE_PREFIX . "customavatar");
         $db->query_write("OPTIMIZE TABLE " . TABLE_PREFIX . "customprofilepic");
         $db->query_write("OPTIMIZE TABLE " . TABLE_PREFIX . "sigpic");
         $db->show_errors();
Ejemplo n.º 6
0
            $db->query_write("DELETE FROM " . TABLE_PREFIX . "usernote WHERE userid IN({$userids})");
            echo $vbphrase['okay'] . '</p><p>' . $vbphrase['updating_threads_posts'] . "</p>\n";
            vbflush();
            build_adminutil_text('ids', $userids);
            require_once DIR . '/includes/functions_databuild.php';
            build_user_statistics();
            print_cp_redirect("user.php?" . $vbulletin->session->vars['sessionurl'] . "do=prune_updateposts&startat=0", 1);
            exit;
        } else {
            if ($vbulletin->GPC['dowhat'] == 'move') {
                $group = $db->query_first("\n\t\t\t\tSELECT title\n\t\t\t\tFROM " . TABLE_PREFIX . "usergroup\n\t\t\t\tWHERE usergroupid = " . $vbulletin->GPC['movegroup']);
                echo '<p>' . $vbphrase['updating_users'] . "\n";
                vbflush();
                $db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "user\n\t\t\t\tSET displaygroupid = IF(displaygroupid = usergroupid, 0, displaygroupid),\n\t\t\t\t\tusergroupid = " . $vbulletin->GPC['movegroup'] . "\n\t\t\t\tWHERE userid IN({$userids})\n\t\t\t");
                echo $vbphrase['okay'] . '</p><p><b>' . $vbphrase['moved_users_successfully'] . '</b></p>';
                print_cp_redirect("user.php?" . $vbulletin->session->vars['sessionurl'] . "do=prune", 1);
            } else {
                $vbulletin->input->clean_array_gpc('r', array('usergroupid' => TYPE_INT, 'daysprune' => TYPE_INT, 'minposts' => TYPE_INT, 'joindate' => TYPE_STR, 'order' => TYPE_STR));
                define('CP_REDIRECT', "user.php?do=pruneusers" . "&usergroupid=" . $vbulletin->GPC['usergroupid'] . "&daysprune=" . $vbulletin->GPC['daysprune'] . "&minposts=" . $vbulletin->GPC['minposts'] . "&joindate=" . $vbulletin->GPC['joindate'] . "&order=" . $vbulletin->GPC['order']);
                print_stop_message('invalid_action_specified');
            }
        }
        if (is_array($query)) {
            foreach ($query as $val) {
                echo "<pre>{$val}</pre>\n";
            }
        }
    } else {
        print_stop_message('please_complete_required_fields');
    }
}
Ejemplo n.º 7
0
 */
/**
 * Header stuff
 */
error_reporting(E_ALL & ~E_NOTICE);
define("AME", true);
$phrasegroups = array('advertising', 'notice', 'ame_admincp');
$specialtemplates = array();
require_once './global.php';
/**
 * Redirects to vB's rebuildvideo function
 * which resets all data back to default
 */
if ($_REQUEST['do'] == 'doresetall') {
    print_cp_header("AME");
    print_cp_redirect('index.php?do=buildvideo');
}
/**
 * A rewritten version of half of vB's similar function. Would be far better moving forward
 * if vB would break the functionality appart as per http://www.vbulletin.com/forum/project.php?issueid=34122
 * Once that gets done Ill revert to it.
 */
if ($_REQUEST['do'] == 'rebuildvideos') {
    $defs = array();
    $codes = $db->query_read_slave("SELECT provider, tagoption, embed FROM " . TABLE_PREFIX . "bbcode_video ORDER BY priority, provider");
    while ($code = $db->fetch_array($codes)) {
        $template .= "<vb:" . ($template ? "else" : "") . "if condition=\"\$provider == '{$code['tagoption']}'\"" . ($template ? "/" : "") . ">\r\n\t{$code['embed']}\r\n";
    }
    $template .= "</vb:if>";
    require_once DIR . '/includes/adminfunctions_template.php';
    $t = compile_template($template);
Ejemplo n.º 8
0
    print_submit_row($vbphrase['photoplog_yes'], '', 2, $vbphrase['photoplog_no']);
}
if ($_REQUEST['do'] == 'dodelete') {
    $vbulletin->input->clean_array_gpc('p', array('catid' => TYPE_UINT));
    $photoplog_catid = $vbulletin->GPC['catid'];
    $photoplog_dscatopts = $photoplog_ds_catopts;
    $photoplog_child_list = array();
    $photoplog_parent_list = array();
    photoplog_child_list($photoplog_child_list, $photoplog_parent_list, $photoplog_catid);
    $photoplog_catids_array = array_merge(array($photoplog_catid), $photoplog_child_list, $photoplog_parent_list);
    $photoplog_sql = "WHERE catid = " . intval($photoplog_catid);
    unset($photoplog_dscatopts["{$photoplog_catid}"]);
    if (!empty($photoplog_child_list)) {
        $photoplog_sql = "WHERE catid IN (" . intval($photoplog_catid) . "," . implode(",", $photoplog_child_list) . ")";
        foreach ($photoplog_child_list as $photoplog_childid) {
            unset($photoplog_dscatopts["{$photoplog_childid}"]);
        }
    }
    if ($db->query_write("UPDATE " . PHOTOPLOG_PREFIX . "photoplog_fileuploads\r\n\t\t\tSET catid = 0\r\n\t\t\t{$photoplog_sql}\r\n\t\t") && $db->query_write("UPDATE " . PHOTOPLOG_PREFIX . "photoplog_ratecomment\r\n\t\t\tSET catid = 0\r\n\t\t\t{$photoplog_sql}\r\n\t\t") && $db->query_write("DELETE FROM " . PHOTOPLOG_PREFIX . "photoplog_categories\r\n\t\t\t{$photoplog_sql}\r\n\t\t") && $db->query_write("DELETE FROM " . PHOTOPLOG_PREFIX . "photoplog_catcounts\r\n\t\t\t{$photoplog_sql}\r\n\t\t")) {
        $db->query_write("ALTER TABLE " . PHOTOPLOG_PREFIX . "photoplog_categories\r\n\t\t\tORDER BY parentid, displayorder, catid\r\n\t\t");
        // not approved: 0, approved: 1, declined: 2, cat deleted: 3
        $db->query_write("UPDATE " . PHOTOPLOG_PREFIX . "photoplog_suggestedcats\r\n\t\t\tSET approve = 3\r\n\t\t\t{$photoplog_sql}\r\n\t\t");
        //		photoplog_regenerate_counts_table_v2($photoplog_catids_array);
        photoplog_custom_field_delete_category($photoplog_catid, $photoplog_child_list);
        build_datastore('photoplog_dscat', serialize($photoplog_dscatopts));
        print_cp_redirect("photoplog_category.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify", 1);
    } else {
        print_stop_message('generic_error_x', $vbphrase['photoplog_bad_cat_delete']);
    }
}
print_cp_footer();
Ejemplo n.º 9
0
    while ($cron = $db->fetch_array($crons_result)) {
        $old = $cron['active'] ? 1 : 0;
        $new = $vbulletin->GPC['enabled']["{$cron['varname']}"] ? 1 : 0;
        if ($old != $new) {
            $updates["{$cron['varname']}"] = $new;
        }
    }
    $db->free_result($crons_result);
    if (!empty($updates)) {
        $cases = '';
        foreach ($updates as $varname => $status) {
            $cases .= "WHEN '" . $db->escape_string($varname) . "' THEN {$status} ";
        }
        $db->query_write("UPDATE " . TABLE_PREFIX . "cron SET active = CASE varname {$cases} ELSE active END");
    }
    print_cp_redirect('cronadmin.php?do=modify' . $vbulletin->session->vars['sessionurl_js']);
}
// ###################### Start run cron #######################
if ($_REQUEST['do'] == 'runcron') {
    $vbulletin->input->clean_array_gpc('r', array('cronid' => TYPE_INT, 'varname' => TYPE_STR));
    $nextitem = null;
    if ($vbulletin->GPC['cronid']) {
        $nextitem = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "cron WHERE cronid = " . $vbulletin->GPC['cronid']);
    } else {
        if ($vbulletin->GPC['varname']) {
            $nextitem = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "cron WHERE varname = '" . $db->escape_string($vbulletin->GPC['varname']) . "'");
        }
    }
    if ($nextitem) {
        ignore_user_abort(1);
        @set_time_limit(0);
Ejemplo n.º 10
0
                $dataman->save();
                unset($dataman);
            } else {
                echo $vbphrase['error'];
            }
            // Remove temporary file
            if (!$vbulletin->options['usefileavatar']) {
                @unlink($filename);
            }
            echo '<br />';
            vbflush();
            $finishat = $picture['userid'] > $finishat ? $picture['userid'] : $finishat;
        }
        $finishat++;
        if ($checkmore = $db->query_first("SELECT userid FROM " . TABLE_PREFIX . "customprofilepic WHERE userid >= {$finishat} LIMIT 1")) {
            print_cp_redirect("blog_admin.php?" . $vbulletin->session->vars['sessionurl'] . "do=rebuildprofilepic&startat={$finishat}&pp=" . $vbulletin->GPC['perpage']);
            echo "<p><a href=\"blog_admin.php?" . $vbulletin->session->vars['sessionurl'] . "do=rebuildprofilepic&amp;startat={$finishat}&amp;pp=" . $vbulletin->GPC['perpage'] . "\">" . $vbphrase['click_here_to_continue_processing'] . "</a></p>";
        } else {
            define('CP_REDIRECT', 'blog_admin.php');
            print_stop_message('updated_profile_pictures_successfully');
        }
    } else {
        define('CP_REDIRECT', 'blog_admin.php');
        print_stop_message('updated_profile_pictures_successfully');
    }
}
if ($_REQUEST['do'] == 'listfe') {
    if (empty($vbulletin->GPC['perpage'])) {
        $vbulletin->GPC['perpage'] = 20;
    }
    ?>
Ejemplo n.º 11
0
function photoplog_maintain_postbitcounts($photoplog_start, $photoplog_perpage, $photoplog_phase, $header_phrase, $redirect)
{
    global $vbulletin, $vbphrase;
    $photoplog_stop = intval($photoplog_start + $photoplog_perpage);
    print_table_start();
    print_table_header($header_phrase, 1);
    print_cells_row(array('<nobr>' . $vbphrase['photoplog_postbit_file_and_comment_counts'] . '</nobr>'), 1, '', -1);
    $photoplog_table_name = $photoplog_phase ? 'photoplog_ratecomment' : 'photoplog_fileuploads';
    $photoplog_msg = $vbphrase['photoplog_updating'] . ' ' . $photoplog_table_name . ' - ' . $vbphrase['photoplog_table'] . ' ' . TABLE_PREFIX . 'user: '******' - ' . $photoplog_stop;
    photoplog_update_postbit_counts_interval($photoplog_start, $photoplog_stop, $photoplog_phase);
    print_description_row($photoplog_msg, 0, 1);
    @flush();
    @ob_flush();
    if ($photoplog_phase == 0) {
        print_table_footer();
        if ($photoplog_morecheck = $vbulletin->db->query_first("SELECT userid\r\n\t\t\t\tFROM " . PHOTOPLOG_PREFIX . "photoplog_fileuploads\r\n\t\t\t\tWHERE userid >= " . intval($photoplog_stop) . "\r\n\t\t\t\tORDER BY userid ASC\r\n\t\t\t\tLIMIT 1")) {
            $photoplog_stop = intval($photoplog_morecheck['userid']);
            print_cp_redirect($redirect . "?" . $vbulletin->session->vars['sessionurl'] . "do=postbitcounts&phase=0&start=" . $photoplog_stop . "&perpage=" . $photoplog_perpage, 1);
        } else {
            print_cp_redirect($redirect . "?" . $vbulletin->session->vars['sessionurl'] . "do=postbitcounts&phase=1&start=0&perpage=" . $photoplog_perpage, 1);
        }
    } else {
        if ($photoplog_morecheck = $vbulletin->db->query_first("SELECT userid\r\n\t\t\t\tFROM " . PHOTOPLOG_PREFIX . "photoplog_ratecomment\r\n\t\t\t\tWHERE userid >= " . intval($photoplog_stop) . "\r\n\t\t\t\tORDER BY userid ASC\r\n\t\t\t\tLIMIT 1")) {
            print_table_footer();
            $photoplog_stop = intval($photoplog_morecheck['userid']);
            print_cp_redirect($redirect . "?" . $vbulletin->session->vars['sessionurl'] . "do=postbitcounts&phase=1&start=" . $photoplog_stop . "&perpage=" . $photoplog_perpage, 1);
        } else {
            print_description_row('<strong>' . $vbphrase['photoplog_done'] . '</strong>', 0, 1);
            print_table_footer();
        }
    }
}
Ejemplo n.º 12
0
function print_next_step()
{
    global $vbulletin, $numsteps, $installcore_phrases, $vbphrase, $hiddenfields;
    // do nothing if print_next_page() or nextStep has already been called
    if (defined('NONEXTSTEP')) {
        return;
    }
    define('NONEXTSTEP', true);
    // reset $perpage to tell the upgrade log that any multi-page steps are complete
    $vbulletin->GPC['perpage'] = 0;
    $nextstep = $vbulletin->GPC['step'] + 1;
    if ($step >= $numsteps) {
        $formaction = THIS_SCRIPT;
        $buttonvalue = ' ' . $vbphrase['proceed'] . ' ';
        $buttontitle = '';
    } else {
        $formaction = THIS_SCRIPT;
        $buttonvalue = sprintf($installcore_phrases['next_step'], $nextstep, $numsteps);
        $buttontitle = fetch_step_title($nextstep);
        // automatic advance - enable if you want to get through upgrades quickly without reading the text
        if (!defined('HIDEPROCEED') and $vbulletin->GPC['step'] >= 3 and $vbulletin->config['Misc']['upgrade_autoproceed'] and $vbulletin->debug and ($vbulletin->GPC['step'] != 'welcome' or $vbulletin->config['Misc']['upgrade_autoproceed'] == 'full')) {
            print_cp_redirect(THIS_SCRIPT . "?step={$nextstep}", 0.5);
        }
    }
    echo '</div> <!-- end #all -->';
    ?>
	<!-- </div> -->
	<form action="<?php 
    echo $formaction;
    ?>
" method="get" name="nextStep">
	<input type="hidden" name="step" value="<?php 
    echo $nextstep;
    ?>
" />
	<?php 
    foreach ($hiddenfields as $varname => $value) {
        echo "<input type=\"hidden\" name=\"" . htmlspecialchars_uni($varname) . "\" value=\"" . htmlspecialchars_uni($value) . "\" />\r\n";
    }
    ?>
	<table cellpadding="4" cellspacing="0" border="0" width="100%" class="navbody" style="padding:4px; border:outset 2px;">
	<tr align="center">
		<td><?php 
    if (!defined('HIDEPROCEED')) {
        ?>
<b><?php 
        echo $installcore_phrases['click_button_to_proceed'];
        ?>
</b><br /><?php 
    }
    ?>
vBulletin &copy;2000 - <?php 
    echo date('Y');
    ?>
 Jelsoft Enterprises Ltd.</td>
		<td><?php 
    if (!defined('HIDEPROCEED')) {
        ?>
<input type="submit" class="button" accesskey="s" value="<?php 
        echo $buttonvalue;
        ?>
" title="<?php 
        echo $buttontitle;
        ?>
" /><?php 
    }
    ?>
</td>
	</tr>
	</table>
	</form>
	<?php 
}
Ejemplo n.º 13
0
        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();
/*=========================================================================*\
|| #######################################################################
|| # Downloaded: 15:45, Tue Sep 8th 2015
|| # CVS: $RCSfile$ - $Revision: 85086 $
|| #######################################################################
\*=========================================================================*/
Ejemplo n.º 14
0
    if (!$userids) {
        $userids = '0';
    }
    $users = $db->query_read("\n\t\tSELECT userid, username\n\t\tFROM " . TABLE_PREFIX . "user\n\t\tWHERE userid IN ({$userids})\n\t\tLIMIT 0, 50\n\t");
    if ($db->num_rows($users)) {
        while ($user = $db->fetch_array($users)) {
            echo '<p>' . construct_phrase($vbphrase['deleting_user_x'], $user['username']) . "\n";
            vbflush();
            $userdm =& datamanager_init('User', $vbulletin, ERRTYPE_CP);
            $userdm->set_existing($user);
            $userdm->delete();
            unset($userdm);
            echo '<b>' . $vbphrase['done'] . "</b></p>\n";
            vbflush();
        }
        print_cp_redirect("user.php?" . $vbulletin->session->vars['sessionurl'] . "do=dodeleteusers", 0);
        exit;
    } else {
        build_adminutil_text('ids');
        ($hook = vBulletinHook::fetch_hook('useradmin_prune')) ? eval($hook) : false;
        define('CP_REDIRECT', "user.php?do=prune");
        print_stop_message('pruned_users_successfully');
    }
}
// ############################# start list users for pruning #########################
if ($_REQUEST['do'] == 'pruneusers') {
    $vbulletin->input->clean_array_gpc('r', array('usergroupid' => TYPE_INT, 'daysprune' => TYPE_INT, 'minposts' => TYPE_INT, 'joindate' => TYPE_ARRAY_UINT, 'order' => TYPE_STR));
    unset($sqlconds);
    if ($vbulletin->GPC['usergroupid'] != -1) {
        $sqlconds = "WHERE user.usergroupid = " . $vbulletin->GPC['usergroupid'] . ' ';
    }
Ejemplo n.º 15
0
            print_cp_footer();
        }
    } else {
        if ($vbulletin->GPC['dismiss']) {
            // choosing to forget about the issue
            $adminmessageid = intval($vbulletin->GPC['dismiss'][0]);
            $db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "adminmessage\n\t\t\tSET status = 'dismissed', statususerid = " . $vbulletin->userinfo['userid'] . "\n\t\t\tWHERE adminmessageid = {$adminmessageid}\n\t\t");
        } else {
            if ($vbulletin->GPC['acpnews']) {
                $items = preg_split('#\\s*,\\s*#s', $vbulletin->userinfo['dismissednews'], -1, PREG_SPLIT_NO_EMPTY);
                $items[] = intval($vbulletin->GPC['acpnews'][0]);
                $vbulletin->userinfo['dismissednews'] = implode(',', array_unique($items));
                $admindata =& datamanager_init('Admin', $vbulletin, ERRTYPE_CP);
                if ($getperms = $vbulletin->db->query_first("\n\t\t\tSELECT userid\n\t\t\tFROM " . TABLE_PREFIX . "administrator\n\t\t\tWHERE userid = " . $vbulletin->userinfo['userid'])) {
                    $admindata->set_existing($vbulletin->userinfo);
                } else {
                    $admindata->set('userid', $vbulletin->userinfo['userid']);
                }
                $admindata->set('dismissednews', $vbulletin->userinfo['dismissednews']);
                $admindata->save();
            }
        }
    }
    print_cp_redirect('index.php?do=home' . $vbulletin->session->vars['sessionurl_js']);
}
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
|| # CVS: $RCSfile$ - $Revision: 77126 $
|| ####################################################################
\*======================================================================*/
Ejemplo n.º 16
0
}
// *********************** insert *********************
if ($_POST['do'] == 'insert') {
    $vbulletin->input->clean_array_gpc('p', array('findtext' => TYPE_STR, 'replacetext' => TYPE_STR));
    $vbulletin->GPC['findtext'] = strtolower($vbulletin->GPC['findtext']);
    if ($vbulletin->GPC['findtext'] === '') {
        print_stop_message('please_complete_required_fields');
    }
    if ($existing = $db->query_first("\n\t\tSELECT templateid, styleid, title, template\n\t\tFROM " . TABLE_PREFIX . "template\n\t\tWHERE styleid = " . $vbulletin->GPC['dostyleid'] . "\n\t\t\tAND templatetype = 'replacement'\n\t\t\tAND title = '" . $db->escape_string($vbulletin->GPC['findtext']) . "'\n\t")) {
        print_stop_message('replacement_already_exists', htmlspecialchars($existing['title']), htmlspecialchars($existing['template']), "replacement.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;dostyleid={$existing['styleid']}&amp;templateid={$existing['templateid']}");
    } else {
        /*insert query*/
        $db->query_write("\n\t\t\tINSERT INTO " . TABLE_PREFIX . "template\n\t\t\t\t(styleid, templatetype, title, template)\n\t\t\tVALUES\n\t\t\t\t(" . $vbulletin->GPC['dostyleid'] . ", 'replacement', '" . $db->escape_string($vbulletin->GPC['findtext']) . "', '" . $db->escape_string($vbulletin->GPC['replacetext']) . "')\n\t\t");
        $style = $db->query_first("SELECT styleid, title FROM " . TABLE_PREFIX . "style WHERE styleid = " . $vbulletin->GPC['dostyleid']);
        print_rebuild_style($vbulletin->GPC['dostyleid'], iif($vbulletin->GPC['dostyleid'] == -1, MASTERSTYLE, $style['title']), 0, 0, 1, 0);
        print_cp_redirect("replacement.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify", 1);
    }
}
// *********************** add *********************
if ($_REQUEST['do'] == 'add') {
    print_form_header('replacement', 'insert');
    print_table_header($vbphrase['add_new_replacement_variable']);
    print_style_chooser_row('dostyleid', $vbulletin->GPC['dostyleid'], MASTERSTYLE, $vbphrase['style'], iif($vbulletin->debug == 1, 1, 0));
    print_input_row("{$vbphrase['search_for_text']} <dfn>({$vbphrase['case_insensitive']})</dfn>", 'findtext', '');
    print_textarea_row($vbphrase['replace_with_text'], 'replacetext', '', 5, 50);
    print_submit_row($vbphrase['save']);
}
// *********************** modify *********************
if ($_REQUEST['do'] == 'modify') {
    // ###################### Start displayreplacements #######################
    function print_replacements($parentid = -1, $indent = "\t")
Ejemplo n.º 17
0
	");
	while ($post = $db->fetch_array($posts))
	{
		$postman =& datamanager_init('Post', $vbulletin, ERRTYPE_SILENT, 'threadpost');
		$postman->set_existing($post);
		$postman->delete();
		unset($postman);

		echo construct_phrase($vbphrase['processing_x'], $post['postid'])."<br />\n";
		vbflush();
		$gotsome = true;
	}

	if($gotsome)
	{
		print_cp_redirect("misc.php?" . $vbulletin->session->vars['sessionurl'] . "do=removeorphanposts&pp=" . $vbulletin->GPC['perpage'] . "&startat=$finishat");
		echo "<p><a href=\"misc.php?" . $vbulletin->session->vars['sessionurl'] . "do=removeorphanposts&amp;pp=" . $vbulletin->GPC['perpage'] . "&amp;startat=$finishat\">" . $vbphrase['click_here_to_continue_processing'] . "</a></p>";
	}
	else
	{
		define('CP_REDIRECT', 'misc.php');
		print_stop_message('deleted_orphan_posts_successfully');
	}
}

// ###################### Anonymous Survey Code #######################
if ($_REQUEST['do'] == 'survey')
{
	// first we'd like extra phrase groups from the cphome
	fetch_phrase_group('cphome');
Ejemplo n.º 18
0
    require_once DIR . '/includes/functions_cron.php';
    build_cron_next_run();
    build_product_datastore();
    // build bitfields to remove/add this products bitfields
    require_once DIR . '/includes/class_bitfield_builder.php';
    vB_Bitfield_Builder::save($db);
    if (!defined('DISABLE_PRODUCT_REDIRECT')) {
        define('CP_REDIRECT', 'index.php?loc=' . urlencode('plugin.php?do=product'));
    }
    print_stop_message('product_x_uninstalled', $vbulletin->GPC['productid']);
}
// #############################################################################
if ($_REQUEST['do'] == 'productdelete') {
    $vbulletin->input->clean_array_gpc('r', array('productid' => TYPE_STR));
    if (strtolower($vbulletin->GPC['productid']) == 'vbulletin') {
        print_cp_redirect('plugin.php?do=product');
    }
    $dependency_result = $db->query_read("\n\t\tSELECT productid, parentproductid\n\t\tFROM " . TABLE_PREFIX . "productdependency\n\t\tWHERE dependencytype = 'product' AND parentproductid <> ''\n\t");
    // find child products -- these may break if we uninstall this
    $dependency_list = array();
    while ($dependency = $db->fetch_array($dependency_result)) {
        $dependency_list["{$dependency['parentproductid']}"][] = $dependency['productid'];
    }
    $children = fetch_product_dependencies($vbulletin->GPC['productid'], $dependency_list);
    $product_list = fetch_product_list(true);
    $children_text = array();
    foreach ($children as $childproductid) {
        $childproduct = $product_list["{$childproductid}"];
        if ($childproduct) {
            $children_text[] = $childproduct['title'];
        }
Ejemplo n.º 19
0
/**
* Generates the style for the style generator
*
* @param	array 	contains all color data
* @param	int 	Number for the parent id
* @param	string	Title for the genrated style
* @param	boolean	Override version check
* @param	int		Display order for the style
* @param	boolean	True / False whether it will be user selectable
* @param	int		Version
*
*/

function generate_style($data, $parentid, $title, $anyversion=false, $displayorder, $userselect, $version)
{
	global $vbulletin;
	// Need to check variable for values - Check to make sure we have a name etc

	$arr = explode('{', stripslashes($data)); // checked below
	$hex = array(0 => ''); // start at one
	$match = $match2 = array(); // initialize
	$type = 'lps'; // checked below

	foreach ($arr AS $key => $value)
	{
		if (preg_match("/\"hex\":\"([0-9A-F]{6})\"/", $value, $match) == 1)
		{
			$hex[] = '#' . $match[1];
		}
		if (preg_match("/\"type\":\"([a-z0-9]{3})\"/", $value, $match2) == 1)
		{
			$type = $match2[1];
		}
	}

	switch (count($hex))
	{
		case '11':
			break;

		default:
			print_stop_message('incorrect_color_mapping');
	}

	if ($type == 'lps') // Color : Primary and Secondary (except S3 and S4)
	{
		$sample_file = "style_generator_sample_light.xml";
		$from = array('#FF0000', '#BF3030', '#A60000', '#FF4040', '#FF7373', '#009999', '#1D7373', '#5CCCCC');
		$to = array($hex[1], $hex[2], $hex[3], $hex[4], $hex[5], $hex[6], $hex[7], $hex[10]);
	}
	else if ($type == 'lpt') // White : Similar to the current style
	{
		$sample_file = "style_generator_sample_white.xml";
		$from = array('#A60000', '#BF3030', '#FF4040', '#FF7373');
		$to = array($hex[3], $hex[2], $hex[1], $hex[1]);
	}
	else if ($type == 'gry') // Grey :: Primary 3 and Primary 4 only
	{
		$sample_file = "style_generator_sample_gray.xml";
		$from = array('#A60000', '#FF4040');
		$to = array($hex[1], $hex[4]);
	}
	else if ($type == 'drk') // Dark : Primary 3 and Primary 4 only
	{
		$sample_file = "style_generator_sample_dark.xml";
		$from = array('#A60000', '#FF4040');
		$to = array($hex[1], $hex[4]);
	}
	else // Dark : Default to Dark
	{
		$sample_file = "style_generator_sample_dark.xml";
		$from = array('#A60000', '#FF4040');
		$to = array($hex[1], $hex[4]);
	}

	$style = file(DIR . '/includes/xml/' . $sample_file);

	$decode = $match = array();
	foreach($style AS $name => $value) // read in and decode the sample_*.xml file
	{
		if (preg_match("/name=\"(.*)\" value=\"(.*)\"/", $value, $match) == 1)
		{
			$decode[$match[1]] = base64_decode($match[2]);
		}
	}

	$match = array();
	$output = '';
	foreach ($decode AS $name => $value) // replace the RRGGBB in the sample_*.xml file with chosen colors and re-encode
	{
		if (preg_match("/\"(#[a-zA-Z0-9]{6})\"/", $value, $match) == 1)
		{
			$upper = '"' . strtoupper($match[1]) . '"';
			$value = base64_encode(str_replace($from, $to, preg_replace("/\"(#[a-zA-Z0-9]{6})\"/", $upper, $value)));
			$output .= '		<stylevar name="' . $name . '" value="' . $value . '" />
	';
		}
	}
	if($title===''){$title = 'Style ' . time();}
	$output = '<?xml version="1.0" encoding="ISO-8859-1"?>

	<style name="' . $title . '" vbversion="' . $version . '" product="vbulletin" type="custom">
		<stylevardfns>
		</stylevardfns>
		<stylevars>
	' . $output . '	</stylevars>
	</style>
	';

	xml_import_style($output,
		-1, $parentid, $title,
		$anyversion, $displayorder, $userselect
	);

	print_cp_redirect("template.php?" . $vbulletin->session->vars['sessionurl'] . "do=rebuild&amp;goto=template.php?" . $vbulletin->session->vars['sessionurl']);

}
Ejemplo n.º 20
0
    // got an uploaded file?
    if (file_exists($vbulletin->GPC['settingsfile']['tmp_name'])) {
        $xml = file_read($vbulletin->GPC['settingsfile']['tmp_name']);
    } else {
        if (file_exists($vbulletin->GPC['serverfile'])) {
            $xml = file_read($vbulletin->GPC['serverfile']);
        } else {
            print_stop_message('no_file_uploaded_and_no_local_file_found');
        }
    }
    if ($vbulletin->GPC['restore']) {
        xml_restore_settings($xml, $vbulletin->GPC['blacklist']);
    } else {
        xml_import_settings($xml);
    }
    print_cp_redirect("options.php?" . $vbulletin->session->vars['sessionurl'], 0);
}
// ###################### Start import settings XML #######################
if ($_REQUEST['do'] == 'files') {
    if (is_demo_mode()) {
        print_cp_message('This function is disabled within demo mode');
    }
    $vbulletin->input->clean_array_gpc('r', array('type' => TYPE_NOHTML));
    // download form
    print_form_header('options', 'download', 0, 1, 'downloadform', '90%', '', true, 'post" target="download');
    print_table_header($vbphrase['download']);
    print_select_row($vbphrase['product'], 'product', fetch_product_list());
    print_submit_row($vbphrase['download']);
    ?>
	<script type="text/javascript">
	<!--
Ejemplo n.º 21
0
function print_next_step()
{
    global $vbulletin, $numsteps, $upgradecore_phrases, $vbphrase;
    // do nothing if print_next_page() or nextStep has already been called
    if (defined('NONEXTSTEP')) {
        return;
    }
    define('NONEXTSTEP', true);
    // reset $perpage to tell the upgrade log that any multi-page steps are complete
    $vbulletin->GPC['perpage'] = 0;
    log_upgrade_step();
    $nextstep = $vbulletin->GPC['step'] + 1;
    if (defined('SCRIPTCOMPLETE')) {
        $formaction = 'upgrade.php';
        $buttonvalue = ' ' . $vbphrase['proceed'] . ' ';
        $buttontitle = '';
        if ($vbulletin->config['Misc']['upgrade_autoproceed'] == 'full' and $vbulletin->debug) {
            print_cp_redirect('upgrade.php', 0.5);
        }
    } else {
        if ($vbulletin->GPC['step'] >= $numsteps) {
            $formaction = 'upgrade.php';
            $buttonvalue = ' ' . $vbphrase['proceed'] . ' ';
            $buttontitle = '';
            if ($vbulletin->config['Misc']['upgrade_autoproceed'] == 'full' and $vbulletin->debug) {
                print_cp_redirect('upgrade.php', 0.5);
            }
        } else {
            $formaction = THIS_SCRIPT;
            $buttonvalue = sprintf($upgradecore_phrases['next_step'], $nextstep, $numsteps);
            $buttontitle = fetch_step_title($nextstep);
            // automatic advance - enable if you want to get through upgrades quickly without reading the text
            if ($vbulletin->config['Misc']['upgrade_autoproceed'] and $vbulletin->debug and ($vbulletin->GPC['step'] != 'welcome' or $vbulletin->config['Misc']['upgrade_autoproceed'] == 'full')) {
                print_cp_redirect(THIS_SCRIPT . "?step={$nextstep}", 0.5);
            }
        }
    }
    global $upgrade;
    if ($vbulletin->debug and is_object($upgrade) and !empty($upgrade->modifications)) {
        /* Looks like execute wasn't called, this doesn't need phrased because its a dev error! */
        echo "<p style=\"color: red;\"><b>Some queries were not executed, did you forget to call execute() on the upgrade queries?</b></p>\n";
    }
    echo '</div> <!-- end #all -->';
    ?>
	<form action="<?php 
    echo $formaction;
    ?>
" method="get" name="nextStep">
	<?php 
    if (!defined('SCRIPTCOMPLETE')) {
        echo '<input type="hidden" name="step" value="' . $nextstep . '" />';
    }
    ?>
	<table cellpadding="4" cellspacing="0" border="0" width="100%" class="navbody" style="padding:4px; border:outset 2px;">
	<tr align="center">
		<td><b><?php 
    echo $upgradecore_phrases['click_button_to_proceed'];
    ?>
</b><br />vBulletin &copy;2000 - <?php 
    echo date('Y');
    ?>
, vBulletin Solutions, Inc.</td>
		<td><input type="submit" class="button" accesskey="s" value="<?php 
    echo $buttonvalue;
    ?>
" title="<?php 
    echo $buttontitle;
    ?>
" /></td>
	</tr>
	</table>
	</form>
	<?php 
}
Ejemplo n.º 22
0
            $picturedata->setr_info('thumbnail', $thumbnail['filedata']);
            $picturedata->set('thumbnail_dateline', TIMENOW);
            $picturedata->set('thumbnail_width', $thumbnail['width']);
            $picturedata->set('thumbnail_height', $thumbnail['height']);
            $picturedata->save();
            unset($picturedata);
        }
        echo '<br />';
        vbflush();
    }
    if ($vbulletin->options['album_dataloc'] == 'db') {
        @unlink($tempfilename);
    }
    $maxid++;
    if ($checkmore = $db->query_first("SELECT pictureid FROM " . TABLE_PREFIX . "picture WHERE pictureid >= {$maxid} LIMIT 1")) {
        print_cp_redirect("album.php?" . $vbulletin->session->vars['sessionurl'] . "do=rebuildthumbs&amp;startid={$maxid}&amp;pp=" . $vbulletin->GPC['perpage'] . "&amp;quality=" . $vbulletin->GPC['quality']);
        echo "<p><a href=\"album.php?" . $vbulletin->session->vars['sessionurl'] . "do=rebuildthumbs&amp;startid={$maxid}&amp;pp=" . $vbulletin->GPC['perpage'] . "&amp;quality=" . $vbulletin->GPC['quality'] . '">' . $vbphrase['click_here_to_continue_processing'] . "</a></p>";
    } else {
        define('CP_REDIRECT', 'album.php?do=thumb');
        print_stop_message('rebuilt_picture_thumbnails_successfully');
    }
}
// #######################################################################
if ($_REQUEST['do'] == 'thumb') {
    print_form_header('album', 'rebuildthumbs');
    print_table_header($vbphrase['rebuild_album_picture_thumbnails']);
    print_description_row($vbphrase['function_rebuilds_album_picture_thumbs']);
    print_input_row($vbphrase['number_pictures_per_cycle'], 'perpage', 25);
    $quality = intval($vbulletin->options['thumbquality']);
    if ($quality <= 0 or $quality > 100) {
        $quality = 75;
Ejemplo n.º 23
0
// ##########################################################################
if ($_REQUEST['do'] == 'edit') {
    $vbulletin->input->clean_array_gpc('r', array('fieldname' => TYPE_NOHTML, 'pagenumber' => TYPE_UINT, 'prev' => TYPE_STR, 'next' => TYPE_STR));
    if ($vbulletin->GPC['prev'] != '' or $vbulletin->GPC['next'] != '') {
        if ($vbulletin->GPC['prev'] != '') {
            $vbulletin->GPC['pagenumber'] -= 1;
        } else {
            $vbulletin->GPC['pagenumber'] += 1;
        }
    }
    if ($vbulletin->GPC['fieldname'] == '') {
        $vbulletin->GPC['fieldname'] = 'global';
    }
    // ***********************
    if ($vbulletin->GPC['dolanguageid'] == -2) {
        print_cp_redirect("phrase.php?" . $vbulletin->session->vars['sessionurl'] . "fieldname=" . $vbulletin->GPC['fieldname'], 0);
    } else {
        if ($vbulletin->GPC['dolanguageid'] == 0) {
            $_REQUEST['do'] = 'modify';
        } else {
            // ***********************
            $perpage = 10;
            print_phrase_ref_popup_javascript();
            ?>
	<script type="text/javascript">
	<!--
	function js_fetch_default(varname)
	{
		var P = eval('document.forms.cpform.P_' + varname);
		var D = eval('document.forms.cpform.D_' + varname);
		P.value = D.value;
Ejemplo n.º 24
0
	// no uploaded file - got a local file?
	else if (file_exists($vbulletin->GPC['serverfile']))
	{
		$xml = file_read($vbulletin->GPC['serverfile']);
	}
	// no uploaded file and no local file - ERROR
	else
	{
		print_stop_message('no_file_uploaded_and_no_local_file_found');
	}

	xml_import_grid($xml,
		$vbulletin->GPC['allowoverwrite']
	);

	print_cp_redirect("cms_admin.php?" . $vbulletin->session->vars['sessionurl'] . "do=grid");
}

if ($_REQUEST['do'] == 'grid_files')
{
	// download / upload grids  (xml, like styles)
	?>
	<script type="text/javascript">
	<!--
	function js_confirm_upload(tform, filefield)
	{
		if (filefield.value == "")
		{
			return confirm("<?php echo construct_phrase($vbphrase['you_did_not_specify_a_file_to_upload'], '" + tform.serverfile.value + "'); ?>");
		}
		return true;
Ejemplo n.º 25
0
            // update $vboptions to attachments as files...
            // attachfile is only set to 1 to indicate the PRE 3.0.0 RC1 attachment FS behaviour
            $db->query_write("UPDATE " . TABLE_PREFIX . "setting SET value = '" . ATTACH_AS_FILES_NEW . "' WHERE varname = 'attachfile'");
            build_options();
        }
        $attachments = $db->query_read("\n\t\t\tSELECT filedataid\n\t\t\tFROM " . TABLE_PREFIX . "filedata\n\t\t\tORDER BY filedataid\n\t\t\tLIMIT " . $vbulletin->GPC['startat'] . ", " . $vbulletin->GPC['perpage'] . "\n\t\t");
        if ($records = $db->num_rows($attachments)) {
            echo '<p>' . construct_phrase($vbphrase['removing_x_attachments'], $records) . '</p>';
            vbflush();
            $attachmentids = array();
            while ($attachment = $db->fetch_array($attachments)) {
                $attachmentids[] = $attachment['filedataid'];
            }
            $db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "filedata\n\t\t\t\t\tSET filedata = '',\n\t\t\t\t\t\tthumbnail = ''\n\t\t\t\tWHERE filedataid IN (" . implode(",", $attachmentids) . ")\n\t\t\t");
            $finishat = $vbulletin->GPC['startat'] + $vbulletin->GPC['perpage'];
            print_cp_redirect("attachment.php?" . $vbulletin->session->vars['sessionurl'] . "do=confirmattachmentremove&startat={$finishat}&removeattachments=1" . "&pp=" . $vbulletin->GPC['perpage']);
            echo "<p><a href=\"attachment.php?" . $vbulletin->session->vars['sessionurl'] . "do=confirmattachmentremove&amp;startat={$finishat}&amp;removeattachments=1" . "&amp;pp=" . $vbulletin->GPC['perpage'] . "\">" . $vbphrase['click_here_to_continue_processing'] . "</a></p>";
        } else {
            // Again, make sure we are on attachments as files setting.
            $db->query_write("UPDATE " . TABLE_PREFIX . "setting SET value = '" . ATTACH_AS_FILES_NEW . "' WHERE varname = 'attachfile'");
            build_options();
            define('CP_CONTINUE', 'attachment.php?do=stats');
            print_stop_message('attachments_moved_to_the_filesystem', $vbulletin->session->vars['sessionurl']);
        }
    } else {
        define('CP_CONTINUE', 'attachment.php?do=stats');
        print_stop_message('attachments_not_moved_to_the_filesystem');
    }
}
// ###################### Search attachments ####################
$vbulletin->input->clean_array_gpc('r', array('massdelete' => TYPE_STR));
Ejemplo n.º 26
0
    // update css
    if ($vbulletin->GPC['dowhat']['css']) {
        build_special_templates($vbulletin->GPC['css'], 'css', 'css');
    }
    // update replacements
    if ($vbulletin->GPC['dowhat']['replacements'] and is_array($vbulletin->GPC['replacement']) and !empty($vbulletin->GPC['replacement'])) {
        $temp = $vbulletin->GPC['replacement'];
        $vbulletin->GPC['replacement'] = array();
        foreach ($temp as $key => $replacebits) {
            $vbulletin->GPC['replacement']["{$replacebits['find']}"] = $replacebits['replace'];
            $vbulletin->GPC['delete']['replacement']["{$replacebits['find']}"] = $vbulletin->GPC['delete']['replacement']["{$key}"];
        }
        build_special_templates($vbulletin->GPC['replacement'], 'replacement', 'replacement');
    }
    print_rebuild_style($vbulletin->GPC['dostyleid'], iif($vbulletin->GPC['dostyleid'] == -1, $vbphrase['master_style'], $style['title']), $vbulletin->GPC['dowhat']['css'], $vbulletin->GPC['dowhat']['stylevars'], $vbulletin->GPC['dowhat']['replacements'], $vbulletin->GPC['dowhat']['posteditor']);
    print_cp_redirect("css.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit" . "&dostyleid=" . $vbulletin->GPC['dostyleid'] . "&amp;group=" . $vbulletin->GPC['group'] . "&amp;dowhat=" . $vbulletin->GPC['passthru_dowhat'] . "&amp;colorPickerType=" . $vbulletin->GPC['colorPickerType'], 1);
}
// ###################### Start Choose What to Edit #######################
if ($_REQUEST['do'] == 'edit') {
    $vbulletin->input->clean_array_gpc('r', array('dostyleid' => TYPE_INT, 'group' => TYPE_STR, 'dowhat' => TYPE_STR));
    if ($vbulletin->GPC['dostyleid'] == 0 or $vbulletin->GPC['dostyleid'] < -1) {
        $vbulletin->GPC['dostyleid'] = 1;
    }
    if (!empty($vbulletin->GPC['dowhat'])) {
        $_REQUEST['do'] = 'doedit';
    } else {
        if ($vbulletin->GPC['dostyleid'] == -1) {
            $style = array('styleid' => -1, 'title' => $vbphrase['master_style']);
        } else {
            $style = $db->query_first("\n\t\t\t\tSELECT styleid, title\n\t\t\t\tFROM " . TABLE_PREFIX . "style\n\t\t\t\tWHERE styleid = " . $vbulletin->GPC['dostyleid']);
        }
Ejemplo n.º 27
0
/**
* 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();
}
Ejemplo n.º 28
0
                        $photoplog_fetch_userinfo = $db->query_first("SELECT username,email\r\n\t\t\t\t\t\tFROM " . TABLE_PREFIX . "user\r\n\t\t\t\t\t\tWHERE userid = " . intval($photoplog_fileids_row['userid']) . "\r\n\t\t\t\t\t\tAND (options & " . intval($vbulletin->bf_misc_useroptions['adminemail']) . ")\r\n\t\t\t\t\t");
                        if ($photoplog_fetch_userinfo) {
                            $photoplog_username = unhtmlspecialchars($photoplog_fetch_userinfo['username']);
                            $photoplog_title = $photoplog_fileids_row['title'];
                            $photoplog_subject = $photoplog_message = '';
                            eval(fetch_email_phrases('photoplog_declined_comment', -1, '', 'photoplog_'));
                            vbmail($photoplog_fetch_userinfo['email'], $photoplog_subject, $photoplog_message, true);
                        }
                        $db->free_result($photoplog_fetch_userinfo);
                    }
                }
                $db->free_result($photoplog_fileids_query);
                foreach ($photoplog_checked_commentids as $photoplog_commentid) {
                    $photoplog_comment_info = $db->query_first("SELECT userid,comment\r\n\t\t\t\t\tFROM " . PHOTOPLOG_PREFIX . "photoplog_ratecomment\r\n\t\t\t\t\tWHERE commentid = " . intval($photoplog_commentid) . "\r\n\t\t\t\t");
                    if ($photoplog_comment_info) {
                        $photoplog_have_comment = $photoplog_comment_info['comment'] != '' ? 1 : 0;
                        if ($db->query_write("DELETE FROM " . PHOTOPLOG_PREFIX . "photoplog_ratecomment\r\n\t\t\t\t\t\t\tWHERE commentid = " . intval($photoplog_commentid) . "\r\n\t\t\t\t\t\t")) {
                            if ($photoplog_have_comment) {
                                $db->query_write("UPDATE " . TABLE_PREFIX . "user\r\n\t\t\t\t\t\t\t\tSET photoplog_commentcount = photoplog_commentcount - 1\r\n\t\t\t\t\t\t\t\tWHERE userid = " . intval($photoplog_comment_info['userid']) . "\r\n\t\t\t\t\t\t\t");
                            }
                        }
                    }
                }
                photoplog_update_fileuploads_counts_array($photoplog_fileids_array);
                photoplog_regenerate_counts_table_v2($photoplog_catids_array);
            }
        }
    }
    print_cp_redirect("photoplog_comment.php?" . $vbulletin->session->vars['sessionurl'] . "do=moderate", 1);
}
print_cp_footer();
Ejemplo n.º 29
0
    			for the product or the default redirect (aka the products admin page)
    		2. If we do, then redirect to the merge page which will redirect to the proper redirect page
    			when finished.
    
    	As always users complicate things.  Some products want to display errors which get unreadable when
    	the page automatically redirects.  We have a DISABLE_PRODUCT_REDIRECT flag which is supposed to
    	simply display the stop message and not redirect.
    */
    $default_redirect = 'index.php?loc=' . urlencode('plugin.php?do=product');
    if (!defined('DISABLE_PRODUCT_REDIRECT')) {
        define('CP_REDIRECT', $default_redirect);
    }
    if ($info['need_merge']) {
        $merge_url = 'template.php?do=massmerge&product=' . urlencode($info['productid']) . '&hash=' . CP_SESSIONHASH . '&redirect=' . urlencode(defined('CP_REDIRECT') ? CP_REDIRECT : $default_redirect);
        if (!defined('DISABLE_PRODUCT_REDIRECT')) {
            print_cp_redirect($merge_url);
        } else {
            //if we just don't define the back url we'll get a javascript "back" as default.
            //an empty string (instead of null) triggers no back button, which is what we want.
            //ugly, but it avoids rewriting a lot of the logic in print_stop_message here.
            define('CP_BACKURL', '');
            //handle the merge redirect as a continue url instead of immediately redirecting.
            define('CP_CONTINUE', $merge_url);
            print_stop_message('product_x_imported_need_merge', $info['productid'], htmlspecialchars($merge_url));
        }
    } else {
        print_stop_message('product_x_imported', $info['productid']);
    }
}
// #############################################################################
if ($_REQUEST['do'] == 'productexport') {
Ejemplo n.º 30
0
                 $icon->save();
                 unset($icon);
             }
             //else
             //{
             //die('could not get image filedata for: ' . $path);
             //}
             //@unlink($path);
             //@unlink($thumbpath);
         }
         $vbulletin->options['usefilegroupicon'] = true;
     }
     $lastgroup = $group['groupid'];
 }
 if ($lastgroup and $db->query_first("\n\t\tSELECT icon.groupid\n\t\tFROM " . TABLE_PREFIX . "socialgroup AS socialgroup \n\t\tLEFT JOIN " . TABLE_PREFIX . "socialgroupicon AS icon ON (icon.groupid = socialgroup.groupid) \n\t\tWHERE NOT ISNULL(icon.dateline) \n\t\tAND icon.groupid > {$lastgroup} \n\t\tLIMIT 1\n\t")) {
     print_cp_redirect("socialgroup_icon.php?" . $vbulletin->session->vars['sessionurl'] . "do=domoveicon&startat={$finishat}&pp=" . $vbulletin->GPC['perpage']);
     //TODO: pointless?
     echo "<p><a href=\"socialgroup_icon.php?" . $vbulletin->session->vars['sessionurl'] . "do=domoveicon&amp;startat={$finishat}&amp;pp=" . $vbulletin->GPC['perpage'] . "\">" . $vbphrase['click_here_to_continue_processing'] . "</a></p>";
 } else {
     define('CP_REDIRECT', 'socialgroup_icon.php?do=storage');
     if (!$vbulletin->options['usefilegroupicon']) {
         // Update $vboptions[]
         $db->query_write("UPDATE " . TABLE_PREFIX . "setting SET value = 1 WHERE varname = 'usefilegroupicon'");
         build_options();
         $db->query_write("UPDATE " . TABLE_PREFIX . "socialgroupicon SET filedata = '', thumbnail_filedata = ''");
         $db->hide_errors();
         $db->query_write("OPTIMIZE TABLE " . TABLE_PREFIX . "socialgroupicon");
         $db->show_errors();
         print_stop_message('images_moved_to_the_filesystem');
     } else {
         $db->query_write("UPDATE " . TABLE_PREFIX . "setting SET value = 0 WHERE varname = 'usefilegroupicon'");