The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I'm close, but no cigar so far.
I'm trying to put a do=deletetable inside a 3rd party NON admincp file to complete a "product uninstall code" with a clickable button to delete a self contained 3rd party database table of old saved data. Most people (like me) wouldn't want to delete this table ... even if uninstalling ... so this is why I'm being complex with the product. I realize the easy way is to make two seperate files (putting the admin do's in the admin folder) but I already have another 3rd party php file in root with lots of other normal code and being used so figured why make a seperate file for 1 small call. Everything "works" except for the lack of CSS (white backround black text). The blue admincp sidebar and header remains intact. Only the main pane goes to white/black. Just wondering why I can't get the admincp's css. Is it wrong to define VB_AREA as admincp when the file is not truely in admincp directory (inspection of the code led me to believe this would help me attain the admin css)? Code:
error_reporting(E_ALL & ~E_NOTICE); define('THIS_SCRIPT', 'blunts_whodownloaded_ip'); if ($_GET['do'] == 'deletewhodlip' OR $_POST['do'] == 'do_deletewhodlip') { define('VB_AREA', 'AdminCP'); define('CWD', (($getcwd = getcwd()) ? $getcwd : '.')); define('DIR', CWD); require_once(DIR . '/includes/class_core.php'); $vbulletin =& new vB_Registry(); $vbulletin->fetch_config(); chdir(DIR . "/{$vbulletin->config['Misc']['admincpdir']}"); require_once('./global.php'); if (!can_administer('canadminplugins')) { print_cp_no_permission(); } $vbulletin->input->clean_array_gpc('r', array( 'verify' => TYPE_UINT, 'deltable' => TYPE_STR, 'productid' => TYPE_STR )); print_cp_header('Final Uninstallation Step for Blunts Whodownloaded_IP'); if ($_REQUEST['do'] == 'deletewhodlip') { echo "<p> </p><p> </p>"; print_form_header(THIS_SCRIPT, 'do_deletewhodlip', 0, 1, '', '75%'); construct_hidden_code('deltable', $vbulletin->GPC['deltable']); construct_hidden_code('productid', $vbulletin->GPC['productid']); print_table_header(construct_phrase($vbphrase['confirm_deletion_of_x_y'], $vbphrase['table'], $vbulletin->GPC['deltable'])); print_description_row("<blockquote><br />" . construct_phrase($vbphrase['are_you_sure_you_want_to_delete_the_x_called_y'], $vbphrase['table'], TABLE_PREFIX . $vbulletin->GPC['deltable'], 'dB Table', TABLE_PREFIX . $vbulletin->GPC['deltable'], ' ') . "<br /></blockquote>\n\t"); print_submit_row($vbphrase['yes'], 0, 2, $vbphrase['no']); print_cp_footer(); } } I've tried without the chdir and adding the admincp to the require global line. Both ways had the same results. I figured the chdir would solve it since the css appears to be called with a ../ from admincp global, but it didn't help. Any ideas?? And if I implemented something like this, would it decrease any security?? Ohhh, and here's the bit of product uninstall code I'm calling this from. Code:
<uninstallcode><![CDATA[define('DISABLE_PRODUCT_REDIRECT', '1'); print_form_header(); construct_hidden_code('productid', $vbulletin->GPC['productid']); print_table_header("Uninstalling " . $vbulletin->GPC['productid'] . " - Code 1.1.1", 2, 0, '', 'center', 0); print_label_row("By default, this does NOT delete the current table of saved data.", '', 'alt2'); print_label_row("Click here to delete 3rd party database table '" . TABLE_PREFIX . "blunts_whodownloaded_ip'", '', 'alt2'); print_table_footer(2, construct_button_code('Delete Stored Data', '../blunts_whodownloaded_ip.php?' . $vbulletin->session->vars['sessionurl'] . 'do=deletewhodlip&deltable=blunts_whodownloaded_ip'));]]></uninstallcode> |
#2
|
|||
|
|||
![]()
I'm having similar problems. Did you ever find a solution?
|
#3
|
|||
|
|||
![]()
No, I made a seperate admin file for admin directory.
For me, it worked out for the best as I later expanded the file to give admins a few more features. Sorry I didn't conquer it. Hope you have better luck. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|