<?php
// $Id: linkformat.php,v 1.1 2004/07/11 10:28:22 Farsus Exp $
// -------------------------------------------------------------------------//
//			                 RUNCMS                                         //
//                                                                          //
//	 reliable - Unique - Nocost &  Simplicity & ease off use                //
//                       < http://www.runcms.org >                          //
// -------------------------------------------------------------------------//
// Original Author: James Knickelbein
// Author Website : http://www.journeymilwaukee.com
// License Type   : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //

global $HTTP_SERVER_VARS;
if ( preg_match("/linkformat\.php/i", $HTTP_SERVER_VARS['PHP_SELF']) ) {
	exit();
	}

echo "<table width='100%' cellspacing='0' cellpadding='5' border='0'><tr><td align='center' valign='top'>";

if ($mylinksConfig['useshots']) {
	if ($logourl) {
		$logourl = formatURL(XOOPS_URL.'/modules/mylinks/cache/shots/', $logourl);
		echo "
		<a href='".XOOPS_URL."/modules/mylinks/visit.php?lid=$lid' target='_blank'><img src='$logourl' border='0' alt='' width='".$mylinksConfig['shotwidth']."' /></a>
		</td><td align='center' valign='top' width='100%'>";
	}
}

$path = $mytree->getNicePathFromId($cid, "title", "viewcat.php?");
$path = substr($path, 0, -2);
$path = str_replace(":", "<img src='".XOOPS_URL."/modules/mylinks/images/arrow.gif' board='0' alt=''>", $path);

echo "
<table width='100%' border='0' cellspacing='1' cellpadding='0' class='bg2'><tr>
<td>
<table width='100%' border='0' cellspacing='1' cellpadding='4' class='bg1'><tr>
<td colspan='2' class='bg2'>
<b>"._MD_CATEGORYC."</b>".$path."
</td>

</tr><tr>

<td class='bg3'>
<a href='".XOOPS_URL."/modules/mylinks/visit.php?lid=$lid' target='_blank'><img src='images/home.gif' border='0' alt='".$url."'></a>
<a href='".XOOPS_URL."/modules/mylinks/visit.php?lid=$lid' target='_blank'><b>$ltitle</b></a>";

newlinkgraphic($time, $status);
popgraphic($hits);

echo "
</td>
<td class='bg3' align='right' valign='bottom'>
<b>"._MD_HITSC."</b>$hits&nbsp;&nbsp;
<img src='".XOOPS_URL."/modules/mylinks/images/time.gif' border='0' alt='"._MD_LASTUPDATEC."'>
".$datetime."
</td>

</tr><tr>

<td colspan='2' class='bg1' style='border-bottom:solid 1px;border-top:solid 1px;'>
<img src='".XOOPS_URL."/modules/mylinks/images/decs.gif' border='0' align='buttom' alt='"._MD_DESCRIPTION."' />&nbsp;:&nbsp; $description
</td>

</tr><tr>
<td colspan='2' class='bg2' align='center'>";

if ($rating != "0" || $rating != "0.0") {
	if ($votes == 1) {
		$votestring = _MD_ONEVOTE;
		} else {
			$votestring = sprintf(_MD_NUMVOTES, $votes);
		}
	echo "<b>"._MD_RATINGC."</b>$rating ($votestring)";
}

global $xoopsUser, $meta;
echo " <a href='".XOOPS_URL."/modules/mylinks/ratelink.php?lid=$lid'>"._MD_RATETHISSITE."</a>";
if ($xoopsUser) {
	echo " | <a href='".XOOPS_URL."/modules/mylinks/modlink.php?lid=$lid'>"._MD_MODIFY."</a>";
}
echo " | <a href='".XOOPS_URL."/modules/mylinks/brokenlink.php?lid=$lid'>"._MD_REPORTBROKEN."</a>";
echo " | <a target='_top' href='mailto:?subject=".rawurlencode(sprintf(_MD_INTRESTLINK, $meta['title']))."&body=".rawurlencode(sprintf(_MD_INTLINKFOUND,$meta['title']).":\r\n".XOOPS_URL."/modules/mylinks/singlelink.php?lid=$lid")."'>"._MD_TELLAFRIEND."</a>";
if ($xoopsUser) {
	if ( $xoopsUser->isAdmin($xoopsModule->mid()) ) {
		echo "&nbsp; &nbsp; <a href='".XOOPS_URL."/modules/mylinks/admin/index.php?lid=$lid&fct=mylinks&op=modLink'><img src='".XOOPS_URL."/modules/mylinks/images/editicon.gif' border='0' alt='"._MD_EDITTHISLINK."' /></a>";
	}
}

echo "</td></tr></table></td></tr></table></td></tr></table>";
?>
