I'm trying to create a chat system using PHP and javascript. I want to know how the chat in Gmail works: it will remain in the same position even as the user moves to another page. I would be grateful if anyone could explain how it works.
And at the same time, please give some ideas on how to create a chat s/m. For example, the creation of the popup window, protocols to be used with chat, etc.
The chats in GMail, Facebook or Orkut stay at their same position even when you change pages thats because they are not doing a real page change when you click on any link inside GMail or Facebook or orkut. They load the page by means of a hash tag identifier and load the contents using standard AJAX. For example inside GMail you would find all links like inbox as https://mail.google.com/mail/?zx=xxxxxxx&shva=1#inbox and https://mail.google.com/mail/?zx=xxxxxxxx&shva=1#starred so when you click on them the browser doesn't actually reload a new page instead makes an AJAX request and pulls data in, hence this doesn't affect the chat block on the page.
You can have a look at http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=9#start for a simple PHP/MySQL based chat application. If you want a scalable chat application you have to go in Comet or "Bidirectional-streams Over Synchronous HTTP" BOSH. Friendfeeds TornadoWeb in python can help. http://www.tornadoweb.org/
Hope this info helps.
I understand that you want to create a "Chat system",
Gmail's chat is not an isolated system, it is closely integrated/Synced with Gtalk ,
(do you plan on providing a Desktop app as well as a web interface?)
Secondly Gtalk/Gmail chat uses a custom protocol(although it is open..meaning you can write your own Gtalk clients as well).
For your "Chat System", if you want it to be as nice as Gmail's you'll definitely need to use
AJAX and JSON along with Java Script and PHP
AJAX will help you to create Eye Catching at the same time responsive UI and and JSON will help you to transport data along the wire.
Related
The Dynamics documentation is just awful and I couldn't find an answer to this simple question:
In the web version of the CRM, is it possible to register a web page that can be toggled by the user and that itself has an internal state (updated regularly by an interval set with setInterval) that will persist even if the users closes the page (not the entire CRM, just the sub-page)?
We need the user to provide some information for a CTI integration, and this background process to keep alive the CTI session by polling an API while the user session is active. In addition, we need to reuse the component where the user provides the CTI information to be notified if the session fails and restore it or close it if necessary. The real purpose for this is to make a screen pop (push content information about the incoming call to the agent) which I know can be done using Xrm.Utility, although doing it with a REST API method would be much better, RouteTo Aciton looks like the best method to do this, but I'm not sure it will proactively show the item in the user's browser.
I'm not sure this question is as simple as you suggest, it seems relatively complicated, and involves an integration. I'm not suprised the Dynamics documentation doesn't provide an answer for this specific and unique scenario.
I don't believe there is any single feature within Dynamics that will meet this requirement.
You could use a HTML web resource or a web page from a seperate web site iframed into CRM. I think the possible use of these depends on your expected user experience; I believe the user would need to have the page loaded at all times showing these controls (e.g. user is looking at a dashboard) - I don't see how the controls could interact with the user client side otherwise. You could show the controls in multiple places however.
Xrm.Utility is one way to open a record, but it can also be done by Open forms, views, dialogs, and reports with a URL.
RouteToAction looks like it just adds a record into the user queue, the user would need to refresh the queues to see the changes. I don't believe there is any way for a server side REST API call to natively redirect the user.
You could add JavaScript to do this, however you might struggle to add the JavaScript into every page of CRM.
Where I have worked on a CTI integration in the past (assuming you mean computer telephony integration), we always had some other component doing the screen pops - the client's all had a desktop app installed as part of the telephony solution.
Perhaps you could look into browser notifications, or a browser plugin?
My goal is to create a real-time chat similar to the Facebook chat, from scratch. I want to store all the messages on a database table (MySQL) and every time a new message is sent by a user, if the receiver is connected then a request will be sent to the receiver's browser and the message will appear on the chat window.
I don't want to have the client to check if a new message for the user was sent, but I want the server to send the request to the client's browser.
I know that this can be achieved using the Comet technique (I saw this stackoverflow question) but I am not able to find a good guide on how to implement this for this certain problem.
I want to use php and javascript and as less extra software or frameworks as possible.
I use WAMPServer and I have Windows.
If you know a good guide or tutorial or can provide any guidelines on how I could achieve what I want, it would be very helpful.
Try use for this CppComet open source comet server. There have api for php and other languages.
And viwe this chat example or this
You can also use Node.JS with PHP. Creating a Real-Time Chat App with PHP and Node.js
I have already developed an application which is not completely Real-time messaging system, but it works like realtime. Built using without any external new frameworks/API, just used known and familiar skills to develop this using: Ajax jquery, PHP, Mysql, Javascript.
Logic used is:
All messages will be stored in database,
When you load page all messages will be loaded from database.
When you get new messages after reloading, the new messages has to be
loaded/displayed without reloading whole page again right? This is done
using javaScript and ajax jquery. I have set time out for EVERY 0.5 seconds
to reload only new messages and display them.
In my code, At first when the page loads all messages will be loaded in div
tags each, Later whenever new message gets into db it will displayed into new
div tags. its Simple and works without any external API.
To refresh new messages and throw them in to div tags .load() from ajax jquery is used,
to refresh every 0.5secs Javascript is used to set timeout.
I don't know what your exact question is but Websockets is the answer!
https://github.com/crossbario/autobahn-js
https://github.com/voryx/Thruway
(FYI, when you see WAMP in the context of websockets they're talking about something that's not windows/apache/mysql/php)
Unfortunately you can't make a real time application with PHP it self you can use a framework like Laravel in PHP and use packages like laravel-websockets and create a realtime application. laravel-websockets is really useful for creating a realtime application. laravel and the laravel websokcets with any front end you can do this
http://beyondco.de/docs/laravel-websockets
https://laravel.com/docs/
You can easy create anything with it just try to understand the fundamental concept of websokcets .
How to make a script or something to automatically log me in once I enter an iframe of an external website?
For example:
<li> Audi</li>
Once the user clicks on the audi menu item. It opens up audi website and gets the credentials (username/password) from my database and automatically log the user into the audi website.
Is it possible? I don't know if i can do this with only javascript or only php.
You can't login users from your application onto external websites until and unless they don't provide you an interface which allows you to do so. This is generally achieved by way of APIs.
However, there is one way of achieving it still. Since you suggest you have raw user credentials for the external websites, you could send a POST request to their login page. If you try this approach, make sure you are doing it on the client side (via JS and AJAX) since you want to log in the user system and not the server.
This approach is a bit complex and not advisable, but it would get the job done. Search for APIs first, but will most probably fail to find them.
Hope this helps.
I am looking for a way to show Facebook engagement on from our website on our Facebook page. IE, when someone likes/shares etc. a page on the website, that that activity be reflected by our Facebook page in some way.
I was planning on using the graph API calls to do page updates, but the permissions are granted to users, not to the app itself, meaning this would only be possible for existing administrators, defeating the whole purpose (Perhaps a bit obvious in hindsight).
Is there a good, clean way of posting page likes/shares of our web pages to our Facebook page feed?
Notes:
I'm working in PHP and/or client side JS
A high volume of posts drowning our regular content is not likely at the moment, however, advice about how to manage such a beast in the long run might be helpful
If I understood correctly and want to share content from Facebook into your Website, the behavior you mention used to exist via the Activity Feed or Recommendations Feed. However, it has been deprecated since Graph API version 2.3.
If what you want is to update comments from people in your Website to your FB Page, you could implement something in your backend which listens to content uploaded and uses your Page Access Token to create custom stories using your user's data. As you mention, it won't happen in the name of people, but you could be creative and make the text narrate what people did on your website. Maybe even use OpenGraph for this.
I know we can get online users, but this online is not what I want, I want to know the online users who are currently on my web page, but not facebook. I want to get the user list who is now using my web page after log in using their facebook account, and then I don't care whether they are still active on their facebook.
Is there any methods that I can get this information? Please help! I am using Javascript!
There isn't anything in the API that lets you know whether one user is active/online on your app.
You would need to record connections by yourself. But you are using Javascript, which is a client-side language. It means that it is executed on the client's browser and that you won't be able to manage incoming connections.
Are you using PHP (server-side) in the background? That would make it possible for you to display the connected people for the last 5 minutes!