You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.1 KiB
31 lines
1.1 KiB
<?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; |
|
} |
|
?>' |
|
); |
|
|
|
?>
|