diff options
author | David M <davidmj@users.sourceforge.net> | 2006-05-17 23:19:33 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2006-05-17 23:19:33 +0000 |
commit | f15d6862ae4a62421da83e10dfdeb7153756af1a (patch) | |
tree | 150223043cd3bd1d5ab4f193942cf2c564377675 | |
parent | bcdb8c265966d96b58f9546bcdaed71629367d77 (diff) | |
download | forums-f15d6862ae4a62421da83e10dfdeb7153756af1a.tar forums-f15d6862ae4a62421da83e10dfdeb7153756af1a.tar.gz forums-f15d6862ae4a62421da83e10dfdeb7153756af1a.tar.bz2 forums-f15d6862ae4a62421da83e10dfdeb7153756af1a.tar.xz forums-f15d6862ae4a62421da83e10dfdeb7153756af1a.zip |
eh? meh.
git-svn-id: file:///svn/phpbb/trunk@5928 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/includes/ucp/ucp_main.php | 34 | ||||
-rw-r--r-- | phpBB/memberlist.php | 34 |
2 files changed, 40 insertions, 28 deletions
diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index a75901457e..a4944ed2d8 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -841,13 +841,16 @@ class ucp_main $active_f_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - $sql = 'SELECT forum_name - FROM ' . FORUMS_TABLE . ' - WHERE forum_id = ' . $active_f_row['forum_id']; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - $active_f_row['forum_name'] = $row['forum_name']; + if (!empty($active_f_row)) + { + $sql = 'SELECT forum_name + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $active_f_row['forum_id']; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + $active_f_row['forum_name'] = $row['forum_name']; + } // Firebird does not support ORDER BY on aliased columns // MySQL does not support ORDER BY on functions @@ -880,13 +883,16 @@ class ucp_main $active_t_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - $sql = 'SELECT topic_title - FROM ' . TOPICS_TABLE . ' - WHERE topic_id = ' . $active_t_row['topic_id']; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - $active_t_row['topic_title'] = $row['topic_title']; + if (!empty($active_t_row)) + { + $sql = 'SELECT topic_title + FROM ' . TOPICS_TABLE . ' + WHERE topic_id = ' . $active_t_row['topic_id']; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + $active_t_row['topic_title'] = $row['topic_title']; + } $active_f_name = $active_f_id = $active_f_count = $active_f_pct = ''; if (!empty($active_f_row['num_posts'])) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 3375322c4b..40ec02f412 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1303,13 +1303,16 @@ function show_user_activity(&$member) $active_f_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - $sql = 'SELECT forum_name - FROM ' . FORUMS_TABLE . ' - WHERE forum_id = ' . $active_f_row['forum_id']; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - $active_f_row['forum_name'] = $row['forum_name']; + if (!empty($active_f_row)) + { + $sql = 'SELECT forum_name + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $active_f_row['forum_id']; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + $active_f_row['forum_name'] = $row['forum_name']; + } // Firebird does not support ORDER BY on aliased columns // MySQL does not support ORDER BY on functions @@ -1342,13 +1345,16 @@ function show_user_activity(&$member) $active_t_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - $sql = 'SELECT topic_title - FROM ' . TOPICS_TABLE . ' - WHERE topic_id = ' . $active_t_row['topic_id']; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - $active_t_row['topic_title'] = $row['topic_title']; + if (!empty($active_t_row)) + { + $sql = 'SELECT topic_title + FROM ' . TOPICS_TABLE . ' + WHERE topic_id = ' . $active_t_row['topic_id']; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + $active_t_row['topic_title'] = $row['topic_title']; + } $member['active_t_row'] = $active_t_row; $member['active_f_row'] = $active_f_row; |