PHP Code:
<?php
// include backend
require_once('global.php');
// input
$name = $_GET['name'];
$lat = $_GET['lat'];
$lon = $_GET['lon'];
$uid = intval($_GET['uid']);
$gid = $_GET['gid'];
$desc = $_GET['desc'];
$phone = $_GET['phone'];
$addr = $_GET['addr'];
$addr2 = $_GET['addr2'];
$city = $_GET['city'];
$state = $_GET['state'];
$zip = $_GET['zip'];
$cat = $_GET['cat'];
// fetch userinfo
if (!$userinfo = fetch_userinfo($uid))
{
die("Invalid User!");
}
// initialize datamanager
$threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
// set data
$threaddm->set('forumid', 57);
$threaddm->set('userid', $userinfo['userid']);
$threaddm->set('username', $userinfo['username']);
$threaddm->set('postuserid', $userinfo['userid']);
$threaddm->set('postusername', $userinfo['username']);
$threaddm->set('title', 'Some Title');
$threaddm->set('pagetext', $desc);
$threaddm->set('open', 1);
$threaddm->set('allowsmilie', 1);
$threaddm->set('visible', 1);
// error checks
$threaddm->pre_save();
if (!empty($threaddm->errors))
{
die("An Error Occurred!");
}
// save
$threadid = $threaddm->save();
unset($threaddm);
// rebuild caches
require_once('includes/functions_databuild.php');
build_thread_counters($threadid);
build_forum_counters(57);
?>
@toucan42: Threads were merged, please don't create multiple threads.