Did some more searching but to no avail <img> So i had a look at one of my website backups, and the chatspot folder in it, the files are the same but for the user invite php files, it is slightly bigger. I uploaded this older version and it works perfectly, if someone can figure out what the difference is, that is the solution. Just to make it easier i will post the old code here if anyone want to swap their newer version for this one:
<php>sql_query( $sql ) ) ) { message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql); } while( $row = $db->sql_fetchrow( $result ) ) { if( strtolower( $row[ 'username' ] ) == strtolower( $username ) ) { $db->sql_freeresult( $result ); return TRUE; } } $db->sql_freeresult( $result ); return FALSE;} function invite_user( $to_username, $from_userid, $from_username, $location, $room_name ){ global $board_config, $db; $sql = "SELECT * FROM " . USERS_TABLE . " WHERE username = '" . $to_username . "' AND user_id <ANONYMOUS>sql_query( $sql ) ) ) // user is not a member of the forum { $db->sql_freeresult( $result ); return FALSE; } $to_userdata = $db->sql_fetchrow( $result ); $msg_time = time(); // Do inbox limit stuff [the following code is taken from phpBB and modified slightly] $sql = "SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time FROM " . PRIVMSGS_TABLE . " WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . " OR privmsgs_type = " . PRIVMSGS_READ_MAIL . " OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " ) AND privmsgs_to_userid = " . $to_userdata['user_id']; if( !( $result = $db->sql_query( $sql ) ) ) return FALSE; $sql_priority = ( SQL_LAYER == 'mysql' ) ? 'LOW_PRIORITY' : ''; if( $inbox_info = $db->sql_fetchrow( $result ) ) { if( $inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs'] ) { $sql = "SELECT privmsgs_id FROM " . PRIVMSGS_TABLE . " WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . " OR privmsgs_type = " . PRIVMSGS_READ_MAIL . " OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " ) AND privmsgs_date = " . $inbox_info['oldest_post_time'] . " AND privmsgs_to_userid = " . $to_userdata['user_id']; if( !$result = $db->sql_query( $sql ) ) return FALSE; $old_privmsgs_id = $db->sql_fetchrow( $result ); $old_privmsgs_id = $old_privmsgs_id[ 'privmsgs_id' ]; $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . " WHERE privmsgs_id = $old_privmsgs_id"; if( !$db->sql_query( $sql ) ) { message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs (inbox)'.$sql, '', __LINE__, __FILE__, $sql); } $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TEXT_TABLE . " WHERE privmsgs_text_id = $old_privmsgs_id"; if( !$db->sql_query( $sql ) ) return FALSE; } } //old, currently broken code //$subject = sprintf($lang['Inviting_you'],$from_username); //new code (from v2.0.0a7) $subject = $from_username . " is inviting you to enter chat."; //old, currently broken code //$message = sprintf($lang['Pm_invite'],$from_username,$room_name,"java.scriptvoid(0);" onClick="window.open( '" . // $location . "','" . $room_name . "','scrollbars=no,resizable=yes,width=640,height=550' ); return false;"); //new code (from v2.0.0a7) $message = $from_username . " wants you to join the room " . $room_name . ". <a>Click here to join.</a>"; $sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace( "'", "''", $subject ) . "', " . $from_userid . ", " . $to_userdata['user_id'] . ", $msg_time, '$user_ip', 0, 0, 0, 0)"; // 1st zero is HTML if( !( $result = $db->sql_query( $sql_info, BEGIN_TRANSACTION ) ) ) return FALSE; $privmsg_sent_id = $db->sql_nextid(); $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text) VALUES ($privmsg_sent_id, '', '" . str_replace("'", "''", $message) . "')"; if( !$db->sql_query( $sql, END_TRANSACTION ) ) return FALSE; // Add to the users new pm counter // = '9999999999' $sql = "UPDATE " . USERS_TABLE . " SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . $msg_time . " WHERE user_id = " . $to_userdata['user_id']; if ( !$status = $db->sql_query($sql) ) return FALSE; return TRUE;} ?>