Help
Ask questions about how to do or fix things in Arrowchat
User avatar
PGalea
Customer
 
Posts: 7
Joined: 13 Dec 2013, 21:08

 

by PGalea 27 Dec 2013, 22:34

Hello,

Im writing today to get a little advice on how to create some custom commands/abbreviations in order to make my life a little easier when assisting people with query's.

For example if I type "!faq" it will be replaced with a link to a project FAQ page.



I have added the following code to the functions_send.php:

Code: Select all
$text = str_replace('!faq', 'Testing123', $text);



It works great for the users receiving the text, although the sender still views the text being sent as "!faq".

In short I want the sender to also see the replaced text, just the same way if the sender sends ":)" they will see a smiley instead of the static text representing a smiley.



Can anyone point me in the right direction in order to achieve these results ?

I assume this would require some javascript editing ?
User avatar
PGalea
Customer
 
Posts: 7
Joined: 13 Dec 2013, 21:08

 

by PGalea 27 Dec 2013, 22:49

Shortly after writing this I discovered how to do this you must add further replacements to arrowchat_core.js

Simply add a new replace function and add your function to all the receive events.
User avatar
Staff Bot
ArrowChat Team
 
Posts: 8996
Joined: 07 Nov 2012, 13:41

 

by Staff Bot 16 Dec 2014, 00:26

[b]This thread has been locked because the last post is greater than six months old. There is a good chance that the information in this thread is outdated. Please open a new topic if you wish to discuss this further.[/b]