Author Topic: Direct link to images  (Read 52456 times)

0 Members and 1 Guest are viewing this topic.

Offline CBiLL

  • Newbie
  • *
  • Posts: 11
    • View Profile
Direct link to images
« on: April 01, 2003, 04:20:11 PM »
I am looking for a Galley site that allow my members to upload images and offer them a direct links to thier images to links them in forums.

I installed 4Images and it working great but I can't firgue out how to get a direct link to the image itself ie http://www.yoursite.com/4images/member?/image.jpg or something like that so they can post the image link in forum and only images would show up in the forum. I don't want the entire page to show up.

Is there a setting or something allowing members to link only images from 4Image Galley to thier forum or websites?

Also is there a setting to prevent anyone outside of domain name to link images at other sites?

Thank you
CBiLL

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Re: Direct link to images
« Reply #1 on: April 01, 2003, 04:40:53 PM »
Quote from: CBiLL
I installed 4Images and it working great but I can't firgue out how to get a direct link to the image itself ie http://www.yoursite.com/4images/member?/image.jpg or something like that so they can post the image link in forum and only images would show up in the forum. I don't want the entire page to show up.

The link would be:
/4images/data/media/category id number/image file name

Example:
/4images/data/media/2/sample.jpg

This requires the user take note of the category id number which might prove difficult for some.
Quote from: CBiLL

Is there a setting or something allowing members to link only images from 4Image Galley to thier forum or websites?

Search the forums for "htaccess"

Offline CBiLL

  • Newbie
  • *
  • Posts: 11
    • View Profile
Direct link to images
« Reply #2 on: April 01, 2003, 04:47:56 PM »
Can anyone write a small hack for me that will display like a full link or path to images under the actual images they are viewing to be able to copy and paste it in the forum from?

Something like this

IMAGE DISPLAY HERE



This Image path is at
Quote
http://www.yoursite.com/4images/data/media/2/sample.jpg


So member can see the path box and copy paste from the path box .. I think this should be a fairly simple hack.

Will be a great addition to 4Image and have it enable / disable or viewable only by members settings etc etc

CBiLL

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Direct link to images
« Reply #3 on: April 02, 2003, 12:18:58 AM »
also, u can use download button.
 if u didnt disable right click (by default its disabled), then just right click on download button and do "copy shortcut".
I dont know how this will work in others browsers then IE, but it works fine for me.
this way it also protect your site, by hiding actual path to the files.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline CBiLL

  • Newbie
  • *
  • Posts: 11
    • View Profile
Direct link to images
« Reply #4 on: April 02, 2003, 02:37:47 PM »
How do you disable or enable the right click feature on 4Images? I looked and can't see to find the setting for it.

Also I don't care providing a direct image link to the images since the main reason I am installing a photo galley is to provide member on my host a image storage place to be able to link images on thier post or whatever they wish to use it for.

I still would like to have some kind of message under the image where it display the full path ie http://www.yoursite.com/whereisimage/2/image.jpg  so member can copy and past the path in elsewhere ie forums IMG tags etc etc ..

Can anyone provide me a simple hack to have image path displayed?


Thank you

Bill

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Direct link to images
« Reply #5 on: April 02, 2003, 02:59:12 PM »
ok, try this:
open /includes/functions.php
Find:
Code: [Select]
function get_media_code
one line down, in global add $script_url
then find:
Code: [Select]
     "image_name" => $image_name,
add after:
Code: [Select]
     "image_path" => $site_sess->url($script_url.(str_replace("./", "/",$media_src))),

then in /templates/<yourtemplate>/details.html u can use {image_path}
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline CBiLL

  • Newbie
  • *
  • Posts: 11
    • View Profile
Direct link to images
« Reply #6 on: April 02, 2003, 07:28:26 PM »
Wow it works great and almost there ... I love it.. but one thing .. is there a way to get rid of the remaning strings after the file extention displayed?

here an example what it's displaying now
Quote
http://www.yoursite.com/4images/data/media/2/3-31-03h.jpg?s=5dac2660fb96f5d224b77e325853750d


is there a way to code it so it does not show the
Quote
?s=5dac2660fb96f5d224b77e325853750d

after the .jpg extention?

So it would only show
Quote
http://www.yoursite.com/4images/data/media/2/3-31-03h.jpg



But it what I am looking for and I am very happy with it .. it just I wish the string after the .jpg doesn't show up .. I have members who wouldn't understand not to copy and paste the string after the .jpg ...

Thank for the great work .. hope you can give me an answer to correct that remaining little issue.

Bill

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Direct link to images
« Reply #7 on: April 02, 2003, 08:02:27 PM »
try change:
Code: [Select]
     "image_path" => $site_sess->url($script_url.(str_replace("./", "/",$media_src))),
to this:
Code: [Select]
     "image_path" => $site_sess->url($script_url.(preg_replace("/(\?.*)/", "", str_replace("./", "/", $media_src)))),
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline CBiLL

  • Newbie
  • *
  • Posts: 11
    • View Profile
Direct link to images
« Reply #8 on: April 02, 2003, 08:30:29 PM »
Still same thing .. showing the string after the extention  :(

Bill

Offline CBiLL

  • Newbie
  • *
  • Posts: 11
    • View Profile
Direct link to images
« Reply #9 on: April 02, 2003, 10:46:15 PM »
If your curious what it look like .. go to

http://www.findmall.com/4images/details.php?image_id=11&s=77bfbb48322980407817e0907a050cd4

and look under the lightbox / download icon


I still would like to try to get rid of the string after the filename extention.

Bill

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Direct link to images
« Reply #10 on: April 02, 2003, 11:49:29 PM »
strange, it works just fine for me...
anyone else valuntier to play with regular expressions? ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline CBiLL

  • Newbie
  • *
  • Posts: 11
    • View Profile
Direct link to images
« Reply #11 on: April 03, 2003, 02:38:33 PM »
Quote
ok, try this:
open /includes/functions.php
Find: Code:
function get_media_code

one line down, in global add $script_url
then find: Code:
      "image_name" => $image_name,

add after: Code:
      "image_path" => $site_sess->url($script_url.(str_replace("./", "/",$media_src))),


then in /templates/<yourtemplate>/details.html u can use {image_path}


Ok done all that and still same thing .. string appearing after the file extentions.  

So next thing I did is

Quote
try change: Code:
      "image_path" => $site_sess->url($script_url.(str_replace("./", "/",$media_src))),

to this: Code:
      "image_path" => $site_sess->url($script_url.(preg_replace("/(\?.*)/", "", str_replace("./", "/", $media_src)))),





Here what I have edited so far ..




Quote

}

function get_media_code($media_file_name, $image_id = 0, $cat_id = 0, $image_name = "", $mode = "", $show_link = 0, $detailed_view = 0) {
  global $site_template, $site_sess, $lang, $mode, $script_url;



And also this

Quote

"media_icon" => $media_icon,
      "image_name" => $image_name,
      "image_path" => $site_sess->url($script_url.(preg_replace("/(\?.*)/", "", str_replace("./", "/", $media_src)))),
      "width_height" => $width_height,
      "width" => $width,
      "height" => $height,



I am still getting the strings after the file extentions .. You said it working for you? Are you saying it working on your host or your not seeing the strings after the filename extention at my link above I provided?


Bill

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Direct link to images
« Reply #12 on: April 03, 2003, 03:22:47 PM »
just a thought:
is your 4images integrated with some board?
what is that "s=sdfsadfsdf" ?
I never get this, I know that this shows on vBulletine board.
maybe in this query is in $media_src, not in $script_url...
anyway, lets try one more shot ;)
again change:
Code: [Select]
"image_path" => $site_sess->url($script_url.(preg_replace("/(\?.*)/", "", str_replace("./", "/", $media_src)))),
to this:
Code: [Select]
"image_path" => $site_sess->url($script_url.(preg_replace("/(\?.*)/", "", str_replace("./", "/", preg_replace("/(\?.*)/", "",$media_src))))),
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline CBiLL

  • Newbie
  • *
  • Posts: 11
    • View Profile
Direct link to images
« Reply #13 on: April 03, 2003, 03:43:13 PM »
Quote

just a thought:
is your 4images integrated with some board?
what is that "s=sdfsadfsdf" ?
I never get this, I know that this shows on vBulletine board.
maybe in this query is in $media_src, not in $script_url...



Yes It's integrated with Invisionboard sharing the same member database instead of having them register twice.  So is that what causing all those extra string then?

If that the case then ..  :?  is there a way to fix it or I need to remove the integrate hack from 4Images and ask my members to register at both the board and the 4Images? .. I just hate having to have more than 1 member database when I can share them all among to 1 database is why I am doing this..

 8O


Hopefully there a way around to it.

Bill

Offline CBiLL

  • Newbie
  • *
  • Posts: 11
    • View Profile
Direct link to images
« Reply #14 on: April 03, 2003, 03:43:31 PM »
I don't know why it posted it twice ..

Deleted duplicate post this one since it posted my posting twice.