Quote:
Originally posted by chilliboy
Hi Zamtil,
From what you have said I guess this hack is going to require adding numerous addition fields to existing table am I correct in this??
foreach($HTTP_POST_VARS AS $key => $value)
{
$Custom_Field = substr_count($key , $Custom_Check);
if($Custom_Field)
{
$key = str_replace($Custom_Check , "", $key);
$Custom_Data .= $Custom_Field_Seporater . $Values_Seporater . $key . $Values_Seporater . $value;
}
}
|
Nah, only change to EXISTING tables is a custom field (formprefix)in the forum table and (formid) in the thread table.
All the custom data is stored in your OWN table called (formprefix).
I then use code like you used above to convert database fields into PHP variables.
I've had a couple variations on this code, and the original did what you're suggesting - pack the data. But, on my site, I wrote a custom search engine for filtering/displaying the custom table. It can't be searched by vBulletin, but it's still a pretty clean interface, IMHO.
My search:
http://www.noows.com/eqprofiles.php
Bit of SQL for custom table:
CREATE TABLE eqchar (
id int(11) NOT NULL auto_increment,
text_name varchar(60) NOT NULL default '',
sel_server varchar(30) NOT NULL default '',
text_guild varchar(100) default '',
sel_religion varchar(20) default '',
num_level smallint(8) default '0',
sel_class varchar(15) NOT NULL default '',
sel_race varchar(15) NOT NULL default '',
sel_sex varchar(8) default '',
num_hp int(11) NOT NULL default '0',
num_ac int(11) NOT NULL default '0',
num_atk int(11) NOT NULL default '0',
The text_, sel_, and num_ prefixes determine how I handle/display/basic error check the data. 'eqchar' is my formprefix for forumid 84 & 69. Every thread in those forums then references an 'id' in the 'eqchar' table. Clear as mud? =)