3rd Party Chat App Integration


InstantForum Question
Is it possible for the InstantForum to be integrated with 3rd party chat software? I have a chat room supplied by AddonChat from: https://www.addonchat.co.uk and am looking for a forum solution that integrates. It's important when users are logged into my forum they can click to access the chat room and auto login.
InstantForum Question

We use a chat program, we put links in the header, you could run it from a iframe window. We pop it up in a new window

i am looking instatntasp with chat module integration for my website.

if i purchase it will take lot of time to integrate and i need to face lot of integration problem.

some where in forum i have seen that u are developing instant asp with cute chat software.
when it releases.
Tags


Has anyone done an integration with livechat ? We use it in other areas of our web site and are looking at putting it in the KB. Ideally, we would like to have the 'invite' feature where a user gets an invitation to chat if they don't appear to be finding what they need in the kb. We would also consider a chat button that appears in the top section of the Default page, say over to the right of the tabs and under the welcome bar. Has anyone done this? If so I would love to know the details! Thank you.

Hi Alex,

I hope your very well. Good question.

To add the live chat invitation JavaScript to every InstantKB.NET page I would suggest adding this code to the MasterPage.Master file within the root of your skins directory. Typically Skins\{YourSkinName}\MasterPage.Master

To help I converted your code to VB.NET. You will of course need to update the database connection string. You will need to add the code shown below and the lblScript literal control to a InstantKB.NET master page - this is the control used to render the JavaScript.

<%@ Master Language="VB" Inherits="InstantASP.InstantKB.UI.Controls.MasterPage" %>
<%@ Register TagPrefix="InstantASP" Namespace="InstantASP.Common.UI.WebControls" Assembly="InstantASP.Common.UI" %>
<script runat="server">

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

Dim conn As String = "Server=(local);Initial Catalog=YourDatabase;Integrated Security=SSPI"

Dim s As New System.Text.StringBuilder


s.Append("<script type=""text/javascript"">")
s.Append("(function() {")
s.Append("var license = '123456789',")
s.Append("params = 'fullname=" + Session("name") + "&email=")
If Session("email") <> "" Then
s.Append(Session("email"))
End If
s.Append("&userid=")
If Session("userid") <> "" Then
s.Append(Session("userid"))
End If

s.Append("&IP=" + Request.ServerVariables("remote_addr") + "&referrer=" + Session("referral") + "&referral=" + Session("referer") + "&sourcecode=" + getTheSourceNameForLiveChat(Session("sourceid"), conn) + "',")
s.Append("lang = 'en'," + vbCrLf)
s.Append("skill = '0';" + vbCrLf)
s.Append("__lc_load = function (p) { if (typeof __lc_loaded != 'function')" + vbCrLf)
s.Append("if (p) { var d = document, l = d.createElement('script'), s =" + vbCrLf)
s.Append("d.getElementsByTagName('script')[0], a = unescape('%26')," + vbCrLf)
s.Append("h = ('https:' == d.location.protocol ? 'https://' : 'https://'); l.type = 'text/javascript'; l.async = true;" + vbCrLf)
s.Append("l.src = h + 'gis' + p +'.livechatinc.com/gis.cgi?serverType=control'+a+'licenseID='+license+a+'jsonp=__lc_load';" + vbCrLf)
s.Append("if (!(typeof p['server'] !== 'string' || typeof __lc_serv === 'string')) {" + vbCrLf)
s.Append(" l.src = h + (__lc_serv = p['server']) + '/licence/'+license+'/script.cgi?lang='+lang+a+'groups='+skill;" + vbCrLf)
s.Append("l.src += (params == '') ? '' : a+'params='+encodeURIComponent(encodeURIComponent(params)); s.parentNode.insertBefore(l, s);" + vbCrLf)
s.Append("} else setTimeout(__lc_load, 1000); if(typeof __lc_serv != 'string'){ s.parentNode.insertBefore(l, s);}" + vbCrLf)
s.Append("l.src += (params == '') ? '' : a;" + vbCrLf)
s.Append(" } else __lc_load(Math.ceil(Math.random()*5)); }" + vbCrLf)
s.Append("__lc_load();" + vbCrLf)
s.Append(" })();" + vbCrLf)
s.Append("</sc" + "ript" + vbCrLf)

lblScript.Text = s.ToString

End Sub

Public Function getTheSourceNameForLiveChat(ByVal sourceid As String, ByVal conn As String) As String

Dim sourcename As String = ""

If sourceid Is Nothing Then
sourcename = "None"
Else

Dim con As New System.Data.SqlClient.SqlConnection(conn)
Dim cmd As New System.Data.SqlClient.SqlCommand()


cmd.CommandText = "select anothername FROM sources where sourceid=" + sourceid + ""
cmd.Connection = con


Try
con.Open()
Dim reader As System.Data.SqlClient.SqlDataReader = cmd.ExecuteReader()
While reader.Read()
If Not reader("anothername") Is System.DBNull.Value And Not reader("anothername") Is Nothing Then
sourcename = CType(reader("anothername"), String)
End If
End While
reader.Close()
Finally
con.Close()
End Try

End If

Return sourcename

End Function

</script>
<!DOCTYPE HTML>
<html dir="ltr">
<head id="ctlHeader" runat="server">
<title></title>
</head>
<body>

<form id="form1" name="form1" runat="server">

<!-- start -->
<div class="contentWrapper">
<div style="margin: 12px; width: auto;">

<asp:contentplaceholder id="ctlContentPlaceHolder" runat="server"/>

</div>
</div>


<!-- /end -->


<asp:Literal ID="lblScript" runat="server" />


</form>


</body>
</html>

------------------------------------------------

To add your live char button to the InstantKB.NET homepage I would suggest adding this to the right hand panel below the search panel. You could do this by modifying Skins\{YourSkinName}\Default.ascx as shown below...

Again I've made bold the new code...

<%@ Control Language="vb" %>
<%@ Register tagPrefix="InstantASP" Namespace="InstantASP.Common.UI.WebControls" Assembly="InstantASP.Common.UI" %>
<%@ Register tagPrefix="InstantKB" Namespace="InstantASP.InstantKB.UI.Controls" Assembly="InstantASP.InstantKB.UI" %>


<InstantKB:Header id="ctlHeader" Runat="Server"/>


<div class="contentContainer">


<div class="contentHomeMain" id="pnlContentMain" runat="Server">


<InstantASP:PanelBar id="ctlPanelBar" TableName="tblHomepage" Runat="Server">
<InstantASP:Panel ID="tblHomepage" style="float: left; width: 100%;" runat="server">
<div class="TableCell_Light">


<InstantASP:DataList id="ctlDataList" EnableViewState="False" RepeatColumns="2" RepeatDirection="horizontal"
CellPadding="5" Cellspacing="0" width="100%" ItemStyle-Width="50%" Runat="Server">
<ItemTemplate>

<div class="Widget_PanelContainer">
<div class="Widget_Panel">
<div class="Widget_IconPanel">
<InstantASP:Image id="imgWidgetImage" EnableViewState="False" CssClass="Widget_Icon" Runat="Server"/>
</div>
<div class="Widget_MainPanel">
<InstantASP:Hyperlink id="hypWidgetLink" EnableViewState="False" CssClass="SmallTxtBold" Runat="Server"/><br />
<InstantASP:Label id="lblWidgetDescription" EnableViewState="False" Runat="Server"/>
</div>

</div>
</div>


</ItemTemplate>
</InstantASP:DataList>

</div>
</InstantASP:Panel>
</InstantASP:PanelBar>

<InstantASP:Spacer id="lblPanelBarSpacer" Runat="Server"/>

<InstantKB:ViewArticles id="ctlViewArticles"
NoRecordsText="ViewArticles_NoRecordsText"
PageSize="5" Runat="Server"/>

<InstantASP:Spacer id="lblViewArticlesSpacer" Runat="Server"/>

<InstantKB:WhosOnSummary id="ctlWhosOnSummary" runat="Server" />

</div>


<div class="contentHomeExtra" id="pnlContentExtra" runat="Server">


<InstantKB:ViewSearchOptions id="ctlViewSearchOptions" Title="StaffQuickSearch_Header" Runat="Server" />

<InstantASP:Spacer runat="server" />


<InstantASP:PanelBar CurrentSkin="Skins/Classic/" TextNonLocalized="Live Chat" runat="server">
<InstantASP:Panel runat="server">
<div id="LiveChat_123456789"></div>
<script type="text/javascript">
var __lc_buttons = __lc_buttons || [];
__lc_buttons.push({
elementId: 'LiveChat_123456789',
language: 'en',
skill: '1',
params: ''
});
</script>
</InstantASP:Panel>
</InstantASP:PanelBar>


<InstantASP:Spacer ID="lblViewTicketsSpacer" Runat="Server" />


<InstantKB:ViewTickets id="ctlViewTickets" SubjectTruncation="80" runat="server" />


<InstantASP:Spacer ID="lblViewSearchOptionsSpacer" Runat="Server" />


<InstantKB:ViewTags id="ctlPopularTags" ViewType="PopularTags" EnableBrowseAllTags="True" Runat="Server"/>

</div>


</div>

<InstantKB:Footer Runat="Server"/>


You may notice in this example Alex we've removed the response.write statements within the live chats JavaScript objects param property. This is because you can't use response.write statements within our skin controls. I suspect these parameters auto-populate the live chat form so i'm not sure if this would work. The only other way to dynamically populate the params property with session information would be to construct and render the JavaScript from the Default.vb code-behind file however this would require a re-compile to rebuild the InstantASP.InstantKB.UI.dll.

It would be possible to develop a small plug-in using our plug-in framework for the live chat button which would allow you to dynamically create the JavaScript without having to modify our core code. This plug-in would be it's own user control with it's own assembly and could be designed to inject it' s self into a specific location on the homepage. If you would be interested in looking at this as a possible solution please don't hesitate to respond.

I hope this information helps Alex. If we can assist further please don't hesitate to respond,


http://www.instantasp.co.uk/images/line.gif
Kindest Regards,

Ryan Healey



ryan@instantasp.co.uk
www.instantasp.co.uk
Blog | Community | Docs

http://www.instantasp.co.uk/core/assets/images/email/facebook.png http://www.instantasp.co.uk/core/assets/images/email/twitter.png http://www.instantasp.co.uk/core/assets/images/email/google.png http://www.instantasp.co.uk/core/assets/images/email/linkedin.png

Thank you very much! I've forwarded this code to our main web developer and hope to hear back from him shortly. Much appreciated!

Always a pleasure Alex. Thank you. If I can assist further of course please don't hesitate to contact me,

http://www.instantasp.co.uk/images/line.gif
Kindest Regards,

Ryan Healey



ryan@instantasp.co.uk
www.instantasp.co.uk
Blog | Community | Docs

http://www.instantasp.co.uk/core/assets/images/email/facebook.png http://www.instantasp.co.uk/core/assets/images/email/twitter.png http://www.instantasp.co.uk/core/assets/images/email/google.png http://www.instantasp.co.uk/core/assets/images/email/linkedin.png

Hi Ryan,

Its a great help from you. Live2Support live chat is also works nicely when you place code on MasterPage.
Tags

GO

Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....







InstantASP Forums


Search