PDA

View Full Version : how to store additional fields to db during post


radiofranky
08-01-2011, 08:01 PM
Hi

Someone helped me created a plugin that allows additional fields to be inputted during the post creation page. The code is as follows:

I have manually added three table_fields to my db because I want to store those three variable for later use.

I have "price", "saleprice", and "pct".


The problem I have now is I don't know how to store them? Which file should I edit and etc. Could someone show me how? Thanks

vbulletin->input->clean_array_gpc('p', array(
'saleprice' => TYPE_uinit,
'price' => TYPE_uinit));
$price = $vbulletin->GPC['price'];
$saleprice = $vbulletin->GPC['saleprice'];
vB_Template::preRegister('newthread', array('price' => $price, 'saleprice' => $saleprice));
$pct = intval((1-($vbulletin->GPC['saleprice'] / $vbulletin->GPC['price']))*100 );
$vbulletin->GPC['subject'] .= " for $".$vbulletin->GPC['saleprice'] .", {$pct}% off (orig.$" . $vbulletin->GPC['price'] . ")";