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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-30-2007, 11:28 PM
vengefuldeath87 vengefuldeath87 is offline
 
Join Date: Apr 2005
Location: England
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default custom page stopped working after upgrade

Ive just upgraded from 3.6.3 to 3.6.4, and now my custom admin page has stopped working totally.

PHP Code:
<?php
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
@
set_time_limit(0);
 
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('style');
$specialtemplates = array('products');
 
// ########################## REQUIRE BACK-END ############################
require_once('./global.php');
require_once(
DIR '/includes/adminfunctions_template.php');
 
print_cp_header();
 
 
$con mysql_connect("localhost","u","p");
if (!
$con)
  {
  die(
'Could not connect: ' mysql_error());
  }
mysql_select_db("db"$con);
// some code

 
 
 
 // ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminusers'))
{
    
print_cp_no_permission();

$name $_POST['inputname'];
if(
$name) {
$result mysql_query("SELECT * FROM lacn where username='".$name."'",$con);
if (
mysql_num_rows($result) == 1) {
$result mysql_query("delete from lacn where username='".$name."'",$con);
print_description_row('Removed '.$name);
} else {
print_description_row('User '.$name.' was not found.');
}
}


mysql_close($con);
print_cp_header($vbphrase['FAdmin']);
print_form_header('fadmin');
print_table_header('Delete User');

print_input_row('Enter Name to remove:''inputname'); 
print_submit_row("Submit!"0);  



print_cp_footer();


?>
I cant even get anything to output from the code, and the $_POST has stopped working.

Just to add, the db stuff connects to a different db, not the vbulletin one.
Reply With Quote
  #2  
Old 01-31-2007, 01:04 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is untested

PHP Code:
<?php
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
@
set_time_limit(0);
 
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('style');
$specialtemplates = array('products');
 
// ########################## REQUIRE BACK-END ############################
require_once('./global.php');
require_once(
DIR '/includes/adminfunctions_template.php');
 
print_cp_header();
 

// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminusers'))
{
    
print_cp_no_permission();


if(empty(
$_REQUEST['do']))
{
    
$_REQUEST['do'] = "main";
}

if(
$_REQUEST['do'] == "delete")
{

    
$vbulletin->input->clean_gpc('p''inputname'TYPE_UINT);
    
    
    if(!empty(
$vbulletin->GPC['inputname']))
    {
      
$result $db->query_first("SELECT * FROM lacn WHERE username='".$db->escape_string($vbulletin->GPC['inputname'])."'");
    
      if (empty(
$result['username'])) 
      {
        
$db->query_write("DELETE FROM lacn WHERE username='".$db->escape_string($vbulletin->GPC['inputname'])."'");
        
print_description_row('Removed '.$result['username']);
      } 
      else 
      {
        
print_description_row("User ".$result['username']." was not found.");
      }
    }
}

if(
$_REQUEST['do'] == "main")
{
    
print_cp_header($vbphrase['FAdmin']);
    
print_form_header('fadmin''delete');
    
print_table_header('Delete User');
    
    
print_input_row('Enter Name to remove:''inputname'); 
    
print_submit_row("Submit!"0);  

}

print_cp_footer();


?>
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 01:07 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.06434 seconds
  • Memory Usage 2,197KB
  • 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_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)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