Записи. Запись для support journals отправка с меткой journals.ru и скрипты
17 лет назад//Первая функция
function Post($subj,$body,$date,$tags=null){
require_once('utf.php');
if (isset($tags))
$tags=utf_decode($tags);
$param=array();
$param['s']='';
$param['action']='dopost';
$param['userid']=$this->loader->userid;
$param['title']=utf_decode($subj);
$param['message']=str_replace('&','%26',html2bbcode(utf_decode($body)));
$param['usermood']='';
$param['usermood_new']='';
$param['music_new']='';
$param['parseurl']='yes';
$param['disablesmilies']='yes';
// $param['subnewcom']='yes'; /disables
$param['polloptions']=5;
$param['MAX_FILE_SIZE']=184320;
$param['privatepost']= 0;
$param['privatelist']='';
$param['settitle']=implode("\r\n",array_trim(explode(',',$tags)));
$param['post_avatar']=0;
$param['submit']=' Готово ';
if ($this->loader->logged==1){
$this->loader->Post('http://www.journals.ru/newpost.php',$param);
}
return array('url'=>'http://journals.ru/journals.php?userid='.$this->loader->userid);
}
//она вызывает встроенную другую функцию поста
function Post($url, $param)
{
$this->req->clearPostData();
if($this->mycookies)
foreach($this->mycookies as $cookie)
$this->req->AddCookie($cookie['name'],$cookie['value']);
$this->req->setMethod("POST");
foreach($param as $p=>$v)
$this->req->addPostData($p, $v, true);
$this->req->setURL($url);
$this->req->sendRequest();
$res = $this->req->getResponseBody();
$this->mycookies=$this->req->getResponseCookies();
return $res;
}
// Добавление параметров
/**
* Adds postdata items
*
* @param string Post data name
* @param string Post data value
* @param bool Whether data is already urlencoded or not, default = not
* @access public
*/
function addPostData($name, $value, $preencoded = false)
{
if ($preencoded) {
$this->_postData[$name] = $value;
} else {
$this->_postData[$name] = $this->_arrayMapRecursive('urlencode', $value);
}
}
//Формирование