Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
24 stars 19 forks source link

Article and Comments both use mode URL Variable and it Can cause Confusion - Make other Comment URL variables Unique by using "cmt_" #1019

Open eSilverStrike opened 4 years ago

eSilverStrike commented 4 years ago

Article uses mode url variable to specify different types of mode like print and page numbers for articles with page break.

Comments use mode variable when comments are refreshed when determining if flat, nested, etc... is selected.

Comments and articles appear on the same page so the url mode variable has multiple uses which is not good (especially with articles that have multiple pages). Maybe update comments to use a more specific variable like add gl-comment- ... in front of the order and mode variables to avoid issues.

Also see when comment editor is displayed on the same page as content that no post variables are reused by story and at least update the variables to include gl-comment- in the front of them to avoid issues with articles or other plugins that use comments.

When displaying an article using STORY_renderArticle, mode is also used as a global variable inside lib-article not ideal. Not sure if worth fixing since STORY_renderArticle is used in a few places. Check and see.

One possible way to fix this is see COMMENT_ON_SAME_PAGE constant. if True it already adds a prefix to the comment url variables. Maybe we can use this both ways (but remember we will have to create a 301 redirect for the old link to the new link to preserve external sites linking in)

eSilverStrike commented 4 years ago

Last commit was only a partial fix as mode is still being used by both articles and comments to determine pages for articles and display type for comments. If $_CONF['page_break_comments'] = first or last will figure out correct article page to display. If config set to 'all' then first page is assumed as cannot figure out since article and comments both use the mode url variable for stuff

eSilverStrike commented 4 years ago

Remember if we change any url variables that change the way a comment is linked to by an outside site we need to setup 301 redirects so the old way still works for external sites who may have already linked to the content.

eSilverStrike commented 4 years ago

Last commit fixed articles using mode to keep track of article page. Still comments should update all of its form and URL variable names to use the prefix as other plugins will have issues since they use similar variable names.

Also should update cpage to use cmt_page

eSilverStrike commented 2 years ago

Related to #1023 which I will close since what is left in it is described better here

So the main thing left to do here for cleanup is updating the names for the comment variables:

Comment also need to make sure it's url variables are unique (see #1019) so it doesn't interfere with plugins since comments are attached to plugin items and the comment editor can appear on the same page as the plugin content. All comment url variables should start with cmt_ even if the comment on the same page config setting is set to false.

If we change any url variables that change the way a comment is linked to by an outside site (ie the Permanent Link) we need to setup 301 redirects so the old way still works for external sites who may have already linked to the content. This will also help search engines not finding duplicate content