By OK Computer on
Hi. I've just installed the shoutbox module on my website. Very impressive. However, I do have one fault to pick with it. The "Your Name/Nick" input box allows a registered user to put an alias in of their own choice. This also allows annoying users to mimick other users by allowing them to type any name they want. Is there any way of removing this box, and automatically fetching their username that they are logged in as on Drupal? Or possibly leaving the box there, automatically filling it with their registered username and disabling the box from being typed in?
Thanks for your time!
Ritch.
Comments
Shoutbox.module code
Saw that... how come it doesn't function?
Explanation
The code you're looking at does function correctly, but it's not what you want. The code gets the username and puts it in the title attribute of the shout. When you mouseover a shout it should say "Posted 09/09/05 at 10:53am by benshell" or "Posted 09/09/05 at 10:53am by an anonymous user", regardless of what the user put in the nickname box.
An anonymous user could still use a deceptive nickname, but that's a risk of allowing anonymous users to post shouts. If the user is registered and uses a deceptive nickname it would be easy to block/delete the user AND anyone who has noticed the mouseover thing will already know who it really was. In three years of running a reasonablely active website with a shoutbox I've only had one faker, and that was an anonymous user.
The reason I haven't done what you want is because a lot of my users have long usernames that wouldn't fit well in the shoutbox. Still, it wouldn't be a bad optional feature. I don't have time today, but maybe I can do that next week.
BTW, in the future please post feature requests or bug reports on the project page (http://drupal.org/project/issues/10720). I try to read the forums as much as possible but they are very active so I miss things.
Thanks for your patience,
- Ben -
Shoutbox masquereding
I noticed this too and I hacked my way through the module code to remove the URL entry box and force the username to be the $name from the user info array. It is not pretty and I am too embarrased to share the code here because I know nothing really of PHP. It does work however despite the hatchet job I did and I did break the timestamp in doing so. I'll be trying to reverse that damage back out.
I would be most interested in a proper release with the ability to force the registered username.
I would also like the shout box to have a view property in the access control so that I can easily hide this from anonymous users. There is probably another way to do this but i haven't figured it out yet. I'll post the feature request as you have asked.
Thanks
--Daniel
I'm no programmer and I'm
I'm no programmer and I'm new to Drupal, but I think I figured it out.
In shoutbox.module
Comment out the following:
Add this below it:
Comment out the following:
remove the colon from this line (near the end for the file):
You can see it running on my site if you want: http://www.tyrannozaurus.com
Hope this helps someone.
Works wonderfully! And since
Works wonderfully!
And since now there is a permission setting to restrict anonymous users from posting shouts: problem solved!
thanks!
np happy to give back.
np
happy to give back.
Works for admin
I got this to work on the admin account however for the regular user the name isn't being auto populated.
Also if i hit the post button without entering text the edit primary links comes up.
Any help anyone could provide would be appreciated.
I had this working under
I had this working under 4.7.X perhaps you are using 5.X and the code needs to be altered slightly.
hmm
hey i know this Topic seems a little old however is there a way some could send me a shoutbox code or guide me how to get one that lets registered users only to ue it thanks. Btw i am using phpbb forums, its freely hosted (legendarypk.freeforums.org)