2010-04-10, 06:57 PM
Hey there. This isn't really MyBB related but I really need some help. I found this script that you can see below:
What I want to do is make it so when someone posts their Twitter Username in a Form, it will take that data and put it in the $twittername form. Can someone please help me with this?
I would also like it to change the file name to the person's name so that it doesn't get confused when there are multiple people using it.
<?php
// Your Twitter username.
$twittername = "";
$xml = simplexml_load_file("http://twitter.com/statuses/user_timeline/".$twittername.".rss?count=1");
$updated = strtotime($xml->channel->item->pubDate);
$updated = date("M d, Y, h:i a", $updated);
$tweet = str_replace($twittername.": ", "", $xml->channel->item->description);
$t = wordwrap($tweet, 60, "|");
$output = explode("|", $t);
// create image
$im = imagecreatefromjpeg("twitter.jpg");
// The color of your twitter username.
$username_color = imagecolorallocate($im, 180, 0, 0);
// The color of the date.
$date_color = imagecolorallocate($im, 120, 120, 120);
// The color of your tweet.
$tweet_color = imagecolorallocate($im, 0, 0, 0);
// Font to use.
$font = "arial.ttf";
imagettftext($im, 10, 0, 90, 18, $username_color, $font, $twittername);
imagettftext($im, 10, 0, 250, 18, $date_color, $font, $updated);
$y = 25; // Y position of the first line of your tweet.
foreach($output as $text) {
$y = $y + 15;
imagettftext($im, 10, 0, 10, $y, $tweet_color, $font, $text);
}
// output the image
header("Content-type: image/png");
imagepng($im);
?>
What I want to do is make it so when someone posts their Twitter Username in a Form, it will take that data and put it in the $twittername form. Can someone please help me with this?
I would also like it to change the file name to the person's name so that it doesn't get confused when there are multiple people using it.