I have a coppermine (PHP) site that I use to host "myspace" type comments/graphics on. When someone copies a comment from my site and pastes it on a webpage, it leaves a link back to my site.
In the codebase.php file (? -- I think?) I want to redirect/change both: the active url that makes the graphic "clickable" and the "img_src" code to: another url, other than the one for the site.
For example: Current version of a code
<center><a href="http://www.mywebsite.com/displayimage.php?pos=-63996" ><img src="http://www.mywebsite.com/albums/userpic ... h1%7E0.jpg" border="0"><br>
I would like to redirect the original url to another one, like:
<center><a href="http://www.anotherwebsite.com/displayim ... pos=-63996" ><img src="http://www.anotherwebsite.com/albums/us ... h1%7E0.jpg" border="0"><br>
Any help on this is greatly appreciated!
Here is a sample of the codebase.php file:
Code: Select all
<?php
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
//Places a text box in the file information list that allows you to embed an image on another site.
$thisplugin->add_filter('file_info','html_embed');
function html_embed($info)
{
global $information;
global $CONFIG;
global $CURRENT_PIC_DATA;
$info['Embed URL'] = '<table cellpadding="0" cellspacing="1" border="0">';
$info['Embed URL'] .= '<tr><td><b><font color=yellow>HTML Code: For PROFILE pages & COMMENT Walls, or "Autographs" in MyYearbook: (Right click) "Copy" the code below and then (right click) "paste" it, where you want this pic to appear. On MyYearbook, the profile page must be set to allow HTML by the page owner.</font><b><font color=red> THANK YOU for using Mywebsite.com! Please help spread the word! </font></b></td></tr><tr><td><textarea name="htmlcode" class="textinputs" style="border:solid 1px orange; overflow:hidden;" rows="4" cols="60" wrap="on" style="overflow:hidden;height:15px;" onfocus="this.select();" onclick="this.select();"><center><a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" ><img src="' . $CONFIG["ecards_more_pic_target"] . get_pic_url($CURRENT_PIC_DATA, 'fullsize') . '" border="0"><br><a href="http://www.mywebsite.com">MyWebsite.com</a></center><br></textarea></td></tr>';
$info['Embed URL'] .= '<tr><td style="height:15px;"></td></tr><tr><td><font color=orange>BBCode: (for bulletin board systems or sites that use BBCODE)</td></tr><tr><td><textarea name="bbcode" class="textinput" rows="4" cols="60" wrap="on" style="overflow:hidden;height:15px;" onfocus="this.select();" onclick="this.select();">) . "?pos=-$CURRENT_PIC_DATA[pid]" . '][img]'%20.%20$CONFIG["ecards_more_pic_target"]%20.%20get_pic_url($CURRENT_PIC_DATA,%20'fullsize')%20.%20'[/img]</textarea></td></tr>';
$info['Embed URL'] .= '</table>';
return $info;
}
// Add an install action
$thisplugin->add_action('plugin_install','html_embed_install');
// Install function
function html_embed_install() {
// Install
if ($_POST['test']=='true')
{
return true;
// Loop again
} else {
return true;
}
}
?>