<% Response.Buffer=true %> <% dim parent_id dim process dim link_id dim link_title dim link_url dim link_target dim link_desc dim link_categories dim link_openNodes dim returnFileName dim returnMessage parent_id = request("parent_id") process = request("process") link_id = request("link_id") link_title = getContentDBReady(request("linkTitle")) link_url = getContentDBReady(request("linkURL")) link_target = request("LinkTarget") link_desc = getContentDBReady(request("LinkDesc")) link_categories = request("selectedCategories") link_openNodes = request("openNodes") if process = "update" then redirectString = "ia.asp?page_id=" & parent_id & "&mode=manageLinks&editType=addItem&linkID=" & link_id & "&errorMsg" confirmMessage = "Link%20updated" else redirectString = "ia.asp?page_id=" & parent_id & "&mode=manageLinks&editType=addItem&newLinkTitle=" & link_title & "&newLinkURL=" & link_url & "&newLinkDesc=" & link_desc & "&newLinkTarget=" & link_target & "&newLinkCategories=" & link_categories & "&newLinkOpenNodes=" & link_openNodes & "&errorMsg" confirmMessage = "Links%20added" end if if len(link_title) < 1 then Response.Redirect(redirectString & "=LinkTitleZeroLength") end if if link_url = "http://" OR len(link_url) < 1 then Response.Redirect(redirectString & "=LinkURLZeroLength") end if if process = "add" then strSQL = ""&_ "INSERT into links ("&_ "link_title, "&_ "link_url, "&_ "link_target, "&_ "link_desc, "&_ "ia_parentid, "&_ "link_categories, "&_ "link_openNodes "&_ ") VALUES ("&_ "'"& link_title &"', "&_ "'" & link_url &"', "&_ "'" & link_target &"', "&_ "'" & link_desc &"', "&_ "" & parent_id & ", "&_ "'" & link_categories &"', "&_ "'" & link_openNodes & "')" else strSQL = ""&_ "UPDATE links SET "&_ "link_title = '" & link_title & "', "&_ "link_url = '" & link_url & "', "&_ "link_target = '" & link_target & "', "&_ "link_desc = '" & link_desc & "', " &_ "ia_parentid = " & parent_id & ", " &_ "link_categories = '" & link_categories & "', "&_ "link_openNodes = '" & link_openNodes & "' "&_ "WHERE link_id = " & link_id end if 'response.write strSQL 'response.end '-- Run SQL RunSQL strSQL if process = "add" then gSQL = "SELECT link_id from links order by link_id desc limit 1" Set gRS = LoadRSFromDB(gSQL) if not gRS.EOF then link_id = gRS("link_id") end if set gRS = nothing end if '--------------------------------------------------- ' UPDATE THE CATEGORY LOOKUP TABLE '--------------------------------------------------- call updateLookUpTable("links_category_lu", "link_id", "c_id", link_id, link_categories) response.redirect "ia.asp?mode=manageLinks&page_id=" & parent_id & "&editType=view&confirmMsg=" & confirmMessage response.end %>