Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- require_once "{$_SERVER["DOCUMENT_ROOT"]}/include/functions.php";
- class PostLocalmartby{
- public function __construct()
- {
- $this->post();
- }
- function post() {
- global $cookies, $proxy, $useragent;
- $ad_id = $_POST['ad_id'];
- $board_id = 44;
- $func = new Functions();
- $def_stat = $func->GetSingleAdInfo($ad_id);
- $res = $func->GetSettings($ad_id, $board_id);
- $account = $func->GetBoardAccount($ad_id, $board_id);
- $cookies = 'cookie/localmartby-'.microtime(true).".txt";
- // дальше нужно всё привести в соответсвие, что-бы работало
- if($res['category_id2'] == '')
- {
- $pcid2 = '';
- }
- else $pcid2 = $res['category_id2'];
- if($res['category_id2'] != '')
- {
- $pcid = $res['category_id2'];
- }
- else if($res['podcategory_id'] != '')
- {
- $pcid = $res['podcategory_id'];
- }
- else $pcid = $res['category_id'];
- if($res['manufacturer2'] == '')
- {
- if($res['manufacturer'] == '')
- {
- $f31 = '';
- }
- else $f31 = ''.$res['manufacturer'];
- }else $f31 = ''.$res['manufacturer2'];
- if($res['ofse'] != '')
- {
- $ofse = $res['ofse'];
- }else $ofse = '';
- if($res['zanatost'] != '')
- {
- $zanatost = $res['zanatost'];
- }else $zanatost = '';
- $user = trim($res['user']);
- $pass = trim($res['pass']);
- $user = urlencode($user);
- $pass = urlencode($pass);
- setcookie("ssi_login","1");
- setcookie("expires","Sat, 29-Aug-2015 18:23:31 GMT");
- setcookie("path","/");
- setcookie("domain",".localmart.by");
- setcookie("ssi_login","deleted");
- setcookie("expires","Thu, 01-Jan-1970 00:00:01 GMT");
- setcookie("path","/");
- setcookie("PHPSESSID","kqh517se94cpfpq4obrv6vodb6");
- setcookie("path","/");
- setcookie("domain",".localmart.by");
- setcookie("c3f85de4202e74220e48a74870d5a949","13f2f09145df51c27d95ec0fd59bbb04fdd1411fa%3A4%3A%7Bi%3A0%3Bs%3A8%3A%2274707713%22%3Bi%3A1%3Bs%3A16%3A%22%D0%B2%D0%B2%D0%BF%D0%BF%D0%B2%D0%BF%D0%B2%D0%BF%22%3Bi%3A2%3Bi%3A15552000%3Bi%3A3%3Ba%3A0%3A%7B%7D%7D");
- setcookie("expires","Sat, 29-Aug-2015 18:23:31 GMT");
- setcookie("path","/");
- setcookie("domain",".localmart.by");
- setcookie("show_categories","0");
- setcookie("PHPSESSID","kqh517se94cpfpq4obrv6vodb6");
- setcookie("ssi_login","1");
- setcookie("__utmt","1");
- setcookie("_ym_visorc_21642088","b");
- setcookie("__utma","9699880.475212387.1424267154.1425309214.1425319649.23");
- setcookie("__utmb","9699880.12.9.1425321455644");
- setcookie("__utmc","9699880");
- setcookie("__utmz","9699880.1425027853.15.4.utmcsr=99board.ru|utmccn=(referral)|utmcmd=referral|utmcct=/doski.php");
- $url = 'http://localmart.by/login';
- $result = file_get_contents($url, false, stream_context_create(array(
- 'http' => array(
- 'method' => 'POST',
- 'header' => 'Content-type: application/x-www-form-urlencoded',
- 'content' => http_build_query(array(
- 'LoginForm[email]' => 'edishions@gmail.com',
- 'LoginForm[password]' => 'makc106106',
- 'LoginForm[rememberMe]'=> '0',
- 'LoginForm[rememberMe]'=> '1',
- )
- )))));
- $url = 'http://localmart.by/add#';
- $result = file_get_contents($url, false, stream_context_create(array(
- 'http' => array(
- 'method' => 'POST',
- 'header' => 'Content-type: application/x-www-form-urlencoded',
- 'content' => http_build_query(array(
- 'Ad' => array(
- 'title' => $def_stat['ad_name'],
- 'category_id' => $pcid,
- 'phones' => $res['ads_phone'],
- 'description' => $def_stat['ad_desc'],
- 'main_photo' => '',
- 'region_id' => $res['region_id'],
- 'city_id' => $res['sel_city_id'],
- 'email' => $res['ads_email'],
- 'username' => $res['ads_your_name'],
- 'user_type_id' => '1',
- 'icq' => '',
- 'skype' => '',
- 'terms' => '0',
- 'terms' => '1',
- 'categories_list' => array(
- '0' => '',
- '1' => $res['categories_list'],
- '2' => $res['category_id'],
- '3' => $res['podcategory_id'],
- '4' => $pcid2,
- )),
- 'CategoryField' => array(
- 'fields' => array(
- '25' => $zanatost,
- '10' => $ofse,
- '31' => $f31,
- 'price' => '1',
- '1' => $def_stat['ad_price'],
- 'currency' => 'BYR',
- 'auction' => '0',
- )
- )
- )
- )))));
- echo "Удача";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement