NAME
Parley::Controller::Thread - Catalyst Controller
DESCRIPTION
Catalyst Controller.
ACTIONS
add
Adds a new thread to a specified forum
next_post
Take the logged-in user to the post after the last one they have viewed. If they haven't viewed any posts they should be taken to the first in the thread. If the last post they saw was the last in the thread they should be taken to the last post in the thread.
reply
Reply to a post in an existing thread.
view
This action prepares data in the stash for viewing the current thread.
This action is used to add/remove a watch for a given thread
PRIVATE METHODS
_add_new_reply($self,$c)
The guts of the process to add a new reply to an existing thread
_add_new_thread($self,$c)
The guts of the process to add a new thread/topic to a forum
_get_thread_reply_post($self,$c)
Returns the post being replied to in a thread.
_increase_post_count($self,$c,$thread)
Increase the number of posts (by one) for a given thread
_increase_thread_view_count($self,$c)
Inside a transaction, increase the number of views a thread has by one.
_thread_view_pager($self,$c)
Set-up $c->stash->{page}
and $c->stash->{page_range_spread}
for the current thread. These are used by the pager in the templates (Page X of Y, etc).
_thread_watch_count($self,$c)
Sets $c->stash->{watcher_count}
with the number of people who have a watch set for the current thread.
_update_last_post($self,$c,$new_post)
Given a (new) post, update the values for the last post in the relevant thread and forum.
_update_person_post_info($self,$c,$post)
Called when someone makes a new post, increments the total number of posts made by the user, and updates the record of the last post they made.
_watching_thread
Sets $c->stash->{watching_thread}
with a true|false value indicating whether the current authenticated user is watching the current thread.
Sets
_update_thread_view
This method updates an existing record in the thread_view table, or creates a new one if it doesn't exist.
The timestamp value for the record (keyed on person-thread) is updated to the timestamp of the creation time for the last post on the page - unless the user has already viewed a page containing later posts.
AUTHOR
Chisel Wright <chiselwright@users.berlios.de>
LICENSE
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.