I don't really know where to post this, so hopefully this is the best place. I modified your BB code plugin so that it would display html tag links instead, and combined it with the javascript toggle display div to make it visible only when you click on a link that sits below the picture. I also removed the copy code, because it didn't support FF.
You can also easily comment out if you don't want any of the particular sizes to be displayed.
The only problem that I have is that once you click the link, you can't make it invisible again until the page reloads, because the css in
<div id="hotlinking" style="display: none; margin: 0px 20px 0px 20px;">
needs to be actually inserted into the head of the document or into an externally linked css file as:
div#hotlinking {
display: none;
margin: 0px 20px 0px 20px;
}
If anyone knows how to get around this, let me know. In the meantime, its not that big of a deal. Its more of a personal preference.
<?php
/**************************************************
CPG BB Code Plugin for Coppermine Photo Gallery
Modified by Zachary Barnes of UselessHacks.com
Now creates html tags instead of BB
*************************************************
Copyright (c) 2006 Thomas Lange <stramm@gmx.net>
*************************************************
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
*************************************************
Coppermine version: 1.4.9
BB Code Plugin version: 1.2
$Revision: 1.0 $
$Author: stramm $
***************************************************/
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;
//Javascript to hide hotlinking information along with div arrangement, taken from a common toggling script floating around the net
$script_data = <<< EOT
<script language="javascript" type="text/javascript">
<!--
function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}
//-->
</script>
<a href="javascript:toggleLayer('hotlinking');" title="View Hotlinking Information">View Hotlinking Information</a>
<div id="hotlinking" style="display: none; margin: 0px 20px 0px 20px;">
EOT;
$thumb_url = get_pic_url($pic_data, 'thumb'); //here we grab the url to the thumb url
$int_url = get_pic_url($pic_data, 'normal'); //intermediate pic
$full_url = get_pic_url($pic_data, 'fullsize'); //fullsized pic
$pic_data['title'] ? $name = $pic_data['title'] : $name = 'No Title'; //checking if the pic has a title, if not we set it to 'No title'
//Generating the file paths for each picture size
$tn_url = '<a href="'.$CONFIG['ecards_more_pic_target'].$int_url.'"><img src="'.$CONFIG['ecards_more_pic_target'].$thumb_url.'" alt="'.$name.'" /></a>';
$im_url = '<a href="'.$CONFIG['ecards_more_pic_target'].$full_url.'"><img src="'.$CONFIG['ecards_more_pic_target'].$int_url.'" alt="'.$name.'" /></a>';
$fs_url = '<img src="'.$CONFIG['ecards_more_pic_target'].$full_url.'" alt="'.$name.'" />';
//this just brings everything in form... we create a table etc.,
$bbcode_data = $script_data;
$bbcode_data .= '<table align="center" width="'.$CONFIG['picture_width'].'">';
//thumbnail image code with link to intermediate image
$textarea_prop = 'name="bbcode" rows="1" cols="50" style="overflow:off; white-space:nowrap" readonly="readonly"';
$bbcode_data .= '<tr><td>Thumbnail:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$tn_url.'</textarea></td></tr>';
//intermediate image code with link to fullsize image
$bbcode_data .= '<tr><td>Intermediate:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$im_url.'</textarea></td></tr>';
//fullsize image code
$bbcode_data .= '<tr><td>Fullsize:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$fs_url.'</textarea></td></tr>';
//closing table and visiblity div
$bbcode_data .= '</table></div>';
//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;
}
?>
EDIT: Fixed a few bugs. Now trying to find a replacement for 'wrap="off"' that validates under xhtml.
EDIT: The good news is that the above code is now XHTML valid.
Apparently, everyone is looking for a wrap=off equivalent that validates under xhtml, but it doesn't exists. So to keep all the text on one line, I've used " " for all of the spaces, effectively linking everything together. Unfortunately, in FF, if your picture title has a space in it, it will chop it up to two lines. IE6 works fine, and keeps everything on the same line.
So, you could increase the rows to 'rows="2"', or you could remove the 'alt="$name"' attribute, but I'm sticking with it like it is unless anyone has any work-arounds or suggestions.