mirror of
https://github.com/e107inc/e107.git
synced 2025-08-16 19:44:09 +02:00
Extra checking
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_admin/links.php,v $
|
||||
| $Revision: 1.9 $
|
||||
| $Date: 2008-03-09 20:33:04 $
|
||||
| $Revision: 1.10 $
|
||||
| $Date: 2008-06-06 19:14:20 $
|
||||
| $Author: e107steved $
|
||||
|
|
||||
| links.php?debug shows stored data for each link after name (before constant conversion)
|
||||
@@ -554,12 +554,15 @@ class links
|
||||
}
|
||||
|
||||
|
||||
function submit_link($sub_action, $id) {
|
||||
function submit_link($sub_action, $id)
|
||||
{
|
||||
global $sql, $e107cache, $tp;
|
||||
if(!is_object($tp)) {
|
||||
if(!is_object($tp))
|
||||
{
|
||||
$tp=new e_parse;
|
||||
}
|
||||
|
||||
$id = intval($id);
|
||||
$parent_id = ($_POST['link_parent']) ? intval($_POST['link_parent']) : 0;
|
||||
|
||||
$link_name = $tp->toDB($_POST['link_name']);
|
||||
@@ -568,17 +571,22 @@ class links
|
||||
|
||||
$link_description = $tp->toDB($_POST['link_description']);
|
||||
$link_button = $tp->toDB($_POST['link_button']);
|
||||
$link_render = intval($_POST['linkrender']);
|
||||
$link_open = intval($_POST['linkopentype']);
|
||||
$link_class = $tp->toDB($_POST['link_class']);
|
||||
|
||||
$link_t = $sql->db_Count("links", "(*)");
|
||||
if ($id) {
|
||||
$sql->db_Update("links", "link_parent='$parent_id', link_name='$link_name', link_url='$link_url', link_description='$link_description', link_button= '$link_button', link_category='".$_POST['linkrender']."', link_open='".$_POST['linkopentype']."', link_class='".$_POST['link_class']."' WHERE link_id='$id'");
|
||||
if ($id)
|
||||
{
|
||||
$sql->db_Update("links", "link_parent='{$parent_id}', link_name='{$link_name}', link_url='{$link_url}', link_description='{$link_description}', link_button= '{$link_button}', link_category='{$link_render}', link_open='{$link_open}', link_class='{$link_class}' WHERE link_id='{$id}'");
|
||||
//rename all sublinks to eliminate old embedded 'submenu' etc hierarchy.
|
||||
// this is for upgrade compatibility only. Current hierarchy uses link_parent.
|
||||
|
||||
$e107cache->clear("sitelinks");
|
||||
$this->show_message(LCLAN_3);
|
||||
} else {
|
||||
$sql->db_Insert("links", "0, '$link_name', '$link_url', '$link_description', '$link_button', ".$_POST['linkrender'].", ".($link_t+1).", ".$parent_id.", ".$_POST['linkopentype'].", ".$_POST['link_class']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql->db_Insert("links", "0, '$link_name', '$link_url', '$link_description', '$link_button', ".$link_render.", ".($link_t+1).", ".$parent_id.", ".$link_open.", ".$link_class);
|
||||
$e107cache->clear("sitelinks");
|
||||
$this->show_message(LCLAN_2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user