<?
include "../CheckUser.php";
include_once("../comm/db_sql.php");
include_once("../comm/config.php");
include_once("../comm/connect.php");
include_once("../comm/Function.php");
include_once("../../Smarty/Smarty.class.php");

$page_show = new Smarty(); 
$page_show->template_dir = "./template";
$page_show->compile_dir = "./templates_c"; 
$page_show->left_delimiter = "<{";      
$page_show->right_delimiter = "}>";

$check=$_GET['action'];
$id=$_GET['id'];
if ($check=="edit"){
	$channel_record=Links_query_One($id,$db);
	$action="edit&id=".$id;
}else if ($check=="copy"){
	$channel_record=Links_query_One($id,$db);
	$action="add";
}else
{	
	$action="add";
}
$page_show->assign("action", $action);
$page_show->assign("Linkname", $channel_record['Linkname']);
$page_show->assign("id", $channel_record['id']);
$page_show->assign("LinkUrl", $channel_record['LinkUrl']);
$page_show->display("add.html"); 
?>