Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Если продукт успешно найден:
- if($number == 1){
- # Обновляем покупателя товара:
- $sql = "
- UPDATE
- `digital_shop_product`
- SET
- `buyer` = ".csqlEscape($data['source']['from']['id'], $_cdb).",
- `buy_date` = ".csqlEscape(time(), $_cdb)."
- WHERE
- `digital_shop_product_id` = ".csqlEscape($product_id, $_cdb)."
- ";
- csqlQuery($sql, $_cdb);
- # Формируем список кнопок:
- $button[] = array('text' => $settings['button_back'], 'callback_data' => 'product_in_category_'.$product_rows[0][5]);
- $button = array_chunk($button, 1);
- # Если товар является файлом:
- if($product_rows[0][6] == 2){
- # Отправляем товар пользователю:
- tgApi(
- 'sendDocument',
- array(
- 'chat_id' => $data['source']['message']['chat']['id'],
- 'document' => $product_rows[0][3],
- 'caption' => $product_rows[0][4]
- )
- );
- }
- # Если товар является текстом:
- else{
- # Выводим информацию по товару:
- tgApi(
- 'editMessageText',
- array(
- 'chat_id' => $data['source']['message']['chat']['id'],
- 'message_id' => $data['source']['message']['message_id'],
- 'text' => tplReplace(
- array(
- 'product_name' => $product_rows[0][4],
- 'content' => $product_rows[0][3]
- ), unSafeString($settings['product_content'])
- ),
- 'parse_mode' => 'Markdown',
- 'reply_markup' => json_encode(
- array(
- 'inline_keyboard' => $button
- )
- )
- )
- );
- }
- }
- # Если продукт не найден:
- else {
- return $_lang['data_not_found'];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement