Jump to content

[SOLVED] Image Retrieval Problems from another site.


Code E

Recommended Posts

I Purchased a MySpace Friend Adder Template back in May from another forum and it has been working fine until this last week.  Suddenly the images are not updating from myspace when you click :update:  or when you join.  I am a total noob to PHP, but i am assuming that the code has changed.  Can someone please help me figure this out?  ::)  The site is www.ineedmorefriends.com.  If you wanted to login and check it out, I can delete you from the database later.  Thanks for your time and I hope you can help!

 

 

:MYSPACE DEFAULT IMAGE CODE:

 
<a id="ctl00_Main_ctl00_UserBasicInformation1_hlDefaultImage" href="http://viewmorepics.myspace.com/index.cfm?fuseaction=user.viewAlbums&friendID=215056822">

<img border="0" alt="" src="http://a769.ac-images.myspacecdn.com/images01/92/m_a4a430f54c318ef1aa377a51c43878a8.jpg" />
				    </a>

 

 

THIS IS MY "UPDATE PAGE" CODE:

$page=file_get_contents(PROFILE_VIEW . $id);

ereg('<span class="nametext">(.*)</span><br />', $page, $resultDname);

$dname=$resultDname[1];

$u="http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=$id";
$t = join("",file("$u"));
$r = '/ctl00_Main_ctl00_UserBasicInformation1_hlDefaultImage" .*?"><img border="0" alt="" src="(.*?)"/';
$t = ereg_replace("\n", "", $t);

preg_match_all($r, $t, $m);

preg_match("/<a(.*) id=\"ctl00_Main_ctl00_UserBasicInformation1_hlDefaultImage\" href=\"(.*)\"><img(.*) src=\"(.*?)\" (.*)\/>/",$page,$match);
$img=$match[4];
		preg_match("/<span class=\"nametext\".*>?<\/span>/is",$page,$match_name);
		$subname    = substr($match_name[0],0,200);
		$name       = strip_tags($subname,"<span>");
		$name = trim($name);
                        $subname    = substr($name,0,200);
                        $name       = strip_tags($subname,"</span>");
                        $name = trim($name);
		$len_name   = strlen($name);
		$name_final = substr($name,23,($len_name-30));
$query = "UPDATE fc_users SET image='$img', dname='$name_final' WHERE fid='$id'";
mysql_query($query);

} ELSE {

echo '<font face="verdana" size="2">You are not logged in!</a>';
}
Header('Location: '.$url.'index.php');
?>

 

 

THIS IS SOME CODE FROM THE FUNCTIONS PAGE WITH MORE DEFINITIONS:

$page=file_get_contents(PROFILE_VIEW . $id);
ereg('<span class="nametext">(.*)</span><br />', $page, $resultDname);
$dname=$resultDname[1];

$u="http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=$id";
$t = join("",file("$u"));

$r = '/ctl00_Main_ctl00_UserBasicInformation1_hlDefaultImage" .*?"><img border="0" alt="" src="(.*?)"/';
$t = ereg_replace("\n", "", $t);
preg_match_all($r, $t, $m);

$img=$m[1][0];

$query = "INSERT INTO fc_users VALUES ('','$id','$dname','','','','','','','','$img','','','','')";
mysql_query($query) or die(mysql_error());

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.