The Chess Variant Pages
Custom Search




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

Comments/Ratings for a Single Item

Later Reverse Order EarlierEarliest
The new editcomment.php script[Subject Thread] [Add Response]
Fergus Duniho wrote on 2020-07-19 UTC

The editcomment.php script in /index/ now provides the same functionality to editors as the editcomment.php script in /indexmaint/ did. So, I have removed the [*] link and have replaced it with the [Edit] link when the editor is not the comment's author. When the editor is the author, it would be redundant to have two links, and only the regular Edit link is provided.

Instead of having a checkbox for Reviewed, it now has buttons called Approve and Disapprove. The former will update the Reviewed column with a true value, and the latter will update it with a false value.

Instead of having all the buttons show up all the time, only relevant buttons will show up, and only editors will get to see the extra buttons. The Approve and Disapprove buttons show up only if the person who posted a comment is not a registered user, and only the one that will change the value of Reviewed will show up. Likewise, Block will show up only for unblocked comments, and Unblock will show up only for blocked comments.

One change that affects authors too is that authors now have access to the Delete button to delete their own comments.


Fergus Duniho wrote on 2020-07-19 UTC

Since I was using a goto in an if-elseif series that checked the same variable, I changed it to switch and used break again. I also got rid of some breaks by using elseif instead of if in some places. But some early breaks were needed to skip over code for mailing notifications.


Fergus Duniho wrote on 2020-07-19 UTC

I have been working on getting this script to handle the extra abilities provided to editors in the /indexmaint/editcomment.php script. When it's complete, I'll remove the [*] link and just have the edit link show up differently for editors when the comment is not their own.

I also learned that PHP now supports goto, and I used it instead of the kludge of using break in a while or do-while loop.


Fergus Duniho wrote on 2020-07-14 UTC

Okay, I modified it to do that.


H. G. Muller wrote on 2020-07-14 UTC

Authors might still be interested in discussions between other people in the comment section. Wouldn't it be better to send a notification to both the page author and the poster of the comment that is replied to?


Fergus Duniho wrote on 2020-07-10 UTC

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.

There is now a link back to the latest comments page.


Fergus Duniho wrote on 2020-07-14 UTC

I have now added the ability to send email notifications, which was in addcomment.php. I copied over the code from that file and made some modifications to it. Since I previously added the ability to reply to a specific comment, replies will send an email notification to the person whose comment is being replied to instead of to the page authors or game inventors. This will also work for subject comments. Otherwise, no one will be notified for new subject comments. Also, no one will be notified for Kibbitz comments.


H. G. Muller wrote on 2020-07-13 UTC

The 'Edit' links seem to have disappeared from all my comments. Is there another way to modify a comment now?

[Edit] Forget about this; I see the link now. Not sure what was wrong before, it said I was logged on.


Fergus Duniho wrote on 2020-07-13 UTC

The footnotes were initially working in the preview. It appears that some tests following the footnote test are interfering with them working, but it's late, and I don't want to keep trying to figure out what that could be right now. Here is the footnote test by itself.

Testing footnotes

Here's a simple footnote,1 and here's a longer one.2


  1. This is the first footnote. 

  2. Here's one with multiple paragraphs and code.

    Indent paragraphs to include them in the footnote.

    { my code }

    Add as many paragraphs as you like. 


Fergus Duniho wrote on 2020-07-13 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".


Fergus Duniho wrote on 2020-07-10 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 2020-07-11 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.


Carlos Cetina wrote on 2020-07-11 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 2020-07-11 UTC

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


Fergus Duniho wrote on 2020-07-11 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 2020-07-11 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.


Ben Reiniger wrote on 2020-07-10 UTC

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


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

On my desktop monitor: 1680 pixels.


Fergus Duniho wrote on 2020-07-10 UTC

How wide is your screen?


H. G. Muller wrote on 2020-07-10 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.


Ben Reiniger wrote on 2020-07-10 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


Fergus Duniho wrote on 2020-07-10 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.


Fergus Duniho wrote on 2020-07-10 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 2020-07-09 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 2020-07-09 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.


25 comments displayed

Later Reverse Order EarlierEarliest

Permalink to the exact comments currently displayed.