<?php
// $Id: admin_functions.php,v 1.4 2005/10/28 11:56:02 ohwada Exp $

// 2005-10-14 K.OHWADA
// BUG 3095: the number of links does not change, if delete link
// add del_link_vote_comm_catlink_by_lid($lid)
// add del_link_vote_comm_by_lid($lid)

//=========================================================
// admin functions
// created from v0.9
// 2004-12-05 K.OHWADA
//=========================================================

function print_link_index()
{
	echo "<table width='80%' border='0' cellspacing='1' class='outer'>";
	echo "<tr class='odd'><td>";
	echo " - <a href='index.php'>"._WEBLINKS_ADMIN_INDEX."</a>";
	echo "<br /><br />\n";
	echo " - <a href='link_list.php'>"._WEBLINKS_ADMIN_LINK_MANAGE."</a>";
	echo "<br /><br />\n";
	echo"</td></tr></table>\n";
	echo "<br />\n";
}


// delete link, votedata, comments, catlink
// caller delLink() delBrokenLinks()
function del_link_vote_comm_catlink_by_lid($lid)
{
	global $eh;
	global $tbl_catlink;

	del_link_vote_comm_by_lid($lid);
	$tbl_catlink->deleteByLid($lid)  or  $eh->show("0013");
}

// delete link, votedata, comment, notification
// caller deleteCategory()
function del_link_vote_comm_by_lid($lid)
{
	global $eh;
	global $tbl_link, $tbl_votedata;
	global $xoops_module_mid;

	$tbl_link->delete($lid)          or  $eh->show("0013");
	$tbl_votedata->deleteByLid($lid) or  $eh->show("0013");
	xoops_comment_delete( $xoops_module_mid, $lid);
	xoops_notification_deletebyitem ( $xoops_module_mid, 'link', $lid);
}

?>
