Experimental Feature: Visual Editing of Comments

I have just enabled local modifications to permit visual (“rich text”) editing of comments on posts.  Since 2018-02-15 users have been able to edit their own comments on posts.  However, editing was always with the “Quicktags” editor, in which the user edits the HTML code of the comment, not the visual presentation used by default when composing a comment (using the “TinyMCE” editor).

The change makes the TinyMCE visual editor available, and the default, when editing comments.  The Quicktags editor remains available for those who prefer it, or when editing the comment at the HTML level is the only way to accomplish what you’re trying to do (for example, custom styles, fonts, colours, etc.).  The “Add Media” button is available when in Visual mode, making it easy to add new images while editing comments.  Shortcodes, such as those for spoilers, mathematics, and drop capitals, may be used in either Visual or Text mode editing.

This is actually, in terms of lines of code, a relatively minor change, but developing it required extensive research into how WordPress handles editing comments, culminating in a marathon session described in the Updates group post for 2018-05-03.  But given the towering and tottering stack of hacks which is WordPress, the consequences of even the smallest change can be profound, so since putting the new code into production today, 2018-05-04 at 19:30 UTC, I have been watching the HTTP error_log closely for any errors.  If you notice any strange behaviour when editing comments in either Visual or Text mode, please report them in comments to this post or in the Bug Reports group.

If you want to experiment with the new comment editing code or try to break it with torture tests, please use the Sand Box post, which exists for that purpose.

Like 11+

Users who have liked this post:

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar

Knowledge Base: Avatars, Profiles, Posts, and Comments

A series of changes recently made to the site are intended to improve navigation around the site and make it easier to keep track of your own activity and that of other members.  For complete implementation details, see the posts on the Updates group, which is usually updated around 22:00 UTC on any day in which the site’s software or configuration has been changed.

Avatars are the small round images which identify users.  Users can upload their own avatars or use avatars posted on the Gravatar site under the same E-mail address they used when registering their Ratburger membership.  Avatars appear on main page posts and comments, and on group posts and comments, along with the user’s name, which identifies people who haven’t uploaded an avatar image.  For likes on posts and comments, only avatars are shown, but you can “mouse over” or “hover” above the avatar to see the user’s name as a pop-up title.  On almost every place you see an avatar on the site, you can click it to display the user’s Profile page.

Profile pages are a one-stop shop for information about users.  A user’s profile shows you:

  • Display name (“John Walker”)
  • Avatar
  • Account name (“@johnwalker”)
  • Time of last activity
  • Description or biography, if any
  • “Party card number” (Order in joining the site)
  • Date joined

Below this information is a menu which allows you to view additional information about the user, including:

  • Activity in groups in which the user participates
  • Profile of the user
  • Friends of the user
  • Groups of which the user is a member
  • Posts made by the user since joining the site
  • Comments made by the user since joining the site

In addition, when viewing your own profile, additional information is available such as Notifications and Messages, plus the ability to edit most of the profile fields.  When viewing your own posts and comments, there are links that let you edit them.

(A note on “Party card numbers”: some users will have party card numbers which are greater than the number of members shown in the “At a Glance” section of the Dashboard.  This is because these numbers [formally, within the WordPress software, user IDs] are assigned when an account is created and never reused.  If an account fails to complete registration, is closed,  or is banned due to spamming or other misbehaviour, it will have a party card number which corresponds to no active account.  Like many other parties, Ratburger has “unpersons”.)


Users who have liked this post:

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar

Knowledge Base: Viewing Your Comments

Starting with Build 104 (see the Updates group to see details of changes in each build of the site), you can now view all of the comments you’ve made on the site since you joined, across all posts.

You can access your “My Comments” page from either the main menu (across the top on desktop, or as a drop-down on mobile) or the drop-down from your avatar at the top right, in both cases as a “Comments” item under the “Activity” menu. It shows you the comments you’ve made on all posts since you joined the site from the most recent to the oldest. Comments are shown 25 per page, with navigation links at the bottom to move from page to page.  Each comment contains links which let you view the comment in the context of the post on which it was made or edit the comment. Images, video and other embeds, and shortcodes such as spoilers and mathematics should work within comments on these pages.  The number of likes on each comment is shown.

Like 10+

Users who have liked this post:

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar

Knowledge Base: Including Images in Comments on Posts

When you’re writing a comment on a post and wish to include an image, it can seem puzzling, since the mechanism is entirely different from that used when you add an image to a main post.  Why?  Because the image facility for main posts is a WordPress built-in feature while the comment composition editor is a plug-in by a third party which does not conform to the same interface.  It would be nice if it did, but, not wishing to implement everything from scratch, we work with what’s available.  Once you get used to it, including images in comments isn’t all that painful.  Let’s dig into it.

You insert images in comments by clicking the icon at the right of the comment composition box that looks like a mountain range (that’s supposed to suggest a picture).  When it pops up, you’ll see the following dialogue:

Insert image dialogue

(The icon which summons this dialogue is shown at the top left, subdued.)

In the Source field, you enter the URL of the image you wish to insert.  That’s the Web address whence the image can be accessed.  You can use any image hosting service, but by far the best way is to upload the image to the Ratburger Media Library.  You do this, ideally before beginning to compose the comment (but if you forget, simply open another window, navigate to Ratburger, then use the New/Media item in the menu at the top left), by specifying the image file to upload from your local computer.

After you’ve uploaded the image, its URL at Ratburger will appear in the panel at the right of the window.  Copy it to the clipboard and dismiss the Media Library window.  It will look something like:

https://www.ratburger.org/wp-content/uploads/2017/12/insimg.png

which happens to be the URL for the image above.  That’s what you paste into the Source field of the Insert/edit image box.  The “Image description” field is optional, and specifies the alternative text displayed for users whose browsers cannot display images.  This is particularly important for the blind who use screen reader programs, but this is a courtesy and not a requirement.  The Dimensions will be filled in automatically and needn’t be changed unless you wish to resize the image.

If you upload a very large image (for example, a raw snap from a digital camera which you haven’t resized for use on the Web, the image will be automatically scaled to fit within a 600×600 pixel bounding box.  It is not possible to specify alignment (left, centre, right) of images within comments as one can for images in main posts.

Let me be the first to say that this is less than ideal, but it’s a lot better than what WordPress provides out of the box: no facility for including images in comments whatsoever.

In WordPress/BuddyPress posts and comments on posts have nothing in common with posts and comments in groups.  There is presently no simple way to include images in groups.  That doesn’t mean you can’t include images there, just that you’ll have to know how to type an HTML img tag into your message to embed the image.


Users who have liked this post:

  • avatar
  • avatar