SimplePortal

Customization => Blocks and Modifications => Topic started by: phantomm on February 10, 2013, 04:32:52 AM

Title: [MOD] SP Shoutbox PM Button
Post by: phantomm on February 10, 2013, 04:32:52 AM
SP Shoutbox PM Button




This mod will add sign @ before username in Shoutbox, and it will insert in message box something like this:
Quote
@UserName:

Now you can write some text after it :) It's just built in Shoutbox PM function, mod is just adding this button. Useful, because some users have complicated usernames ::)

(http://img59.imageshack.us/img59/534/obraz2rl.png)

Tested with SMF 2.0.4 and SP 2.3.5.

Credits:
Thanks to Alex (http://simpleportal.net/index.php?action=profile;u=35235) for code to insert text in message box ;)
Title: Re: [MOD] SP Shoutbox PM Button
Post by: Kryzen on February 10, 2013, 06:29:54 AM
Nice mod. :)
Title: Re: [MOD] SP Shoutbox PM Button
Post by: xKroniK13x on February 12, 2013, 06:12:26 PM
I made a very similar mod myself, and am curious... is there a way to make it not reset your post when you click @? I know on your color picker mod, it does not erase a previous message; however, when you click @, it does erase it... I looked into the code and could not quite figure out the difference! Figured it out.

New problem: names with spaces in them do not get PMs?  :0
Title: Re: [MOD] SP Shoutbox PM Button
Post by: phantomm on February 13, 2013, 03:21:13 AM
I made a very similar mod myself, and am curious... is there a way to make it not reset your post when you click @? I know on your color picker mod, it does not erase a previous message; however, when you click @, it does erase it... I looked into the code and could not quite figure out the difference! Figured it out.
Can you share it here? :)

New problem: names with spaces in them do not get PMs?  :0
I don't have this issue
Title: Re: [MOD] SP Shoutbox PM Button
Post by: xKroniK13x on February 13, 2013, 04:46:17 PM
I made a very similar mod myself, and am curious... is there a way to make it not reset your post when you click @? I know on your color picker mod, it does not erase a previous message; however, when you click @, it does erase it... I looked into the code and could not quite figure out the difference! Figured it out.
Can you share it here? :)

New problem: names with spaces in them do not get PMs?  :0
I don't have this issue

Well, it isn't with the @ sign for me, in my modification I am using /pm {username} {message}. I attempted /pm "{username}" {message}. I'm sure this is causing the problem. I believe it is likely with the preg_match function, which I have almost no experience with the syntax. If you could help me... I'd be very appreciative.

As for the making it not disappear, this is the link function I am using:
Code: [Select]
<a href="javascript:void(0);" onclick="surroundText(\'@' . $shout['author']['name'] . ': \', \'\', document.getElementById(\'new_shout_' . $shoutbox['id'] . '\'))">@</a>
If you just click it, it will put in inline on the text, but if you select the entire text first and click it, it will place it in the beginning. There may be a better way to do this.
Title: Re: [MOD] SP Shoutbox PM Button
Post by: phantomm on February 13, 2013, 05:05:29 PM
you could find in mod code
Code: [Select]
value= and replace it with
Code: [Select]
value+= but this will add @UserName: where you have placed cursor.
Title: Re: [MOD] SP Shoutbox PM Button
Post by: xKroniK13x on February 14, 2013, 12:05:04 AM
Silly me with the spacing issue... my preg_match function ended the search with a space, so if a name had a space, it only caught the first half. For example, if my name was xKron iK13x, /pm xKron iK13x would sent a PM to xKron, with the message of iK13x. Duh. I fixed this by simply adding a :. So it's now /pm xKron iK13x: message. Simple fix.
Title: Re: [MOD] SP Shoutbox PM Button
Post by: Antler on May 04, 2013, 01:08:39 PM
I installed the Mod. When I tested it, it appears that everyone using the shoutbox will see the message. How is it PM (Private Message)?
Title: Re: [MOD] SP Shoutbox PM Button
Post by: phantomm on May 04, 2013, 04:04:29 PM
Message should be visible for author, for recipient and for admin.
Be aware, that PM function is built in in SimplePortal, this mod only adds button which allows to insert username in message box (with correct formatting for PM), nohing more.

If PM function is not working correctly you should open support topic in English Support (http://simpleportal.net/index.php?board=11.0) board.
Title: Re: [MOD] SP Shoutbox PM Button
Post by: Skaty on June 05, 2013, 04:57:42 PM
''@'' it is disapearing after one message. why is dissapearing ?

and sorry i didn't understand how to fix erase issue. it is erase theme message. which file i should edit ?

Thank you.
Title: Re: [MOD] SP Shoutbox PM Button
Post by: phantomm on June 06, 2013, 12:54:35 PM
Clear cache.
Title: Re: [MOD] SP Shoutbox PM Button
Post by: Burke Knight on October 09, 2013, 11:27:49 PM
Phantom, another great modification to SP. :)
SimplePortal 2.3.8 © 2008-2024, SimplePortal