vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   custom page stopped working after upgrade (https://vborg.vbsupport.ru/showthread.php?t=137991)

vengefuldeath87 01-30-2007 11:28 PM

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.

harmor19 01-31-2007 01:04 AM

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();


?>



All times are GMT. The time now is 03:49 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.01012 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete