Browse Source

add config value, fix warning if user_id is not found

master
R4SAS 5 years ago
parent
commit
48f64d9a56
  1. 3
      include/config/global.inc.dist.php
  2. 3
      include/pages/tghook.inc.php

3
include/config/global.inc.dist.php

@ -317,6 +317,7 @@ $config['system']['load']['max'] = 10.0;
/** /**
* Telegram notificator configuration * Telegram notificator configuration
* To use push notifications via Telegram you need create bot and set here its API key * To use push notifications via Telegram you need create bot and set here its API key and username (without '@')
**/ **/
$config['push']['telegram']['api_key'] = ''; $config['push']['telegram']['api_key'] = '';
$config['push']['telegram']['bot_username'] = '';

3
include/pages/tghook.inc.php

@ -42,7 +42,8 @@ $prepareResponse = function ($message) use ($chatID, $api, $bitcoin, $block, $se
// Get userID in MPOS by chatID // Get userID in MPOS by chatID
$stmt = $mysqli->prepare("SELECT account_id as user_id FROM user_settings WHERE value LIKE '%".$chatID."%' LIMIT 1"); $stmt = $mysqli->prepare("SELECT account_id as user_id FROM user_settings WHERE value LIKE '%".$chatID."%' LIMIT 1");
if($stmt && $stmt->execute() && $result = $stmt->get_result()) if($stmt && $stmt->execute() && $result = $stmt->get_result())
$user_id = $result->fetch_object()->user_id; $row = $result->fetch_object();
$user_id = (!empty($row->user_id)) ? $row->user_id : 0;
if ( ! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300; if ( ! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300;
$response = ''; $response = '';

Loading…
Cancel
Save