ForumTopic.class.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Forum topic backup script
  5. * @package chamilo.backup
  6. */
  7. /**
  8. * Code
  9. */
  10. require_once 'Resource.class.php';
  11. /**
  12. * A forum-topic/thread
  13. * @author Bart Mollet <bart.mollet@hogent.be>
  14. * @package chamilo.backup
  15. */
  16. class ForumTopic extends Resource {
  17. /**
  18. * Create a new ForumTopic
  19. */
  20. /* function ForumTopic($id, $title, $time, $topic_poster_id, $topic_poster_name, $forum_id, $last_post, $replies, $views = 0, $sticky = 0, $locked = 0,
  21. $time_closed = null, $weight = 0, $title_qualify = null, $qualify_max = 0) */
  22. function ForumTopic($obj) {
  23. parent::Resource($obj->thread_id, RESOURCE_FORUMTOPIC);
  24. $this->obj = $obj;
  25. /*
  26. $this->title = $title;
  27. $this->time = $time;
  28. $this->topic_poster_id = $topic_poster_id;
  29. $this->topic_poster_name = $topic_poster_name;
  30. $this->forum_id = $forum_id;
  31. $this->last_post = $last_post;
  32. $this->replies = $replies;
  33. $this->views = $views;
  34. $this->sticky = $sticky;
  35. $this->locked = $locked;
  36. $this->time_closed = $time_closed;
  37. $this->weight = $weight;
  38. $this->title_qualify = $title_qualify;
  39. $this->qualify_max = $qualify_max; */
  40. }
  41. /**
  42. * Show this resource
  43. */
  44. function show() {
  45. parent::show();
  46. $extra = api_convert_and_format_date($this->obj->thread_date);
  47. if ($this->obj->thread_poster_id) {
  48. $user_info = api_get_user_info($this->obj->thread_poster_id);
  49. $extra = $user_info['complete_name'].', '.$extra;
  50. }
  51. echo $this->obj->thread_title . ' (' . $extra . ')';
  52. }
  53. }