@ buro9
I fixed it.
I am using the following classes:
http://code.google.com/p/bitly/
http://twitter.slawcup.com/twitter.class.phps
My vbulletin plugin becomes:
PHP Code:
$excludedForums = array(0);
if (!in_array($foruminfo[forumid], $excludedForums)) {
$shortUrl = 'http://www.yourforumsdomain.com/showthread.php?t='.$newpost[threadid];
include 'BitLy.php';
$bitly = new Bitly('<bit.ly username>', '<bit.ly API key>');
$shortUrl = $bitly->shortenSingle($shortUrl);
$tweet = '';
if (isset($newpost['prefixid']) && $newpost['prefixid'] != '') {
$tweet = $vbphrase['prefix_'.$newpost['prefixid'].'_title_plain'].' ';
}
$tweet .= $newpost['title'].' '.$shortUrl;
include 'twitter.php';
$t= new twitter();
$t->username='twitter username';
$t->password='twitter password';
$t->update($tweet);
}