| @@ 141-162 (lines=22) @@ | ||
| 138 | * @param int $msg_id |
|
| 139 | * @return array |
|
| 140 | */ |
|
| 141 | public function Comments($msg_id) |
|
| 142 | { |
|
| 143 | global $xoopsUser, $xoopsDB; |
|
| 144 | $inspected = $this->inspected(); |
|
| 145 | $query = 'SELECT C.msg_id_fk, C.com_id, C.uid_fk, C.comment, C.created, U.username FROM ' |
|
| 146 | . $xoopsDB->prefix('smallworld_comments') |
|
| 147 | . ' C, ' |
|
| 148 | . $xoopsDB->prefix('smallworld_user') |
|
| 149 | . " U WHERE C.uid_fk=U.userid AND C.msg_id_fk='" |
|
| 150 | . $msg_id |
|
| 151 | . "' AND C.uid_fk NOT IN (" |
|
| 152 | . $inspected |
|
| 153 | . ') ORDER BY C.com_id ASC '; |
|
| 154 | $result = $xoopsDB->queryF($query); |
|
| 155 | $i = $xoopsDB->getRowsNum($result); |
|
| 156 | while ($row = $xoopsDB->fetchArray($result)) { |
|
| 157 | $data[] = $row; |
|
| 158 | } |
|
| 159 | if (!empty($data)) { |
|
| 160 | return $data; |
|
| 161 | } |
|
| 162 | } |
|
| 163 | ||
| 164 | /** |
|
| 165 | * @Get user image based on uid |
|
| @@ 141-162 (lines=22) @@ | ||
| 138 | * @param int $msg_id |
|
| 139 | * @return array |
|
| 140 | */ |
|
| 141 | public function Comments($msg_id) |
|
| 142 | { |
|
| 143 | global $xoopsUser, $xoopsDB; |
|
| 144 | $inspected = $this->inspected(); |
|
| 145 | $query = 'SELECT C.msg_id_fk, C.com_id, C.uid_fk, C.comment, C.created, U.username FROM ' |
|
| 146 | . $xoopsDB->prefix('smallworld_comments') |
|
| 147 | . ' C, ' |
|
| 148 | . $xoopsDB->prefix('smallworld_user') |
|
| 149 | . " U WHERE C.uid_fk=U.userid AND C.msg_id_fk='" |
|
| 150 | . $msg_id |
|
| 151 | . "' AND C.uid_fk NOT IN (" |
|
| 152 | . $inspected |
|
| 153 | . ') ORDER BY C.com_id ASC '; |
|
| 154 | $result = $xoopsDB->queryF($query); |
|
| 155 | $i = $xoopsDB->getRowsNum($result); |
|
| 156 | while ($row = $xoopsDB->fetchArray($result)) { |
|
| 157 | $data[] = $row; |
|
| 158 | } |
|
| 159 | if (!empty($data)) { |
|
| 160 | return $data; |
|
| 161 | } |
|
| 162 | } |
|
| 163 | ||
| 164 | /** |
|
| 165 | * @Get user image based on uid |
|