03-16-2006, 12:08 PM
|
|
|
Join Date: Dec 2005
Location: Spain
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
about powerd page
Hello
i use the powerd page to creat a custom register page but i'm getting error and not sure why
here is the code
Quote:
<?php
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
// change the line below to the actual filename without ".php" extention.
// the reason for using actual filename without extention as a value of this constant is to ensure uniqueness of the value throughout every PHP file of any given vBulletin installation.
define('THIS_SCRIPT', 'test');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array(
// change the lines below to the list of actual templates used in the script
'test_mytesttemplate1',
'test_mytesttemplate22',
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ########################## REQUIRE BACK-END ############################
chdir('/home/site/public_html/forums');
require_once('./global.php');
// #################### HARD CODE JAVASCRIPT PATHS ########################
$headinclude = str_replace('clientscript', $vbulletin->options['bburl'] . '/clientscript', $headinclude);
// #################### add user ########################
function qpc_post($varname)
{
return trim(stripslashes((get_magic_quotes_gpc()) ? $_POST[$varname] : addslashes($_POST[$varname])));
}
define('THIS_SCRIPT', 'bb_add_user.php');
require_once('./global.php');
require_once('./includes/class_dm.php');
require_once('./includes/class_dm_user.php');
$userdm = new vB_DataManager_User($vbulletin, ERRTYPE_ARRAY);
$userdm->set('username', qpc_post('username'));
$userdm->set('email', qpc_post('email'));
$userdm->set('password', qpc_post('password'));
$userdm->set('usergroupid', 2);
$userdm->set('ipaddress', qpc_post('ipaddress'));
$userdm->set('referrerid', qpc_post('referrername'));
$userdm->set('timezoneoffset', qpc_post('timezoneoffset'));
$userdm->set_bitfield('options', 'adminemail', intval(qpc_post('adminemail')));
$userdm->set_bitfield('options', 'showemail', intval(qpc_post('showemail')));
$dst_setting = intval(qpc_post('dst'));
switch ($dst_setting)
{
case 0:
case 1:
$userdm->set_bitfield('options', 'dstonoff', $dst_setting);
break;
case 2:
$userdm->set_bitfield('options', 'dstauto', 1);
break;
}
#If there are errors (eMail not set, eMail banned, Username taken, etc.) you can check for errors using
if (count($userdm->errors)) {
for($i=0; $i<count($userdm->errors); $i++) {
print "ERROR{$i}:{$userdm->errors[$i]}\n";
}
} else {
# If everything is OK
$newuserid = $userdm->save();
print "vbuserid:$newuserid\n";
}
// ################################################## ######################
// ######################### START MAIN SCRIPT ############################
// ################################################## ######################
$navbits = array();
// change the line below to contain whatever you want to show in the navbar (title of your custom page)
$navbits[$parent] = 'Test Page';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
// change the line below to contain the name of the actual main output template used in your script
eval('print_output("' . fetch_template('test_mytesttemplate1') . '");');
?>
|
can someone tell me what wrong with this code .. ?
thanks
|