Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-06-2005, 03:59 AM
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default can't get admincp css from outside it's dir

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>&nbsp;</p><p>&nbsp;</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 with the above code.
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&amp;deltable=blunts_whodownloaded_ip'));]]></uninstallcode>
Reply With Quote
  #2  
Old 11-30-2005, 09:27 PM
led_belly led_belly is offline
 
Join Date: Oct 2005
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm having similar problems. Did you ever find a solution?
Reply With Quote
  #3  
Old 11-30-2005, 10:53 PM
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:44 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03453 seconds
  • Memory Usage 2,177KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete