1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

GET PAID $ Need someone to fix an easy problem.

Discussion in 'PHP' started by bonkerbids, Aug 18, 2007.

  1. #1
    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
     
    bonkerbids, Aug 18, 2007 IP
  2. sea otter

    sea otter Peon

    Messages:
    250
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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.
     
    sea otter, Aug 18, 2007 IP
  3. vipmoney

    vipmoney Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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, Aug 18, 2007 IP
  4. bonkerbids

    bonkerbids Active Member

    Messages:
    986
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    80
    #4
    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.
     
    bonkerbids, Aug 19, 2007 IP
  5. sea otter

    sea otter Peon

    Messages:
    250
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Um...the code vipmoney posted has absolutely nothing to do with your problem, but good luck with that :)
     
    sea otter, Aug 19, 2007 IP
    bonkerbids likes this.
  6. vipmoney

    vipmoney Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    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, Aug 19, 2007 IP
  7. sea otter

    sea otter Peon

    Messages:
    250
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #7
    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 :)
     
    sea otter, Aug 19, 2007 IP
  8. bonkerbids

    bonkerbids Active Member

    Messages:
    986
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    80
    #8
    so can either of you make this work, I can pay.
     
    bonkerbids, Aug 20, 2007 IP
  9. zerotolerance

    zerotolerance Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    send me a PM please.
     
    zerotolerance, Aug 20, 2007 IP
  10. sea otter

    sea otter Peon

    Messages:
    250
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #10
    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, Aug 20, 2007 IP
  11. bonkerbids

    bonkerbids Active Member

    Messages:
    986
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    80
    #11
    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.
     
    bonkerbids, Aug 24, 2007 IP
    sea otter likes this.
  12. vipmoney

    vipmoney Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Nice job ;)
     
    vipmoney, Aug 24, 2007 IP
  13. sea otter

    sea otter Peon

    Messages:
    250
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Thanks bonkerbids, it was a pleasure.
     
    sea otter, Aug 25, 2007 IP