1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-18 05:09:05 +01:00

Better error checking on previous mod

This commit is contained in:
e107steved 2008-03-24 09:40:51 +00:00
parent 9d1874be9b
commit 5bde549381

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/user_shortcodes.php,v $
| $Revision: 1.9 $
| $Date: 2008-03-23 21:22:16 $
| $Revision: 1.10 $
| $Date: 2008-03-24 09:40:51 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@ -337,14 +337,14 @@ global $sql, $user, $full_perms;
if (!$full_perms) return;
if(!$userjump = getcachedvars('userjump'))
{
$sql->db_Select("user", "user_id, user_name", "`user_id` > ".intval($user['user_id'])." AND `user_ban`=0 ORDER BY user_id ASC LIMIT 1 ");
if ($row = $sql->db_Fetch())
if ($sql->db_Select("user", "user_id, user_name", "`user_id` > ".intval($user['user_id'])." AND `user_ban`=0 ORDER BY user_id ASC LIMIT 1 ")
&& ($row = $sql->db_Fetch()))
{
$userjump['next']['id'] = $row['user_id'];
$userjump['next']['name'] = $row['user_name'];
}
$sql->db_Select("user", "user_id, user_name", "`user_id` < ".intval($user['user_id'])." AND `user_ban`=0 ORDER BY user_id DESC LIMIT 1 ");
if ($row = $sql->db_Fetch())
if ($sql->db_Select("user", "user_id, user_name", "`user_id` < ".intval($user['user_id'])." AND `user_ban`=0 ORDER BY user_id DESC LIMIT 1 ")
&& ($row = $sql->db_Fetch()))
{
$userjump['prev']['id'] = $row['user_id'];
$userjump['prev']['name'] = $row['user_name'];
@ -353,11 +353,11 @@ if(!$userjump = getcachedvars('userjump'))
}
if($parm == 'prev')
{
return $userjump['prev']['id'] ? "&lt;&lt; ".LAN_414." [ <a href='".e_SELF."?id.".$userjump['prev']['id']."'>".$userjump['prev']['name']."</a> ]" : "&nbsp;";
return isset($userjump['prev']['id']) ? "&lt;&lt; ".LAN_414." [ <a href='".e_SELF."?id.".$userjump['prev']['id']."'>".$userjump['prev']['name']."</a> ]" : "&nbsp;";
}
else
{
return $userjump['next']['id'] ? "[ <a href='".e_SELF."?id.".$userjump['next']['id']."'>".$userjump['next']['name']."</a> ] ".LAN_415." &gt;&gt;" : "&nbsp;";
return isset($userjump['next']['id']) ? "[ <a href='".e_SELF."?id.".$userjump['next']['id']."'>".$userjump['next']['name']."</a> ] ".LAN_415." &gt;&gt;" : "&nbsp;";
}
SC_END