Advertisement
edishions

Untitled

Mar 3rd, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.21 KB | None | 0 0
  1. <?
  2.     require_once "{$_SERVER["DOCUMENT_ROOT"]}/include/functions.php";
  3.     class PostLocalmartby{
  4.        
  5.         public function __construct()
  6.         {
  7.             $this->post();
  8.         }
  9.        
  10.         function post() {
  11.             global $cookies, $proxy, $useragent;
  12.             $ad_id = $_POST['ad_id'];
  13.             $board_id = 44;
  14.            
  15.             $func = new Functions();
  16.             $def_stat = $func->GetSingleAdInfo($ad_id);
  17.             $res = $func->GetSettings($ad_id, $board_id);
  18.             $account = $func->GetBoardAccount($ad_id, $board_id);
  19.  
  20.             $cookies = 'cookie/localmartby-'.microtime(true).".txt";
  21.            
  22.            
  23.  
  24. // дальше нужно всё привести в соответсвие, что-бы работало         
  25.            
  26. if($res['category_id2'] == '')
  27. {
  28.     $pcid2  = '';
  29. }
  30. else $pcid2  = $res['category_id2'];
  31.  
  32. if($res['category_id2'] != '')
  33. {
  34.     $pcid  = $res['category_id2'];
  35. }  
  36. else if($res['podcategory_id'] != '')
  37. {
  38.     $pcid  = $res['podcategory_id'];
  39. }
  40. else $pcid = $res['category_id'];
  41.  
  42. if($res['manufacturer2'] == '')
  43. {
  44.     if($res['manufacturer'] == '')
  45.     {
  46.             $f31  = '';
  47.     }
  48.     else $f31  = ''.$res['manufacturer'];
  49. }else $f31  = ''.$res['manufacturer2'];
  50.  
  51. if($res['ofse'] != '')
  52. {
  53.     $ofse = $res['ofse'];
  54. }else $ofse = '';
  55.  
  56. if($res['zanatost'] != '')
  57. {
  58.     $zanatost = $res['zanatost'];
  59. }else $zanatost = '';
  60.  
  61. $user = trim($res['user']);
  62. $pass = trim($res['pass']);
  63. $user = urlencode($user);
  64. $pass = urlencode($pass);
  65. setcookie("ssi_login","1");
  66. setcookie("expires","Sat, 29-Aug-2015 18:23:31 GMT");
  67. setcookie("path","/");
  68. setcookie("domain",".localmart.by");
  69. setcookie("ssi_login","deleted");
  70. setcookie("expires","Thu, 01-Jan-1970 00:00:01 GMT");
  71. setcookie("path","/");
  72. setcookie("PHPSESSID","kqh517se94cpfpq4obrv6vodb6");
  73. setcookie("path","/");
  74. setcookie("domain",".localmart.by");
  75. 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");
  76. setcookie("expires","Sat, 29-Aug-2015 18:23:31 GMT");
  77. setcookie("path","/");
  78. setcookie("domain",".localmart.by");
  79. setcookie("show_categories","0");
  80. setcookie("PHPSESSID","kqh517se94cpfpq4obrv6vodb6");
  81. setcookie("ssi_login","1");
  82. setcookie("__utmt","1");
  83. setcookie("_ym_visorc_21642088","b");
  84. setcookie("__utma","9699880.475212387.1424267154.1425309214.1425319649.23");
  85. setcookie("__utmb","9699880.12.9.1425321455644");
  86. setcookie("__utmc","9699880");
  87. setcookie("__utmz","9699880.1425027853.15.4.utmcsr=99board.ru|utmccn=(referral)|utmcmd=referral|utmcct=/doski.php");
  88. $url = 'http://localmart.by/login';
  89. $result = file_get_contents($url, false, stream_context_create(array(
  90.     'http' => array(
  91.         'method'  => 'POST',
  92.         'header'  => 'Content-type: application/x-www-form-urlencoded',
  93.         'content' => http_build_query(array(
  94.             'LoginForm[email]' => 'edishions@gmail.com',
  95.             'LoginForm[password]' => 'makc106106',
  96.             'LoginForm[rememberMe]'=> '0',
  97.             'LoginForm[rememberMe]'=> '1',
  98.         )
  99.                 )))));
  100. $url = 'http://localmart.by/add#';
  101. $result = file_get_contents($url, false, stream_context_create(array(
  102.     'http' => array(
  103.         'method'  => 'POST',
  104.         'header'  => 'Content-type: application/x-www-form-urlencoded',
  105.         'content' => http_build_query(array(
  106.             'Ad' => array(
  107.                 'title'  => $def_stat['ad_name'],
  108.                 'category_id'  => $pcid,
  109.                 'phones'  => $res['ads_phone'],
  110.                 'description'  => $def_stat['ad_desc'],
  111.                 'main_photo'  => '',
  112.                 'region_id'  => $res['region_id'],
  113.                 'city_id'  => $res['sel_city_id'],
  114.                 'email'  => $res['ads_email'],
  115.                 'username'  => $res['ads_your_name'],
  116.                 'user_type_id'  => '1',
  117.                 'icq'  => '',
  118.                 'skype'  => '',
  119.                 'terms'  => '0',
  120.                 'terms'  => '1',
  121.                 'categories_list'  => array(
  122.                     '0'  => '',
  123.                     '1'  => $res['categories_list'],
  124.                     '2'  => $res['category_id'],
  125.                     '3'  => $res['podcategory_id'],
  126.                     '4'  => $pcid2,
  127.             )),    
  128.             'CategoryField' => array(
  129.                 'fields'  => array(
  130.                     '25' => $zanatost,
  131.                     '10' => $ofse,
  132.                     '31'  => $f31,
  133.                     'price'  => '1',
  134.                     '1'  => $def_stat['ad_price'],
  135.                     'currency'  => 'BYR',
  136.                     'auction'  => '0',
  137.                 )
  138.             )
  139.         )
  140.                 )))));
  141.         echo "Удача";
  142.         }
  143.        
  144.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement