Permalink
Browse files

GO

  • Loading branch information...
ARaminco committed Feb 19, 2017
1 parent 41a9680 commit 5e8dc84ac9f2c343ccce1926fca16108574ea263
Showing 874 changed files with 221,283 additions and 0 deletions.
View
@@ -0,0 +1,12 @@
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
View
@@ -0,0 +1,108 @@
<?php
if($inText == "/user"){
$sum=0;
$cheker=0;
$result2 = mysql_query("SELECT * FROM gs_tbot_users WHERE ID > 1 ")or die(mysql_error());// انتخاب از جدول
//گرفتن خروجی از اطلاعات فیلدها با mysql_fetch_array
while ($row = mysql_fetch_array($result2)){
$id = $row['id'];
$cheker++;
}
$curl = curl_init("https://api.telegram.org/bot$botapi/sendMessage");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, "chat_id=$cid&text=$cheker");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($curl);
curl_close($curl);
echo $result ;
}elseif (!empty($photo)){
$curl = curl_init("https://api.telegram.org/bot$botapi/sendPhoto");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, "chat_id=$cid&photo=$photo");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($curl);
curl_close($curl);
echo $result ;
$curl2 = curl_init("https://api.telegram.org/bot$botapi/sendMessage");
curl_setopt($curl2, CURLOPT_POST, 1);
curl_setopt($curl2, CURLOPT_POSTFIELDS, "chat_id=$cid&text=$photo");
curl_setopt($curl2, CURLOPT_RETURNTRANSFER, TRUE);
$result2 = curl_exec($curl2);
curl_close($curl2);
echo $result2 ;
}elseif(!empty($video)){
$curl = curl_init("https://api.telegram.org/bot$botapi/sendVideo");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, "chat_id=$cid&video=$video");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($curl);
curl_close($curl);
echo $result ;
$curl2 = curl_init("https://api.telegram.org/bot$botapi/sendMessage");
curl_setopt($curl2, CURLOPT_POST, 1);
curl_setopt($curl2, CURLOPT_POSTFIELDS, "chat_id=$cid&text=$video");
curl_setopt($curl2, CURLOPT_RETURNTRANSFER, TRUE);
$result2 = curl_exec($curl2);
curl_close($curl2);
echo $result2 ;
}elseif(!empty($sticker)){
$curl = curl_init("https://api.telegram.org/bot$botapi/sendSticker");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, "chat_id=$cid&sticker=$sticker");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($curl);
curl_close($curl);
echo $result ;
$curl2 = curl_init("https://api.telegram.org/bot$botapi/sendMessage");
curl_setopt($curl2, CURLOPT_POST, 1);
curl_setopt($curl2, CURLOPT_POSTFIELDS, "chat_id=$cid&text=$sticker");
curl_setopt($curl2, CURLOPT_RETURNTRANSFER, TRUE);
$result2 = curl_exec($curl2);
curl_close($curl2);
echo $result2 ;
}elseif(!empty($doc)){
$curl = curl_init("https://api.telegram.org/bot$botapi/sendDocument");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, "chat_id=$cid&document=$doc");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($curl);
curl_close($curl);
echo $result ;
$curl2 = curl_init("https://api.telegram.org/bot$botapi/sendMessage");
curl_setopt($curl2, CURLOPT_POST, 1);
curl_setopt($curl2, CURLOPT_POSTFIELDS, "chat_id=$cid&text=$doc");
curl_setopt($curl2, CURLOPT_RETURNTRANSFER, TRUE);
$result2 = curl_exec($curl2);
curl_close($curl2);
echo $result2 ;
}
?>
View
@@ -0,0 +1,34 @@
<?php
/**
* Created by PhpStorm.
* User: RaminCo
* Date: 08/01/2017
* Time: 03:11 AM
*/
include ("config.php");
$pass = $webapi;
$inpass = $_POST['pass'];
$phone = (int) $_POST['phone'];
$text = $_POST['text'];
$photo = $_POST['photo'];
$caption = $_POST['caption'];
$doc = $_POST['doc'];
if ($pass == $inpass){
$result2 = mysql_query("SELECT * FROM gs_tbot_users WHERE phone LIKE '%$phone'")or die(mysql_error());// انتخاب از جدول
while ($row = mysql_fetch_array($result2)){
$cid = $row['UID'];
//echo $cid ;
}
if (isset($text)){
$sendM = sendMessage($cid, $text, $botapi, $encodedMarkup);
}
if (isset($photo)){
$sendP = sendPhoto($cid, $photo, $botapi ,$caption ,$encodedMarkup);
}
if (isset($doc)){
$sendD = sendDocument($cid, $doc, $botapi ,$caption);
}
}
View
@@ -0,0 +1,90 @@
<?php include ("config.php"); ?>
<?php
//دستور های مدیر
if ($cid == "$adminUID"){
include ("admin.php");
}
$gs_botin = $proptions->find_by_name('botin')->int ;
$gs_botin++;
$gs_update_db = $proptions->find_by_name('botin');
$gs_update_db -> int = $gs_botin ;
$gs_update_db-> save();
//دستور های کاربران معمولی
if ($chattype == "private"){
//چک و قرار دادن یوزر در لیست اعضا
$sum=0;
$cheker=0;
$result2 = mysql_query("SELECT * FROM gs_tbot_users WHERE ID > 0 AND ChatID = '$uid' ")or die(mysql_error());// انتخاب از جدول
while ($row = mysql_fetch_array($result2)){
$u_t_id = $row['id'];
$u_t_phone = $row['phone'];
$cheker = $sum+1 ;
}
if($cheker==0){
$regDate = date("Y-m-d");
mysql_query("INSERT INTO gs_tbot_users (UName,UID,FName,LName,ChatID,phone,rdate) VALUES('$uname','$uid','$fname','$lname','$cid','','$regDate')")
or die(mysql_error());
}
if ($checkrphone == '1'){
if (empty($u_t_phone)){
if (isset($userPhoneNumber)){
$update = mysql_query("UPDATE gs_tbot_users SET phone='$userPhoneNumber' WHERE UID='$uid' ");
$text = $gs_tbot_commands->find_by_id(2)->text;
$encodedMarkup = $gs_tbot_commands->find_by_id(2)->keyboard;
$sendM = sendMessage($cid, $text, $botapi, $encodedMarkup);
$inText = "";
}else{
$text = $gs_tbot_commands->find_by_id(1)->text;
$encodedMarkup = $gs_tbot_commands->find_by_id(1)->keyboard;
$sendM = sendMessage($cid, $text, $botapi, $encodedMarkup);
$inText = "";
}
}
}
$commandOk = urlencode($inText);
$result2 = mysql_query("SELECT * FROM gs_tbot_commands WHERE command='$commandOk' AND type='1'") or die(mysql_error());
while ($row = mysql_fetch_array($result2)) {
$text = $row['text'];
$keyboard = $row['keyboard'];
$photo = $row['photo'];
$video = $row['video'];
$encodedMarkup = $keyboard;
if (!empty($video)){
$sendV = sendVideo($cid, $video, $botapi ,$text ,$encodedMarkup);
}elseif (!empty($photo)){
$sendP = sendPhoto($cid, $photo, $botapi ,$text ,$encodedMarkup);
}else{
$sendM = sendMessage($cid, $text, $botapi, $encodedMarkup);
}
}
}
if (!empty($sendM)||!empty($sendP)){
$gs_botout = $proptions->find_by_name('botout')->int ;
$gs_botout++;
$gs_update_db = $proptions->find_by_name('botout');
$gs_update_db -> int = $gs_botout ;
$gs_update_db-> save();
}
if ($botdebug == 1){
$text = $sendV;
$sendM = sendMessage($cid, $text, $botapi, $encodedMarkup);
}
mysql_close;
?>
View
@@ -0,0 +1,59 @@
<?php
include ("db.php");
include_once('../classes/jdf.php');
include ("../classes/db.php");
include ("../config.php");
include ("../classes/functions.php");
$db = new DB("mysql://$mysql_user:$mysql_pass@$mysql_host/$mysql_db");
mysql_set_charset('utf8');
$proptions = $db->table('gs_options');
$gs_tbot_commands = $db->table('gs_tbot_commands');
$botapi = $proptions->find_by_name('TelegramBotAPI')->text ;
$adminUID = $proptions->find_by_name('TelegramAdminUID')->text ;
$adminUser = $proptions->find_by_name('TelegramAdminID')->text ;
$BotName = $proptions->find_by_name('BotName')->text ;
$botid = $proptions->find_by_name('BotID')->text ;
$botdebug = $proptions->find_by_name('BotDebug')->int ;
$checkrphone = $proptions->find_by_name('rphone')->int ;
$webapi = $proptions->find_by_name('webapi')->text ;
$gs_botout = $proptions->find_by_name('botout')->int ;
$data = json_decode(file_get_contents("php://input"), true);
$dataset = file_get_contents("php://input");
$prttext = prettyPrint( $dataset );
//var_dump($data);
$cid = $data ["message"]["chat"]["id"];
$chattype = $data ["message"]["chat"]["type"];
$chattitle = $data ["message"]["chat"]["title"];
$uid = $data ["message"]["from"]["id"];
$inText = $data["message"]["text"];
$fname = $data["message"]["from"]["first_name"];
$photo = $data["message"]["photo"]["0"]["file_id"];
$video = $data["message"]["video"]["file_id"];
$sticker = $data["message"]["sticker"]["file_id"];
$doc = $data["message"]["document"]["file_id"];
$uname = $data["message"]["from"]["username"];
$fname = $data["message"]["from"]["first_name"];
$lname = $data["message"]["from"]["last_name"];
$reply = $data["message"]["reply_to_message"]["text"];
$userPhoneNumber = $data["message"]["contact"]["phone_number"];
$callback = $data ["callback_query"]["data"];
if($callback!=""){
$cid = $data ["callback_query"]["from"]["id"];
$uid = $cid;
}
?>
View
@@ -0,0 +1,11 @@
<?php
include ('../config.php');
mysql_connect("$mysql_host", "$mysql_user", "$mysql_pass")//اطلاعات اتصال
or die(mysql_error());
//echo "ارتباط برقرار شد!<br />";
mysql_select_db("$mysql_db")//نام دیتابیس
or die(mysql_error());
//echo "ارتباط با پایگاه داده برقرار شد!<br />";
mysql_query('SET NAMES \'utf8\'');
mysql_set_charset('utf8');
?>
@@ -0,0 +1,9 @@
<?php include_once("$gs_admin_directory/head.php"); ?>
<?php include_once("$gs_admin_directory/header.php"); ?>
<?php include_once("$gs_admin_directory/sidebar.php"); ?>
<?php include("classes/propageADMIN.php"); ?>
<?php include_once("$gs_admin_directory/footer.php"); ?>
Oops, something went wrong.

0 comments on commit 5e8dc84

Please sign in to comment.