Generate a link to the picture automaticly for copy paste. Generate a link to the picture automaticly for copy paste.
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Generate a link to the picture automaticly for copy paste.

Started by postcarduniverse, January 14, 2004, 11:53:28 AM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

postcarduniverse

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.

MaThIbUs

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

{search for}
   // 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}

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


Let me know if it worked by posting here :)

/m_aTh!bUs

Joachim Müller

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

MaThIbUs


KrazyK

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:

    // 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

Joachim Müller

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

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...

jeremed

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.

CBiLL

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

MaThIbUs

// 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]

JimpsEd

How do I make;

// 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?

jenepherre

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?   ???
=================================
Jen Robertson
=================================
I don't want to explain, I just want to dance.

Joachim Müller

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

jenepherre

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.  

   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;
=================================
Jen Robertson
=================================
I don't want to explain, I just want to dance.

Joachim Müller

$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:$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

jenepherre

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...   :-\
=================================
Jen Robertson
=================================
I don't want to explain, I just want to dance.

JSi

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

Quote from: MaThIbUs on January 14, 2004, 08:28:15 PM
{search for}
   // 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}

   // 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

JSi

Still waiting for a reply. I really need this.

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

Does anybody know?

Tranz

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

waynenwendysworld

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