This repository has been archived on 2026-02-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files

31 lines
1.1 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
return array(
'title' => 'Подобные цены',
'desc' => 'Позволяет отобразить тизеры документов из рубрики с подобными ценами',
'author' => 'Юрий Рахимов',
'db_name' => 'Подобные цены',
'db_text' => '<h3>За такуюже цену:</h3><br />
<?php
$last_count=5; //Количество
$rubric_field_id=29; //ID поля с ценой
$percent=10; //Проценты
$price=get_document_field($_REQUEST[\'id\'],$rubric_field_id);
$price_from=intval($price-$price*$percent/200);
$price_to=intval($price+$price*$percent/200);
$sql=$AVE_DB->Query("Select
d.document_id
FROM
".PREFIX."_document_fields d,
".PREFIX."_documents a
WHERE a.Id=d.document_id AND d.rubric_field_id=".$rubric_field_id." AND d.field_number_value>".$price_from." AND d.field_number_value<".$price_to." AND a.document_status=1
ORDER by d.field_number_value
LIMIT ".$last_count);
while ($row = $sql->FetchAssocArray()) {
$t=eval2var(\'?>\'.showteaser($row[\'document_id\']).\'<?\');
echo $t;
}
?>'
);
?>