SimplePortal
Customization => Blocks and Modifications => Topic started 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:
@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 ;)
-
Nice mod. :)
-
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
-
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
-
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:
<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.
-
you could find in mod code
value=
and replace it with value+=
but this will add @UserName: where you have placed cursor.
-
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.
-
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)?
-
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.
-
''@'' 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.
-
Clear cache.
-
Phantom, another great modification to SP. :)