Ok I bought this script and it worked fine until myspace started the profile 2. Now the script works for calling the users profile pic if they are using mprofile 1 but if they have profile 2 it doesn't get the info and posts blank to the database.
I tried getting support from the place I bought it but all they would say is check back for an update. That was almost a year ago and they still don't have a fix.
Anyone know how to make this call either picture?
<?
include("config.php");
include("header.php");
if (isset($_POST['submit'])) {
if ($_POST['name'] == "dddddd") {
echo "<B>An error has occured - You did not enter a valid name</B>";
exit;
}
if ($_POST['id'] == "") {
echo "<B>An error has occured - You did not enter your Friend ID</B>";
exit;
}
if (!is_numeric($_POST['id'])) {
$check = file_get_contents("http://profile.myspace.com/".$_POST['id']);
$pattern ="/addfriend_verify&friendID=(.*?)&MyToken/";
preg_match($pattern, $check, $match);
$id = $match[1];
} else {
$id = $_POST['id'];
$check = file_get_contents("http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=".$_POST['id']);
// $ch=curl_init();
// $url = "http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=".$_POST['id'];
// curl_setopt($ch, CURLOPT_URL, $url);
// curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
// $check = curl_exec ($ch);
// curl_close ($ch);
}
$check = str_replace("\n","",$check);
$check = str_replace("\r","",$check);
//echo $check;
if (strstr(strtolower($check),"invalid friend")) {
echo "<B>An error has occured - The Friend ID you entered was invalid</B>";
echo '<BR><BR><a href="index.php">Go back to the train!</a>';
exit;
}
// extract the picture
$pattern ="/UserBasicInformation1_hlDefaultImage(.*?)<img.*? src=\"(.*?)\"/";
preg_match($pattern, $check, $match);
$pic = $match[2];
//echo "pic = $pic";
mysql_connect($mysql['server'],$mysql['user'],$mysql['pass']);
mysql_select_db($mysql['db']);
mysql_query("SELECT * FROM `sticky`");
$total = mysql_affected_rows();
mysql_query("SELECT * FROM `train`");
$total = $total + mysql_affected_rows();
if ($total == $config['riders']) {
mysql_query("TRUNCATE TABLE `train`");
$new_round = $config['round'] + 1;
mysql_query("UPDATE `config` SET `value` = '".$new_round."' WHERE `varible` = 'round'");
}
else
{
if ($total > $config['riders']) {
mysql_query("TRUNCATE TABLE `train`");
$new_round = $config['round'] + 1;
mysql_query("UPDATE `config` SET `value` = '".$new_round."' WHERE `varible` = 'round'");
}
}
mysql_query("SELECT * FROM `train` WHERE `id` = '".$id."'");
if (!mysql_affected_rows()) {
mysql_query("INSERT INTO `train` VALUES('".time()."','".addslashes($_POST['name'])."','".$id."','".$pic."')");
}
else
{
echo "<B>Sorry, but you can only jump the train once! Please wait for the next round to jump on it again!</B>";
echo '<BR><BR><a href="index.php">Go back to the train!</a>';
mysql_close();
exit;
}
mysql_close();
}
?>
<b>You have successfully jumped the train!</b><br><br>
<form name='bulletinForm' target='_blank' action='http://bulletin.myspace.com/index.cfm?fuseaction=bulletin.confirm#OnlineNowBuffer' method='post'>
<input name='groupID' value='0' type='hidden'>
<input name='subject' value='<?=stripslashes($config['bulletin_subject'])?>' type='hidden'>
<textarea name='body'><?=stripslashes($config['bulletin'])?></textarea><BR>
<input value='Click Here to Post a Bulletin' name='submit' type='submit'>
</form><BR><BR>
<a href="index.php">Go back to the train!</a>
<? include("footer.php"); ?>