I encountered a problem with this plugin and the "Chaotic" style. The Chaotic style attaches a "frame" around the intermediate images, and thus this plugin was inserting the BBcode table between the image and frame.
After figuring out CPG a little (which was very hard as I found almost zero plugin-writing documentation--I hope someone is working on this!!), I changed the plugin to this: <?php/*****Snipped Copyright for copy/paste purposes :) ******/
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
// Add a filter
$thisplugin->add_filter('page_html','bbcode_add_data');
function bbcode_add_data($page_html){
global $CONFIG, $CURRENT_PIC_DATA;
$fullsize_url = get_pic_url($CURRENT_PIC_DATA); //here we grab the url to the fullsized pic
$thumb_url = get_pic_url($CURRENT_PIC_DATA, 'thumb'); //thumb url
$CURRENT_PIC_DATA['title'] ? $name = $CURRENT_PIC_DATA['title'] : $name = 'No Title'; //checking 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'].$thumb_url.'[/IMG][/url]';
$name_url = '[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.']'.$name.'[/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></td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.'</textarea></td>';
$bbcode_data .= '</tr><tr>';
$bbcode_data .= '<td></td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40">'.$name_url.'</textarea></td>';
$bbcode_data .= '</tr></table>';
$search = 'LR.gif"></td>
</tr>
</table>';
$replace = $search.$bbcode_data;
$page_html = str_replace($search,$replace,$page_html);
return $page_html;
}
?>
If you see anything that's not right with this, can someone please say something? I know next to nothing about Coppermine and I'm not sure what difference there is--if any--between $CURRENT_PIC_DATA and the $pic_data you used in the original plugin.
And that brings me to my next point: I'll have to go back and check now, but I believe I have found some kind of error. I was testing this on a photo with a space in the title, e.g. "Jim Bob", and I noticed that the 2nd URL code looked like this:
[url="http://localhost/path/to/image"]Jim
And then stopped at the space.
Is this some problem with $CURRENT_PIC_DATA or does this exist in the original plugin? Like I said, I have to go back and check now, but I'm too lazy to do it right now (I was working at another computer). Chances are I'll do it before someone replies, so I'll probably be replying again shortly.
Anyway, this isn't much a problem for me as it may be for everyone using this plugin, since I probably won't be using that BBcode box anyway... just the 1st one, and then adding my own.
EDIT: ^^ That space problem doesn't actually exist.. For whatever reason the URL breaks to a new line, and you can only see the whole thing if you scroll with your scroll wheel, instead of there being a scroll bar that shows you there is more to the URL.
Thanks for a great mod!