forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Miscellaneous => Topic started by: postcarduniverse on January 14, 2004, 11:53:28 am

Title: Generate a link to the picture automaticly for copy paste.
Post by: postcarduniverse 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.
Title: Generate a link to the picture automaticly for copy paste.
Post by: MaThIbUs 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
Title: Generate a link to the picture automaticly for copy paste.
Post by: Joachim Müller 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
Title: Generate a link to the picture automaticly for copy paste.
Post by: MaThIbUs 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
Title: Image URL
Post by: KrazyK 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
Title: Generate a link to the picture automaticly for copy paste.
Post by: Joachim Müller 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
Title: Generate a link to the picture automaticly for copy paste.
Post by: MaThIbUs on January 20, 2004, 04:52:41 pm
:) indeed!

You might want to use the bbCode mod (http://forum.coppermine-gallery.net/index.php?topic=431) to 'put images on bulletin boards and forums' though, which outputs bbCode and is preferably used with the thumbnail...
Title: Generate a link to the picture automaticly for copy paste.
Post by: jeremed on January 21, 2004, 02:49:27 am
Quote from: "MaThIbUs"
:) indeed!

You might want to use the bbCode mod (http://forum.coppermine-gallery.net/index.php?topic=431) 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.
Title: Generate a link to the picture automaticly for copy paste.
Post by: CBiLL 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
Title: Generate a link to the picture automaticly for copy paste.
Post by: MaThIbUs 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]
Title: Generate a link to the picture automaticly for copy paste.
Post by: JimpsEd 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?
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: jenepherre 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?   ???
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Joachim Müller 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
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: jenepherre 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;
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Joachim Müller 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
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: jenepherre 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...   :-\
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: JSi 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
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: JSi 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?
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Tranz on November 08, 2004, 09:19:27 pm
You could do a search for text in the files in the coppermine folder.
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: waynenwendysworld 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
 
Title: Re: Generate a link to the picture automaticaly for copy paste.
Post by: DanTheMan on November 26, 2004, 04:10:36 am
Using b2evolution for family blog, needed a media library. Played around with a few, tried Coppermine, found it really good. Thanks to the developers.

Anyway, don't know much about intergrating with b2evo but all I needed was a way to copy-and-paste the thumbnail with a link to the pic in the album, read this post, grepped a few of the php files so this is what I have done. It puts a (non-hyperlinked) "Post to Weblog'" row under the URL row in the picture info spot. The file edited was displayimage.php
.. the mod is the part commented with 'create an absolute image link for the pic'

-------
Code: [Select]
    // Create the absolute URL for display in info
    $info['URL'] = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" >' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . 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 an absolute image link for the pic
$info['Paste to Weblog'] = '&lt;a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" &gt;&lt;img src="'. $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb') . '" height="' . $CONFIG['thumb_width'] . '" alt="' . $CURRENT_PIC_DATA['title'] . '" align="left" /&gt;&lt;/a&gt;';

    // 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>';
    }
-----

the only part I'm not a 100% sure about is using $CONFIG['thumb_width'] as the pic height. Will this always be correct?

Hope this helps - Dan
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Nibbler on November 26, 2004, 11:40:56 am
The dimensions of the thumbnail are not stored by coppermine, so you'd have to read them from the file directly.
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: St. Anger on December 13, 2004, 06:11:05 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

What about an option for admins to choose which way the gallery displays the URLs?  That would solve both problems since the admins could choose how the links would be displayed.
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: inductionconcepts on December 19, 2004, 07:56:12 am
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

What file is this modification made in?
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Nibbler on December 19, 2004, 01:10:41 pm
... The file edited was displayimage.php ...
;)
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: bobimus on January 06, 2005, 05:37:38 am
Help please, I always get a parser error on line 334.  I've tried all the different scripts above, it just won't work.
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Nibbler on January 06, 2005, 05:39:24 am
Why don't you post the exact error and line 334, plus a few lines above and below.
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Tranz on March 20, 2005, 01:41:19 am
Here's a modified version of the suggestions. It includes a conditional so that it only displays while in admin mode; regular users won't see it. If you want regular users to see, remove the conditional. This includes variations for bbc and html coding, with and without linking. It would be placed in the same place as advised in other posts.

Adjust to suit your needs:

Code: [Select]
if (GALLERY_ADMIN_MODE) {
$info['HTML without link'] = '&lt;img src="'. $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb') . '" height="' . $CONFIG['thumb_width'] . '" alt="' . $CURRENT_PIC_DATA['title'] . '" align="left" border="0" /&gt;';
$info['HTML with link'] = '&lt;a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" &gt;&lt;img src="'. $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb') . '" height="' . $CONFIG['thumb_width'] . '" alt="' . $CURRENT_PIC_DATA['title'] . '" align="left" border="0" /&gt;&lt;/a&gt;';
$info['BBC without link'] = '[img]<br />'. $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb') . '<br />[/img]';
$info['BBC with link'] = '[url=' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '][img]<br />'. $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb') . '<br />[/img][/url]';
}
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: mlanham on March 21, 2005, 05:20:18 am
Why don't you post the exact error and line 334, plus a few lines above and below.

He might not, but I will! :)

I get this error:
Code: [Select]
Parse error: parse error, unexpected T_STRING in /home/[HOMEDIRECTORY]/public_html/copperminetest/displayimage.php on line 338
and have this: (lines 337-339)
Code: [Select]
// Create the absolute URL for display in info
    $info['URL'] = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" >' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . 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

Sorry, I'm a complete newbie and understand very little of this.  ;D
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Stramm on March 29, 2005, 12:03:24 pm
I haven't checked what that code's doing so don't blame me if it doesn't work as you expect. It's just error corrected.

Code: [Select]
    $info['URL'] = "<a href='" . $CONFIG['ecards_more_pic_target'] . (substr($CONFIG['ecards_more_pic_target'], -1) == '/' ? '' : '/') .basename($_SERVER['PHP_SELF']) . "?pos=".(-$CURRENT_PIC_DATA['pid']) . "'>" . $CONFIG['ecards_more_pic_target'] . (substr($CONFIG['ecards_more_pic_target'], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=". (-$CURRENT_PIC_DATA['pid']) . "</a>";
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Sonikempire on April 26, 2005, 03:33:19 am
Is it possible to create the link so it shows the full path to the normal_pic.jpg instead of pic.jpg
WHY? Because i don't want to post huge images into forums and i dont want to right click the pic, properties, copy paste.

This works great for me

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

this didnt work
   
Code: [Select]
// Create the image link for display in info
   $info['Direct Link'] = "http://".($_SERVER['SERVER_NAME'])."/gallery/".$path_to_normal; ...etc...??/

Please help!!
www.sonikempire.com is the site, /gallery is the gallery.
bambule@gmail.com
s0nikempire on AIM
Please feel free to contact me!

THANK YOU VERY MUCH!
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Crash_Sys on May 19, 2005, 09:47:39 am
I have been trying to show the BB-Code for my Images, like in some of these sites, but can't make it to work, with my theme or classic theme.
I do have the BB Help on in the Admin Config! Not sure what i'm doing wrong! ???

http://www.s0ber.net/displayimage.php?album=lastcom&cat=0&pos=5
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Crash_Sys on May 20, 2005, 02:27:02 am
Never mind I got it to work, but Thanks.
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Joachim Müller on May 20, 2005, 08:07:49 am
it would have been nice if you posted what you did to make it work for you, so others may benefit from your insight.
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Crash_Sys on May 22, 2005, 08:12:50 am
it would have been nice if you posted what you did to make it work for you, so others may benefit from your insight.
I could'nt make this one work, how I wanted it too, so I made one!
But if any body is interested, I could placed the code here at coppermine.
I have it confire for the users/public mode can only see the thumb version, with HTML Code and BB-Code on it. And for Members a lot of diffrent ones.
Check it out:
http://sandbox.fastefx.com/cpg1.3.3/cpg133/displayimage.php?album=random&cat=0&pos=-1

User/Public Mode:

(http://sandbox.fastefx.com/user.jpg)
Admin MODE:

(http://sandbox.fastefx.com/admin.jpg)
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: FedericaSanta on June 09, 2005, 01:55:56 pm
it would have been nice if you posted what you did to make it work for you, so others may benefit from your insight.
I could'nt make this one work, how I wanted it too, so I made one!
But if any body is interested, I could placed the code here at coppermine.
I have it confire for the users/public mode can only see the thumb version, with HTML Code and BB-Code on it. And for Members a lot of diffrent ones.
Check it out:
http://sandbox.fastefx.com/cpg1.3.3/cpg133/displayimage.php?album=random&cat=0&pos=-1

User/Public Mode:

(http://sandbox.fastefx.com/user.jpg)
Admin MODE:

(http://sandbox.fastefx.com/admin.jpg)

Hy,
the link yuo suggest dosn't work.

Anyone can help me??
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Crash_Sys on June 10, 2005, 08:30:20 am
FedericaSanta, Its not active, If you need to see I could upload it, and re-install it!
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: FedericaSanta on June 10, 2005, 01:41:55 pm
Oh yes, i just need it.

Thank, with the hope of being able to reciprocate your courtesy!!

Thanks!!!!!!
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Crash_Sys on June 13, 2005, 04:44:15 am
Oh yes, i just need it.

Thank, with the hope of being able to reciprocate your courtesy!!

Thanks!!!!!!

Here is the URL:
http://sandbox.fastefx.com/cpg133/index.php
Please Note, It will be there for a week.

User Account to View all of them;
UserID: test
PassWD: test
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: FedericaSanta on June 13, 2005, 02:41:24 pm
Thanks Crash_Sys,

I have tested it on my gallery.

I have only one problem.When i try to upload a new image a get this:

Notice: Array to string conversion in ..../include/init.inc.php on line 135


Thanks a lot!!!

Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Crash_Sys on June 14, 2005, 02:40:15 am
Thanks Crash_Sys,

I have tested it on my gallery.

I have only one problem.When i try to upload a new image a get this:

Notice: Array to string conversion in ..../include/init.inc.php on line 135


Thanks a lot!!!



Most likelyy the problem is with the <form name="formA"> and No Problem
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: FedericaSanta on June 14, 2005, 10:22:22 pm
Thanks Crash_Sys!

I' ve tested it all day but i can't find a solution: it's impossible to upload images  :\'(

Anyone has got an idea or a solution??

It's a sin lose all the job made from Crash_Sys...


Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Crash_Sys on June 16, 2005, 12:54:03 am
Thanks Crash_Sys!

I' ve tested it all day but i can't find a solution: it's impossible to upload images  :\'(

Anyone has got an idea or a solution??

It's a sin lose all the job made from Crash_Sys...

You could rename the forum to the same name of the upload forum. PS: I working on a Fix!
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: FedericaSanta on June 16, 2005, 01:20:36 pm

You could rename the forum to the same name of the upload forum. PS: I working on a Fix!


I don'y understand what do you mean...can you explane it?? Thanks!!!!
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: snork13 on June 16, 2005, 02:08:23 pm
@FedericaSanta

pm sent

--snork13
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: janwen99 on June 25, 2005, 11:04:15 pm
I absolutely do want this, and here's the code which has worked for me:

Code: [Select]
  // Create the absolute URL for display in info

    // 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'] = "http://".($_SERVER['SERVER_NAME'])."/gallery/".$path_to_pic; 

Controlled hotlinking is why I've set up the gallery in the first place and I want to make it as easy as possible for my members to find their URLs! Anyway, thanks for all the help, I got my solution with trial, error, and all your handy tips!

See the result http://www.steveperryfans.com/gallery/index.php
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: FedericaSanta on July 17, 2005, 02:55:52 pm
Thanks Snork13!!

He shows me the right way.  :-* :-* :-*

I've another question: i'd like to show the users the image's url after they have upload it.  Anyone has an idea??


THANKS!!!!

Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Joachim Müller on July 18, 2005, 07:43:15 am
I've another question: i'd like to show the users the image's url after they have upload it. Anyone has an idea??
not related imo, please don't try to hijack threads, especially not in the mods/hacks board. After all, the mods/hacks board is meant for existing mods, not to request new ones. Modifications of upload.php or db_input.php would be needed, a simple text input field with the url output in the value attribute would do as far as I can see.
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: rcsmith on August 08, 2005, 09:52:44 pm
Oh yes, i just need it.

Thank, with the hope of being able to reciprocate your courtesy!!

Thanks!!!!!!

Here is the URL:
http://sandbox.fastefx.com/cpg133/index.php
Please Note, It will be there for a week.

User Account to View all of them;
UserID: test
PassWD: test

How can I get your hack?  that's awesome.
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: jenepherre on August 09, 2005, 11:20:56 pm

Here is the URL:
http://sandbox.fastefx.com/cpg133/index.php
Please Note, It will be there for a week.

User Account to View all of them;
UserID: test
PassWD: test

How can I get your hack?  that's awesome.

I'd love to have the code for this too.  Looks fantastic!
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Crash_Sys on August 12, 2005, 12:24:18 am
Oh yes, i just need it.

Thank, with the hope of being able to reciprocate your courtesy!!

Thanks!!!!!!

Here is the URL:
http://sandbox.fastefx.com/cpg133/index.php
Please Note, It will be there for a week.

User Account to View all of them;
UserID: test
PassWD: test

How can I get your hack?  that's awesome.

What Hack ???

Plz email me much better to contact me, fastefx_com@cox.net
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Crash_Sys on August 12, 2005, 12:25:48 am

Here is the URL:
http://sandbox.fastefx.com/cpg133/index.php
Please Note, It will be there for a week.

User Account to View all of them;
UserID: test
PassWD: test

How can I get your hack?  that's awesome.

I'd love to have the code for this too.  Looks fantastic!

Sure, Just Contact me and Ill e-mail you the code>

my email is fastefx_com@cox.net
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Crash_Sys on August 12, 2005, 12:41:09 am
Change DOMAIN to your Domain.


On DisplayImage.php, around line 322.

Find:

Code: [Select]
    // Create the absolute URL for display in info
    $info['URL'] = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" >' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . 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 After:

Code: [Select]
// *** Begin of USER/Public Mode BB-Code and HTML ***
    // Create the BB-Code with Link to Thumbnail for USERS/PUBLIC MODE
    $bbcodethumb_url = get_pic_url($CURRENT_PIC_DATA, 'thumb');
    $info['<b>Copy Info</b>']='<font color="#FF0000">Press Ctrl+A to Select All.</font> <font color="#008000">Then Press Ctrl+C to Copy Selected </font>';
    $info['bbCode<br>Thumbnail']='<textarea type=text name=text rows=2 cols=46>[url=http://DOMAIN.COM'.$_SERVER["SCRIPT_NAME"]."?pos=-$CURRENT_PIC_DATA[pid]".'][img]'.'http://DOMAIN.COM/'.$bbcodethumb_url.'[/img][/url]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbcodepublic();">Copy</button>';
    // Image Link with URL for HTML
    $info['HTML Code<br>Thumbnail'] = '<textarea type=text name=text1 rows=2 cols=46>&lt;a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" &gt;&lt;img src="'. $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb') . '" height="' . $CONFIG['thumb_width'] . '" alt="' . $CURRENT_PIC_DATA['title'] . '" align="left" border="0" /&gt;&lt;/a&gt;</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:htmlcode();">Copy</button>';
    // *** END of USER/Public Mode BB-Code and HTML ***
    // *** Begin Admin Mode BB-Code List ***
      if (GALLERY_ADMIN_MODE || USER_ADMIN_MODE) {
    //Show BBcode for
  if ($CONFIG['make_intermediate'] && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {
     $bbcodepicture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
     } else {
     $bbcodepicture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
  }
    // Create Image Link for Display
    $info['Full'] = "<textarea type=text name=text2 rows=2 cols=46>http://".($_SERVER['SERVER_NAME'])."/".$path_to_pic."</textarea>&nbsp;&nbsp;&nbsp;<button class=button onClick=javascript:link();>Copy</button>";
     // Create Intermediate Image for Display
    $info['Intermediate']='<textarea type=text name=text3 rows=2 cols=46>'.'http://DOMAIN.COM/'.$bbcodepicture_url.'</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:inter();">Copy</button>';

    // Create the Image Link with URL for BBS
    $info['bbCode<br>With URL']='<textarea type=text name=text4 rows=2 cols=46>[url=http://DOMAIN.COM'.$_SERVER["SCRIPT_NAME"]."?pos=-$CURRENT_PIC_DATA[pid]".'][img]'.'http://DOMAIN.COM/'.$path_to_pic.'[/img][/url]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbcode();">Copy</button>';

// Create the BB-Code with link to resized image
      $info['bbCode<br>Intermediate']='<textarea type=text name=text5 rows=2 cols=46>[img]http://DOMAIN.COM/'.$bbcodepicture_url.'[/img]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbinter();">Copy</button>';
      $info['bbCode<br>Intermediate<br>With URL']='<textarea type=text name=text6 rows=2 cols=46>[url=http://DOMAIN.COM'.$_SERVER["SCRIPT_NAME"]."?pos=-$CURRENT_PIC_DATA[pid]".'][img]'.'http://DOMAIN.COM/'.$bbcodepicture_url.'[/img][/url]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbinterurl();">Copy</button>';

      }
// *** End of Admin Mode BB-Code List ***

Please Note the Copy Bottom is Still Not Working...I havent Work on it since a while!
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: jenepherre on August 12, 2005, 09:10:56 am

Please Note the Copy Bottom is Still Not Working...I havent Work on it since a while!

Thanks so much for posting this.  I hope you'll keep working on it and get that copy button working.   :)
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Crash_Sys on September 13, 2005, 06:15:25 am

Please Note the Copy Bottom is Still Not Working...I havent Work on it since a while!

Thanks so much for posting this.  I hope you'll keep working on it and get that copy button working.   :)

Yes, I have finish it, is currently under Beta Testing!

View Beta Version of it!
http://sandbox.fastefx.com/gallery/displayimage.php?album=random&cat=0&pos=-3
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: ed3877 on December 21, 2005, 06:31:58 am
Change DOMAIN to your Domain.


On DisplayImage.php, around line 322.

Find:

Code: [Select]
    // Create the absolute URL for display in info
    $info['URL'] = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" >' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . 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 After:

Code: [Select]
// *** Begin of USER/Public Mode BB-Code and HTML ***
    // Create the BB-Code with Link to Thumbnail for USERS/PUBLIC MODE
    $bbcodethumb_url = get_pic_url($CURRENT_PIC_DATA, 'thumb');
    $info['<b>Copy Info</b>']='<font color="#FF0000">Press Ctrl+A to Select All.</font> <font color="#008000">Then Press Ctrl+C to Copy Selected </font>';
    $info['bbCode<br>Thumbnail']='<textarea type=text name=text rows=2 cols=46>[url=http://DOMAIN.COM'.$_SERVER["SCRIPT_NAME"]."?pos=-$CURRENT_PIC_DATA[pid]".'][img]'.'http://DOMAIN.COM/'.$bbcodethumb_url.'[/img][/url]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbcodepublic();">Copy</button>';
    // Image Link with URL for HTML
    $info['HTML Code<br>Thumbnail'] = '<textarea type=text name=text1 rows=2 cols=46>&lt;a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" &gt;&lt;img src="'. $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb') . '" height="' . $CONFIG['thumb_width'] . '" alt="' . $CURRENT_PIC_DATA['title'] . '" align="left" border="0" /&gt;&lt;/a&gt;</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:htmlcode();">Copy</button>';
    // *** END of USER/Public Mode BB-Code and HTML ***
    // *** Begin Admin Mode BB-Code List ***
      if (GALLERY_ADMIN_MODE || USER_ADMIN_MODE) {
    //Show BBcode for
  if ($CONFIG['make_intermediate'] && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {
     $bbcodepicture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
     } else {
     $bbcodepicture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
  }
    // Create Image Link for Display
    $info['Full'] = "<textarea type=text name=text2 rows=2 cols=46>http://".($_SERVER['SERVER_NAME'])."/".$path_to_pic."</textarea>&nbsp;&nbsp;&nbsp;<button class=button onClick=javascript:link();>Copy</button>";
     // Create Intermediate Image for Display
    $info['Intermediate']='<textarea type=text name=text3 rows=2 cols=46>'.'http://DOMAIN.COM/'.$bbcodepicture_url.'</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:inter();">Copy</button>';

    // Create the Image Link with URL for BBS
    $info['bbCode<br>With URL']='<textarea type=text name=text4 rows=2 cols=46>[url=http://DOMAIN.COM'.$_SERVER["SCRIPT_NAME"]."?pos=-$CURRENT_PIC_DATA[pid]".'][img]'.'http://DOMAIN.COM/'.$path_to_pic.'[/img][/url]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbcode();">Copy</button>';

// Create the BB-Code with link to resized image
      $info['bbCode<br>Intermediate']='<textarea type=text name=text5 rows=2 cols=46>[img]http://DOMAIN.COM/'.$bbcodepicture_url.'[/img]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbinter();">Copy</button>';
      $info['bbCode<br>Intermediate<br>With URL']='<textarea type=text name=text6 rows=2 cols=46>[url=http://DOMAIN.COM'.$_SERVER["SCRIPT_NAME"]."?pos=-$CURRENT_PIC_DATA[pid]".'][img]'.'http://DOMAIN.COM/'.$bbcodepicture_url.'[/img][/url]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbinterurl();">Copy</button>';

      }
// *** End of Admin Mode BB-Code List ***

Please Note the Copy Bottom is Still Not Working...I havent Work on it since a while!

Hi, I have added the above code in my gallery and it working wonderfully just as it claimed, Thanks!

I wonder if anyone have know how to show the absolute url understand each thumbs.

Cheers,
ed3877
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: dannyvcf on December 29, 2005, 04:23:52 pm
Hello!
First thanks for this MOD because it is very useful for me. I have installed the MOD, although only I want to use the function of "Image Link with URL for BBS".
Everything works correctly, but there is a problem. The case is that, on having generated the code, since the photos of my gallery it has the format "Name of the photo", (With spaces between the words), on having generated the code, also it includes these spaces, and on having included the code in a forum, it does not work, since when a space is used, it is generated automatically "%20" to replace this space. My question is if there would be some possible way of modifying this code, or in another case to be able to rename all the photos simultaneously to replace the spaces for, for example, "_" or "-".
I hope that you could help me and if it is possible in the minor possible time since I need this MOD. Thank you very much!
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: xilr8n on January 01, 2006, 07:38:49 pm
Thanks to all that have come before me!

This is what I did for  Coppermine version: 1.4.3

in displayimage.php find (was line 169 in mine)
Code: [Select]
    // Create the absolute URL for display in info
    $info[$lang_picinfo['URL']] = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" >' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '</a>';
After add
Code: [Select]
 

    //**mod on

    $info['Picture link'] = '<a href="' .$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .$path_to_pic. '" >' .$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .$path_to_pic. '</a>';
     $info['Thumbnail link'] =  '<a href="' .$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb'). '" >' .$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb'). '</a>' ;
    $info['Cut and Paste notes'] =' Cut and paste one of the following to put in a forum thread. Do not use the img link that is part of the forum. If your photo is very large be considerate and use the thumbnail version which allows the viewer the choice of downloading it, and keeps the forum layout smooth.';
$info['Forum code fullsize'] = '[img]'. $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .$path_to_pic . '[/img]';
$info['Forum code thumb with link back here'] = '[url=' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '][img]'. $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb') . '[/img]<br />Click to enlarge![/url]';
//**mod off


Edit
the last line respects viewing restrictions. If you want to bypass that so anyone can view use this one
Code: [Select]
$info['Forum code thumb with link to full size'] = '[url=' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .$path_to_pic . '][img]'. $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb') . '[/img]<br />Click to enlarge![/url]';
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: sundgaard on January 05, 2006, 02:16:14 pm
I've have found this discussion very useful.

I am using this code to link directly to the picture:
Code: [Select]
$info['Forum code thumb with link to full size'] = '[url=' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .$path_to_pic . '][img]'. $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb') . '[/img]<br />Click to enlarge![/url]';
It gives me this link:
Code: [Select]
<a href="http://www.mindscope.dk/coppermine/albums/2005/totalkursus5/000_0019.jpg" >Direct link</a>

I need to wrap the url to redirect it to our SMS server.
The link should then look like this:
Code: [Select]
<a href="#" onClick="OpenMobilpic('http://www.mindscope.dk/coppermine/albums/2005/totalkursus5/000_0019.jpg');">Order SMS</a>

Do any of you know how to make this.

Regards.

Bo Sundgaard
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Ratrace on January 05, 2006, 05:03:10 pm
I have to say that I also found this very usefull. I was able to use the codes that Crash Sys had posted with a bit of mod and get it closer to what I wanted. I still need to edit out some of the links it adds which I do not need.

Code: [Select]
// *** Begin of USER/Public Mode BB-Code and HTML ***
    // Create the BB-Code with Link to Thumbnail for USERS/PUBLIC MODE
    $bbcodethumb_url = get_pic_url($CURRENT_PIC_DATA, 'thumb');
    $info['<b>Copy Info</b>']='<font color="#FF0000">Press Ctrl+A to Select All.</font> <font color="#008000">Then Press Ctrl+C to Copy Selected </font>';
    $info['bbCode<br>Thumbnail']='<textarea type=text name=text rows=2 cols=46>[url=http://www.image-elf.com/Coppermine'.$_SERVER["SCRIPT_NAME"]."?pos=-$CURRENT_PIC_DATA[pid]".'][img]'.'http://www.image-elf.com/Coppermine/'.$bbcodethumb_url.'[/img][/url]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbcodepublic();">Copy</button>';
    // Image Link with URL for HTML
    $info['HTML Code<br>Thumbnail'] = '<textarea type=text name=text1 rows=2 cols=46>&lt;a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" &gt;&lt;img src="'. $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb') . '" height="' . $CONFIG['thumb_width'] . '" alt="' . $CURRENT_PIC_DATA['title'] . '" align="left" border="0" /&gt;&lt;/a&gt;</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:htmlcode();">Copy</button>';
    // *** END of USER/Public Mode BB-Code and HTML ***
    // *** Begin Admin Mode BB-Code List ***
      if (GALLERY_ADMIN_MODE || USER_ADMIN_MODE) {
    //Show BBcode for
  if ($CONFIG['make_intermediate'] && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {
     $bbcodepicture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
     } else {
     $bbcodepicture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
  }
    // Create Image Link for Display
    $info['Full'] = "<textarea type=text name=text2 rows=2 cols=46>http://".($_SERVER['SERVER_NAME'])."/".$path_to_pic."</textarea>&nbsp;&nbsp;&nbsp;<button class=button onClick=javascript:link();>Copy</button>";

     // Create Intermediate Image for Display
    $info['Intermediate']='<textarea type=text name=text3 rows=2 cols=46>'.'http://www.image-elf.com/Coppermine/'.$bbcodepicture_url.'</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:inter();">Copy</button>';

    // Create the Image Link with URL for BBS
    $info['bbCode<br>With URL']='<textarea type=text name=text4 rows=2 cols=46>[url=http://www.image-elf.com/Coppermine'.$_SERVER["SCRIPT_NAME"]."?pos=-$CURRENT_PIC_DATA[pid]".'][img]'.'http://www.image-elf.com/Coppermine/'.$path_to_pic.'[/img][/url]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbcode();">Copy</button>';

// Create the BB-Code with link to resized image
      $info['bbCode<br>Intermediate']='<textarea type=text name=text5 rows=2 cols=46>[img]http://www.image-elf.com/Coppermine'.$bbcodepicture_url.'[/img]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbinter();">Copy</button>';
      $info['bbCode<br>Intermediate<br>With URL']='<textarea type=text name=text6 rows=2 cols=46>[url=http://www.image-elf.com/Coppermine'.$_SERVER["SCRIPT_NAME"]."?pos=-$CURRENT_PIC_DATA[pid]".'][img]'.'http://www.image-elf.com/Coppermine/'.$bbcodepicture_url.'[/img][/url]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbinterurl();">Copy</button>';

     
// *** End of Admin Mode BB-Code List ***

Thanks to everyone that contributed!!!
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: svennicus on January 08, 2006, 12:55:22 am
Thanks Crash_Sys, great mod.

I have made some small alterations of my own, like remove the need to hardcode your domain name, reduced the list to the links i require and also fixed all the links. (my first attempt at this by the way, didnt even know what the code looked like 2 days ago)

Still working on the copy buttons tho.

I hope this will be useful, just copy and paste, no changes needed.

Again, thanks for the mod Crash_Sys

Find lines

Code: [Select]
// Create the absolute URL for display in info
    $info[$lang_picinfo['URL']] = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" >' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . 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 following lines below

Code: [Select]
// *** Begin of USER/Public Mode BB-Code and HTML ***
    // Create the BB-Code with Link to Thumbnail for USERS/PUBLIC MODE
    $bbcodethumb_url = get_pic_url($CURRENT_PIC_DATA, 'thumb');
    $info['<b>Copy Info</b>']='<font color="#FF0000">Press Ctrl+A to Select All.</font> <font color="#008000">Then Press Ctrl+C to Copy Selected </font>';
    $info['Forum Code<br>Thumbnail<br>With URL']='<textarea type=text name=text rows=2 cols=46>[url='.$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/').basename($_SERVER['PHP_SELF'])."?pos=-$CURRENT_PIC_DATA[pid]".'][img]'.$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/').$bbcodethumb_url.'[/img][/url]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbcodepublic();">Copy</button>';
    // Image Link with URL for HTML
    //$info['HTML Code<br>Thumbnail'] = '<textarea type=text name=text1 rows=2 cols=46>&lt;a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" &gt;&lt;img src="'. $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb') . '" height="' . $CONFIG['thumb_width'] . '" alt="' . $CURRENT_PIC_DATA['title'] . '" align="left" border="0" /&gt;&lt;/a&gt;</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:htmlcode();">Copy</button>';
    // *** END of USER/Public Mode BB-Code and HTML ***
    // *** Begin Admin Mode BB-Code List ***
      if (GALLERY_ADMIN_MODE || USER_ADMIN_MODE) {
    //Show BBcode for
  if ($CONFIG['make_intermediate'] && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {
     $bbcodepicture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
     } else {
     $bbcodepicture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
  }
   
    // Create Intermediate Image for Display
    //$info['Intermediate']='<textarea type=text name=text3 rows=2 cols=46>' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . (str_replace($CURRENT_PIC_DATA['filename'] , "normal_".$CURRENT_PIC_DATA['filename'] , $path_to_pic)).'</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:inter();">Copy</button>';

// Create the BB-Code with link to resized image
      $info['Forum Code<br>Intermediate']='<textarea type=text name=text5 rows=2 cols=46>[img]'.$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/').(str_replace($CURRENT_PIC_DATA['filename'] , "normal_".$CURRENT_PIC_DATA['filename'] , $path_to_pic)).'[/img]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbinter();">Copy</button>';
      $info['Forum Code<br>Intermediate<br>With URL']='<textarea type=text name=text6 rows=2 cols=46>[url='.$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/').basename($_SERVER['PHP_SELF'])."?pos=-$CURRENT_PIC_DATA[pid]".'][img]'.$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/').(str_replace($CURRENT_PIC_DATA['filename'] , "normal_".$CURRENT_PIC_DATA['filename'] , $path_to_pic)).'[/img][/url]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbinterurl();">Copy</button>';

// Create Image Link for Display
    //$info['Full'] = "<textarea type=text name=text2 rows=2 cols=46>".$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . $path_to_pic ."</textarea>&nbsp;&nbsp;&nbsp;<button class=button onClick=javascript:link();>Copy</button>";
   
    // Show BB-Code for Full Image
    $info['Forum Code<br>Full']='<textarea type=text name=text4 rows=2 cols=46>[img]'.$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . $path_to_pic.'[/img]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbcode();">Copy</button>';
   
    // Create the Image Link with URL for BBS
    //$info['Forum Code<br>Full<br>With URL']='<textarea type=text name=text4 rows=2 cols=46>[url='.$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]".'][img]'.$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . $path_to_pic.'[/img][/url]</textarea>&nbsp;&nbsp;&nbsp; <button class=button onClick="javascript:bbcode();">Copy</button>';
   
      }
// *** End of Admin Mode BB-Code List ***
Title: Copy buttons
Post by: Ross(SE-MI) on February 05, 2006, 08:54:06 pm
Hi svennicus,
I am not a programer but have been researching this topic.
Not sure if this code is of any use to you but saw it on another forum.
Dealing with copy text to clipboard for pasting somewhere else across different browsers.

Code: [Select]
<script>
function copy_clip(meintext){
if (window.clipboardData){   
window.clipboardData.setData("Text", meintext);
}else if (window.netscape){
netscape.security.PrivilegeManager.enablePrivilege  ('UniversalXPConnect');

var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard  );
if (!clip) return;

var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
if (!trans) return;

trans.addDataFlavor('text/unicode');

var str = new Object();
var len = new Object();

var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);   
var copytext=meintext;   
str.data=copytext;   
trans.setTransferData("text/unicode",str,copytext.length*2);   
var clipid=Components.interfaces.nsIClipboard;

if (!clip) return false;   
clip.setData(trans,null,clipid.kGlobalClipboard);

}

return false;
}
//-->
</script>   
<form name="testform">
<textarea name="testsquare">
</textarea>
<br>
<input type="button" onclick="return copy_clip(document.forms[0].testsquare.value)" value="Copy to Clipboard">
</form>
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: djtaz on February 14, 2006, 03:29:52 pm
I think that code would work if intrgrated with another ... i didnt realise there was a BBCode output thing for coppermine , and i ended up doing my own version ...
http://forum.coppermine-gallery.net/index.php?topic=27804.0


So here is my code integrated with the code that Ross just posted for easy copying to clipboard

OK THIS IS TESTED AND IT WORKS - JUST WHAT U WANT


In /gallery/lang/english.php

Find :
Code: [Select]
$lang_picinfo = array(
  'title' =>'File information', //cpg1.3.0
  'Filename' => 'Filename',
  'Album name' => 'Album name',
 
 
 
Add below :   
Code: [Select]
 
  'BB Code' => 'VB Code',
_________________________________________________________________________

in /gallery/displayimage.php

Find :


Code: [Select]
   $info[$lang_picinfo['Filename']] = htmlspecialchars($CURRENT_PIC_DATA['filename']);
   $info[$lang_picinfo['Album name']] = '<span class="alblink">' . $owner_link . $ipinfo . '<a href="thumbnails.php?album=' . $CURRENT_PIC_DATA['aid'] . '">' . $CURRENT_ALBUM_DATA['title'] . ' Photos</a></span>';
add below
Code: [Select]
//// THANKS TO ROSS FOR THE SCRIPT//
?>
<script>
function copy_clip(meintext){
if (window.clipboardData){
window.clipboardData.setData("Text", meintext);
}else if (window.netscape){
netscape.security.PrivilegeManager.enablePrivilege  ('UniversalXPConnect');

var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard  );
if (!clip) return;

var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
if (!trans) return;

trans.addDataFlavor('text/unicode');

var str = new Object();
var len = new Object();

var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
var copytext=meintext;
str.data=copytext;
trans.setTransferData("text/unicode",str,copytext.length*2);
var clipid=Components.interfaces.nsIClipboard;

if (!clip) return false;
clip.setData(trans,null,clipid.kGlobalClipboard);

}

return false;
}
//-->
</script>

<?
////////////////////////////////////////////////
//// OUTPUT CODES FOR VBCODE AND HTML CODE /////
//////////////// BY DjTaz  (www.djtaz.com)//////
////////////////////////////////////////////////
$picture_url = get_pic_url($CURRENT_PIC_DATA, '');
$website = $CONFIG["ecards_more_pic_target"];
$info[$lang_picinfo['BB Code']] = "<form name=\"testform\"><textarea name=\"testsquare\" cols=35>[IMG] ".$website.$picture_url." [/IMG]</textarea><input type=\"button\" onclick=\"return copy_clip(document.forms[0].testsquare.value)\" value=\"Copy to Clipboard\"></form>";
////////////////////////////////////////////////
//// END OF VBCODE AND HTML OUTPUT CODE ////////
////////////////////////////////////////////////


Reupload both files , click and thats it , your done !
Also here :
http://www.vbulletin.org/forum/showthread.php?p=898178
Title: Thanks djtaz for the credit, however
Post by: Ross(SE-MI) on February 17, 2006, 04:03:02 am
I can't take credit for the code just finding it & passing it on.
Only wish I remembered where I found it to give that person the proper credit.
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: ginzadune on February 18, 2006, 05:52:20 pm
What about an option for admins to choose which way the gallery displays the URLs?  That would solve both problems since the admins could choose how the links would be displayed.

Wow - imagine that...
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: cheenamalai on March 21, 2006, 09:59:25 pm
I think that code would work if intrgrated with another ... i didnt realise there was a BBCode output thing for coppermine , and i ended up doing my own version ...
http://forum.coppermine-gallery.net/index.php?topic=27804.0


So here is my code integrated with the code that Ross just posted for easy copying to clipboard

OK THIS IS TESTED AND IT WORKS - JUST WHAT U WANT


In /gallery/lang/english.php

Find :
Code: [Select]
$lang_picinfo = array(
  'title' =>'File information', //cpg1.3.0
  'Filename' => 'Filename',
  'Album name' => 'Album name',
 
 
 
Add below :   
Code: [Select]
 
  'BB Code' => 'VB Code',
_________________________________________________________________________

in /gallery/displayimage.php

Find :


Code: [Select]
   $info[$lang_picinfo['Filename']] = htmlspecialchars($CURRENT_PIC_DATA['filename']);
   $info[$lang_picinfo['Album name']] = '<span class="alblink">' . $owner_link . $ipinfo . '<a href="thumbnails.php?album=' . $CURRENT_PIC_DATA['aid'] . '">' . $CURRENT_ALBUM_DATA['title'] . ' Photos</a></span>';
add below
Code: [Select]
//// THANKS TO ROSS FOR THE SCRIPT//
?>
<script>
function copy_clip(meintext){
if (window.clipboardData){
window.clipboardData.setData("Text", meintext);
}else if (window.netscape){
netscape.security.PrivilegeManager.enablePrivilege  ('UniversalXPConnect');

var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard  );
if (!clip) return;

var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
if (!trans) return;

trans.addDataFlavor('text/unicode');

var str = new Object();
var len = new Object();

var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
var copytext=meintext;
str.data=copytext;
trans.setTransferData("text/unicode",str,copytext.length*2);
var clipid=Components.interfaces.nsIClipboard;

if (!clip) return false;
clip.setData(trans,null,clipid.kGlobalClipboard);

}

return false;
}
//-->
</script>

<?
////////////////////////////////////////////////
//// OUTPUT CODES FOR VBCODE AND HTML CODE /////
//////////////// BY DjTaz  (www.djtaz.com)//////
////////////////////////////////////////////////
$picture_url = get_pic_url($CURRENT_PIC_DATA, '');
$website = $CONFIG["ecards_more_pic_target"];
$info[$lang_picinfo['BB Code']] = "<form name=\"testform\"><textarea name=\"testsquare\" cols=35>[IMG] ".$website.$picture_url." [/IMG]</textarea><input type=\"button\" onclick=\"return copy_clip(document.forms[0].testsquare.value)\" value=\"Copy to Clipboard\"></form>";
////////////////////////////////////////////////
//// END OF VBCODE AND HTML OUTPUT CODE ////////
////////////////////////////////////////////////


Reupload both files , click and thats it , your done !
Also here :
http://www.vbulletin.org/forum/showthread.php?p=898178

this isn't working. Why is that? no field nothing shows up!
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Crash_Sys on April 03, 2006, 10:05:52 pm
I just want to inform everybody, that I will begin working on the MOD, for the latest version of Coppermine, with more power to it...

I'll be adding:

Fire Fox and most common Browsers Support.
Control what type of code to show, via Admin Control Panel…
Control what to show, TEXT/Bottom/ and so on...


And some more Modification to it…
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: dshade69 on August 15, 2006, 11:08:39 pm
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

Is it possible that we can get this feature as an option that can be turned on and off in the control panel?  I know that quite a few people do like having the direct url for the picture which is why this thread keeps turning up again and again for different versions of coppermine. 

Thanks,

Dshade69
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Stramm on August 16, 2006, 07:55:15 am
This is not the place for feature requests. Also there's a plugin with the basic functiuonality of this mod. You can add everything you need to that plugin and customize it to your needs.
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: chican0 on May 16, 2007, 11:43:05 am
There is really no need for a button to copy the code. You can easily modify the first FORM declaration to append the following emphasized attributes.

Quote
<textarea type=text name=text1 rows=4 cols=50  onFocus="this.select()" onClick="this.select()" readonly>
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Joachim Müller on May 16, 2007, 01:16:36 pm
Proper syntax would be
Code: [Select]
<textarea type="text" name="text1" rows="4" cols="50"  onFocus="this.select();" onClick="this.select();" readonly="readonly">
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: chican0 on May 16, 2007, 06:46:14 pm
Thanks for the correction.
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: MatthewSchenker on June 25, 2007, 02:38:45 pm
I'm very interested in this modification.

I run a woodworking forum, with a bridge to Coppermine.  My members like to pick up their photos in the gallery and use them to post inline in the posts.  It would be great to have an easy way to pick up the URL for pasting in the forum.

There seems to be a lot of great information here.  But I'm a little confused.  What's the best way to simply get the URL references to display?

Thanks for your help!

Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Thomas_Hansen on January 22, 2008, 06:29:15 pm
I think that i am missing somthing, isent there supose to be somthing in the themes.inc.php to actualy shov the link ?
Well im not getting anything if i add the $info['Link'] = "http://".($_SERVER['SERVER_NAME'])."/galleri/".$path_to_pic; in the displayimage.php
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Nibbler on January 22, 2008, 06:55:39 pm
Do you even have the file information section displayed? Post a link to your gallery.
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Thomas_Hansen on January 22, 2008, 07:04:41 pm
http://yal.dk/galleri/displayimage.php?album=1&pos=1

Where it says {LINK} i would like a link for the file

the file info thingy i cant find, hmmm not that smart am i
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Nibbler on January 22, 2008, 07:13:43 pm
The file information section is displayed in a box below the pic. I can see the link where it should be. If you want it where the {LINK} is then you need to code that. This mod does not place it there.
Title: Re: Generate a link to the picture automaticly for copy paste.
Post by: Thomas_Hansen on January 22, 2008, 07:14:57 pm
Figured it out, gotta look in the code thanks