htmly
htmly copied to clipboard
Comment Slug
I've been able to set up a comment form (not disqus or fb) that is working except that I can't figure out what the page-id is for the posted articles. I have it set up where the url looks like this https://www.myhtmlysite.com/post/name-of-article
Can anyone five me some ideas on how to find the page id so that each article will have its own comments? I am attaching a screenshot of the comment form that will be used.
Thanks.
Don't have a solution for you, but did you develop the comment form yourself? Is source code available somewhere?
No, I did not develop it on my own and the source code is located here. https://github.com/CGrassin/interact_php Let me know if you can figure it out.
Currently htmly only use the post filename path as the ID, you can access it using $p->file so use it as the key. Please note the filename path will changed if we edit the slug, tag, category, and date. Solutions for this in popular posts:
if ($oldfile != $newfile) {
if (file_exists($viewsFile)) {
$views = json_decode(file_get_contents($viewsFile), true);
$arr = replace_key($views, $oldfile, $newfile);
file_put_contents($viewsFile, json_encode($arr, JSON_UNESCAPED_UNICODE));
}
}
Using $p->file is not working unless I misunderstand your response. Just to make sure, the comments code should be placed in the post.html.php file of each theme, correct? Since I am using the blog theme, I am entering the comments code in the post,html.php file of the blog theme.
As for the other code you provided, it is unfortunately over my head.
From the project readme.
\Interact_PHP\Interact_PHP("<some-id-such-as-article-title>");
I have the code set up as follows:
\Interact_PHP\Interact_PHP("<$p->file>");
But that does not work. I am also trying to confirm that the code above should be placed in the post.html.php file.
Yes it should placed in post.html.php. Try check the PHP error log to find the problems
Thanks...there are no errors in the log but at least I know I have placed the code in the right place. I will keep trying to see if I can get it to work.
After upgrading to version 2.8.7 of HTMLy and using $p->file as the file id, the comments system seems to be working. I will re-post if something happens where it is not working, but for the moment, all is well.
It will be better using the $p->url with /post/ type slug because as long as the slug never changed it always has the same format.
Well, I take it all back...it is now not working with $p->file nor /post/$p->url and the comments that were posted yesterday are no longer visible. I have run out of ideas on how to make a comment system to work with HTMLy if it is not Disqus or Facebook.
I think I finally found the comment system that will work with HTMLy. It is called Hashover and I'm using version 1.02 of the application, but I just noticed that there is a version 2.0 (developer) version that I will try. It is easy to set up and worked right out of the box.
Currently htmly only use the post filename path as the ID, you can access it using
$p->fileso use it as the key. Please note the filename path will changed if we edit the slug, tag, category, and date. Solutions for this in popular posts:if ($oldfile != $newfile) { if (file_exists($viewsFile)) { $views = json_decode(file_get_contents($viewsFile), true); $arr = replace_key($views, $oldfile, $newfile); file_put_contents($viewsFile, json_encode($arr, JSON_UNESCAPED_UNICODE)); } }
What to do with that information if already using the latest HTMLy version?
@afoster1955 Please fix your links to https://github.com/CGrassin/interact_php and https://www.barkdull.org/software/hashover. Clicking
So, anything on this? I wish for HTMLy as commenting option in itself, and not via a 3rd party.
Finally...I have been able to get a third party comment system to work with HTMLy. It is called Commentics and with the help of its developer, I have been able to get it to work on my HTMLy blog.
Once you have installed Commentics, post the following in the post.html.php file beginning on line 62 (in my file). Since I am using Commentics in two different blogs, this one is set up as an iFrame. You will have to see the Commentics documentation to see what I am talking about. Here is the code you need to enter.
<script>
var commentics_config = {
'identifier': '<?php echo $p->url; ?>',
'reference' : '<?php echo $p->title;?>'
};
</script>
<div id="commentics"></div>
Good luck and let me know if you have any questions.
Excellent
@danpros
My 2 cents: Commentics requires a MySQL database, while HTMLy uses flat files. That doesn't fit for me.
HTMLy should include a flat-file based comment system. Even a simple one (e. g., no threading) would be better than nothing. From my point of view, comments are like blog posts, but from visitors.
My feature wish list:
- Markdown formatting, because it's already included in HTMLy core
- CAPTCHA support, e. g., math, graphical, or more simple: http://svardos.org/?p=forum&action=newthread#formularz
- moderation, i.e., new comments will only be shown after admin approval
- RSS comments feed to allow users to be notified about replies to their comment
- (optional) email subscription
@afoster1955 for PHP integration read #747
Already added it to the docs: Commentics PHP Integration
How about hosting the docs at GitHub, so others could contribute to via PRs? Or enabling the wiki component here and move existing content to?
@bttrx exactly what I tried explaining earlier as well. Plus, I too wish to contribute to the wiki of the fav and only blog engine I use. :)
@bttrx OK noted. No ETA but I will look into it. At the moment we can look at third party solutions and integrate them into htmly.
Regarding the docs I already upload it to Github: https://github.com/danpros/htmly-docs