What I am trying to do is Add the Avatar at the top. I tried Xfering a portion that looked like it was for that from Raven's Distro but it didn't work.
Code:
if (is_user($user)) {
$sqlp = "SELECT user_posts AS posts FROM $user_prefix"._users." WHERE username = '$uname'";
$result = $db->sql_query($sqlp);
$row = $db->sql_fetchrow($result);
$posts = $row[posts];
$sql = "SELECT user_avatar FROM " . $prefix."_users WHERE username='$uname' AND user_avatar IS NOT NULL";
$result = $db->sql_query($sql);
if ($result) {
$userinfo = $db->sql_fetchrow($result);
if ( ereg( "(http)", $userinfo[user_avatar]) ) {
$content .= "<br /><center><img src=\"$userinfo[user_avatar]\" /></center>\n";
}
else
if ($userinfo[user_avatar]) {
$content .= "<br /><center><img src=\"modules/Forums/images/avatars/$userinfo[user_avatar]\" /></center>\n";
}
}
It said it had a parse error. I am using nuke 7.2 with Eventcal if that helps. I only noticed a couple of things that were different.. I tried changing them and still got the error... like..
Code:
if (is_user($user))
is
Code:
if (!is_user($user))
in most blocks for 7.2 but again I'm not sure... here is the block I'm trying to add the avatar to:
// Set Nuke session table
$past = time()-900;
sql_query( "DELETE FROM $prefix"._users." WHERE time < '$past'", $dbi);
$result = sql_query( "SELECT time FROM $prefix"._session." WHERE uname='$username'", $dbi );
$ctime = time();
if ( $row = sql_fetch_array( $result , $dbi ) )
{
sql_query( "UPDATE $prefix"._session." SET uname='$username', time='$ctime', host_addr='$ip', guest='$guest' WHERE uname='$username'", $dbi );
}
else
{
sql_query( "INSERT INTO $prefix"._session." (uname, time, host_addr, guest) VALUES ('$username', '$ctime', '$ip', '$guest')" , $dbi );
}
// Determine last registered user
$result = sql_query( "select username from $prefix"._users." order by user_id DESC limit 0,1", $dbi );
list( $lastuser ) = sql_fetch_row( $result, $dbi );
// Amount of registered users
$numrows = sql_num_rows( sql_query( "select user_id from $prefix"._users." where username != 'Anonymous'", $dbi ) );
// Amount of registered users online
$result2 = sql_query( "SELECT uname, guest FROM $prefix"._session." where guest=0", $dbi );
$member_online_num = sql_num_rows( $result2 );
// Assemble the online registered users
$who_online_now = "";
$i = 1;
while ( $session = sql_fetch_array( $result2, $dbi ) )
{
if ( isset($session["guest"]) and $session["guest"] == 0 )
{
// Determine Location for Flag image
$FlagResult = sql_query( "select user_from from ".$prefix."_users where username='$session[uname]'", $dbi );
$FlagInfo = sql_fetch_array( $FlagResult, $dbi );
// Display all information
if ( is_user( $user ) )
{
// Determine how many READ Messages and how many UNREAD Messages
$result = sql_query( "select user_id from $prefix"._users." where username='$username'", $dbi );
list( $user_id ) = sql_fetch_row( $result, $dbi );
$result2 = sql_query( "select privmsgs_type from $prefix"._bbprivmsgs." where privmsgs_to_userid='$user_id' AND (privmsgs_type='1' or privmsgs_type='5')", $dbi );
$MesUnread = sql_num_rows( $result2 );
$result3 = sql_query( "select privmsgs_type from $prefix"._bbprivmsgs." where privmsgs_to_userid='$user_id' AND (privmsgs_type='0')", $dbi );
$MesRead = sql_num_rows( $result3 );
// Info for users who logged in AND Guests
// $content .= "<a href=\"modules.php?name=Members_List\"><img src=images/visitors/mem.gif border=\"0\" alt=\"Members List\"></a><b> ".Members."</b><br>\n";
// Hyperlink last registered user to phpBB viewing profile
// $resultName = sql_query( "SELECT user_id FROM ".$prefix."_users where username='$lastuser'", $dbi );
// list( $Lastuser_id ) = sql_fetch_row( $resultName, $dbi );
// $content .= "<img src=images/visitors/arrow.gif> ".Latest." <A HREF=\"forums.html&file=profile&mode=viewprofile&u=$Lastuser_id\"><b>$lastuser</b></a><br>\n";
if ( is_user( $user ) )
{
// Show only registered online users to users who logged in
$content .= "<img src=images/visitors/online.gif><b> <u>".ONLINE."</u></b><br>$who_online $who_online_now";
}
else
{
// Show guests how to register
$content .= "<center><img src=images/visitors/signup.gif><br>"._YOUAREANON."</center>";
}
Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
Posted:
Sat Jun 12, 2004 5:00 am
Wouldn't it just have been easier to post the parse error ? Go back to that and let's fix it. In that code at the top, if that is complete, you are missing a closing }. And, by adding the ! to the expression you are saying "Only do this if it is NOT a user", meaning, you will never execute that logic for a registered user.
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum