|
General Links
ONLINE MANUAL
General Sections
affCAFF Manager - The Basics
affCAFF Manager - Advanced
|
|
Storing affCAFF Code In A Database Text Field
If you store reviews and text in a database, there is a facility within affCAFF to include
the affCAFF code and parameters required within the text. When the text is read, it is
evaluated so as to execute the PHP within the text string.
To achieve this, just follow Steps 1 & 2 in your data generator
as normal. Then just add the resulting affCAFF code from Step 2 to the text in your database field,
ensuring that the <?php and ?> php tags are still wrapped around it as shown.
All you need to do then is to include the following line of code somewhere in your PHP page
before you display the text...
$txt = parsePHP($txt);
...where $txt is your string containing the text for display.
You can include as many blocks of affCAFF code in a single field as you wish.
NB:
This function is also useful if you want to store other
PHP code in your database fields - it is not just limited to evaluating affCAFF code,
but you will need to "include" the functions file "acFunctions.php" on your
page in order to call it (as shown in Step 1 of the data generator).
|
|