logo
Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
bart  
#1 Posted : Wednesday, June 9, 2010 11:56:32 AM(UTC)
bart

Rank: Administration

Reputation:

Groups: Administration
Joined: 10/8/2008(UTC)
Posts: 190
Man

Was thanked: 1 time(s) in 1 post(s)
The function pbw.Get_UrlRewriting_OnDestination is disabled in the newest sienn release, can I just delete this from my source?

Wanna join the discussion?! Login to your Sienn Forum forum account. New Registrations are disabled.

bart  
#2 Posted : Wednesday, June 9, 2010 12:15:13 PM(UTC)
bart

Rank: Administration

Reputation:

Groups: Administration
Joined: 10/8/2008(UTC)
Posts: 190
Man

Was thanked: 1 time(s) in 1 post(s)
The complete function looks like this
You can use this if you need a quick fix of your cotrols.
You even can make it bether without these ugly try catches, but this is the original source from the siennengine
Code:
Function Get_UrlRewriting_OnDestination(ByVal cid As String, ByVal destinationurl As String, ByVal constring As String) As String

        destinationurl = System.Web.HttpUtility.UrlDecode(destinationurl)
        destinationurl = System.Web.HttpUtility.HtmlDecode(destinationurl)

        Dim RetString As String
        Dim Con As New SqlConnection(constring)
        Dim Query As String = "SELECT Taalid from " & cid & "_Config Where SLEUTEL=N'URLDESTINATION' and Waarde500=N'" & destinationurl.Replace("'", "''") & "'"
        Dim Com As New SqlCommand(pbwsev.QReplace(cid, Query), Con)
        Dim Taalid As Integer = -1
        DBOpen(Con, 99)
        Dim Reader As SqlDataReader = Com.ExecuteReader()
        Try
            Reader.Read()
            Try
                Taalid = Reader.GetInt32(0)
                If Taalid < 0 Then
                    Taalid = -1
                End If
            Catch
                Taalid = -1
            Finally
            End Try
            DBClose(Con, 99)
        Catch ex As Exception
            Try
                DBClose(Con, 99)
            Catch
            End Try
       End Try
       If Taalid >= 0 Then
           Get_Config(cid, Taalid, "URLSOURCE", RetString, constring)
           If pbwsev.IsLocalHost Then
               Dim root_path As String
               root_path = Me.Get_RootMap_LocalHost()
               RetString = root_path & RetString
                RetString = RetString.Replace("//", "/")
            End If
        Else
            RetString = ""
        End If
        Return RetString
End Function


The fastest way to get this work is
Code:
Function Get_UrlRewriting_OnDestination(ByVal cid As String, ByVal destinationurl As String, ByVal constring As String) As String

        destinationurl = System.Web.HttpUtility.UrlDecode(destinationurl)
        destinationurl = System.Web.HttpUtility.HtmlDecode(destinationurl)

        Dim RetString As String
        Dim Con As New SqlConnection(constring)
        Dim Query As String = "SELECT Taalid from " & cid & "_Config Where SLEUTEL=N'URLDESTINATION' and Waarde500=N'" & destinationurl.Replace("'", "''") & "'"
        Dim Com As New SqlCommand(Query, Con)
        Dim Taalid As Integer = -1
        pbw.DBOpen(Con, 99)
        Dim Reader As SqlDataReader = Com.ExecuteReader()
        Try
            Reader.Read()
            Try
                Taalid = Reader.GetInt32(0)
                If Taalid < 0 Then
                    Taalid = -1
                End If
            Catch
                Taalid = -1
            Finally
            End Try
            pbw.DBClose(Con, 99)
        Catch ex As Exception
            Try
                pbw.DBClose(Con, 99)
            Catch
            End Try
       End Try
       If Taalid >= 0 Then
           pbw.Get_Config(cid, Taalid, "URLSOURCE", RetString, constring)

        Else
            RetString = ""
        End If
        Return RetString
End Function

changed some calls to pbw

Edited by user Wednesday, June 9, 2010 12:20:06 PM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.