$html_file = str_replace('{language_text}', '', $html_file); } else { $html_file = str_replace('{language}', $pic_language . $file_lang_values[$files[$i]->file_language], $html_file); $html_file = str_replace('{language_text}', $pic_language . $file_lang_values[$files[$i]->file_language], $html_file); } // insert rating system if ($jlistConfig['view.ratings']) { $rating_system = JDHelper::getRatings($files[$i]->file_id, $files[$i]->rating_count, $files[$i]->rating_sum); $html_file = str_replace('{rating}', $rating_system, $html_file); $html_file = str_replace('{rating_title}', JText::_('COM_JDOWNLOADS_RATING_LABEL'), $html_file); } else { $html_file = str_replace('{rating}', '', $html_file); $html_file = str_replace('{rating_title}', '', $html_file); } // custom fields $custom_fields_arr = JDHelper::existsCustomFieldsTitles(); $row_custom_values = array('dummy', $files[$i]->custom_field_1, $files[$i]->custom_field_2, $files[$i]->custom_field_3, $files[$i]->custom_field_4, $files[$i]->custom_field_5, $files[$i]->custom_field_6, $files[$i]->custom_field_7, $files[$i]->custom_field_8, $files[$i]->custom_field_9, $files[$i]->custom_field_10, $files[$i]->custom_field_11, $files[$i]->custom_field_12, $files[$i]->custom_field_13, $files[$i]->custom_field_14); for ($x = 1; $x < 15; $x++) { // replace placeholder with title and value if (in_array($x, $custom_fields_arr[0]) && $row_custom_values[$x] && $row_custom_values[$x] != '0000-00-00') { $html_file = str_replace("{custom_title_{$x}}", $custom_fields_arr[1][$x - 1], $html_file); if ($x > 5) { $html_file = str_replace("{custom_value_{$x}}", stripslashes($row_custom_values[$x]), $html_file); } else { $html_file = str_replace("{custom_value_{$x}}", $custom_fields_arr[2][$x - 1][$row_custom_values[$x]], $html_file); } } else { // remove placeholder if ($jlistConfig['remove.field.title.when.empty']) { $html_file = str_replace("{custom_title_{$x}}", '', $html_file); } else {