[TITLE]
{TITLE}
[/TITLE][SUBTITLE]
{SUBTITLE}
[/SUBTITLE][INGREDIENTS]
{INGREDIENTS}
[/INGREDIENTS][CALORIES]
{CALORIES} kJ / {KCAL} kcal[CALORIESADD] ({CALORIESADD})[/CALORIESADD]
[/CALORIES][PREPARATION]
{PREPARATION}
[/PREPARATION][TIME]
{TIME} Minuten[TIMEADD], {TIMEADD}[/TIMEADD]
[/TIME]
[CAT]
{CAT}
[/CAT]';
}
$crow["acontent_form"]['kcal'] = ceil($crow["acontent_form"]['calorificvalue'] / 4.1868);
$crow["acontent_form"]['ingredients'] = convertStringToArray($crow["acontent_form"]['ingredients'], "\n", 'NOT-UNIQUE', false);
if(count($crow["acontent_form"]['ingredients'])) {
$crow["acontent_form"]['temp'] = array();
$ingrediens_counter = 0;
foreach($crow["acontent_form"]['ingredients'] as $temp_val) {
$temp_val = html_specialchars($temp_val);
if($temp_val{0} == '*') { //headline
if(isset($crow["acontent_form"]['temp'][$ingrediens_counter]['h'])) {
$ingrediens_counter++;
}
$crow["acontent_form"]['temp'][$ingrediens_counter]['h'] = substr($temp_val, 1);
continue;
}
$crow["acontent_form"]['temp1'] = explode('|', $temp_val, 2);
$temp_val = implode(' ', $crow["acontent_form"]['temp1']);
if(empty($crow["acontent_form"]['temp1'][1])) {
$crow["acontent_form"]['temp1'][1] = $crow["acontent_form"]['temp1'][0];
$crow["acontent_form"]['temp1'][0] = ' ';
}
$crow["acontent_form"]['temp'][$ingrediens_counter]['li'][] = ' '.$temp_val.'';
$crow["acontent_form"]['temp'][$ingrediens_counter]['tr'][] = ' ' . LF .
' '.$crow["acontent_form"]['temp1'][0].' | '.LF.
' '.$crow["acontent_form"]['temp1'][1].' | '.LF.
'
';
}
$crow["acontent_form"]['ingredients'] = '';
$crow["acontent_form"]['i_table'] = '';
if(count($crow["acontent_form"]['temp'])) {
foreach($crow["acontent_form"]['temp'] as $temp_val) {
if(isset($temp_val['h'])) { //alternative headline
$crow["acontent_form"]['ingredients'] .= '' . $temp_val['h'] . '
' . LF;
$crow["acontent_form"]['i_table'] .= '' . $temp_val['h'] . '
' . LF;
}
if(isset($temp_val['li'])) {
$crow["acontent_form"]['ingredients'] .= '' . LF . implode(LF, $temp_val['li']) . LF . '
' . LF;
$crow["acontent_form"]['i_table'] .= '' . LF . implode(LF, $temp_val['tr']) . LF . '
' . LF;
}
}
}
} else {
$crow["acontent_form"]['ingredients'] = '';
$crow["acontent_form"]['i_table'] = '';
}
// now render whole recipe
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'TITLE', html_specialchars($crow['acontent_title']));
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'INGREDIENTS', $crow["acontent_form"]['ingredients']);
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'INGREDIENTSTABLE', $crow["acontent_form"]['i_table']);
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'CALORIES', $crow["acontent_form"]['calorificvalue']);
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'KCAL', $crow["acontent_form"]['kcal']);
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'CALORIESADD', html_specialchars($crow["acontent_form"]['calorificvalue_add']));
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'PREPARATION', $crow["acontent_form"]['preparation']);
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'TIME', html_specialchars($crow["acontent_form"]['time']));
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'TIMEADD', html_specialchars($crow["acontent_form"]['time_add']));
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'SEVERITY', $crow["acontent_form"]['severity']);
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'CAT', html_specialchars($crow["acontent_form"]['category']));
$CNT_TMP .= $crow["acontent_form"]['template'];
?>