Check out Symmetric Chess, our featured variant for March, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Comments/Ratings for a Single Item

Earlier Reverse Order LaterLatest
The new editcomment.php script[All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Fri, Jul 3, 2020 09:38 PM UTC:

I am running a test of a new script for editing comments. It is a single script that will handle comments on pages and subjects. It is intended to replace createcomment.php, previewcomment.php, addcomment.php, createsubject.php, previewsubject.php, addsubject.php, usereditcomment.php, userpreviewcomment.php, and usermodifycomment.php.

I have written a new function for database-funcs.php called insert_row(). This script uses it to insert new comments.

As a test, I am updating it with this third paragraph.


🕸Fergus Duniho wrote on Mon, Jul 6, 2020 02:26 AM UTC:

Update of test comment, using REPLACE instead of UPDATE. This time for real.


🕸Fergus Duniho wrote on Tue, Jul 7, 2020 06:22 PM UTC:

Insertion of new subject comment using REPLACE instead of INSERT. Updating.


🕸Fergus Duniho wrote on Tue, Jul 7, 2020 07:44 PM UTC:

I have switched the script back to using INSERT and UPDATE. I wanted to make sure that the replace_row() function would work properly, and it does. Semantically, INSERT and UPDATE make more sense, especially given that the script uses them under different conditions anyway. You don't have to be signed in to INSERT a new comment, but you do have to be signed in to UPDATE a previously posted comment. The replace_row() function is useful in code that may be used for either inserting or updating a row.


🕸Fergus Duniho wrote on Tue, Jul 7, 2020 08:27 PM UTC:

I have switched the script back to using INSERT and UPDATE. I wanted to make sure that the replace_row() function would work properly, and it does. Semantically, INSERT and UPDATE make more sense, especially given that the script uses them under different conditions anyway. You don't have to be signed in to INSERT a new comment, but you do have to be signed in to UPDATE a previously posted comment. The replace_row() function is useful in code that may be used for either inserting or updating a row.

Modified with new paragraph.


🕸Fergus Duniho wrote on Tue, Jul 7, 2020 08:28 PM UTC:

I have switched the script back to using INSERT and UPDATE. I wanted to make sure that the replace_row() function would work properly, and it does. Semantically, INSERT and UPDATE make more sense, especially given that the script uses them under different conditions anyway. You don't have to be signed in to INSERT a new comment, but you do have to be signed in to UPDATE a previously posted comment. The replace_row() function is useful in code that may be used for either inserting or updating a row.


🕸Fergus Duniho wrote on Thu, Jul 9, 2020 04:20 PM UTC:

I enabled this script to work with Kibbitz comments yesterday. I also noticed that the kibbitzinc.php script was no appearing in the footer, which led to no one posting Kibbitz comments for a long time. So, I fixed that. After posting this, I will try to update it immediately.


🕸Fergus Duniho wrote on Thu, Jul 9, 2020 04:21 PM UTC:

I enabled this script to work with Kibbitz comments yesterday. I also noticed that the kibbitzinc.php script was not appearing in the footer, which led to no one posting Kibbitz comments for a long time. So, I fixed that. After posting this, I will try to update it immediately.

And now to update it with a new line.


🕸Fergus Duniho wrote on Thu, Jul 9, 2020 04:27 PM UTC:

I enabled this script to work with Kibbitz comments yesterday. I also noticed that the kibbitzinc.php script was not appearing in the footer, which led to no one posting Kibbitz comments for a long time. So, I fixed that. After posting this, I will try to update it immediately.

And now to update it with a new line.

Attempting again.


🕸Fergus Duniho wrote on Thu, Jul 9, 2020 04:29 PM UTC:

I enabled this script to work with Kibbitz comments yesterday. I also noticed that the kibbitzinc.php script was not appearing in the footer, which led to no one posting Kibbitz comments for a long time. So, I fixed that. After posting this, I will try to update it immediately.

And now to update it with a new line.

Attempting again.

That was an insertion. Attempting again before fixing anything more.


🕸Fergus Duniho wrote on Thu, Jul 9, 2020 04:30 PM UTC:

I enabled this script to work with Kibbitz comments yesterday. I also noticed that the kibbitzinc.php script was not appearing in the footer, which led to no one posting Kibbitz comments for a long time. So, I fixed that. After posting this, I will try to update it immediately.

And now to update it with a new line.

Attempting again.

That was an insertion. Attempting again before fixing anything more.

I was assigning the primary key from the newly inserted row to $subjectid, which was a mistake. I have now corrected it to assign it to $commentid.


🕸Fergus Duniho wrote on Fri, Jul 10, 2020 01:03 AM UTC:

I am replacing the useshtml value with a format value, which can take three different values:

  • HTML
  • Markdown
  • Text

This is to allow the use of Markdown. I installed Parsedown.php for the sake of using Markdown.

I am also removing CKEditor from this script, because it modifies the text in the text area.


🕸Fergus Duniho wrote on Fri, Jul 10, 2020 01:19 AM UTC:

There are still some things to fix up, but I figured it's time to switch over to the new editcomment.php script. This replaces a whole bunch of other scripts, and instead of giving you a WYSIWYG editor, which can modify the HTML entered by people, it allows you to enter HTML, Markdown, or plain text. By default, it will use Markdown, which is commonly used on reddit and on other sites.

Since this is the beta testing phase, give me your feedback on how well it works out for you.


Ben Reiniger wrote on Fri, Jul 10, 2020 02:47 AM UTC:

The Subject entry box is wider than my screen. When I press Preview, make some changes, and press Preview again, the preview is empty. (This was before logging in, if that matters.) There's an Edit and View (and [*]) link on the preview that doesn't work (and probably shouldn't be there). When I draft a message and then try to log in, I get an error along the lines of "You must be logged in as the original author to edit a comment" (this was after Preview, in case that matters).

We should add

  1. a link to a markdown guide; since Parsedown uses github-flavored markdown, maybe https://guides.github.com/features/mastering-markdown/ ?
  2. possibly a short list of common markdown?

bold emph emph, emph

header

header2


H. G. Muller wrote on Fri, Jul 10, 2020 11:24 AM UTC:

I think the CKEditor was a lot more user-friendly then markdown. It made it very easy to enter simple text messages with common typographic refinements. You just had to be careful to never switch off 'source-code' mode once you had messed with the HTML.

The new script doesn't seem to have an exit: when you click 'post' after having seen the preview, it goes back to edit mode.


🕸Fergus Duniho wrote on Fri, Jul 10, 2020 02:34 PM UTC:

How wide is your screen?


H. G. Muller wrote on Fri, Jul 10, 2020 03:04 PM UTC:

On my desktop monitor: 1680 pixels.


Ben Reiniger wrote on Fri, Jul 10, 2020 03:53 PM UTC:

The display width of my netbook is 1366px. After the left column ad, the article block is only 998px.


🕸Fergus Duniho wrote on Sat, Jul 11, 2020 02:54 AM UTC:

I updated the Format value in the Comment and Kibbitz tables to be HTML for any comment with HTML tags in it.

I modified the Markdown format to not allow HTML. It will display any HTML as text. However, it will still work with shortcodes.

I have modified the Text format to place text inside of <PRE STYLE="white-space: pre-wrap;"></PRE> tags, and I have stopped it from putting <P></P> tags around each paragraph. The style given to the tag allows it to wrap long lines. For the sake of backward compatibility, it will allow HTML and work with shortcodes. Unlike HTML mode, it does not require the use of <P> tags to separate paragraphs. A blank line will do.

The Subject entry box is wider than my screen.

I reduced it in size.

When I press Preview, make some changes, and press Preview again, the preview is empty. (This was before logging in, if that matters.)

I signed out to test this, and initially, there didn't seem to be a problem, but when I tried to post an earlier draft of this reply, I got the same problem. It is a bit too late right now to deal with it. It seems related to not signing me in even though I've entered my userid and password.

There's an Edit and View (and [*]) link on the preview that doesn't work (and probably shouldn't be there).

I removed those.

When I draft a message and then try to log in, I get an error along the lines of "You must be logged in as the original author to edit a comment" (this was after Preview, in case that matters).

I fixed that.

We should add

  1. a link to a markdown guide; since Parsedown uses github-flavored markdown, maybe https://guides.github.com/features/mastering-markdown/ ?
  2. possibly a short list of common markdown?

I added a link to a site called Markdown Guide, and I wrote a quick Markdown guide.


🕸Fergus Duniho wrote on Sat, Jul 11, 2020 03:43 PM UTC:

When I press Preview, make some changes, and press Preview again, the preview is empty. (This was before logging in, if that matters.)

That should now be fixed. When someone enters a userid and password, one of the first things it now does is try to log in.


🕸Fergus Duniho wrote on Sat, Jul 11, 2020 04:14 PM UTC:

I removed the action from the form element, since the form calls the same page. It looks like it works.


Carlos Cetina wrote on Sat, Jul 11, 2020 05:56 PM UTC:

It seems that the script change affected the editor that is used in presets to write a brief description of the rules since these now appear in html view.

Example: Apothecary Chess-Classic


🕸Fergus Duniho wrote on Sat, Jul 11, 2020 07:32 PM UTC:

It seems that the script change affected the editor that is used in presets to write a brief description of the rules since these now appear in html view.

It didn't affect the editor. It affected how Game Courier displays the written rules for a game, because I made some changes to the display_comment() function. I changed the call to this function to use HTML, and now it displays the rules properly again.


🕸Fergus Duniho wrote on Fri, Jul 10, 2020 11:24 AM UTC:

H. G. Muller wrote on 2020-07-10 EDT

I think the CKEditor was a lot more user-friendly then markdown. It made it very easy to enter simple text messages with common typographic refinements.

Have you used Markdown much yet? I have been using it for years with reddit, and I find it more convenient to use than a WYSIWYG editor. It makes it easy to do things by typing rather than by clicking a button in a toolbar.

You just had to be careful to never switch off 'source-code' mode once you had messed with the HTML.

Yes, that's the main complaint I got about CKEditor. It would be nice to have an editor without that problem.

The new script doesn't seem to have an exit: when you click 'post' after having seen the preview, it goes back to edit mode.

The new script will show the most recent comments in the footer, which wasn't fully working before, and it gives you the ability to make last-minute changes if you spot something you want to change after posting a comment. Links to the original page and to more comments should be found in the footer.


🕸Fergus Duniho wrote on Mon, Jul 13, 2020 01:50 AM UTC:

I have installed ParsedownExtra to handle Markdown Extra. I have also changed it to allow HTML to be used with Markdown. Here are some tests. Most are copied and pasted from the Markdown Guide's Extended Syntax page or from PHP Markdown Extra.

This is a test of how it handles code blocks. It does not do syntax highlighting.

// A useful debugging function for identifying the exact contents of a string
// Added by Fergus Duniho 4/6/2012
function show_ascii_code($text) {
    $len = strlen($text);
    for ($i = 0; $i < $len; $i++) {
        echo ord($text{$i}) . "/";
    }
}

Testing tables

Syntax Description
Header Title
Paragraph Text

Testing alignment of text in table cells

Syntax Description Test Text
Header Title Here's this
Paragraph Text And more

Testing footnotes

Here's a simple footnote,[^1] and here's a longer one.[^bignote]

Testing definition lists

First Term
This is the definition of the first term.
Second Term
This is one definition of the second term.
This is another definition of the second term.

Testing strikethrough

The world is flat. We now know that the world is round.

Testing task lists

  • [x] Write the press release
  • [ ] Update the website
  • [ ] Contact the media
Testing emoji shortcodes

grinning:

grinning_face:

Testing pasting an emoji

?

Testing automatic URL linking

https://www.chessvariants.com

Testing the disabling of automatic URL linking

https://www.chessvariants.com

Testing Markdown inside HTML DIV

This is *italics*, and this is **bold**.

Trying it again with markdown set to "1"

This is italics, and this is bold.

Testing abbreviations

The HTML specification is maintained by the W3C.

Testing underscores vs asterisks for emphasizing text within a word.

Please open the folder "secret_magic_box".

Please open the folder "secretmagicbox".


25 comments displayed

Earlier Reverse Order LaterLatest

Permalink to the exact comments currently displayed.