gibigbig Posted April 6, 2010 Share Posted April 6, 2010 this code takes place in the vbulletin page but it has nothing to do with the vbulletin core, it is just a custom hack. it is meant to take information from a database and add it to the default value of a text area, that can be edited and then updated on the database. This is the html code i have: $stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> $headinclude <title>$vboptions[bbtitle]</title> </head> <body> $header $navbar <if condition="is_member_of($vbulletin->userinfo, 6, 7, 5)"> <FORM ACTION="edit-bleach-bio.php?id=$gibid" METHOD="POST"> Edit Bio Info<BR> <TEXTAREA NAME="bio" COLS=120 ROWS=30> $uberarray </TEXTAREA> <br/> <INPUT TYPE=SUBMIT VALUE="submit"> </FORM> <else /> You are not allowed to view this resource </if> $footer </body> </html> and this is my php code: <?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', 'edit-bleach-bio'); // #################### 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( ); // pre-cache templates used by specific actions $actiontemplates = array(); // ########################## REQUIRE BACK-END ############################ require_once('./global.php'); // #################### HARD CODE JAVASCRIPT PATHS ######################## $headinclude = str_replace('clientscript', $vbulletin->options['bburl'] . '/clientscript', $headinclude); // ######################################################################## // ######################### 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] = 'Moderator Naruto Bio Page'; $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); /************************ begin vars *************************************/ // ######################### Gib Code #################################### //declare some vars $gibid = $_GET['id']; $titlequery = mysql_query("SELECT title FROM formresults WHERE userid = '".$gibid."' AND fid <> '1'" ) or die(mysql_error()); $titlearray = mysql_fetch_array( $titlequery ); $title = $titlearray[0]; if (isset($title)) {$hasbio = '1';} else {$hasbio = '0';}; /*************************** SHINIGAMI **************************************/ if ($title == 'Naruto RPG bio') { $data = mysql_query("SELECT * FROM formresults WHERE userid = '".$gibid."' AND fid <> '1' " ) or die(mysql_error()); $formresults = mysql_fetch_array( $data ); $uberarray = $formresults[7]; $newinfo = $_POST['bio']; if ($uberarray != $newinfo) { $query1 = "UPDATE formresults SET sdata = '".$newinfo."' WHERE userid = ".$gibid." AND fid <> '1'"; mysql_query($query1); }; }; // change the line below to contain the name of the actual main output template used in your script eval('print_output("' . fetch_template('edit-bleach-bio') . '");'); ?> and the database structure is attached (not zipped because coders dont like downloading zipped for fear of malware) can anyone help me? [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/197788-vbulletin-custom-form-help/ Share on other sites More sharing options...
gibigbig Posted April 6, 2010 Author Share Posted April 6, 2010 the output i get is nothing, plus the data on the database gets deleted, why is that? Link to comment https://forums.phpfreaks.com/topic/197788-vbulletin-custom-form-help/#findComment-1037935 Share on other sites More sharing options...
gibigbig Posted April 6, 2010 Author Share Posted April 6, 2010 can anyone help me, its very important Link to comment https://forums.phpfreaks.com/topic/197788-vbulletin-custom-form-help/#findComment-1038002 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.