4images Forum & Community

4images Issues / Ausgaben => Installation, Update & Configuration => Topic started by: CBiLL on April 01, 2003, 04:20:11 PM

Title: Direct link to images
Post by: CBiLL 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
Title: Re: Direct link to images
Post by: Chris 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"
Title: Direct link to images
Post by: CBiLL 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
Title: Direct link to images
Post by: V@no 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.
Title: Direct link to images
Post by: CBiLL 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
Title: Direct link to images
Post by: V@no 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}
Title: Direct link to images
Post by: CBiLL 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
Title: Direct link to images
Post by: V@no 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)))),
Title: Direct link to images
Post by: CBiLL on April 02, 2003, 08:30:29 PM
Still same thing .. showing the string after the extention  :(

Bill
Title: Direct link to images
Post by: CBiLL 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
Title: Direct link to images
Post by: V@no on April 02, 2003, 11:49:29 PM
strange, it works just fine for me...
anyone else valuntier to play with regular expressions? ;)
Title: Direct link to images
Post by: CBiLL 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
Title: Direct link to images
Post by: V@no 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))))),
Title: Direct link to images
Post by: CBiLL 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
Title: Direct link to images
Post by: CBiLL 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.
Title: Direct link to images
Post by: TedAppleberry on April 07, 2003, 06:02:48 AM
Quote from: CBiLL
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

Heh, I like that. Anyway to enable this only for special accounts? I disabled the right click feature but am now getting linked to from all over the place. I hate that.
Title: Direct link to images
Post by: V@no on April 07, 2003, 06:27:00 AM
Quote from: TedAppleberry
Heh, I like that. Anyway to enable this only for special accounts? I disabled the right click feature but am now getting linked to from all over the place. I hate that.

only if u create new field in the USERS_TABLE in the database...
but also, u can try use this:
Code: [Select]
     "image_path" => ($download_image) ? $site_sess->url($script_url.(preg_replace("/(\?.*)/", "", str_replace("./", "/", $media_src)))) : "",
that will show the link only where "download" is alowed
Title: Re: Direct link to images
Post by: michi-w. on April 11, 2005, 01:45:15 AM
Code: [Select]
"image_path" => $site_sess->url($script_url.(str_replace("./", "/",$media_src))),Very well, path works with jpg ending is indicated. 

Could I receive also for the Thumbnail path
Ask

I would like, which is indicated in such a way it.
Code: [Select]
[url=http://www.web-upload.de/data/media/54/upload.jpg][img]http://www.web-upload.de/data/thumbnails/54/thumbnail.jpg[/img][/url]
So far, so well
Code: [Select]
[url={image_path}][img]http://www.web-upload.de/data/thumbnails/54/thumbnail.jpg[/img][/url]

Gruß
michi-w.
Title: Re: Direct link to images
Post by: michi-w. on April 13, 2005, 11:36:52 AM
Code: [Select]
[url={image_path}][img]http://www.web-upload.de/data/thumbnails/{cat_id}/{thumbnail_file_name}[/img][/url]
Title: Re: Direct link to images
Post by: michi-w. on May 09, 2005, 05:12:01 PM
A little problem:

{image_path}

The path becomes Internet Explorer of direct path, but by the Firefox is it the session id path. I wont by the Firefox the direct path, too.

Gruß
michi-w.
Title: Re: Direct link to images
Post by: michi-w. on May 09, 2005, 08:28:02 PM
only if u create new field in the USERS_TABLE in the database...

Can you make a update.php?

Please!

For the moment make it so, for direct path in details.html

1. open details.php
Code: [Select]
define('ROOT_PATH', './');to
Code: [Select]
define('ROOT_PATH', '');
2. in details.html
http://www.yourdomain.de/{media_src}

Title: Re: Direct link to images
Post by: littleteam on April 17, 2006, 11:21:08 PM
but also, u can try use this:
Code: [Select]
      "image_path" => ($download_image) ? $site_sess->url($script_url.(preg_replace("/(\?.*)/", "", str_replace("./", "/", $media_src)))) : "",that will show the link only where "download" is alowed
ähm .... in which file do I have to make theses changes?
Title: Re: Direct link to images
Post by: V@no on April 18, 2006, 12:40:16 AM
http://www.4homepages.de/forum/index.php?topic=4907.msg20807#msg20807
Title: Re: Direct link to images
Post by: littleteam on April 18, 2006, 10:46:22 AM
thanks
Title: Re: Direct link to images
Post by: Jenn on February 13, 2007, 03:37:00 AM
Is this still good for the new version of 4images? If not, where can I get a mod that does this?

If it does, in the templates, how do I use the image path?
Title: Re: Direct link to images
Post by: CeJay on February 13, 2007, 07:07:54 AM
Is this still good for the new version of 4images? If not, where can I get a mod that does this?

If it does, in the templates, how do I use the image path?
It should as it worked in the last version.
Title: Re: Direct link to images
Post by: Jenn on February 13, 2007, 12:43:27 PM
ok, try this:

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

I'm a bit confused on how to use this. When I use this, it just gives the path, thats it. See here I thought it would tur into a clickable copy and paste link for others to use on myspace?
http://www.hellonturf.com/4image/details.php?image_id=16&sessionid=f4eb766b0134f0c7d847547eb0ef360d

Also what code would I edit to make links appear as such:

<style>
.contactTable { width: 300px !important; height: 150px !important; padding: 0px !important; background-image: url('LINK TO IMAGE'); background-attachment: scroll; background-position: center center; background-repeat: no-repeat; background-color: transparent; }
.contactTable table, table.contactTable td { padding: 0px !important; border: 0px; background-color: transparent; background-image: none; }
.contactTable a img { visibility: hidden; border: 0px !important; }
.contactTable a { display: block; height: 28px; width: 115px; }
.contactTable .text { font-size: 1px !important; }
.contactTable .text, .contactTable a, .contactTable img { filter: none !important; }
</style><br><a href=LINK TO SITE='Myspace Layouts'>Myspace Contact Tables</a>

Title: Re: Direct link to images
Post by: michi-w. on February 13, 2007, 01:56:33 PM
ok, try this:
open /includes/functions.php
Find:
Code: [Select]
function get_media_codeone 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.(preg_replace("/(\?.*)/", "", str_replace("./", "/", preg_replace("/(\?.*)/", "",$media_src))))),

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

My functions.php
Code: [Select]
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;
$script_url :!:
and
Code: [Select]
$site_template->register_vars(array(
      "media_src" => $media_src,
      "media_icon" => $media_icon,
      "image_name" => $image_name,
      "image_path" => $site_sess->url($script_url.(preg_replace("/(\?.*)/", "", str_replace("./", "/", preg_replace("/(\?.*)/", "",$media_src))))),

{image_path} in details.html results in  http://www.yoursite.com/4images/data/media/2/3-31-03h.jpg

No
<a href=LINK TO SITE='Myspace Layouts'>Myspace Contact Tables</a>

Yes
<a href="{image_path}" target="_blank" title="">Myspace Contact Tables</a>
Title: Re: Direct link to images
Post by: Jenn on February 13, 2007, 02:16:56 PM
Ok, this is what I have in my functions...

Quote
$site_template->register_vars(array(
      "media_src" => $media_src,
      "media_icon" => $media_icon,
      "image_name" => $image_name,
     "image_path" => $site_sess->url($script_url.(preg_replace("/(\?.*)/", "", str_replace("./", "/", preg_replace("/(\?.*)/", "",$media_src))))),
      "width_height" => $width_height,
      "width" => $width,
      "height" => $height,
      "iptc_info" => $iptc_info,
      "exif_info" => $exif_info
    ));

I have this in my details
Quote
<div align="center">{admin_links}</div>
           
<p><br />
  {endif admin_links} </p>
<p align="center">{image_path}<br />
</p>

I take it I can add the image_path anywhere?

With those in place I still get the same result. Not sure what I am doing wrong...Since this just gives the URL, I'm thinking this is not what I wanted.

I am looking for something that will spit out the code needed to be used on myspace like the code I have listed above. Is this what this mod is for?
Title: Re: Direct link to images
Post by: michi-w. on February 13, 2007, 02:22:10 PM
ok, try this:
open /includes/functions.php
Find:
Code: [Select]
function get_media_codeone line down, in global add $script_url

My functions.php
Code: [Select]
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;
$script_url :!:


 :!:
Code: [Select]
<a href="{image_path}" target="_blank" title="">pic</a> :!:

List? No! The root path of the upload in details.htm

Look
http://www.web-upload.de/details.php?image_id=10
Title: Re: Direct link to images
Post by: Jenn on February 13, 2007, 02:25:22 PM
Yep

Code: [Select]
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;
Title: Re: Direct link to images
Post by: Jenn on February 13, 2007, 02:29:12 PM
Thats why I was thinking or asking if this works with the new version of 4images or not.
Title: Re: Direct link to images
Post by: michi-w. on February 13, 2007, 03:07:40 PM
I dont know, my version is 1.7.3
Title: Re: Direct link to images
Post by: Jenn on February 13, 2007, 04:36:14 PM
Got it working. It was missing a period .

Went through all the code and compared it to others..

Thanks for your help.
Title: Re: Direct link to images
Post by: Jenn on February 14, 2007, 06:00:37 PM
What would the code be that I need to add to the html file for this?

Code: [Select]
<style>
.contactTable { width: 300px !important; height: 150px !important; padding: 0px !important; background-image: url('LINK TO IMAGE'); background-attachment: scroll; background-position: center center; background-repeat: no-repeat; background-color: transparent; }
.contactTable table, table.contactTable td { padding: 0px !important; border: 0px; background-color: transparent; background-image: none; }
.contactTable a img { visibility: hidden; border: 0px !important; }
.contactTable a { display: block; height: 28px; width: 115px; }
.contactTable .text { font-size: 1px !important; }
.contactTable .text, .contactTable a, .contactTable img { filter: none !important; }
</style><br><a href=LINK TO SITE='Myspace Layouts'>Myspace Contact Tables</a>
Title: Re: Direct link to images
Post by: Jenn on March 05, 2007, 10:01:56 PM
I couldnt remember if I asked this or not, looked through my posts and didnt see it. Thought I did but...

Is it possible say I have 10 categories..

On 3 of the categories, it uses a different direct image code then the others.

Can I specify somehow which categories I want to use a certain direct image code then the others?

Does that make sense?

I have seen other sites (not 4images) have this capability and really need to integrate it into mine.

I could always have ALL the codes on each image in every category but it would make the details page junky looking and over run with code.
Title: Re: Direct link to images
Post by: callmefreak on March 24, 2007, 02:00:16 AM
is there anyway to do this for thumbnails?? im really in a rut
Title: Re: Direct link to images
Post by: JCoster on April 29, 2007, 02:04:58 PM
Right.

I'm using this mod and instaed of putting the {image_path} on my details page, I'm putting it on the individual file media extensions page, firstly so that it won't appear for movies (as code is incorrect) and secondly so that it will appear under the image immediately after the user uploads it.

However, one problem: on the page immediately after upload, it shows the path of the random image rather than the path of the image uploaded.

Any advice?

Cheers.
Title: Re: Direct link to images
Post by: JCoster on May 09, 2007, 09:21:31 PM
Still no one?? :(
Title: Re: Direct link to images
Post by: viper357 on October 15, 2009, 12:25:42 AM
Has anybody got this working in 1.7.7?

I've just upgraded and redone the edits but it's not working now.
Title: Re: Direct link to images
Post by: mawenzi on October 15, 2009, 01:02:52 AM
... you can also use [MOD] Display image codes on details page (image permalink) ...
... http://www.4homepages.de/forum/index.php?topic=17912.0 ...
Title: Re: Direct link to images
Post by: viper357 on October 15, 2009, 08:59:52 AM
... you can also use [MOD] Display image codes on details page (image permalink) ...
... http://www.4homepages.de/forum/index.php?topic=17912.0 ...
Thank you  :D