Here's the working version of codebase.php, with the following features:
1. Just the absolute URL (plain)
2. HTML title link, no thumb
3. HTML with thumb and title link (CPMFetch version... It is commented out, but it works perfectly if you want it)
4. HTML with thumb and title link (standalone version)
5. bbCode with thumbnail, no text
6. bbCode with thumbnail and title link
7. bbcode title link, no thumb (title is the anchor text)
Tip to non-gurus: Remember that if you add a comment inside of function bbcode_add_data($pic_data), you need to use this method
<!-- comment -->
because the typical PHP comment such as
// comment
will still display as text and not an invisible comment.
<?php
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
include ("http://www.jakesjokes.com/gallery/include/functions.inc.php");
// Create the BBcode with link to thumbnail
$bbcodethumb_url = get_pic_url($CURRENT_PIC_DATA, 'thumb');
// Add a filter
$thisplugin->add_filter('file_data','bbcode_add_data');
function bbcode_add_moredata($pic_data){ //$pic_data
$thumb_url = get_pic_url($pic_data, 'thumb');
$fullsized_url = get_pic_url($pic_data);
$normal_url = get_pic_url($pic_data, 'normal');
$pic_data['html'] = $thumb_url.'<br>'.$fullsized_url.'<br>'.$normal_url.'<br>'.$pic_data['html'];
return $pic_data; //return $pic_data
}
function bbcode_add_data($pic_data){
$event = isset($_GET['event']) ? $_GET['event'] : null;
switch ($event) {
case 'show_bbcode':
//Define Thumbnail image URL, as called from gallery (ie - albums/10001/thumb_picture.jpg)
$thumb_url = get_pic_url($pic_data, 'thumb');
//Define Fullsized image URL, as called from gallery (ie - albums/10001/thumb_picture.jpg)
$fullsized_url = get_pic_url($pic_data);
//Define Intermediate image URL, as called from gallery (ie - albums/10001/thumb_picture.jpg)
$normal_url = get_pic_url($pic_data, 'normal'); $display_data = <<<EOT
<table>
<tr>
<td>
<!-- Generate code for absolute URL of intermediate pictures page (ie - displayimage.php?pos=-1234) -->
<strong>Permanent URL:</strong><br><textarea name="textarea" cols="50" rows="2">
http://www.jakesjokes.com/gallery/displayimage.php?pos=-{$pic_data['pid']}</textarea>
<br>
<!-- Generate HTML code linking thumbnail to intermediate picture page (ie - displayimage.php?pos=-1234) -->
<!-- This version currently requires CPMFetch - See below for stand alone version -->
<!-- BEGIN commenting out CPMFetch version
<strong>HTML Linking code:</strong> (With Thumbnail)<br><textarea name="textarea" cols="50" rows="6">
<iframe SRC="http://www.jakesjokes.com/specificoffsite.php?item={$pic_data['pid']}" TITLE="Free funny jokes, videos, and pictures at JakesJokes.com" WIDTH="135" HEIGHT="160" FRAMEBORDER="0" SCROLLING="no"></iframe></textarea>
<br>
END editing out CPMFetch version -->
<!-- Generate HTML code linking thumbnail to intermediate picture page (ie - displayimage.php?pos=-1234) -->
<!-- This version DOES NOT require CPMFetch -->
<strong>HTML Linking code:</strong> (With Thumbnail)<br><textarea name="textarea" cols="50" rows="8">
<a href="http://www.jakesjokes.com/gallery/displayimage.php?pos=-{$pic_data['pid']}" TITLE="Free funny jokes, videos, and pictures at JakesJokes.com"><img src="http://www.jakesjokes.com/gallery/{$thumb_url}" WIDTH="100" HEIGHT="100"><br>{$pic_data['title']}</a>
</textarea>
<br>
<!-- Generate HTML code linking text to intermediate picture page (ie - displayimage.php?pos=-1234) -->
<strong>HTML Linking code:</strong> (Without Thumbnail)<br><em>Tip</em> - You can edit "Funny video or picture" to say whatever you want)<br><textarea name="textarea" cols="50" rows="5">
<a href="http://www.jakesjokes.com/gallery/displayimage.php?pos=-{$pic_data['pid']}" title="Free funny jokes, videos, and pictures at JakesJokes.com" target="_blank">Funny video or picture</a></textarea>
<br>
<strong>Forum bbCode:</strong> (Thumb and title)<br><textarea name="textarea" cols="50" rows="6">
[url=http://www.jakesjokes.com/gallery/displayimage.php?pos=-{$pic_data['pid']}][img]http://www.jakesjokes.com/gallery/{$thumb_url}[/img]
{$pic_data['title']}[/url]
</textarea>
<br>
<strong>Forum bbCode:</strong> (Thumb only)<br><textarea name="textarea" cols="50" rows="4">
[url=http://www.jakesjokes.com/gallery/displayimage.php?pos=-{$pic_data['pid']}][img]http://www.jakesjokes.com/gallery/{$thumb_url}[/img][/url]</textarea>
<br>
<strong>Forum bbCode:</strong> (Title text only)<br><textarea name="textarea" cols="50" rows="2">
[url=http://www.jakesjokes.com/gallery/displayimage.php?pos=-{$pic_data['pid']}]{$pic_data['title']}[/url]</textarea>
</td>
</tr>
</table>
EOT;
break;
default :
$referer = ($_SERVER['PHP_SELF'] . (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] : ''));
$display_data = <<<EOT
<table>
<tr>
<td>
<a href="{$referer}&event=show_bbcode"><h2><font color="blue"><u>Link to this!</u></font></h2></a>
</td>
</tr>
</table>
EOT;
break;
}
$pic_data['html'] = $display_data.$pic_data['html'];
return $pic_data;
}
?>