Why no HTML in new messages?
-
When i send a message the chat is updated LIVE.
I want to manipulate the updated message LIVE.But the code i use is only printed as plain text and the iframe isnt shown.
How do i show iframe in the LIVE message update? Not the old ones?Check the iframe code here. simple-ajax-chat.php
function sac_getData($sac_lastID) { global $wpdb, $table_prefix, $sac_lastID, $sacGetChat; $loop = ''; if (isset($_GET['sac_nonce_receive']) && wp_verify_nonce($_GET['sac_nonce_receive'], 'sac_nonce_receive')) { if ((isset($sacGetChat) && $sacGetChat === 'yes') && (!empty($sac_lastID) && is_numeric($sac_lastID))) { $query = $wpdb->get_results("SELECT * FROM ". $table_prefix ."ajax_chat WHERE id > ". $sac_lastID ." ORDER BY id DESC", ARRAY_A); for ($row = 0; $row < 1; $row++) { if (isset($query[$row]) && !empty($query[$row]) && is_array($query[$row])) { $id = isset($query[$row]['id']) ? $query[$row]['id'] : ''; $time = isset($query[$row]['time']) ? $query[$row]['time'] : ''; $name = isset($query[$row]['name']) ? $query[$row]['name'] : ''; $text = isset($query[$row]['text']) ? $query[$row]['text'] : ''; $url = isset($query[$row]['url']) ? $query[$row]['url'] : ''; $time = sac_time_since($time); $user = get_user_by('slug', $name); $test = get_user_meta( $user->ID, 'description', true); $loop = $id .'---<iframe src="https://MYWEBSITE.COM/'.$test.'"></iframe>---'. $text .'---'. $time .' '. esc_html__('ago', 'simple-ajax-chat') .'---'. $url .'---'; } } } } echo $loop;
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Why no HTML in new messages?’ is closed to new replies.