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 June 3rd 2012, 3:17 pm

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?

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 June 3rd 2012, 4:14 pm

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

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 June 4th 2012, 10:48 pm

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().

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: PM link - Autofill subject

Post by c3vietk on June 5th 2012, 2:25 am

i have checked it.

the function is available in http://illiweb.com/rs3/33/frm/lang/notutf8-en.js

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 June 5th 2012, 2:30 am

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

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
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