Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Youngn

  • Rank
  1. I found a way around it. It had to do with my view. I had to add an if statement if post_id = post_comment.post_id retrieve comments of each posts. Thanks everyone.
  2. @gizmola, your method seems like best option for me. I will try this method as soon as I get back on. If I have issues I will get back to you. Thanks mate.
  3. That's what I thought but I have tried amending the query but still nothing. Do you know a better way please? Thanks
  4. I have an issue regarding user posts and comments. I can retrieve posts and comments which is alright but the comments don't seem to align with corresponding posts. Please see code and image attached. Post Model public function get_user_posts(){ $session = $this->session->userdata('user_id'); $this->db->select('*'); $this->db->from('posts'); $this->db->join('users', 'users.user_id = posts.user_id'); $this->db->where(array('posts.user_id' => $session)); $this->db->order_by('date_created', 'DESC'); $query = $this->db->get(); return $query->
  5. You see the content polls, but I need it to capture the latest entry into the table. I don't know if is something to do with the layout of my divs or something. like if I break it then refresh the page nothing shows but if I amend the code the data appears to screen without page reload but then it comes in batches instead of one by one. I don't know if it makes sense
  6. sorry it should have been if(data.status == 'ok'){ .......... ......... }
  7. Hi I successfully designed a chat message system between users and it works fine. The only problem I am having at this point is polling data from chat table to browser real time. The messages are displayed using ajax and the setInterval works as I checked the console. The issue is that it does not capture new entries to the table for display and hence the user has to keep refreshing the page to see new content. Please help. My code is below. Please forgive my file naming convention as I will change it later on. PS this is developed using codeigniter framework. Chats.php - Controller
  8. @gizmola, Please forgive my ignorance. chat_id is a hard coded column that always has a value of 1. Please see screenshot of my table attached below. Thank you for your feed back, so observing my query you are advising I remove the cm.chat_id from the where clause? I tried using the Where in() function; but it is still seen by every user .
  9. Hi I implemented a chat system using Codeigniter where users can send and receive chat messages but the problem I'm having is that everyone can see everyone's chat. How can I make the chat messages only accessible to the sender and receiver/recipient and vice versa? Controller - Chat.php public function ajax_get_chat_messages(){ $chat_id = $this->input->post('chat_id'); $recipient = $this->input->post('recipient'); if (!$recipient){ echo $this->_get_chat_messages($chat_id); } } function _get_chat_messages($chat_id){ $last_chat_message_id = (int)$this->session->u
  10. It should not refresh, I want it to update real time
  11. Hi, thanks for the response. Here is my code: I am using codeigniter to handle this: View: <?php if($notification_count): ?> <li class="dropdown"> <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#"> <i class="fa fa-bell"></i> <span class="label label-warning count" id="alert_id"></span> </a> <ul class="dropdown-menu dropdown-alerts">
  12. Hi all, I have just implemented a notification system where if any action is triggered on the users page they see the notification in real time on their page. The problem I have is read and unread notifications. I have an idea in my mind. I have a table called notifications with a column which has boolean values of 0 and 1(read/unread) Now the notification icon is embedded in a <span> and my idea is that on clicking that span or icon etc the boolean field should be updated to read. Is there a way of updating mysql table by just clicking the icon? If so, could you
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.