The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
2 posters

    Default title for PMs

    teliosmetonma1
    teliosmetonma1
    Forumember


    Posts : 247
    Reputation : 1
    Language : greek

    Solved Default title for PMs

    Post by teliosmetonma1 January 7th 2019, 12:32 pm

    Hello, i would like to know if there is a way to have a default title when someone is trying to send a private message

    like: "(no title)"

    is there any code?

    thank you  Hello
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51554
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Default title for PMs

    Post by SLGray January 7th 2019, 1:45 pm

    PM's without a title will not be sent.  Are you asking for a way to add a tag to the titles?



    Default title for PMs Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    teliosmetonma1
    teliosmetonma1
    Forumember


    Posts : 247
    Reputation : 1
    Language : greek

    Solved Re: Default title for PMs

    Post by teliosmetonma1 January 7th 2019, 1:49 pm

    Im saying to press the "Send pm" button and this will be default:

    Default title for PMs Ice_sc13
    avatar
    Guest
    Guest


    Solved Re: Default title for PMs

    Post by Guest January 7th 2019, 2:08 pm

    Hello,

    This can be done, but I need your forum address.
    teliosmetonma1
    teliosmetonma1
    Forumember


    Posts : 247
    Reputation : 1
    Language : greek

    Solved Re: Default title for PMs

    Post by teliosmetonma1 January 7th 2019, 2:33 pm

    avatar
    Guest
    Guest


    Solved Re: Default title for PMs

    Post by Guest January 8th 2019, 11:38 am

    Could you please PM me an account on your forum? I dont understand the language. It doesnt have to be admin or mod. Just a simple account that can send PMs. Also, do you want the default title to be inserted when the user tries to send a pm without a title, or do you want that title to be there before the user tries to send the pm?
    teliosmetonma1
    teliosmetonma1
    Forumember


    Posts : 247
    Reputation : 1
    Language : greek

    Solved Re: Default title for PMs

    Post by teliosmetonma1 January 8th 2019, 1:05 pm

    to be there before the user tries to send the pm


    the language is greek.


    Here is a test account:


    Spoiler:
    avatar
    Guest
    Guest


    Solved Re: Default title for PMs

    Post by Guest January 8th 2019, 3:23 pm

    I cant connect with that account. This is the error I got:
    Code:
    Πιθανόν δώσατε λάθος όνομα χρήστη-κωδικό ή δεν είστε ενεργοποιημένο μέλος

    Για να ξαναδοκιμάσετε πατήστε εδώ

    Πατήστε εδώ για να επιστρέψετε στην Αρχική σελίδα
    teliosmetonma1
    teliosmetonma1
    Forumember


    Posts : 247
    Reputation : 1
    Language : greek

    Solved Re: Default title for PMs

    Post by teliosmetonma1 January 10th 2019, 8:27 am

    try again now.
    avatar
    Guest
    Guest


    Solved Re: Default title for PMs

    Post by Guest January 10th 2019, 11:09 am

    Add this Javascript code with the placement on all pages:
    Code:
    document.addEventListener("DOMContentLoaded", function(){
    if(!/privmsg\?mode=post/.test(location)) return;
    var def="(no title)";
    var elem=document.querySelector("[name='subject']");
    if(elem.value===""){
    elem.value=def;
    }
    elem.addEventListener("focus", function(){
    if(elem.value===def){
    elem.value="";
    }
    });
    elem.addEventListener("blur", function(){
    if(elem.value===""){
    elem.value=def;
    }
    });
    })
    This will generate the following behaviour:
    1.When the page is loaded, if the field is empty, the default text is pasted in.
    2.When somebody clicks on the field, the default text dissapears so they can write their title.
    3.If one clicks the field but leaves it empty, the default text will be pasted in.

    To modify the default text, you have to modify this line in the code:
    Code:
    var def="(no title)";
    The text in the quotes is the default text that will show up.
    teliosmetonma1
    teliosmetonma1
    Forumember


    Posts : 247
    Reputation : 1
    Language : greek

    Solved Re: Default title for PMs

    Post by teliosmetonma1 January 10th 2019, 11:41 am

    Thank you a lot!

    SOLVED
    avatar
    Guest
    Guest


    Solved Re: Default title for PMs

    Post by Guest January 10th 2019, 12:14 pm

    No problem!
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51554
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Default title for PMs

    Post by SLGray January 10th 2019, 12:46 pm

    Problem solved & topic archived.
    Please read our forum rules:  ESF General Rules



    Default title for PMs Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.

      Current date/time is November 11th 2024, 1:53 pm