diff --git a/include/comments.php b/include/comments.php index b309645..05cb749 100644 --- a/include/comments.php +++ b/include/comments.php @@ -3,22 +3,21 @@ /* get user info for posts */ /***************************/ -function forum_lookup_user ($userid) +function forum_lookup_user($iUserId) { $mailto = ''; - if ($userid > 0) + if ($iUserId > 0) { - $qstring = "SELECT email FROM user_list WHERE userid = '".$userid."' LIMIT 1"; - $result = mysql_query($qstring); - $usr = mysql_fetch_object($result); - $mailto = '' . $usr->realname . ''; - unset($qstring, $result, $usr); + $sQuery = "SELECT email,realname FROM user_list WHERE userId = '".$iUserId."' LIMIT 1"; + $hResult = query_appdb($sQuery); + $oUsr = mysql_fetch_object($hResult); + $sMailto = '' . $oUsr->realname . ''; } else { - $mailto = 'Anonymous'; + $sMailto = 'Anonymous'; } - return $mailto; + return $sMailto; } /** @@ -36,7 +35,7 @@ function view_app_comment($ob) // message header echo "\n"; echo " ".$ob->subject."
\n"; - echo " by ".forum_lookup_user($ob->userid)." on ".$ob->time."
\n"; + echo " by ".forum_lookup_user($ob->userId)." on ".$ob->time."
\n"; echo "\n"; // body @@ -83,7 +82,7 @@ function grab_comments($appId, $versionId, $parentId = -1) $extra = "AND parentId = $parentId "; $qstring = "SELECT from_unixtime(unix_timestamp(time), \"%W %M %D %Y, %k:%i\") as time, ". - "commentId, parentId, appId, versionId, userid, subject, body ". + "commentId, parentId, appId, versionId, userId, subject, body ". "FROM appComments WHERE appId = '$appId' AND versionId = '$versionId' ". $extra. "ORDER BY appComments.time ASC"; @@ -149,7 +148,7 @@ function do_display_comments_threaded($handle, $is_main) } else { echo '
  • '. - $ob->subject.' by '.forum_lookup_user($ob->userid).' on '.$ob->time.'
  • '."\n"; + $ob->subject.' by '.forum_lookup_user($ob->userId).' on '.$ob->time.' '."\n"; } $result = grab_comments($ob->appId, $ob->versionId, $ob->commentId);