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 97071 times)

0 Members and 1 Guest are viewing this topic.

Crash_Sys

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: Generate a link to the picture automaticly for copy paste.
« Reply #40 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
Logged

FedericaSanta

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Generate a link to the picture automaticly for copy paste.
« Reply #41 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...


Logged

Crash_Sys

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: Generate a link to the picture automaticly for copy paste.
« Reply #42 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!
Logged

FedericaSanta

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Generate a link to the picture automaticly for copy paste.
« Reply #43 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!!!!
Logged

snork13

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 260
  • Internet! Is that thing still around?
    • Gallery
Re: Generate a link to the picture automaticly for copy paste.
« Reply #44 on: June 16, 2005, 02:08:23 pm »

@FedericaSanta

pm sent

--snork13
Logged

janwen99

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Generate a link to the picture automaticly for copy paste.
« Reply #45 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
« Last Edit: June 25, 2005, 11:25:40 pm by janwen99 »
Logged

FedericaSanta

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Generate a link to the picture automaticly for copy paste.
« Reply #46 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!!!!

Logged

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 #47 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.
Logged

rcsmith

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Generate a link to the picture automaticly for copy paste.
« Reply #48 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.
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 #49 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!
Logged
=================================
Jen Robertson
=================================
I don't want to explain, I just want to dance.

Crash_Sys

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: Generate a link to the picture automaticly for copy paste.
« Reply #50 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
Logged

Crash_Sys

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: Generate a link to the picture automaticly for copy paste.
« Reply #51 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
Logged

Crash_Sys

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: Generate a link to the picture automaticly for copy paste.
« Reply #52 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!
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 #53 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.   :)
Logged
=================================
Jen Robertson
=================================
I don't want to explain, I just want to dance.

Crash_Sys

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: Generate a link to the picture automaticly for copy paste.
« Reply #54 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
Logged

ed3877

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Generate a link to the picture automaticly for copy paste.
« Reply #55 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
Logged

dannyvcf

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Generate a link to the picture automaticly for copy paste.
« Reply #56 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!
Logged

xilr8n

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Generate a link to the picture automaticly for copy paste.
« Reply #57 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]';
« Last Edit: January 01, 2006, 07:59:45 pm by xilr8n »
Logged

sundgaard

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 8
    • Mindscope
Re: Generate a link to the picture automaticly for copy paste.
« Reply #58 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
Logged

Ratrace

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Generate a link to the picture automaticly for copy paste.
« Reply #59 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!!!
Logged
Pages: 1 2 [3] 4   Go Up
 

Page created in 0.066 seconds with 20 queries.