WordPress.org

Ready to get started?Download WordPress

Forums

Simple Ajax Chat
[resolved] Change guest_ (16 posts)

  1. Buienradars
    Member
    Posted 4 months ago #

    How can i change guest_ with the numbers to something else ?

    https://wordpress.org/plugins/simple-ajax-chat/

  2. Jeff Starr
    Member
    Plugin Author

    Posted 4 months ago #

    There is no setting for that, but you could always locate the string in the plugin files and change it to whatever.

  3. Buienradars
    Member
    Posted 4 months ago #

    Where can i find it sir ?

  4. Jeff Starr
    Member
    Plugin Author

    Posted 4 months ago #

    You're gonna have to look for it.. (sorry I'm working remotely w/o access to my files)

  5. Buienradars
    Member
    Posted 4 months ago #

    I have searched but i can`t find it.

  6. Jeff Starr
    Member
    Plugin Author

    Posted 4 months ago #

    I'll take a look when I get back to the office and let you know.

  7. Buienradars
    Member
    Posted 4 months ago #

    Thank you Jeff ;)

  8. Buienradars
    Member
    Posted 4 months ago #

    Any news ?

  9. kropamk
    Member
    Posted 4 months ago #

    Hi,

    I had the same problem but I found the solution. You have to find the file sac.php (location: simple-ajax-chat/resources). You look checkName() function and you make a change in the condition
    if (currentName.value =='') {
    currentName.value = '(leave blank if you do not want to show)';
    }
    I hope I helped,
    Kropamk

  10. Buienradars
    Member
    Posted 4 months ago #

    Hi kropank

    On what number of line do i search ?
    And how to change it to Vul hier je naam in.

  11. kropamk
    Member
    Posted 4 months ago #

    file sac.php, line 338 is function checkName() but the condition line is 348

    This is the function:

    function checkName(){
    sacCookie = sac_getCookie("sacUserName");
    currentName = document.getElementById('sac_name');
    if (currentName.value != sacCookie) {
    document.cookie = "sacUserName="+currentName.value+"; expires=<?php echo gmdate("D, d M Y H:i:s",time() + $offset)." UTC"; ?>;"
    }
    if (sacCookie && currentName.value == '') {
    currentName.value = sacCookie;
    return;
    }
    if (currentName.value == '') {
    currentName.value = '';
    }
    }

  12. kropamk
    Member
    Posted 4 months ago #

    You just find the functions checkName () (line 338) and the variable currentName.value = 'Guest_' + Math.floor (Math.random () * 10000); change everything after the = sign, ie 'Guest_' + Math.floor (Math.random () * 10000);

  13. Buienradars
    Member
    Posted 4 months ago #

    I have it now this way

    if (currentName.value == '') {
    		currentName.value = 'Naam_'+ Math.floor(Math.random() * 10000);

    Now it shows Naam like i like it but also the numbers.

  14. kropamk
    Member
    Posted 4 months ago #

    delete '+ Math.floor(Math.random() * 10000)' and disappear numbers ;)

  15. Buienradars
    Member
    Posted 4 months ago #

    Thnx kropamk

    Works fine now ;)

  16. Buienradars
    Member
    Posted 4 months ago #

    Solved

Reply

You must log in to post.

About this Plugin

About this Topic

Tags