There is a code that takes data from the table_prefix . files table table_prefix . files table_prefix . files . And in this table there is a cell file_number , I need to output its value lower in the condition, but it is not displayed if I write {if $file_number > 2} <br /> {/if} , but {if $comment_id > 2} <br /> {/if} everything will work as it should, but you need exactly $file_number . Probably, you need to pull out this value in the lower code.
if ($upload_link=='story') $sql = "SELECT a.*, b.file_fields AS `fields`, '' AS link_name FROM " . table_prefix . "files a LEFT JOIN " . table_prefix . "files b ON a.file_orig_id=b.file_id WHERE a.file_size='$upload_defsize' AND a.file_comment_id='{$this->_vars['comment_id']}' $hide_sql ORDER BY file_number"; elseif ($upload_link=='orig') $sql = "SELECT a.*, b.file_fields AS `fields`, IF(LEFT(b.file_name,4)='http',b.file_name,CONCAT('$upload_directory/',b.file_name)) AS link_name FROM " . table_prefix . "files a LEFT JOIN " . table_prefix . "files b ON a.file_orig_id=b.file_id WHERE a.file_size='$upload_defsize' AND a.file_comment_id='{$this->_vars['comment_id']}' $hide_sql ORDER BY file_number"; else $sql = "SELECT a.*, c.file_fields AS `fields`, CONCAT('$upload_thdirectory/',b.file_name) AS link_name FROM " . table_prefix . "files a LEFT JOIN " . table_prefix . "files b ON a.file_orig_id=b.file_orig_id AND b.file_size='$upload_link' LEFT JOIN " . table_prefix . "files c ON a.file_orig_id=c.file_id WHERE a.file_size='$upload_defsize' AND a.file_comment_id='{$this->_vars['comment_id']}' $hide_sql ORDER BY file_number"; $images = $db->get_results($sql,ARRAY_A);
file_numberat the output. And in fact - redo the base already, renaming the attributes and removing their prefixfile_. In queries, it is clear that they refer to files (files.nameinstead offiles.file_name). - stck