<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/

	incoh();
	$mainlink = 1;
	menu(1);
	br('1');
	Max_OpenTable();
	echo "<center><font class='title'><b>"._ADDALINK."</b></font></center><br /><br />";
	if (defined('USER_ALLOW') || $links_anonaddlinklock == 1) {  /* 06-24-01 Bug fix : changed $links_anonaddlinklock != 1 to $links_anonaddlinklock == 1 */
	echo "<b>"._INSTRUCTIONS.":</b><br />"
	."<strong><big>&middot;</big></strong> "._SUBMITONCE."<br />"
	."<strong><big>&middot;</big></strong> "._POSTPENDING."<br />"
	."<strong><big>&middot;</big></strong> "._USERANDIP."<br />"
	."<form method=\"post\" action=\"modules.php?name=$module_name&amp;l_op=Add\">"
	.""._PAGETITLE.": <input type=\"text\" name=\"title\" size=\"50\" maxlength=\"100\" /><br />"
	.""._PAGEURL.": <input type=\"text\" name=\"url\" size=\"50\" maxlength=\"100\" value=\"http://\" /><br />";
	echo ""._CATEGORY.": <select name=\"cat\">";
	$result = $db->sql_query("SELECT cid, title, parentid from ".TABLE_LINKS_CATEGORIES." order by parentid,title");
	while ($row = $db->sql_fetchrow($result)) {
		$cid2 = $db->XMFnum($row['cid']);
		$ctitle2 = stripslashes(check_html($row['title'], "nohtml"));
		$parentid2 = $db->XMFnum($row['parentid']);
		if ($parentid2!=0) $ctitle2=getparent($parentid2,$ctitle2);
		echo "<option value=\"$cid2\">$ctitle2</option>";
	}
	echo "</select><br /><br />"
	.""._LDESCRIPTION."<br /><textarea name=\"description\" cols=\"70\" rows=\"15\"></textarea><br /><br /><br />"
	.""._YOURNAME.": <input type=\"text\" name=\"auth_name\" size=\"30\" maxlength=\"60\" /><br />"
	.""._YOUREMAIL.": <input type=\"text\" name=\"email\" size=\"30\" maxlength=\"60\" /><br /><br />"
	."<input type=\"hidden\" name=\"l_op\" value=\"Add\" />"
	."<input type=\"submit\" value=\""._ADDURL."\" /> "._GOBACK."<br /><br />"
	."</form>";
	}else {
		echo "<center>"._LINKSNOTUSER1."<br />"
		.""._LINKSNOTUSER2."<br /><br />"
		.""._LINKSNOTUSER3."<br />"
		.""._LINKSNOTUSER4."<br />"
		.""._LINKSNOTUSER5."<br />"
		.""._LINKSNOTUSER6."<br />"
		.""._LINKSNOTUSER7."<br /><br />"
		.""._LINKSNOTUSER8."";
	}
	Max_CloseTable();
	incof();