Custom JPG Links, forcing them to open in with a banner/link

Discussion in 'Programming' started by kissmyarse, Sep 5, 2009.

  1. #1
    Hullo all,

    I have a few thousand galleries on my site, all the thumbnails in which link directly to a larger version of the image.

    I'd like to know if it's possible to have them open in a page, with a banner or text link above? Rather than me having to create those pages I figured it could *possibly* done via a change to my htaccess, or a bit of php?

    I've seen other sites do it, the link points to http://www.site.com/image.jpeg, but the link opens a very simple page, showing the image and 1 banner.

    Any pointers? Tips? Links?

    Thanks,
    kma
     
    kissmyarse, Sep 5, 2009 IP
  2. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You'll want to use mod_rewrite (.htaccess) to redirect all jpegs in sertain folders to a php script, which then generates a simple html page, with an <img> tag displaying the original image. The trick is to use the referer to determine when to display the image, and when to display the html page.
     
    matthewrobertbell, Sep 6, 2009 IP
  3. kissmyarse

    kissmyarse Peon

    Messages:
    100
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Cheers Matt, I thought I was close with my rewrite assumption. That clarifies it nicely.

    Cheers,
    kma
     
    kissmyarse, Sep 7, 2009 IP