Default title for PMs Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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.
2 posters

    Default title for PMs

    teliosmetonma1
    teliosmetonma1
    Forumember


    Posts : 247
    Reputation : 1
    Language : greek

    Solved Default title for PMs

    Post by teliosmetonma1 Mon 7 Jan - 19:32

    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 : 51496
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Default title for PMs

    Post by SLGray Mon 7 Jan - 20:45

    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 Mon 7 Jan - 20:49

    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 Mon 7 Jan - 21:08

    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 Mon 7 Jan - 21:33

    avatar
    Guest
    Guest


    Solved Re: Default title for PMs

    Post by Guest Tue 8 Jan - 18:38

    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 Tue 8 Jan - 20:05

    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 Tue 8 Jan - 22:23

    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 Thu 10 Jan - 15:27

    try again now.
    avatar
    Guest
    Guest


    Solved Re: Default title for PMs

    Post by Guest Thu 10 Jan - 18:09

    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 Thu 10 Jan - 18:41

    Thank you a lot!

    SOLVED
    avatar
    Guest
    Guest


    Solved Re: Default title for PMs

    Post by Guest Thu 10 Jan - 19:14

    No problem!
    SLGray
    SLGray
    Administrator
    Administrator


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

    Solved Re: Default title for PMs

    Post by SLGray Thu 10 Jan - 19:46

    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.