Simple bbCode tag generation Simple bbCode tag generation
 

News:

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

Main Menu

Simple bbCode tag generation

Started by ginzadune, February 16, 2006, 11:07:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ginzadune

I have had this discussion somewhat resolved under "Hesitate to ask"... but when I went to search the mods forum (all 8 pages) I did not quite find what I was looking for. This is not a mod request, but a plea for someone to tell me if the mod I am looking for exists, and where it is/what it is called.

The one that I did find that seemed close to what I am looking for was the one that had "bbcode" in the title (I think it was just below halfway on page 2).

What I am looking for is any mod that will create a simple field with a link (in Coppermine) that one can copy and post between the img tags (in a phpBB post)... Right clicking the image is producing inconsistent and unpredictable results with each pic. I am looking for something that is easy so that even a novice can be told "open the pic, look for the url information in the field that has [img] and [/img] on each end, copy that info, and paste it between the img tags in your post."

Currently I have directions for users that are exasperatingly long... If this field existed (if I can mod it in) then the directions would take one paragraph.

This kind of feature can be seen at photobucket.com, but I think most of you know what I am talking about...

Coppermine shows an absolute URL when you click "info". I am looking for the bbcode to be as readily available for copy and paste.

Thanks!


theklub


Paver

The first is tagged as 1.4.x so it should.  The second is only tagged for 1.3.x so either no one has tried it yet, or someone has and decided it doesn't work.  In any case, you are welcome to try it and if you get it to work (unmodified or modified), please post appropriately (unmodified in that thread, modified in a new thread with a link to the old one).

And you really should upgrade to 1.4.5 for the security fix.

theklub

i used 1.4.5 and this code mod worked on a brand new board.......

Quote from: Crash_Sys on August 12, 2005, 12:41:09 AM
Change DOMAIN to your Domain.


On DisplayImage.php, around line 322.

Find:

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

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

Stramm