|
@@ 72-83 (lines=12) @@
|
| 69 |
|
$query = 'SELECT M.msg_id, M.uid_fk, M.priv, M.message, M.created, U.username FROM ' . $xoopsDB->prefix('smallworld_messages') . ' M, ' . $xoopsDB->prefix('smallworld_user') . " U WHERE M.uid_fk=U.userid AND M.uid_fk='" . $uid . "'"; |
| 70 |
|
} |
| 71 |
|
|
| 72 |
|
if (is_array($followers)) { |
| 73 |
|
foreach ($followers as $k => $v) { |
| 74 |
|
if ($last > 0) { |
| 75 |
|
$query .= " OR M.uid_fk=U.userid and M.uid_fk= '" . $v . "' and M.msg_id < '" . $last . "'"; |
| 76 |
|
} elseif (0 == $last) { |
| 77 |
|
$query .= " OR M.uid_fk=U.userid and M.uid_fk= '" . $v . "'"; |
| 78 |
|
} elseif ('a' === $last) { |
| 79 |
|
$query .= " OR M.uid_fk=U.userid and M.uid_fk= '" . $v . "'"; |
| 80 |
|
} |
| 81 |
|
++$i; |
| 82 |
|
} |
| 83 |
|
} |
| 84 |
|
if (!is_array($followers)) { |
| 85 |
|
$followers = $uid; |
| 86 |
|
if ($last > 0) { |
|
@@ 84-93 (lines=10) @@
|
| 81 |
|
++$i; |
| 82 |
|
} |
| 83 |
|
} |
| 84 |
|
if (!is_array($followers)) { |
| 85 |
|
$followers = $uid; |
| 86 |
|
if ($last > 0) { |
| 87 |
|
$query .= " OR M.uid_fk=U.userid and M.uid_fk= '" . $followers . "' and M.msg_id < '" . $last . "'"; |
| 88 |
|
} elseif (0 == $last) { |
| 89 |
|
$query .= " OR M.uid_fk=U.userid and M.uid_fk= '" . $followers . "'"; |
| 90 |
|
} elseif ('a' === $last) { |
| 91 |
|
$query .= " OR M.uid_fk=U.userid and M.uid_fk= '" . $followers . "'"; |
| 92 |
|
} |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
if ($last > 0) { |
| 96 |
|
$query .= ' order by created DESC LIMIT ' . $hm; |