krishna.p Posted August 7, 2009 Share Posted August 7, 2009 Hi all, Requirement: When admin user enter some text and clicks on send button in one particular screen of my application, the message should be sent to all the users who are using my application. I would like to send global alert message to all users..in my previous post on the same topic i got some ideas from you and had implemented it.. but it has some performance issues... i.e...it is clearly evident that my server is receiving heavy load... Actually my application is running in FreeBSD box. Here is there any way i can fix this issue using RPC..i.e...Remote procedure call.. ultimately all users should notice the message sent by admin user. Any help would be appreciated.. Thanks in advance... Link to comment https://forums.phpfreaks.com/topic/169189-can-i-send-global-alert-message-to-all-users-using-rpc/ Share on other sites More sharing options...
jonsjava Posted August 7, 2009 Share Posted August 7, 2009 I'd say add a column to the user table, call it something like global_admin_msg_read, set it to bool, and create a small table called `global_messages`, and add 2 columns: `id` and `msg_body`. When you post a message, you post the message to the new table, and run a query something like this UPDATE `users` SET `global_admin_msg_read`= 0; then use an ajax script on the frontend to check every so often for unread messages. when it show that there is an unread message, have it grab the message, and set the global_admin_msg_read to 1. to have it check, use a query like this SELECT * FROM `global_messages` ORDER BY `id` DESC LIMIT 1; oh, and make sure ID is auto increment. I'd post some real code, but I'm a firm believer in posting code only after the person asking the question has. Link to comment https://forums.phpfreaks.com/topic/169189-can-i-send-global-alert-message-to-all-users-using-rpc/#findComment-892885 Share on other sites More sharing options...
krishna.p Posted August 12, 2009 Author Share Posted August 12, 2009 Hi All, I think i am 50 percent successful in solving this problem. I have installed samba client in my FreeBSD machine. Through console when i type message "cat message.txt | smbclient -M MACHINENAME", the message present in message.txt file is successfully sent to MACHINENAME. However when i am trying to execute the same command through php script as exec("cat message.txt | smbclient -M MACHINENAME"); the message is NOT sent. Is there any thing iam missing. Would appreciate if you could please explain how to execute above command through PHP? Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/169189-can-i-send-global-alert-message-to-all-users-using-rpc/#findComment-896297 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.