Allow other webmasters to promote your site with this simple promotional MOD
This code was specificly writen for
http://www.free-online-games-central.com you can see a live demo here.
But works on any coppermine site in the same way.
1. Copy the code below anywhere in your template
<p><b>Link to this File!</b><br />
<textarea rows='5' cols='40' style='font-size: 9px; font-family: Verdana;'><a target=_blank href="{CONFIG_DOMAIN}play/{GAME_ID}/">{GAME_NAME}</a></textarea> </p>
<p>Add this File to your website or blog!</b><br /><br />
<textarea rows='20' cols='40' style='font-size: 9px; font-family: Verdana;'><center><a target=_blank href="{CONFIG_DOMAIN}play/{GAME_ID}/">{GAME_NAME}</a><br /><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="{GAME_WIDTH}" height="{GAME_HEIGHT}"><param name="movie" value="{CONFIG_DOMAIN}games/{GAME_SRC}"><param name="quality" value="high"><param name="menu" value="true"><embed width="{GAME_WIDTH}" height="{GAME_HEIGHT}" src="{CONFIG_DOMAIN}games/{GAME_SRC}" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object><br /><a target=_blank href='{CONFIG_DOMAIN}'>{CONFIG_SLOGAN}</a></center></textarea>
There are 2 parts, you can remove the second section if you dont have flash movies or games, but has the same effect as cmfetch for displaying content on other websites. If your displaying pictures remove all of the flash stuff (...pluginspage="
http://www.macromedia.com/go/getflashplayer" type="...) etc etc
2. Open funtions.inc.php, find line 691
$template_footer = CPGPluginAPI::filter('gallery_footer','').substr($template, $gallery_pos);
IMMEDIATLY after this add:
/*++++++++++++++++++ Code Modified by Westnblue Network www.simple-scripts-online.com [starts] +++++++++++++++++++++++++++++*/
/*+++++++++ Allow other webmasters to copy a link and add it to thier blog or website. Great promotional and SEO MOD ++++++*/
// Retrieving values from REQUEST
$hostname = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$host = "http://".$_SERVER['HTTP_HOST'];
$album_id = $_REQUEST['album'];
$pos = $_REQUEST['pos'];
$template_footer = str_replace('{CONFIG_DOMAIN}play/{GAME_ID}/', $hostname ,$template_footer); // Replacing Variables
/*------------------- Retrieving The File Id to be displayed -------------------------------*/
if($album_id == 'random')
{
$pid = abs($pos);
}
elseif($album_id == 'lastup')
{
$qry = "select `pid` from cpg1411_pictures order by `pid` desc limit ".$pos.",1";
$get_pid = mysql_query($qry);
$pidval = mysql_fetch_assoc($get_pid);
$pid = $pidval['pid'];
}
else
{
$qry = "select `pid` from cpg1411_pictures where aid='".$album_id."' order by `pid` asc limit ".$pos.",1";
$get_pid = mysql_query($qry);
$pidval = mysql_fetch_assoc($get_pid);
$pid = $pidval['pid'];
}
/*------------------- Retrieving The File Title to be displayed -------------------------------*/
if(($album_id == 'random')||($album_id == 'lastup'))
{
$get_title= mysql_query("select cpg1411_albums.title as `title` from cpg1411_albums,cpg1411_pictures where cpg1411_pictures.aid = cpg1411_albums.aid and cpg1411_pictures.pid='".$pid."'") or die(mysql_error());
}
else
{
$get_title= mysql_query("select `title` from cpg1411_albums where aid='".$album_id."'") or die(mysql_error());
}
$rowvalue = mysql_fetch_assoc($get_title);
$game_title = $rowvalue['title'];
if($game_title == '')
{
$game_title = "More"; // default
}
$template_footer = str_replace('{GAME_NAME}',$game_title,$template_footer); // Replacing Variables
/*------------------- Retrieving Various Data corresponding to The File -------------------------------*/
$get_details= mysql_query("select * from cpg1411_pictures where `pid`='".$pid."'") or die(mysql_error());
$rowvalue1 = mysql_fetch_assoc($get_details);
$req = $host."/albums/games/";
$game_src = $rowvalue1['filename'];
$game_ht = $rowvalue1['pheight'];
$game_wd = $rowvalue1['pwidth'];
// Replacing Variables
$template_footer = str_replace('{GAME_HEIGHT}',$game_ht,$template_footer);
$template_footer = str_replace('{GAME_WIDTH}',$game_wd,$template_footer);
$template_footer = str_replace('{GAME_SRC}',$game_src,$template_footer);
$template_footer = str_replace('{CONFIG_DOMAIN}games/',$req,$template_footer);
$template_footer = str_replace('{CONFIG_DOMAIN}',$host,$template_footer);
$template_footer = str_replace('{CONFIG_NAME}',$host,$template_footer);
$template_footer = str_replace('{CONFIG_SLOGAN}',"LOOK FOR THIS LINE IN FUNCTIONS.INC.PHP TO DISPLAY YOUR SLOGAN",$template_footer);
/*++++++++++++++++++ Code Modified by Westnblue Network www.simple-scripts-online.com [ends] +++++++++++++++++++++++*/
You wont have to change the variables here, but if you do, change the code in template.html to suit
There you have it 2 full days of my life on this MOD

Hope you can find it as useful as we have