Quote:
Originally Posted by KirbyDE
Instead of $botuserid and $botusername use $bbuserinfo[userid] and $bbuserinfo[username].
And I wonder why this hack re-invents the wheel instead of just using build_new_post()?
PHP Code:
$forumid = 1; // forumid in which to post
// Get forum info
$foruminfo = fetch_foruminfo($forumid, false);
// Prepare the thread ...
$post[title] = "[".date($dateformat, $dateline_from)."] ".$title;
$post[poststarttime] = TIMENOW;
$post[posthash] = md5($post[poststarttime] . $bbuserinfo['userid'] . $bbuserinfo['salt']);
$post[message] = "This is an automatically generated thread for the event [b]".$title."[/b].
More information on this event is available on [url=".$vboptions['bburl']."/calendar.php?".$session[sessionurl]."do=getinfo&e=".$eventid."&day=".date("Y-n-j")."&c=".$calendarid."]this page[/url].";
$post[username] = $bbuserinfo[userid];
$post[iconid] = 0;
$post[emailupdate] = 9999;
// ... and create it
require_once('./includes/functions_newpost.php');
build_new_post('thread', $foruminfo, array(), 0, $post, $errors);
If you want to be fully flexible, one could make the text as a phrase, forum ID and date format string as a setting 
|
I have public and private events and if the event is public I want it to be posted into the public forum. If it is a private event I want it to be posted into the proivate forum. Is this able to be done?