Guest User

vBulletin Poster Class

a guest
Feb 7th, 2012
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.29 KB | None | 0 0
  1. <?php
  2. header("content-type: text/html; charset=utf-8");
  3. /*
  4. vBulletin Poster Class
  5. vBulletin forumlara login olup konu açar.
  6. Ahmet Burak DEMIRKOPARAN tarafından kodlanmıştır.
  7. */
  8. set_time_limit(0);  
  9. class vb{
  10.     public $loginpostpath = "login.php?do=login";
  11.     public $konuacform = "newthread.php?do=newthread&f=";
  12.    
  13.     /*
  14.     Gidip forumda yeni konu butonuna tıkladığınızda linkte bir sayı verir kategori id sidir.
  15.     o Sayıyıda eşittirden sonra ekleyeceğiz.
  16.     http://www.frmtr.com/newthread.php?do=newthread&f=41 -> 41 asp,php,perl,html kategorisinin idsidir.
  17.     */
  18.    
  19.     public function login($siteadi,$kullaniciadi,$sifre){
  20.     $tokenbul = file_get_contents($siteadi."index.php");
  21.     preg_match('/<input type="hidden" name="securitytoken" value="(.*?)"/',$tokenbul,$a);
  22.     $md5sifre = md5($sifre);
  23.     $loginpostbilgileri = array(
  24.     "cookieuser" => "1",
  25.     "do"         => "login",
  26.     "s"          => "",
  27.     "securitytoken" => $a[1],
  28.     "vb_login_md5password" =>    $md5sifre,
  29.     "vb_login_md5password_utf" => $md5sifre,
  30.     "vb_login_password" => "",    
  31.     "vb_login_username" => $kullaniciadi);
  32.     $ch = curl_init();
  33.     curl_setopt($ch,CURLOPT_URL,$siteadi.$this->loginpostpath);
  34.     curl_setopt($ch,CURLOPT_REFERER,$siteadi."index.php");
  35.     curl_setopt($ch,CURLOPT_USERAGENT,"Mozilla/5.0 (Windows NT 5.1; rv:10.0) Gecko/20100101 Firefox/10.0");
  36.     curl_setopt($ch,CURLOPT_POST,1);
  37.     curl_setopt($ch,CURLOPT_POSTFIELDS,$loginpostbilgileri);
  38.     curl_setopt($ch,CURLOPT_COOKIEJAR,dirname(__FILE__)."/cerez.txt");
  39.     curl_setopt($ch,CURLOPT_COOKIEFILE,dirname(__FILE__)."/cerez.txt");
  40.     curl_setopt($ch,CURLOPT_FOLLOWLOCATION,TRUE);
  41.     curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
  42.     $a = curl_exec($ch);
  43.     curl_setopt($ch, CURLOPT_URL, $siteadi."index.php");
  44.     $a = curl_exec($ch);
  45.     curl_close($ch);
  46.     return iconv("ISO-8859-9","UTF-8",$a);
  47.    
  48.     }
  49.     public function konuac($siteadi,$kategori_id,$baslik,$mesaj){
  50.     $ot = curl_init();
  51.     curl_setopt($ot,CURLOPT_URL,$siteadi.$this->konuacform.$kategori_id);
  52.     curl_setopt($ot,CURLOPT_COOKIEFILE,dirname(__FILE__)."/cerez.txt");
  53.     curl_setopt($ot,CURLOPT_RETURNTRANSFER,true);
  54.     $exec = curl_exec($ot);
  55.     preg_match('/<input type="hidden" name="securitytoken" value="(.*?)"/',$exec,$securitytoken);
  56.     $konuacpostbilgileri = array(
  57.     "do"    => "postthread",
  58.     "emailupdate" => "9999",
  59.     "f"    => $kategori_id,
  60.     "iconid" => "0",
  61.     "loggedinuser" => "3652239",
  62.     "message" => $mesaj,
  63.     "parseurl" =>     "1",
  64.     "posthash" => "",    
  65.     "poststarttime" =>"",    
  66.     "s" => "",    
  67.     "sbutton" => "Yeni Konuyu Gönder",
  68.     "securitytoken"    => $securitytoken[1],
  69.     "subject" => $baslik,
  70.     "taglist" => "",    
  71.     "wysiwyg" => "1"
  72.     );
  73.     curl_setopt($ot,CURLOPT_POST,1);
  74.     curl_setopt($ot,CURLOPT_POSTFIELDS,$konuacpostbilgileri);
  75.     curl_setopt($ot,CURLOPT_FOLLOWLOCATION,true);
  76.     $exec = curl_exec($ot);
  77.     curl_opt($ot,CURLOPT_URL,$siteadi."index.php");
  78.     return $exec = curl_exec($ot);
  79.     curl_close($ot);  
  80.     }
  81.      
  82. }
  83. $sinif = new vb();
  84. $sinif->login("http://frmtr.com/","morukh2","alaturkaces");
  85. $sinif->konuac("http://www.frmtr.com/","41","deneme2","curl ile post deneme");
  86. ?>
Advertisement
Add Comment
Please, Sign In to add comment