1
|
|
|
<?php |
2
|
|
|
namespace AL\Common\Model\GameSubmission; |
3
|
|
|
|
4
|
|
|
require_once __DIR__."/../../../config/config.php"; |
5
|
|
|
require_once __DIR__."/../../../lib/functions.php"; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Maps to the `GameSubmission' table |
9
|
|
|
*/ |
10
|
|
|
class GameSubmission { |
11
|
|
|
private $game_id; |
12
|
|
|
private $game_name; |
13
|
|
|
private $timestamp; |
14
|
|
|
private $date; |
|
|
|
|
15
|
|
|
private $comment; |
16
|
|
|
private $submission_id; |
17
|
|
|
private $done; |
18
|
|
|
private $userid; |
19
|
|
|
private $username; |
20
|
|
|
private $email; |
21
|
|
|
private $join_date; |
|
|
|
|
22
|
|
|
private $karma; |
23
|
|
|
private $show_email; |
24
|
|
|
private $avatar_ext; |
|
|
|
|
25
|
|
|
private $user_subm_count; |
26
|
|
|
private $user_comment_count; |
27
|
|
|
private $screenshots; |
28
|
|
|
|
29
|
|
|
public function __construct( |
30
|
|
|
$game_id, |
31
|
|
|
$game_name, |
32
|
|
|
$timestamp, |
33
|
|
|
$date, |
34
|
|
|
$comment, |
35
|
|
|
$submission_id, |
36
|
|
|
$done, |
37
|
|
|
$userid, |
38
|
|
|
$username, |
39
|
|
|
$email, |
40
|
|
|
$join_date, |
41
|
|
|
$karma, |
42
|
|
|
$show_email, |
43
|
|
|
$avatar_ext, |
44
|
|
|
$user_subm_count, |
45
|
|
|
$user_comment_count, |
46
|
|
|
$screenshots |
47
|
|
|
) { |
48
|
|
|
$this->game_id = $game_id; |
49
|
|
|
$this->game_name = $game_name; |
50
|
|
|
$this->timestamp = $timestamp; |
51
|
|
|
$this->post_date = date("F j, Y", $date); |
|
|
|
|
52
|
|
|
$this->comment = $comment; |
53
|
|
|
$this->submission_id = $submission_id; |
54
|
|
|
$this->done = $done; |
55
|
|
|
$this->userid = $userid; |
56
|
|
|
$this->username = $username; |
57
|
|
|
$this->email = $email; |
58
|
|
|
$this->screenshots = $screenshots; |
59
|
|
|
|
60
|
|
|
if ($join_date == "") { |
61
|
|
|
$this->join = "unknown"; |
|
|
|
|
62
|
|
|
} else { |
63
|
|
|
$this->join = date("d-m-y", $join_date); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
$this->karma = $karma; |
67
|
|
|
$this->show_email = $show_email; |
68
|
|
|
$this->user_subm_count = $user_subm_count; |
69
|
|
|
$this->user_comment_count = $user_comment_count; |
70
|
|
|
|
71
|
|
|
if ($avatar_ext && $avatar_ext !== "") { |
72
|
|
|
$this->avatar_image = $GLOBALS['user_avatar_path']."/{$userid}.{$avatar_ext}"; |
|
|
|
|
73
|
|
|
} else { |
74
|
|
|
$this->avatar_image = $GLOBALS['style_folder']."/images/default_avatar_image.png"; |
75
|
|
|
} |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
public function getGameId() { |
79
|
|
|
return $this->game_id; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
public function getName() { |
83
|
|
|
return $this->game_name; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
public function getComment() { |
87
|
|
|
return $this->comment; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
public function getDate() { |
91
|
|
|
return $this->post_date; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
public function getSubmissionId() { |
95
|
|
|
return $this->submission_id; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
public function getDone() { |
99
|
|
|
return $this->done; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
public function getUserId() { |
103
|
|
|
return $this->userid; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
public function getUserName() { |
107
|
|
|
return $this->username; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
public function getEmail() { |
111
|
|
|
return $this->email; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
public function getJoinDate() { |
115
|
|
|
return $this->join; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
public function getKarma() { |
119
|
|
|
return $this->karma; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
public function getShowEmail() { |
123
|
|
|
return $this->show_email; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
public function getAvatarImage() { |
127
|
|
|
return $this->avatar_image; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
public function getUserSubCount() { |
131
|
|
|
return $this->user_subm_count; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
public function getUserCommentCount() { |
135
|
|
|
return $this->user_comment_count; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
public function getTimestamp() { |
139
|
|
|
return $this->timestamp; |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
public function getScreenshots() { |
143
|
|
|
return $this->screenshots; |
144
|
|
|
} |
145
|
|
|
} |
146
|
|
|
|