Changeset 1588825
- Timestamp:
- 02/04/2017 10:14:44 AM (9 years ago)
- Location:
- channeller-telegram-channel-administrator/trunk
- Files:
-
- 2 deleted
- 3 edited
-
channeller.php (modified) (2 diffs)
-
includes/ch-send-functions.php (modified) (2 diffs)
-
languages/tchannel.po (deleted)
-
languages/tchannel.pot (deleted)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
channeller-telegram-channel-administrator/trunk/channeller.php
r1570682 r1588825 2 2 /** 3 3 * @package Websima Telegram Channel 4 * @version 1.5. 34 * @version 1.5.4 5 5 */ 6 6 /* … … 9 9 Description: Send Text, URL, Photo, Video and Audio from Wordpress to Telegram Channel using Telegram bot API. 10 10 Author: Websima Creative Agency 11 Version: 1.5. 311 Version: 1.5.4 12 12 Author URI: http://websima.com 13 13 */ -
channeller-telegram-channel-administrator/trunk/includes/ch-send-functions.php
r1571026 r1588825 128 128 $chatter = get_site_option( $chat_id ); 129 129 $caption = truncate_channeller ($caption , 200); 130 // $fields = array( 131 // 'chat_id' => $chatter, 132 // // make sure you do NOT forget @ sign 133 // 'photo' => 134 // '@' . $photo 135 // . ';filename=' . $photo, 136 // 'caption' => $caption 137 // ); 130 131 138 132 139 $caption = urlencode($caption); 133 //$caption = urlencode($caption); 134 140 135 if ($keyboard == 'no') { 141 $url = 'https://api.telegram.org/bot'.$token.'/sendPhoto?chat_id='.$chatter.'&photo='.$photo.'&caption='.$caption.'&parse_mode=HTML'; 142 } else { 136 $params=[ 137 'chat_id'=>$chatter, 138 'photo'=>$photo, 139 'caption'=>$caption, 140 'parse_mode'=>'HTML', 141 ]; 142 } else { 143 143 $replyMarkup = array('inline_keyboard' => $keyboard); 144 144 $encodedMarkup = json_encode($replyMarkup); 145 $url = 'https://api.telegram.org/bot'.$token.'/sendPhoto?chat_id='.$chatter.'&photo='.$photo.'&caption='.$caption.'&parse_mode=HTML&reply_markup='.$encodedMarkup; 145 $params=[ 146 'chat_id'=>$chatter, 147 'photo'=>$photo, 148 'caption'=>$caption, 149 'parse_mode'=>'HTML', 150 'reply_markup'=>$encodedMarkup, 151 ]; 146 152 } 147 $update = file_get_contents($url, false); 153 $url="https://api.telegram.org/bot".$token; 154 $ch = curl_init($url. '/sendPhoto'); 155 curl_setopt($ch, CURLOPT_HEADER, false); 156 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 157 curl_setopt($ch, CURLOPT_POST, 1); 158 curl_setopt($ch, CURLOPT_POSTFIELDS, ($params)); 159 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 160 $update = curl_exec($ch); 161 curl_close($ch); 148 162 $result = json_decode ($update); 149 163 if ($result->ok == 1) { … … 163 177 $message = truncate_channeller ($message , 4096); 164 178 if ($token) { 165 $message = urlencode($message);179 //$message = urlencode($message); 166 180 if ($keyboard == 'no') { 167 $url = 'https://api.telegram.org/bot'.$token.'/sendMessage?chat_id='.$user_id.'&text='.$message.'&parse_mode=HTML'; 168 } else { 181 $params=[ 182 'chat_id'=>$user_id, 183 'text'=>$message, 184 'parse_mode'=>'HTML', 185 ]; } else { 169 186 $replyMarkup = array('inline_keyboard' => $keyboard); 170 187 $encodedMarkup = json_encode($replyMarkup); 171 $url = 'https://api.telegram.org/bot'.$token.'/sendMessage?chat_id='.$user_id.'&text='.$message.'&parse_mode=HTML&reply_markup='.$encodedMarkup; 188 $params=[ 189 'chat_id'=>$user_id, 190 'text'=>$message, 191 'parse_mode'=>'HTML', 192 'reply_markup'=>$encodedMarkup, 193 ]; 172 194 } 173 $update = file_get_contents($url, false); 195 $url="https://api.telegram.org/bot".$token; 196 $ch = curl_init($url. '/sendMessage'); 197 curl_setopt($ch, CURLOPT_HEADER, false); 198 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 199 curl_setopt($ch, CURLOPT_POST, 1); 200 curl_setopt($ch, CURLOPT_POSTFIELDS, ($params)); 201 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 202 $update = curl_exec($ch); 203 curl_close($ch); 174 204 $result = json_decode($update); 175 205 if ($result->ok == 1) { -
channeller-telegram-channel-administrator/trunk/readme.txt
r1570682 r1588825 5 5 Requires at least: 3.0.1 6 6 Tested up to: 4.7 7 Stable tag: 1.5. 37 Stable tag: 1.5.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 81 81 82 82 == Changelog == 83 = 1.5.4 = 84 change file_get_contents function to CURL 85 83 86 = 1.5.2 = 84 87 Future Posts Support for channels
Note: See TracChangeset
for help on using the changeset viewer.