".$locale['401'].""; } opentable($title); echo "
".$message."
\n"; closetable(); tablebreak(); } if ($action == "refresh") { $i = 1; $result = dbquery("SELECT * FROM ".$db_prefix."site_links ORDER BY link_order"); while ($data = dbarray($result)) { $result2 = dbquery("UPDATE ".$db_prefix."site_links SET link_order='$i' WHERE link_id='".$data['link_id']."'"); $i++; } redirect(FUSION_SELF.$aidlink); } elseif ($action == "moveup") { $data = dbarray(dbquery("SELECT * FROM ".$db_prefix."site_links WHERE link_order='$order'")); $result = dbquery("UPDATE ".$db_prefix."site_links SET link_order=link_order+1 WHERE link_id='".$data['link_id']."'"); $result = dbquery("UPDATE ".$db_prefix."site_links SET link_order=link_order-1 WHERE link_id='$link_id'"); redirect(FUSION_SELF.$aidlink); } elseif ($action == "movedown") { $data = dbarray(dbquery("SELECT * FROM ".$db_prefix."site_links WHERE link_order='$order'")); $result = dbquery("UPDATE ".$db_prefix."site_links SET link_order=link_order-1 WHERE link_id='".$data['link_id']."'"); $result = dbquery("UPDATE ".$db_prefix."site_links SET link_order=link_order+1 WHERE link_id='$link_id'"); redirect(FUSION_SELF.$aidlink); } elseif ($action == "delete") { $data = dbarray(dbquery("SELECT * FROM ".$db_prefix."site_links WHERE link_id='$link_id'")); $result = dbquery("UPDATE ".$db_prefix."site_links SET link_order=link_order-1 WHERE link_order>'".$data['link_order']."'"); $result = dbquery("DELETE FROM ".$db_prefix."site_links WHERE link_id='$link_id'"); redirect(FUSION_SELF.$aidlink."&status=del"); } else { if (isset($_POST['savelink'])) { $link_name = stripinput($_POST['link_name']); $link_url = stripinput($_POST['link_url']); $link_visibility = isNum($_POST['link_visibility']) ? $_POST['link_visibility'] : "0"; $link_position = isset($_POST['link_position']) ? $_POST['link_position'] : "0"; $link_window = isset($_POST['link_window']) ? $_POST['link_window'] : "0"; if ($action == "edit") { $result = dbquery("UPDATE ".$db_prefix."site_links SET link_name='$link_name', link_url='$link_url', link_visibility='$link_visibility', link_position='$link_position', link_window='$link_window' WHERE link_id='$link_id'"); redirect(FUSION_SELF.$aidlink); } else { if(!$link_order) $link_order=dbresult(dbquery("SELECT MAX(link_order) FROM ".$db_prefix."site_links"),0)+1; $result = dbquery("UPDATE ".$db_prefix."site_links SET link_order=link_order+1 WHERE link_order>='$link_order'"); $result = dbquery("INSERT INTO ".$db_prefix."site_links (link_name, link_url, link_visibility, link_position, link_window, link_order) VALUES ('$link_name', '$link_url', '$link_visibility', '$link_position', '$link_window', '$link_order')"); redirect(FUSION_SELF.$aidlink); } } if ($action == "edit") { $result = dbquery("SELECT * FROM ".$db_prefix."site_links WHERE link_id='$link_id'"); $data = dbarray($result); $link_name = $data['link_name']; $link_url = $data['link_url']; $link_visibility = $data['link_visibility']; $link_order = $data['link_order']; $pos1_check = ($data['link_position']=="1" ? " checked" : ""); $pos2_check = ($data['link_position']=="2" ? " checked" : ""); $pos3_check = ($data['link_position']=="3" ? " checked" : ""); $window_check = ($data['link_window']=="1" ? " checked" : ""); $formaction = FUSION_SELF.$aidlink."&action=edit&link_id=".$data['link_id']; opentable($locale['410']); } else { $link_name = ""; $link_url = ""; $link_visibility = ""; $link_order = ""; $pos1_check = " checked"; $pos2_check = ""; $pos3_check = ""; $window_check = ""; $formaction = FUSION_SELF.$aidlink; opentable($locale['411']); } $visibility_opts = ""; $sel = ""; $user_groups = getusergroups(); while(list($key, $user_group) = each($user_groups)){ $sel = ($link_visibility == $user_group['0'] ? " selected" : ""); $visibility_opts .= "\n"; } echo "
".$locale['420']."
".$locale['421']."
".$locale['422']." \n"; if ($action != "edit") { echo $locale['423']." "; } echo "
".$locale['424']." ".$locale['425']."
".$locale['426']."
".$locale['427']."
".$locale['428']."
\n"; closetable(); tablebreak(); opentable($locale['412']); echo "\n"; $result = dbquery("SELECT * FROM ".$db_prefix."site_links ORDER BY link_order"); if (dbrows($result) != 0) { $i = 0; $k = 1; while($data = dbarray($result)) { echo "\n\n"; } } else { echo "\n\n\n"; } if (dbrows($result)) echo "\n\n\n"; echo "
".$locale['430']." ".$locale['431']." ".$locale['432']." ".$locale['433']."
"; if ($data['link_position'] == 3) echo ""; if ($data['link_name'] != "---" && $data['link_url'] == "---") { echo "".$data['link_name']."\n"; } else if ($data['link_name'] == "---" && $data['link_url'] == "---") { echo "
\n"; } else { if (strstr($data['link_url'], "http://") || strstr($data['link_url'], "https://")) { echo " ".$data['link_name']."\n"; } else { echo " ".$data['link_name']."\n"; } } if ($data['link_position'] == 3) echo "
"; echo "
".getgroupname($data['link_visibility'])." ".$data['link_order']." \n"; if (dbrows($result) != 1) { $up = $data['link_order'] - 1; $down = $data['link_order'] + 1; if ($k == 1) { echo "".$locale[\n"; } elseif ($k < dbrows($result)) { echo "".$locale[\n"; echo "".$locale[\n"; } else { echo "".$locale[\n"; } } $k++; echo " ".$locale['434']." - ".$locale['435']."
".$locale['436']."
[ ".$locale['444']." ]
\n"; closetable(); } echo "\n"; require_once BASEDIR."footer.php"; ?>