Qobilov_Sardor
Hikoya.tk dagi maqolalarni telegram kanalda chiqarish uchun shu kodni yozsham kanalda avto chiqadimi.

  1. // $asptoken = "321707943:AAHeDB5zJh3rDPU_N886PwpfvMPMkXvwnII";
  2. // $canallink= "@hikoya_tk";
  3. // $photo = 'http://hikoya.tk/files/library/big/'.$cid.'.jpg';
  4. $text1 = $_POST['name'];
  5. $text1 .= "\n";
  6. $text1 .= $_POST['text'];
  7. $text1 .= "\n";
  8. $text1 .= $photo ;
  9. $text1 .= "\n";
  10. $text1.= "hikoya.tk/library/index.php?id=".$cid;
  11. $text1 = str_replace('','',$text1);
  12. $text1 = str_replace('','',$text1);
  13. $text1 = str_replace('','',$text1);
  14. $text1 = str_replace('','',$text1);
  15. $text1 = functions::rus_lat($text1);
  16. $aspurl = "https://api.telegram.org/bot".$asptoken;
  17. $url = $aspurl."/sendMessage?chat_id=".$canallink."&text=".urlencode($text1);
  18. /*
  19. $bot_id= "321707943:AAHeDB5zJh3rDPU_N886PwpfvMPMkXvwnII";
  20. $telegram = new Telegram($bot_id);
  21. $chat_id = "@hikoya_tk";
  22. $text1 = $_POST['name'];
  23. $text1 .= "\n";
  24. $text1.= "hikoya.tk/library/index.php?id=".$cid;
  25. $photo = 'http://hikoya.tk/files/library/big/'.$cid.'.jpg';
  26. $text1 = str_replace('','',$text1);
  27. $text1 = str_replace('','',$text1);
  28. $text1 = str_replace('','',$text1);
  29. $text1 = str_replace('','',$text1);
  30. $text1 = functions::rus_lat($text1);
  31. $img = ('http://hikoya.tk/files/lobrary/big/'.$cid.'.jpg','image/jpg');
  32. $content = array('chat_id' => $chat_id, 'photo' => $img, 'caption' => $text1 );
  33. $telegram->sendPhoto($content);