summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/comments.pm
AgeCommit message (Collapse)Author
2010-05-15Revert "avoid showing comment post stuff on dynamic pages"Joey Hess
This reverts commit 4a6d5330e5b9554f1bd25b9025dd96200c6519c7. That was too ugly, the DYNAMIC test on page.tmpl will avoid the problem anyway -- just needs to be added.
2010-05-15avoid showing comment post stuff on dynamic pagesJoey Hess
If the site is configured to allow comments on *, then the comment post interface was being added to cgi pages like signin and prefs. This fixes it w/o requiring more page.tmpl changes. The pagetemplate hook is called by misctemplate with an empty page name for dynamic pages.
2010-05-07Merge branch 'master' into commentreorgJoey Hess
2010-05-07avoid linking directly to ikiwiki.cgi?do=signinJoey Hess
Instead, add a custom do=commentsignin, that calls cgi_signin. This allows a plugin to inject a custom cgi_signin, that uses a different do= parameter, and have it be used consitently. (This was the only place to hardcode a link to do=signin.)
2010-05-07fix comment matching pagespecsJoey Hess
test isinternal first, because match_glob with internal => 1 also returns non-internal pages that match. This order should also be faster. Remove test to see if pagesources is set. isinternal will not succeed if it is not.
2010-05-07better wordingJoey Hess
2010-05-07bugfixJoey Hess
2010-05-07bugfixesJoey Hess
2010-05-07check that pagesources exists before testingJoey Hess
2010-05-07fix match_commentJoey Hess
2010-05-06moved comments pending moderationJoey Hess
* comments: Comments pending moderation are now stored in the srcdir alongside accepted comments, but with a `._comment_pending` extension. * This allows easier byhand moderation, as the "_pending" need only be stripped off and the comment be committed to version control. * The `comment_pending()` pagespec can be used to match such unmoderated comments, which makes it easy to add a feed of them, or a counter indicating how many there are. * Belatedly added a `comment()` pagespec.
2010-05-02adapt comment.tmpl to html5Joey Hess
Note that I put comment-header in a <header> despite it being below the comment. Using a <footer> would be confusing given the class name. Also, the content is semantically closer to a header than a footer.
2010-05-02Add parameter to displaytime to specify that it is a pubdate, and in html5 ↵Joey Hess
mode, use time tag.
2010-04-24template() - return params in list contextJoey Hess
I forgot CGI::Formbuilder's horrible interface that needs template parameters instead of a constructed object.
2010-04-22look for templates in srcdir and underlays, firstJoey Hess
This entailed changing template_params; it no longer takes the template filename as its first parameter. Add template_depends to api and replace calls to template() with template_depends() in appropriate places, where a dependency should be added on the template. Other plugins don't use template(), so will need further work. Also, includes are disabled for security. Enabling includes only when using templates from the templatedir would be nice, but would add a lot of complexity to the implementation.
2010-04-20bugfixJoey Hess
Avoid file_pruned triggering on absolute paths causing the whole comments_pending directory being pruned. Simplify code.
2010-04-20fix stat to use unmunged filenameJoey Hess
2010-04-20oops, fix for no_chdir modeJoey Hess
$_ will be absolute then
2010-04-20use one parameter form of file_pruned here tooJoey Hess
In File::Find, $_ is relative to the current directory, so that is ok. Also, the directory name doesn't need to be stripped from $_.
2010-04-17unfinished file_prune revampJoey Hess
Many calls to file_prune were incorrectly calling it with 2 parameters. In cases where the filename being checked is relative to the srcdir, that is not needed. Made absolute filenames be pruned. (This won't work for the 2 parameter call style.)
2010-04-06HTML-encode meta title, description, guid on output, but not in the pagestateSimon McVittie
This makes them consistent with the rest of the meta keys. A wiki rebuild will be needed on upgrade to this version; until the wiki is rebuilt, double-escaping will occur in the titles of pages that have not changed.
2010-04-05comments: Fix missing entity encoding in title.Joey Hess
The meta title data set by comments needs to be encoded the same way that meta encodes it. (NB The security implications of the missing encoding are small.) Note that meta's encoding of title, description, and guid data, and not other data, is probably a special case that should be removed. Instead, these values should be encoded when used. I have avoided doing so here because that would mean forcing a wiki rebuild on upgrade to have the data consitently encoded.
2010-03-12typoJoey Hess
2010-03-09typoJoey Hess
2010-03-09Fix utf8 issues in calls to md5_hex.Joey Hess
This prevented comments containing some utf-8, including euro sign, from being submitted. Since md5_hex is a C implementation, the string has to be converted from perl's internal encoding to utf-8 when it is called. Some utf-8 happened to work before, apparently by accident. Note that this will change the checksums returned. unique_comment_location is only used when posting comments, so the checksum does not need to be stable there. I only changed page_to_id for completeness; it is passed a comment page name, and they can currently never contain utf-8. In teximg, the bug could perhaps be triggered if the tex source contained utf-8. If that happens, the checksum will change, and some extra work might be performed on upgrade to rebuild the image.
2010-02-14comments: Display number of comments in comment action link.Joey Hess
This was not doable before, but when I added transitive dependency handling in the big dependency rewrite, it became possible to include a comment count when inlining. This also improves the action link when a page has no comments. It will link direct to the cgi to allow posting the first comment. And if the page is locked to prevent posting new comments, the link is no longer shown.
2010-02-14minor refactor/optimisationJoey Hess
2010-02-12add section informationJoey Hess
2010-02-04factor out a userpage functionJoey Hess
Not yet exported, as only 4 quite core plugins use it.
2010-01-04comments: Fix permalinks for comments using new conflict-free filenames.Joey Hess
2009-12-30comments: Add a checksum to the name of comment pages, to avoid merge ↵Joey Hess
conflicts when comments are posted to two branches of a site.
2009-06-02comment: Make comment directives no longer use the internal "_comment" form, ↵Joey Hess
and document the comment directive syntax. Rationalle: Comments need to be user-editable so that they can be posted via git commit etc. The _comment directive is still supported, for back-compat.
2009-05-21support longname for page types in commands and renameJoey Hess
Also, sort the list of page types.
2009-04-23comments: Add link to comment post form to allow user to sign in if they ↵Joey Hess
wish to, if the configuration makes signin optional for commenting.
2009-03-27use md5sum for page_to_idJoey Hess
The munged ids were looking pretty nasty, and were not completly guaranteed to be unique. So a md5sum seems like a better approach. (Would have used sha1, but md5 is in perl core.)
2009-03-26comments: Fix anchor ids to be legal xhtml. Closes: #521339Joey Hess
Well, that was a PITA. Luckily, this doesn't break guids to comments in rss feeds, though it does change the links. I haven't put in a warning about needing to rebuild to get this fix. It's probably good enough for new comments to get the fix, without a lot of mass rebuilding.
2009-03-26comments: Fix too loose test for comments pages that matched normal pages ↵Joey Hess
with "comment_" in their name. Closes: #521322
2009-02-26comments: Avoid showing comment moderation button in prefs to non-admins.Joey Hess
2009-01-31Split cgi_goto into a goto pluginSimon McVittie
2009-01-31comments: delete cgi hook in favour of the global oneSimon McVittie
2009-01-26typoJoey Hess
2009-01-25format moderation queue only at end, avoid O(N^3) bugJoey Hess
It was calling format hooks for each comment on the page. When relativedate is enabled, that made it insert <script> tags for each comment. And the browser loaded the same script over and over, which was slow on its own. But that was nothing compared to running the onload even over and over.. especially since the hook system added a new call to the hook each time it loaded. For a page with 10 comments, that caused the relativedate DOM parsing code to run 1000 times, I think. Anyway, it was sloow. Now it runs once.
2009-01-25add reject all marked defer checkboxJoey Hess
2009-01-25sort comment queue by time, newest firstJoey Hess
2009-01-25add a button to prefs page for comment moderationJoey Hess
2009-01-25clean up comment previewJoey Hess
Remove actions from it, and avoid a broken title link.
2009-01-25comments: Add a moderation web interface.Joey Hess
2009-01-25comments: If comment content checks fail, store the comment (in ↵Joey Hess
.ikiwiki/comments_pending) for moderator review.
2009-01-22fix uninitialized value warningsJoey Hess
I suspect these are only triggered by spammers.
2009-01-16make postcomment() pagespecs work while in checkcontentJoey Hess