ForumTopic.class.php 1.6 KB

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