Creating a vibrant forum from start can be hard. I use this auto post script to help things get started.
<?php
/*
You can use this to post to your forum automatically
It might be a good idea to set the bb_specials.php accordingly for the forum you autopost to. Please read the manual regarding bb_specials.php settings
$lastOut=array(6);
$clForums=array();
$clForumsUsers[6]=array(3);
$roForums=array(6);
$poForums=array(6);
$regUsrForums=array();
$userRanks=array(3=>'Automate Bot');
$mods=array(
6=>array(3),
);
You can use a cron job to run this script but I would not over do it. In my case, I auto post about 3 times a day.
*/
//Start Editing
$websiteUrl='yourwebsitedotcom/';
$referrer='yourwebsitedotcom/';
$forumUrl='yourwebsitedotcom/forum/index.php';
//Forum Crendentials For User
$uName='forumuserName';
$uPass='forumuserPass';
$forumid=6;//id of forum to post to
//you can modify the code to include a MySQL statements to pull Title and Descriptor from a database to post to your forum
$pTitle='This is a test title';
$pDesc='This is a post description test';
//Stop Editing
$ch = curl_init();//initiate curl
//Let's Post
setForumCookie($websiteUrl, $referrer, $ch);//set's a session cookie
$data=setData($pTitle,$pDesc, $uName,$uPass,$forumid);
$data = http_build_query($data);
//log's in and post to forum
echo post2Forum($forumUrl.'?', $referrer, $data, $ch);
function setData($pT,$pD,$uN,$pW,$fId)
{
$data = array(
'showSep' => '1',
'forum' => $fId,
'topicTitle' =>$pT,
'postText' => $pD,
'prevForm' => '0',
'user_usr' => $uN,
'user_pwd' => $pW,
'mode' => 'login',
'queryStr' => 'action=vtopic&forum='.$fId.'&showSep=1',
'action' => 'ptopic'
);
return $data;
}
function setForumCookie($wUrl, $refr, $ch)
{
curl_setopt ($ch, CURLOPT_URL,$wUrl);
curl_setopt ($ch, CURLOPT_POST, 0);
curl_setopt ($ch, CURLOPT_COOKIEJAR, realpath('cookie.txt')); // cookie.txt
curl_setopt ($ch, CURLOPT_COOKIEFILE, realpath('cookie.txt'));
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i586; de; rv:5.0) Gecko/20100101 Firefox/5.0');
curl_setopt ($ch, CURLOPT_REFERER, $refr);
curl_exec($ch);
}
function post2Forum($postUrl, $refr, $data, $ch)
{
curl_setopt ($ch, CURLOPT_URL,$postUrl);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt ($ch, CURLOPT_COOKIEJAR, realpath('cookie.txt')); // cookie.txt
curl_setopt ($ch, CURLOPT_COOKIEFILE, realpath('cookie.txt'));
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i586; de; rv:5.0) Gecko/20100101 Firefox/5.0');
curl_setopt ($ch, CURLOPT_REFERER, $refr);
curl_exec($ch);
return 'Topic Posted';
}
?>