Hello GoForum is a free mod that allows certain forums to link to InterActive Tools "Article Manager" I would like to use but it only works with UBB5. Here is part of the script... would any Perl expert help me modify it? So it works with UBB6?
<pre>
# ----------------------------------------------------------------------------
# Function : post_ubbclassic5
# Description : login to ubbclassic 5.x+ and create a new thread
# Usage : &post_ubbclassic5($subject,$message);
# ----------------------------------------------------------------------------
sub post_ubbclassic5 {
my($forum_subj,$forum_body) = @_;
my($url, $headers, $postdata, $head, $html, $cookie);
unless ($g{'forum_num'} && $g{'forum_board'}) { die "Error: both forum_num and form_board must be specified for UBB Classic!"; }
### Login and create new thread in one step
$url = "$g{'forum_url'}/postings.cgi";
$headers = { 'Cookie' => $cookie, };
my $postdata= {
# login data
'UserName' => $g{'forum_user'},
'Password' => $g{'forum_pass'},
# message metadata
'number' => $g{'forum_num'},
'forum' => $g{'forum_board'},
'MsgIcon' => '1',
# message data
'TopicSubject' => $forum_subj,
'Message' => $forum_body,
# other
'Submit' => 'Submit New Topic',
'action' => 'posttopic',
};
($head, $html) = &GetPage($url, $headers, $postdata);
if ($g{'debug'}) { print "<h1>Server response to new thread request<hr></h1>$head$html"; }
# Check for errors
if ($head !~ m|^HTTP/d+.d+ 200|i) { die "Error logging in to forum. No 200 response code!n"; }
if ($html =~ /no one registered with the UserName/i) { die "Error logging in, invalid username."; }
if ($html =~ /password you entered was not correct/i) { die "Error logging in, invalid password."; }
if ($html !~ /Thanks for posting your message/i) { die "Error creating thread in forum!"; }
### Display forum and "guess" that first message matching our subject is us
$url = "$g{'forum_url'}/forumdisplay.cgi?action=topics&number=$g{'forum_num'}";
$headers = { 'Cookie' => $cookie, };
($head, $html) = &GetPage($url, $headers);
if ($g{'debug'}) { print "<h1>Server response to forum list request<hr></h1>$head$html"; }
# get URL out of results page
my $thread_url;
if ($html =~ m|<a href="([^">]+)">Q$forum_subjE</a>|i) { $thread_url = $1; }
# Check for errors
if ($head !~ m|^HTTP/d+.d+ 200|i) { die "Error logging in to forum. No 200 response code!n"; }
if (!$thread_url) { die "Error parsing story thread URL. Unable to redirect."; }
# and we're done, return URL
return $thread_url;
}
</pre>