Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1] 2 3 4   Go Down

Author Topic: Generate a link to the picture automaticly for copy paste.  (Read 97062 times)

0 Members and 1 Guest are viewing this topic.

postcarduniverse

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Generate a link to the picture automaticly for copy paste.
« on: January 14, 2004, 11:53:28 am »

Is there a way that when I upload a picture that there is a http link under the picture?

So I can copy paste the link in the webbrowser so I can see the picture?

It must go automaticly! I don't want to use the right mouse button and copy the link there.
« Last Edit: March 20, 2005, 04:13:05 am by TranzNDance »
Logged

MaThIbUs

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
  • I rock.
    • http://mathibus.com/
Generate a link to the picture automaticly for copy paste.
« Reply #1 on: January 14, 2004, 08:28:15 pm »

[size=24]NOTE: this is NOT tested! Back up your files first![/size]

{search for}
Code: [Select]
   // Create the absolute URL for display in info
    $info['URL'] = '<a href=' . $CONFIG["ecards_more_pic_target"] . '/' . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . ' >' . $CONFIG["ecards_more_pic_target"] . '/' . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '</a>';
    // with subdomains the variable is $_SERVER["SERVER_NAME"] does not return the right value instead of using a new config variable I reused $CONFIG["ecards_more_pic_target"] no trailing slash in the configure


{add under}

Code: [Select]
   // Create the image link for display in info
    $info['link'] = $picture_url;


Let me know if it worked by posting here :)

/m_aTh!bUs
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Generate a link to the picture automaticly for copy paste.
« Reply #2 on: January 14, 2004, 10:40:24 pm »

I'm a bit confused: I always thought that there is a link underneath each picture with the actual url in the pic info section.
Please enlighten me.

GauGau
Logged

MaThIbUs

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
  • I rock.
    • http://mathibus.com/
Generate a link to the picture automaticly for copy paste.
« Reply #3 on: January 15, 2004, 09:54:04 am »

I think he doesn't mean this url (http://coppermine.sourceforge.net/demo/displayimage.php?pos=-1) but this url:

http://coppermine.sourceforge.net/demo/albums/food/fruit/761_O.jpg

..so the direct link to the image file actually.

/m_aTh!bUs
Logged

KrazyK

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Image URL
« Reply #4 on: January 20, 2004, 05:28:48 am »

I wanted to allow people posting pictures to hotlink their images on bulletin boards and forums, so i added the following code where Mathibus suggested:
Code: [Select]

    // Create the image link for display in info
    $info['Link'] = "http://".($_SERVER['SERVER_NAME'])."/".$path_to_pic;



This would make a good feature in the next version.

-Kev
Santa Barbara, CA
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Generate a link to the picture automaticly for copy paste.
« Reply #5 on: January 20, 2004, 05:47:41 am »

usually people don't want their pics to be hotlinked at all and request features to make hotlinking impossible.
Will definitely not go into a future version - most users would hate us for such a feature... :wink:

GauGau
Logged

MaThIbUs

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
  • I rock.
    • http://mathibus.com/
Generate a link to the picture automaticly for copy paste.
« Reply #6 on: January 20, 2004, 04:52:41 pm »

:) indeed!

You might want to use the bbCode mod to 'put images on bulletin boards and forums' though, which outputs bbCode and is preferably used with the thumbnail...
Logged

jeremed

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Generate a link to the picture automaticly for copy paste.
« Reply #7 on: January 21, 2004, 02:49:27 am »

Quote from: "MaThIbUs"
:) indeed!

You might want to use the bbCode mod to 'put images on bulletin boards and forums' though, which outputs bbCode and is preferably used with the thumbnail...


I use this and it works great. The images that I have are meant to be used on forums so it's amusing to look through the logs and see all of the places that people are using my images.
Logged

CBiLL

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Generate a link to the picture automaticly for copy paste.
« Reply #8 on: January 23, 2004, 11:16:05 pm »

Quote
{add under}

Code:
    // Create the image link for display in info
    $info['link'] = $picture_url;


This didn't work for me however the second mod code posted

Quote

// Create the image link for display in info
    $info['Link'] = "http://".($_SERVER['SERVER_NAME'])."/".$path_to_pic;



But I had to change the

NAME'])."/".$path_to_pic;

to

NAME'])."/gallery/".$path_to_pic;

to get the link correct because I have my coppermine in it own folder named /gallery/ and it woudn't show up in the link at all unless I added the /gallery/ to the code ..



However I am wondering if there a code to make the whole path clickable link to image?


Thanks

Bill
Logged

MaThIbUs

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
  • I rock.
    • http://mathibus.com/
Generate a link to the picture automaticly for copy paste.
« Reply #9 on: January 24, 2004, 12:34:43 pm »

Code: [Select]
// Create the image link for display in info
    $info['Link'] = <a href=\".http://".($_SERVER['SERVER_NAME'])."/gallery/".$path_to_pic\">http://".($_SERVER['SERVER_NAME'])."/gallery/".$path_to_pic."</a>";


[size=24]not tested[/size][/b]
Logged

JimpsEd

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Generate a link to the picture automaticly for copy paste.
« Reply #10 on: April 07, 2004, 02:10:32 pm »

How do I make;

Code: [Select]
// Create the image link for display in info
$info['Link'] = "http://".($_SERVER['SERVER_NAME'])."/".$path_to_pic;


Into a link as well as a text output?
Logged

jenepherre

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Female
  • Posts: 54
  • there's beauty in the breakdown
Re: Generate a link to the picture automaticly for copy paste.
« Reply #11 on: April 24, 2004, 03:00:37 pm »

I can't get this to work.  Is there a PHPmyAdmin query I need to run?

When I click on an individual photo in an album ( http://www.inxplicable.org/gallery/thumbnails.php?album=1 ), I get this error:

Parse error: parse error in /home/inxplic/public_html/gallery/displayimage.php on line 280

Help?   ???
Logged
=================================
Jen Robertson
=================================
I don't want to explain, I just want to dance.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Generate a link to the picture automaticly for copy paste.
« Reply #12 on: April 24, 2004, 03:06:03 pm »

parse error means you haven't applied the modifications properly (it's a most basic php syntax error). Undo all your changes (start with a fresh copy of the file you modified) and make sure to carefully apply the modifications, or copy'n paste lines 270 to 290 of your displayimage.php into your posting.
There's no database query to be run anyway...

GauGau
Logged

jenepherre

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Female
  • Posts: 54
  • there's beauty in the breakdown
Re: Generate a link to the picture automaticly for copy paste.
« Reply #13 on: April 24, 2004, 03:32:26 pm »

Still not working.  Now it says the error is on line 279 though.  Heh.  ???  Here is roughly the section you asked for (actually lines 267 to 293, if it matters).  I'm using the bit of code from MaThIbUs from reply #9 above.  

Code: [Select]
   if (isset($exif) && is_array($exif)) {
        if (isset($exif['Camera'])) $info[$lang_picinfo['Camera']] = $exif['Camera'];
        if (isset($exif['DateTaken'])) $info[$lang_picinfo['Date taken']] = $exif['DateTaken'];
        if (isset($exif['Aperture'])) $info[$lang_picinfo['Aperture']] = $exif['Aperture'];
        if (isset($exif['ExposureTime'])) $info[$lang_picinfo['Exposure time']] = $exif['ExposureTime'];
        if (isset($exif['FocalLength'])) $info[$lang_picinfo['Focal length']] = $exif['FocalLength'];
        if (isset($exif['Comment'])) $info[$lang_picinfo['Comment']] = $exif['Comment'];
    }
    // Create the absolute URL for display in info
    $info['URL'] = '<a href=' . $CONFIG["ecards_more_pic_target"] . '/' . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . ' >' . $CONFIG["ecards_more_pic_target"] . '/' . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '</a>';
    // with subdomains the variable is $_SERVER["SERVER_NAME"] does not return the right value instead of using a new config variable I reused $CONFIG["ecards_more_pic_target"] no trailing slash in the configure
// Create the image link for display in info
    $info['Link'] = <a href=\".http://".($_SERVER['SERVER_NAME'])."/gallery/".$path_to_pic\">http://".($_SERVER['SERVER_NAME'])."/gallery/".$path_to_pic."</a>";
    // Create the add to fav link
    if (!in_array($CURRENT_PIC_DATA['pid'], $FAVPICS)) {
        $info[$lang_picinfo['addFavPhrase']] = "<a href=addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . " >" . $lang_picinfo['addFav'] . '</a>';
    } else {
        $info[$lang_picinfo['addFavPhrase']] = "<a href=addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . " >" . $lang_picinfo['remFav'] . '</a>';
    }

    return theme_html_picinfo($info);
}
// Displays comments for a specific picture
function html_comments($pid)
{
    global $CONFIG, $USER, $CURRENT_ALBUM_DATA, $comment_date_fmt, $HTML_SUBST;
    global $template_image_comments, $template_add_your_comment, $lang_display_comments;
Logged
=================================
Jen Robertson
=================================
I don't want to explain, I just want to dance.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Generate a link to the picture automaticly for copy paste.
« Reply #14 on: April 24, 2004, 04:20:58 pm »

Code: [Select]
$info['Link'] = <a href=\".http://".($_SERVER['SERVER_NAME'])."/gallery/".$path_to_pic\">http://".($_SERVER['SERVER_NAME'])."/gallery/".$path_to_pic."</a>";is of course causing a parse error - in fact the whole line is crap (since it doesn't respect any coppermine or coding conventions at all), but without further looking into if obviously the double quote at the beginning of the string is missing:
Code: [Select]
$info['Link'] = "<a href=\".http://".($_SERVER['SERVER_NAME'])."/gallery/".$path_to_pic\">http://".($_SERVER['SERVER_NAME'])."/gallery/".$path_to_pic."</a>";
I think MaThIbUs' code should have been put here in the first place, since hard-coding the path "gallery" into the script is bull.
If you want my opinion: forget about this hack...

GauGau
Logged

jenepherre

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Female
  • Posts: 54
  • there's beauty in the breakdown
Re: Generate a link to the picture automaticly for copy paste.
« Reply #15 on: April 24, 2004, 04:32:47 pm »

Do you have an alternative?  It's actually rather important.  The gallery will be for Live Journal icons, and having the direct URL to the image allows you to easily load them into your LJ user pics section.  LJ has an "upload from URL" feature for the user pics, which - if there's a way to include the direct URLs in Coppermine - would mean people would never have to save the icons to their hard drive, making it faster and less of a hassle.

Please tell me there's a way to do this...   :-\
Logged
=================================
Jen Robertson
=================================
I don't want to explain, I just want to dance.

JSi

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Generate a link to the picture automaticly for copy paste.
« Reply #16 on: November 04, 2004, 06:31:06 pm »

This seems pretty simple to do. However, what file do I have to edit?

{search for}
Code: [Select]
   // Create the absolute URL for display in info
    $info['URL'] = '<a href=' . $CONFIG["ecards_more_pic_target"] . '/' . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . ' >' . $CONFIG["ecards_more_pic_target"] . '/' . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '</a>';
    // with subdomains the variable is $_SERVER["SERVER_NAME"] does not return the right value instead of using a new config variable I reused $CONFIG["ecards_more_pic_target"] no trailing slash in the configure

{add under}

Code: [Select]
   // Create the image link for display in info
    $info['link'] = $picture_url;


Can anyone help me with this? I just need the name of the file that needs editing for me to have this feature.

- thanx
« Last Edit: November 05, 2004, 01:53:12 am by JSi »
Logged

JSi

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Generate a link to the picture automaticly for copy paste.
« Reply #17 on: November 08, 2004, 09:15:18 pm »

Still waiting for a reply. I really need this.

What is the name of the file I have to edit?

Does anybody know?
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Generate a link to the picture automaticly for copy paste.
« Reply #18 on: November 08, 2004, 09:19:27 pm »

You could do a search for text in the files in the coppermine folder.
Logged

waynenwendysworld

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Generate a link to the picture automaticly for copy paste.
« Reply #19 on: November 08, 2004, 09:54:15 pm »

Okay I think this is what I want, but can some one please simplify the process for me.

I have coppermine 1.3.2

Display URL link as *.jpg instead of postion=-2
And copying of the URL to clipboard function

Thanks for you help in avdance, please be gentle I am new.

Thanks
Wayne
 
Logged
Pages: [1] 2 3 4   Go Up
 

Page created in 0.029 seconds with 19 queries.