Posted by: Nono
« on: July 18, 2013, 04:43:58 pm »For the custom field:
There are 4 SQL tables that store the data. They are:
CUSTOM_VALUES_DATE - for date custom fields
CUSTOM_VALUES_INT - for?? custom fields
CUSTOM_VALUES_LONGSTR - for long text fields (memo I guess as well)
CUSTOM_VALUES_REAL
CUSTOM_VALUES_SHORSTR - for short text fields.
You will have to choose the proper table for the type of data you store.
The CUSTOM_FIELDS_MOVIES holds the reference of the fields display value and types.
To add a custom field to your Movie details for instance. You would insert a new file into the MovieDetail-x sequence. Rename all the MovieDetail-*.html from 8 to 10 with an increment of 1 making them 9 to 11. So you can now create a file called MovieDetail-8.html.
Put this content in the -8.html file:
Replace all occurrence of CUSTOM_VALUES_SHORTSTR with the proper table name for the type of custom field you use.
Replace the 'My custom display' value with want you see in PVD for your custom field.
We could use the globalParam file to store table names or what not and/or other SQL request but I think this is the simplest way.
Make sense?
There are 4 SQL tables that store the data. They are:
CUSTOM_VALUES_DATE - for date custom fields
CUSTOM_VALUES_INT - for?? custom fields
CUSTOM_VALUES_LONGSTR - for long text fields (memo I guess as well)
CUSTOM_VALUES_REAL
CUSTOM_VALUES_SHORSTR - for short text fields.
You will have to choose the proper table for the type of data you store.
The CUSTOM_FIELDS_MOVIES holds the reference of the fields display value and types.
To add a custom field to your Movie details for instance. You would insert a new file into the MovieDetail-x sequence. Rename all the MovieDetail-*.html from 8 to 10 with an increment of 1 making them 9 to 11. So you can now create a file called MovieDetail-8.html.
Put this content in the -8.html file:
Code: [Select]
<!--DBINFO
REQUEST=SELECT FIRST 1 "value" FROM "CUSTOM_VALUES_SHORTSTR" INNER JOIN "MOVIES" ON "MOVIES"."mid" = "CUSTOM_VALUES_SHORTSTR"."mid" INNER JOIN "CUSTOM_FIELDS_MOVIES" ON "CUSTOM_FIELDS_MOVIES"."cmfid" = "CUSTOM_VALUES_SHORTSTR"."cmfid" WHERE "CUSTOM_FIELDS_MOVIES"."dispname" = 'My custom display' AND "MOVIES"."mid"=[parentref]
MYCUSTOMFIELD-S=value
RECORDCHARSET=UTF-8
-->
<tr>
<td class="title3" colspan="1">My field</td>
<td class="normal" colspan="3"><!--MYCUSTOMFIELD-S--></td>
</tr>
Replace all occurrence of CUSTOM_VALUES_SHORTSTR with the proper table name for the type of custom field you use.
Replace the 'My custom display' value with want you see in PVD for your custom field.
We could use the globalParam file to store table names or what not and/or other SQL request but I think this is the simplest way.
Make sense?