copy/ paste bbcode img URL below intermediate image copy/ paste bbcode img URL below intermediate image
 

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

Main Menu

copy/ paste bbcode img URL below intermediate image

Started by Stramm, September 16, 2006, 07:16:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Stramm

This plug-in shows copy/ paste ready bbcode for bulletin boards below the intermediate image. It links to the fullsized image either with a text link (title) or the image thumb. You will have to allow hotlinking if you want to use it over domains! The copy button only works within IE. Unfortunately firefox security settings do not allow that without modifying prefs.js. So the script displays a warning if a firefox user hits the copy button to copy the text manually.

10/25/2006: new version 1.2, fixes the lil glitch mentioned here http://forum.coppermine-gallery.net/index.php?topic=36302.msg175557#msg175557


[Edit GauGau 2010-03-03]
This plugin has been added to the subversion repository: http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.4.x/plugins/bbcode_below_intermediate

It has been updated as well to reflect the version checking routines in the plugin manager that are meant to make sure that galleries don't break because of plugins installed that aren't meant for that particular version of the gallery.

Download: https://sourceforge.net/projects/coppermine/files/Plugins/1.4.x/cpg1.4.x_plugin_bbcode-below-intermediate_v1.3.zip/download
[/Edit]

barbv59

So this only works for Forums? How do you install this?

Sami

This will give you a bbcode version of fie URL and Title you can use it anywhere that accept bbcode
and you should unpack the bbcod.zip under your plugins folder and use plugin manager (config=>general) to install it
‍I don't answer to PM with support question
Please post your issue to related board

Davide Renda

I've deleted on lines 47 and 52 the buttons forms removing from both lines following code:
<input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.'")\'>

Firefox users are more and more and that error message may generate useless panic among users...!!

Apart from this, great plugin Stramm  ;) (as usual!)

Stramm

You're free to modify the code as you want. This is just a note to Firefox users that due to the browsers security settings it's not possible to use the copy button.

MrBlue

Fine PlugIn, but i have one problem:

in the bb_code Text-Link there appears "No Title"! But the picture Have a title!

I havn't install other PlugIn's.

And the second point:
I would have the link to the picture-info-site (not directly to the fullsize image) What must i change?

Thanks for answer!

Greetings
MrBlue


Stramm

1. lil bug
find in codebase.php
$CURRENT_PIC_DATA['title']
replace with
$pic_data['title']

2. the path to the pic is stored in the var $fullsize_url
if you want a different one, you have to modify it... eg. replace
$fullsize_url = get_pic_url($pic_data);  //here we grab the url to the fullsized pic
with
$fullsize_url = 'displayimage.php?pos=-'.$pic_data['pid'];

MrBlue


b4uphotos

is there any how any way ?

so that we can hide the bbcode to visitors and only admin can view that

Stramm

open codebase.php and after
global $CONFIG;
add
if (!(GALLERY_ADMIN_MODE)) return $pic_data;

b4uphotos

thanks!

ITs working fine.

Thanks a lot!

With Best Regards!
Anand Maheshwari

realchaos1


realchaos1

wait i take back what i said, i modified it so it works... works great now BUT...

ONLY I can see this plugin... none of my members can...

*edit* figured it out, I put

if (!(GALLERY_ADMIN_MODE)) return $pic_data;

in when suggested above, i deleted that and now members can see it.

I attempted to insert onClick="highlight(this);" to allow automatic selecting when someone clicks the text area, but it doesnt work for some reason...

here is a copy of my codebase.php,

demo: http://nissanpacific.com/gallery/displayimage.php?album=17&pos=9


<?php
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

// Add a filter
$thisplugin->add_filter('file_data','bbcode_add_data');


function 
bbcode_add_data($pic_data){ //$pic_data
global $CONFIG;


//here we define a var that holds the copy to clipboard javascript 
//unfortunately the Firefox security settings do not allow clipboard copy to work without modifying prefs... 
//therefore only a msg pops up if a user uses netscape/ firefox and presses the copy button
$script_data = <<< EOT

<script language="javascript" type="text/javascript">
<!--
function copy_clip(bb_text)
{
 if (window.clipboardData) 
   {
    window.clipboardData.setData("Text", bb_text);
   }
   else if (window.netscape) 
   { 
    alert("Not possible");
   }
   return false;
}
//-->
</script>
EOT;

$fullsize_url get_pic_url($pic_data);  //here we grab the url to the fullsized pic
$thumb_url get_pic_url($pic_data'thumb'); //thumb url

$pic_data['title'] ? $name $pic_data['title'] : $name 'No Title'//chcking if the pic has a title, if not we set it to 'No title'

//here we define the actual bbcode coppermine path + the path to the pic $img_url is for the version that displays the thumb, $name_url is for a txt link with the ikmage title
$img_url '[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.'][IMG]'.$CONFIG['ecards_more_pic_target'].$fullsize_url.'[/IMG][/url]';
$name_url '<img src="'.$CONFIG['ecards_more_pic_target'].$fullsize_url.'" />';


//this just brings everything in form... we create a table etc.
$bbcode_data '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '<td>BBCode/Forum (Copy/Paste)</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;" onClick="highlight(this);">'.$img_url.'</textarea></td>';

$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td>HTML/Myspace (Copy/Paste)</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="3" cols="40" onClick="highlight(this);">'.$name_url.'</textarea></td>';

$bbcode_data .= '</tr></table>';

//finally we add the created stuff to the picture data and return it to coppermine
$pic_data['html'] = $pic_data['html'].$bbcode_data

return $pic_data
}
?>



[  u  r  l  = http://nissanpacific.com/gallery/albums/formulad/gallery_330_13_125905.jpg ]  [  I  M  G  ] http://nissanpacific.com/gallery/albums/formulad/gallery_330_13_125905.jpg [ / i m g ] [ / u r l ]
[edit GauGau]Replaced hotlinked advertizing pic with attachment (not related to this thread).[/edit]

Stramm

not related to the plugin, just a javascript problem
(you can't call a function that hasn't been defined -> write the function highlight())

akulion

Thanks for this plugin - just what I needed and works wonderfully :D

Iced Coffee

Please help with this:
[edit GauGau] Replaced hot-linked image with attachment [/edit]

The rows are doubled, I don't know why. Can anyone help to solve this?

Iced Coffee

And can we modify this so the picture will be linked to the picture page, not the full-size image? I want my member to use this code to post pictures on other forum but when clicked they will go to my gallery.

Stramm

the plugin interfers with another one... move it up or down in the plugin manager

Stramm

Quote from: Iced Coffee on October 25, 2006, 07:07:42 AM
And can we modify this so the picture will be linked to the picture page, not the full-size image? I want my member to use this code to post pictures on other forum but when clicked they will go to my gallery.

read this thread

jesseg

The plugin works great, but the image url show "localhost" instead of my domain name...  any suggestions?