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??
If this is so - and is one of the reasons why it is difficult to install and probably require a fair bit of time 'bug fixing' - then one way of significantly cutting down the required fields would be to do something like this:
When you are creating a 'customised field' in a submit form you prefix the variable 'name' with 'custom'. So as an example I would have :
variable name: Custom_Name , variable value: some holiday
variable name: Custom_Introduction, variable value: blah blah
variable name: Custom_Description, variable value: blah blah
variable name: Custom_Available Dates variable value: July5
variable name: Custom_Cost variable value: ?500
variable name: Custom_Contact variable value:
e-mail@home.com
$Custom_Check = "custom";
$Custom_Field_Seporater = "field split here";
$Values_Seporater = "values split here";
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;
}
}
// You now have all the custom fields as a string with certain 'seporaters' which can be used to get the information back in the required format for processing later. The string $Custom_Data then gets put in the 'additional content' field in the table.
To get the information back you can do something like this:
// Get the string from the 'additional content' field then:
$Fields_and_values = explode($Custom_Field_Seporater, $Custom_Data);
foreach ($Fields_and_values AS $Extract_Info)
{
$Data = explode($Values_Seporater, $Extract_Info);
$Custom_Field [$Data[1]] = $Data[2];
$Custom_Field [$Data[1]][name] = $Data[1]
}
I should now have an array $Custom_Field which holds the names and values of my custom defined fields which I can put into my related template as variables to be parsed.
This way obviously limits on search capabilities and stuff, but significantly reduces the problems you would have with adding lots of new table field and associated problems. Its also pretty flexible as all the 'custom' data is only ever stored in one field, you don't have to bother with adding new fields to a table everytime you want to add something another value into your
submit form. You may be able to move quite a lot of the 'hacking' into the phpinclude file, which would also be helpful for upgrades etc.
As I don't know how your code works for this I may be barking up the wrong tree, but I thought I'd give you my input in the off chance it would be of use.
Cheers