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]