|
@@ 372-385 (lines=14) @@
|
| 369 |
|
* @param int $ownerID |
| 370 |
|
* @return array |
| 371 |
|
*/ |
| 372 |
|
public function updatesPermalink($updid, $uid, $ownerID) |
| 373 |
|
{ |
| 374 |
|
$query = 'SELECT M.msg_id, M.uid_fk, M.message, M.created, M.priv, U.username FROM ' . $GLOBALS['xoopsDB']->prefix('smallworld_messages') . ' M, ' . $GLOBALS['xoopsDB']->prefix('smallworld_user') . " U WHERE M.uid_fk=U.userid AND M.uid_fk='" . $ownerID . "'"; |
| 375 |
|
$query .= " AND M.msg_id = '" . $updid . "'"; |
| 376 |
|
$query .= ' ORDER BY M.created DESC LIMIT 1'; |
| 377 |
|
$result = $GLOBALS['xoopsDB']->queryF($query); |
| 378 |
|
//$count = $GLOBALS['xoopsDB']->getRowsNum($result); |
| 379 |
|
$data = []; |
| 380 |
|
while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) { |
| 381 |
|
$data[] = $row; |
| 382 |
|
} |
| 383 |
|
|
| 384 |
|
return $data; |
| 385 |
|
} |
| 386 |
|
|
| 387 |
|
/** |
| 388 |
|
* Updates share link in dB |
|
@@ 394-408 (lines=15) @@
|
| 391 |
|
* @param int $ownerID |
| 392 |
|
* @return array |
| 393 |
|
*/ |
| 394 |
|
public function updatesSharelink($updid, $ownerID) |
| 395 |
|
{ |
| 396 |
|
$GLOBALS['xoopsLogger']->activated = false; |
| 397 |
|
//error_reporting(E_ALL); |
| 398 |
|
$query = 'SELECT M.msg_id, M.uid_fk, M.message, M.created, M.priv, U.username FROM ' . $GLOBALS['xoopsDB']->prefix('smallworld_messages') . ' M, ' . $GLOBALS['xoopsDB']->prefix('smallworld_user') . " U WHERE M.uid_fk=U.userid AND M.uid_fk='" . $ownerID . "' AND M.priv = 0"; |
| 399 |
|
$query .= " AND M.msg_id = '" . (int)$updid . "'"; |
| 400 |
|
$query .= ' ORDER BY created DESC LIMIT 1'; |
| 401 |
|
$result = $GLOBALS['xoopsDB']->queryF($query); |
| 402 |
|
//$count = $GLOBALS['xoopsDB']->getRowsNum($result); |
| 403 |
|
$data = []; |
| 404 |
|
while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) { |
| 405 |
|
$data[] = $row; |
| 406 |
|
} |
| 407 |
|
return $data; |
| 408 |
|
} |
| 409 |
|
|
| 410 |
|
/** |
| 411 |
|
* Get sharing HTML link |