EricBalingit / c9-forum-and-chat

node, express, socket-io basic live forum for internal use
Other
1 stars 0 forks source link

Article titles should be linked to specific database queries #7

Open EricBalingit opened 7 years ago

EricBalingit commented 7 years ago

Currently article titles ( stubs ) are not links, they are headings that have click handlers bound to them. In order to provide bookmarking capability to articles, a system of query strings must be implemented, such that when a title is bookmarked, upon following the link, the forum should note the query string, redirect to login if necessary, and process the query string once the user is on the forum. Should be possible to handle this by utilizing the session variable.

When clicking the stub normally, the link should not redirect as this would destroy the user cache ( and perhaps break normal function of the site ). Therefore article stubs should provide a bookmarkable link but also prevent default and channel the action through the socket as is done now.

Links should follow these specifications:

  1. text should be the full title with html ( as is displayed in the stub )
  2. href should be the forum url followed by "?" and the query string
  3. query string should consist of category=<id> and optionally topic=<id> joined with &, OR chat=<id>
  4. chat id should be validated by participation with an error message if the user is not permitted to view the chat
  5. category id's and topic id's should be validated
  6. optional topic id defaults to null
  7. query string should be validated in entirely based on 3