The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

PM link - Autofill subject

View previous topic View next topic Go down

PM link - Autofill subject

Post by TMartin3000 on 3/6/2012, 15:17

I'd like to request a little help here, if I may.

Now, it's possible to create a link that would open the PM window to send a message to a certain user, but is it possible to create a link that automatically fills the subject of the PM, too?

For example, when a link directs to this URL: http://www.thesonicfamily.com/privmsg?mode=post&u=4, it opens the "Send Private Message" window (for the person who's already registered and logged in on the forum) to send a PM to user #4 (that's what u=4 stands for in the link), but is it possible to add further parameters to the URL, such as the subject of the message being composed? I tried adding "&subject=Text", but it didn't work. Is there any way to do this?
avatar
TMartin3000
New Member

Male Posts : 1
Reputation : 1
Language : English, German, Hungarian

http://tsfsonicfamily.forumotion.com

Back to top Go down

Re: PM link - Autofill subject

Post by c3vietk on 3/6/2012, 16:14

Try this script :
Code:
$(function(){
   if (GetParam("mode") + GetParam("u") == "post4") $("input[name='subject']").val("TEXT");
});
avatar
c3vietk
Forumember

Male Posts : 65
Reputation : 41
Language : Vietnamese, HTML, Javascript, C#, PHP
Location : Vietnam, HCMc

http://diendan.chinhphuc.info/

Back to top Go down

Re: PM link - Autofill subject

Post by LGforum on 4/6/2012, 22:48

No, there's no parameter for filling the subject field.

You could try something like this:
Code:

$(function(){
 var form = document.post;
 if(form && form.mode == 'post' && form.action == '/privmsg') {
    if(document.getElementById('username').value == 'USERNAMEOFPERSON') {
        form.subject.value = 'SUBJECT HERE';
  }
 }
});

Or you could try the post above, but I doubt it will work because you'd need the function getParam().
avatar
LGforum
Hyperactive

Male Posts : 2262
Reputation : 260
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: PM link - Autofill subject

Post by c3vietk on 5/6/2012, 02:25

i have checked it.

the function is available in http://illiweb.com/rsc/33/frm/lang/notutf8-en.js
avatar
c3vietk
Forumember

Male Posts : 65
Reputation : 41
Language : Vietnamese, HTML, Javascript, C#, PHP
Location : Vietnam, HCMc

http://diendan.chinhphuc.info/

Back to top Go down

Re: PM link - Autofill subject

Post by LGforum on 5/6/2012, 02:30

I wouldn't say it's available in phpbb3 then. Use a console, getParam is undefined. So can't be used as a function.
avatar
LGforum
Hyperactive

Male Posts : 2262
Reputation : 260
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum