Message not appears in Chat system in Blab

Hello experts.
i m new here. I have installed a chat script to my website. it has a strange error. i write messages but thy not a ppears on board in main chat and not in private chat. Smilies also not working, but Paint i do is easily go and can send e ven files i send is giong easily. only text messages and smilies not appears.
Script is Blab6Pro.
and the sample link is https://comet.rd350.info
installed on a subdomain to test.
Please take a look and find the problem if anyone can.

Well, you own the PRO version. The creators of it should assist you with getting it running.
For us to help you, we would need to see a lot of the code to understand what might be the problem.
I suggest contacting them first. If you still have problems and want us to assist you, then, you would need to show us the code where you think it might be failing. We can not help you without seeing some of your code.

hello alex.
I already contacted thm and thy are not suppose to help and want to sell their new scrit and asit was an old purchase and have no help anymore. I tried finding the error codes using browser Inspect feature but i m not actually understand anything. Please look at the chat link (https://chattext.online ). It was installed on subdomain before thn i suspect that perhaps subdomain creating melfunctions so i installed it on main domain now. Thn you may ask any specific file or JS file. i Doubt tht Blab php or blab.js or i dnt know wht is the problem. please suggest

Rahil, programming can not be done in a browser. I will explain…

PHP is a SERVER-SIDE process. It happens BEFORE the browser sees the results of the output from the PHP code. Browsers are CLIENT-SIDE only and does not contain the server’s PHP code. Therefore, you will never, ever-ever, see any PHP code in the webpages when viewed by the browser. The only thing you see there is HTML and JS that is sent, along with any data or programmed output from the PHP scripts. Therefore, you can not work that way. You must use a programming editor to view the pages.

Also, since we can not see the code, it could be a permissions issue. This means that the user, in this case you, does not have the correct permission to send text and smiles. You should check the server’s logs first to see if it is throwing errors. Otherwise, you would need to have someone look over all of your code. There also, could be a problem with the versions of PHP if you are using a newer version.

You might want to hire a programmer and give them access to your server so they can fix the problem. We have a section here and several of the programmers here hire-out to work this way. The only way to test it yourself is to learn the PRO version’s code and learn what every page does. If you want us to do it for free here, we would need to see some of the code. At least where the text and smiles are displayed.
Ernie

Hello Alex,
Please find attached Gdrive link for zip folder. it has complete chat. if u want to install and test thn code is 12345.
all files inside the folder. this is what i have got years back.
https://drive.google.com/file/d/1eSCSqi-bYlHiC9HIzp6MaokHq3OoqICt/view?usp=sharing

Please test the other melfunctions by visiting the installed chat on my website.
There are three major problems i have found.
1- Text messages and smily dont go in private chat or on group chat.
2- Video files i shared on mains or private using flash player which already discontinued.
3 Map location which i shared is not working anymore, perhaps address issue.
Thanks

Okay, I retrieved the files. I will set it up here on my server and test it. But, it will be later today as I have work to handle now. I will let you know what I find.

Rahill, I had a few free minutes to look at the code. It is using older code. On my server, I run PHP 5.6 for testing. It says that some of the commands are not valid in PHP 5.6.

What version of PHP are you running on your server? If it is 5.6 or higher, several lines in the code will have to be changed. Let me know which version of PHP you use. Thanks, Ernie

Well, I narrowed down the error to one line. ( So far, might be others once this is fixed. )

In the folder named “incl” there is a file named “main.inc” which is an INCLUDE file that gets loaded into the system and has many routines that are used in the chat system. On line #41 this line throws the error:

$t=preg_replace("#(([a-zA-Z]+://)([a-zA-Z0-9?&%.;:#/=+_-]*))#e", “’<span class=“lu” onclick=“window.open(’$1’);return false”>’.shorturl(”$3").’’",$t);

This line takes an URL and converts it to a link with a SHORTURL. Not sure why, but, it is used and called by other pages when needed. This line does not work in PHP 5.6 ! I can not go back any further than version 5.6 in my server. Therefore, I need to know what PHP version you are using before I can go any further. I will check in again in a few hours to see if you posted your version of PHP. Thanks, Ernie

Hello Alex. Thank you so much to give it a look and using your precious time. I am using Php 7 right now as it is commonly used these days.
Regards

Well, that is the problem. This library will not run as-is on a PHP 7 system. It requires several changes to be made. Mostly in old functions that do not work the same in PHP 7. The “preg_replace()” command as I posted is one of them. The one I showed you above uses the old style call-back system. I found a reference on a website that explained it and has a work-around version. But, I have not got it working as yet.

I think that it can be changed, but, I have to study the shorturl() function in the system and what the PREG is really doing. It appears it is creating a link that is displayed inside the posts. But, I have not had enough time to sort it out. Once this is fixed, there might be others, too.

I have free time coming up tomorrow, but little time today to look into this. Check back tomorrow!

Thanks Alex,
i am not gonna give pressure as i know you already busy a lot. but check this when you have time. If possible.

My first name is Ernie, not Alex. Thanks.

So, I figured out one error and so far I did not get another one. Therefore, I think I have a solution for you.
I have not tested the full chat system, but, it does display the smiles and text now. This is how I fixed it.
Edit the file named " main.inc " inside the folder named " incl ". Look at line #41 and it looks line this:

$t=preg_replace_callback("#(([a-zA-Z]+://)([a-zA-Z0-9?&%.;:\#/=+_-]*))#e", "'<span class=\"lu\" onclick=\"window.open(\'$1\');return false\">'.shorturl(\"$3\").'</span>'", $t);

This line is in error. It is " DEPRICATED ", meaning it does not work on PHP 5.6 and up, so it will not work on your PHP version 7. I found a fix for it. Here is the replacement line that I came up with. It does work on my test system using PHP 5.6. I do not have a PHP 7.0 set up now, so please test it on yours.

$t=preg_replace_callback("#(([a-zA-Z]+://)([a-zA-Z0-9?&%.;:#/=+_-]*))#", function($matches) { return “’<span class=“lu” onclick=“window.open(’$matches[1]’);return false”>’.shorturl(”$matches[3]").’’"; }, $t);

It appears that the second command in the preg_replace() function is a call-back and the newer version needs it formatted as an array instead. In my version, it uses an array called " matches " which seems to work as it should.

Hope this works on your PHP 7. If not, I will have to set up a PHP 7 to test it further, but, I think this fixes it. Good luck!

Hello Ernie,
I have change the code as you advised but it gives Error500 after changing the code. Thn I have changed the PHP 7.0 to 5.6 exactly as u to ld but result was same . here is the changed code:Line 40 to 42:
`function url2link($t) {
$t=preg_replace_callback("#(([a-zA-Z]+://)([a-zA-Z0-9?&%.;:#/=+_-]*))#", function($matches) { return “’<span class=“lu” onclick=“window.open(’$matches[1]’);return false”>’.shorturl(”$matches[3]").’’"; }, $t);
return $t;}

Perhaps some missing here`

Well, this site did not display some of the characters correctly. The RETURN section of the code does not include the backward slashes. They are missing from your code.

I would just leave your site at PHP 7.0 or 7.4 and keep it that way and fix the code to work on it. There is no reason to go back to 5.6. So, here is the correct line again. Note the backward slashes…

There should be 8 of them. These are what is causing the ERROR#500. Hope this fixes it.

hi Ernie,
i did as you told but problem still the same. Error500 still there. added this code in line 40 to 42…
function url2link($t) {
$t=preg_replace_callback("#(([a-zA-Z]+://)([a-zA-Z0-9?&%.;:#/=+_-]*))#", function($matches) { return “’<span class=\“lu\” onclick=\“window.open(\’$matches[1]\’);return false\”>’.shorturl(\”$matches[3]").’’"; }, $t);
return $t;}

all backslashes there already.
If you say we can connect using teamviewer or can give you hosting link to check yourself… I have checked your post timing and you posted replied this at 9.30Pm IST i usually online that time.

You need one just after the $matches[3]\ … Let us know if that fixes it.

let me edit this now

if you are online and want to use teamviewer we can do it now

it has this already

indent preformatted text by 4 spaces    { return “’<span class=\“lu\” onclick=\“window.open(\’$matches[1]\’);return false\”>’.shorturl(\”$matches[3]\").’’"; }, $t);

earnie this page actually removes the backslash in code view. i give four spaces zafter the c ode view and thn all code look like this exacly

indent preformatted text by 4 spaces    $t=preg_replace_callback("#(([a-zA-Z]+://)([a-zA-Z0-9?&%.;:#/=+_-]*))#", function($matches) { return “’<span class=\“lu\” onclick=\“window.open(\’$matches[1]\’);return false\”>’.shorturl(\”$matches[3]\").’’"; }, $t);
Sponsor our Newsletter | Privacy Policy | Terms of Service