I’m wondering how quoting works in forums in general. I want users to be able to quote other posts in their own posts. And the quote should contain the quote and the author of the quote. I’m wondering how this should be done. Should I simply put the username and the quote as it is in the new post, or should I only put the users id and regex it out and get the username from the db each time. Would not be very efficient, but “better” if I let user change their username in the future.
I’m using bbcode, so it would be something like this:
[quote=username]The quote[/quote]
Or if I go with user id
[quote=user_id]The quote[/quote]
And then with regex I will have to capture the user id and get the corresponding username from the db.
I’m not asking for the code. I’m more wondering how other forums have done this, and if it would be “okay” to put the username with the quote and not the user id.
Usually quotes are just static text within the post. The username is used not the user ID, and it is not dynamic, so won’t change if the user changes their username.
There isn’t a great deal of benefit to be had by making the username in the quote dynamic, especially when in most forums the username can’t be changed after registration.