I guess I'm just impatient. I looked over the code, and though I'm no programmer, I set up a BBcode that would work on my site and implemented it into the plugin given. Also, I only really wanted this so that users could embed their gallery entries into the forums. Here's what I did:
<?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>
<br><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
$fs_url = '&#91;img&#93;'.$CONFIG['ecards_more_pic_target'].$full_url.'&#91;&#47;img&#93;';
$ve_url = '&#91;flv&#93;'.$CONFIG['ecards_more_pic_target'].$full_url.'&#91;&#47;flv&#93;';
//this just brings everything in form... we create a table etc.,
$bbcode_data = $script_data;
$bbcode_data .= '<table align="center" width="600">';
//thumbnail image code with link to intermediate image
$textarea_prop = 'name="bbcode" rows="1" cols="75" style="overflow:off; white-space:nowrap" readonly="readonly"';
//fullsize image code
$bbcode_data .= '<tr><td>Fullsize:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$fs_url.'</textarea></td></tr>';
//video embed code
$bbcode_data .= '<tr><td>Video Embed Code:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$ve_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;
}
?>
Basically, I removed the entire thumbnail string and added an extra variable specifically for my FLV files. As I allow more video formats, I'll increase the options. Granted, it's not the most flexible, but it's easy and functional for my users.
