Hi, I need a php coder to fix a problem I am having at my myspace train website. Please take a look at WhoreTrainz.com. You can see that all the train riders images do not show up. It is supposed to pull the myspace users profile image and display it. Due to a myspace code update it is not working anymore, If you think you can fix this problem for a reasonable price, please PM me when you are available and how much it will cost. Thank you, Brian
Interesting...if I go to a myspace user's page and copy their image URL and paste it in the browser address bar, the image won't display -- I'm redirected to the myspace homepage. I'm *guessing* that they now do some kind of referrer checking to see if the request came from their own servers or not (good old-fashioned anti-hotlinking protection). It's easy to set the referrer header (I assume you're using CURL to pull the pages), but they might also be checking by IP (or IP range) as well.
You can use an image manipulation script... like a watermark script, but without inserting a watermark. This kind of scripts, will download the original image and change it (or not) being seen directly from your server. Example: <?php $imagesource = "path to the original image"; $filetype = substr($imagesource,strlen($imagesource)-4,4); $filetype = strtolower($filetype); if($filetype == ".gif") $image = @imagecreatefromgif($imagesource); if($filetype == ".jpg") $image = @imagecreatefromjpeg($imagesource); if($filetype == ".png") $image = @imagecreatefrompng($imagesource); //if (!$image) die(); if (!$image) $image = @imagecreatefrompng($imagesource); $watermark = @imagecreatefromgif('path to a transparent image GIF with the exact same size of the original'); $imagewidth = imagesx($image); $imageheight = imagesy($image); $watermarkwidth = imagesx($watermark); $watermarkheight = imagesy($watermark); $startwidth = (($imagewidth - $watermarkwidth)/1); $startheight = (($imageheight - $watermarkheight)/20000); imagecopy($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight); imagepng($image); imagedestroy($image); imagedestroy($watermark); ?> PHP: This worked for me when I had a similar problem
vipmoney, is this something you think you could fix, I am no coder and wouldn't know where to add the code you have supplied.
Um...the code vipmoney posted has absolutely nothing to do with your problem, but good luck with that
Why do you say so ? I posted that code, based on your assumption that the problem is to load images from an outside URL, this code will solve that specific problem, creating a new image on his own server. This code can be used on a new file, for example newimage.php, using for example the users id with GET inside the ouside images url. Bonkerbids, looking to your website again the train riders images do not show up, but the links also go to some «unknown» page. How do you get these links ? and how do you post it in your website ? This should be simple.
vipmoney, while writing up an answer here to your last post I did a little more poking... It seems that the image is displayed within a url. Trying to "view" the image by clicking on it or loading/copying that url, which is in the form http://viewmorepics.myspace.com/index.cfm?fuseaction=user.viewAlbums&friendID=XXXXXX Code (markup): will cause a redirect to the myspace homepage. HOWEVER... the *content* of the url is actually an IMG tag, with the src attribute in the form of: http://a323.ac-images.myspacecdn.com/images01/73/m_8d49747a5a982b300d524d4280c1e212.gif Code (markup): The domain "myspacecdn" seems to indicate that they're now using a content distribution network (cdn) to spread the load. However, I have no idea how to correlate the subdomains, directory names and image name to the profile. It seems like the thing to do is load the entire page (via curl, file_get_contents or whatever), locate the href containing the link from the first code snippet, and then use the actual img tag src attribute embedded therein to retrieve a viewable image. Just some tedious parsing, but nothing impossible. After all, that's what computers do best(!) So...thanks for making me revisit this. It seems like we were both right
bonkerbids, I'm sure I could fix it, but...I'm working on some similar scripts. One in particular doesn't have a friend adder feature yet but is going to. Just a matter of time until I can get to it. Therefore, probably not a good idea for me to see your code, lest you then wonder if it ended up in my project. This is why I posted my findings for you here in the thread rather than via PM.
sea otter got the job done! Thanks for the excellent work. Payment sent with a bonus! I would recommend using sea otter if you have something that needs worked on. job is done so no more pm's please.