<%option explicit%> <% sub InserirLink(Idpasta, nome, link) dim obj dim idLink set obj = server.CreateObject("ArdinaRegister_bus.clsLink") if err.number<>0 then call showErro(true, "Erro na criação do objecto: ArdinaRegister_bus.clsLink") else idLink = obj.AddNew(CONNECTIONSTRINGRegister, _ clng(Idpasta),_ cstr(nome), _ cstr(link), _ "") end if set obj = nothing end sub function ValidPasta(pasta, iduser) dim obj dim spasta dim idpasta if pasta = "noticias" then spasta = "Noticias" elseif pasta = "noticiasonline" then spasta = "Noticias Online" elseif pasta = "fotos" then spasta = "Fotos" elseif pasta = "forum" then spasta = "Mensagens do Forum" else spasta = "" end if If spasta <> "" then set obj = server.CreateObject("ArdinaRegister_bus.clsPasta") if err.number<>0 then call showErro(true, "Erro na criação do objecto: ArdinaRegister_bus.clsPasta") else idpasta = obj.GetPastaInUser(CONNECTIONSTRINGRegister, _ clng(iduser), _ cstr(spasta)) if idpasta = 0 then idpasta = obj.AddNew(CONNECTIONSTRINGRegister, _ clng(IdUser),_ cstr(spasta), _ "", _ 1) ValidPasta = idpasta else ValidPasta = idpasta end if end if set obj = nothing end if end function if cCommon.Assinante = "true" then Response.Redirect "/assinfavorito/link_action.asp?" & Request.ServerVariables("QUERY_STRING") end if dim nickname 'dim iduser dim nome dim pasta dim idpasta dim link dim qry dim svalues dim aVar dim qrystring nickname = GetNickName() if nickname <> "" then if Request.ServerVariables("QUERY_STRING") = "" then svalues = session("newlink") session("newlink")="" aVar = split(svalues,"#") iduser = session("iduser") nome = aVar(0) pasta = aVar(1) link = aVar(2) else iduser = session("iduser") nome = Request.QueryString("name") pasta = Request.QueryString("pasta") qry = Request.QueryString("page") & "?" & Request.ServerVariables("QUERY_STRING") if Instr(qry, "&pasta") > 0 then link = left(qry,Instr(qry, "&pasta")-1) else link = "/index.asp" end if end if idpasta = ValidPasta(pasta, iduser) call InserirLink(Idpasta, nome, link) if pasta = "noticias" then qrystring = "/favorito/link_result.asp?text=" & arrarRegister(5) & _ "&opcoes=Voltar à Noticia" & _ "&opcoesURL=" & server.URLEncode(link) & _ "&opcoes=As Minhas Notícias" & _ "&opcoesURL=/favorito/index.asp?action=noticias" elseif pasta = "noticiasonline" then qrystring = "/favorito/link_result.asp?text=" & arrarRegister(5) & _ "&opcoes=Voltar à Noticia" & _ "&opcoesURL=" & server.URLEncode(link) & _ "&opcoes=As Minhas Notícias" & _ "&opcoesURL=/favorito/index.asp?action=noticias" elseif pasta = "fotos" then qrystring = "/favorito/link_result.asp?text=" & arrarRegister(6) & _ "&opcoes=Voltar à Galeria" & _ "&opcoesURL=/func/galeria.asp" & _ "&opcoes=As Minhas Fotos" & _ "&opcoesURL=/favorito/index.asp?action=fotos" elseif pasta = "forum" then qrystring = "/favorito/link_result.asp?text=" & arrarRegister(7) & _ "&opcoes=Voltar ao Fórum" & _ "&opcoesURL=" & server.URLEncode(link) & _ "&opcoes=As Minhas Mensagens" & _ "&opcoesURL=/favorito/index.asp?action=forum" else qrystring = "/" end if Response.Redirect qrystring else iduser = session("iduser") nome = Request.QueryString("name") pasta = Request.QueryString("pasta") qry = Request.QueryString("page") & "?" & Request.ServerVariables("QUERY_STRING") if Instr(qry, "&pasta") > 0 then link = left(qry,Instr(qry, "&pasta")-1) else link = "/index.asp" end if svalues = nome & "#" & pasta & "#" & link session("newlink") = svalues if pasta = "noticias" then qrystring = "/favorito/link_result.asp?text=" & arrarRegister(8) & _ "&opcoes=Voltar à noticia" & _ "&opcoesURL=" & server.URLEncode(link) & _ "&opcoes=Registe-se" & _ "&opcoesURL=" & server.URLEncode("/register/user_edit.asp?opcao=add") & _ "&opcoes=Login" & _ "&opcoesURL=" & server.URLEncode("/register/index.asp?tipo=favorito") elseif pasta = "noticiasonline" then qrystring = "/favorito/link_result.asp?text=" & arrarRegister(9) & _ "&opcoes=Voltar à noticia" & _ "&opcoesURL=" & server.URLEncode(link) & _ "&opcoes=Registe-se" & _ "&opcoesURL=" & server.URLEncode("/register/user_edit.asp?opcao=add") & _ "&opcoes=Login" & _ "&opcoesURL=" & server.URLEncode("/register/index.asp?tipo=favorito") elseif pasta = "fotos" then qrystring = "/favorito/link_result.asp?text=" & arrarRegister(10) & _ "&opcoes=Voltar à Galeria" & _ "&opcoesURL=/func/galeria.asp" & _ "&opcoes=Registe-se" & _ "&opcoesURL=" & server.URLEncode("/register/user_edit.asp?opcao=add") & _ "&opcoes=Login" & _ "&opcoesURL=" & server.URLEncode("/register/index.asp?tipo=favorito") elseif pasta = "forum" then qrystring = "/favorito/link_result.asp?text=" & arrarRegister(11) & _ "&opcoes=Voltar ao Fórum" & _ "&opcoesURL=" & server.URLEncode(link) & _ "&opcoes=Registe-se" & _ "&opcoesURL=" & server.URLEncode("/register/user_edit.asp?opcao=add") & _ "&opcoes=Login" & _ "&opcoesURL=" & server.URLEncode("/register/index.asp?tipo=favorito") else qrystring = "/" end if Response.Redirect qrystring end if %>