View Single Post
  #22  
Old 07-03-2001, 07:19 PM
Zamtil
Guest
 
Posts: n/a
Default

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? =)
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01170 seconds
  • Memory Usage 1,763KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete