summaryrefslogtreecommitdiff
path: root/www-ssl/inc
diff options
context:
space:
mode:
Diffstat (limited to 'www-ssl/inc')
-rw-r--r--www-ssl/inc/ShowUserPicture.php3
-rwxr-xr-xwww-ssl/inc/funktion_user.php37
2 files changed, 30 insertions, 10 deletions
diff --git a/www-ssl/inc/ShowUserPicture.php b/www-ssl/inc/ShowUserPicture.php
index 218b2a24..f8185c3e 100644
--- a/www-ssl/inc/ShowUserPicture.php
+++ b/www-ssl/inc/ShowUserPicture.php
@@ -22,8 +22,9 @@ if( mysql_num_rows($res) == 1)
header( "HTTP/1.0 403 Forbidden");
die( "403 Forbidden");
}
+
// ist das bild sichtbar?
- if( mysql_result($res, 0, "show")=="N" )
+ if( (mysql_result($res, 0, "show")=="N") AND ($_SESSION['UID']!=$_GET["UID"]) )
{
$SQL= "SELECT * FROM `UserPicture` WHERE `UID`='-1'";
$res = mysql_query( $SQL, $con);
diff --git a/www-ssl/inc/funktion_user.php b/www-ssl/inc/funktion_user.php
index 9a1433fd..ac8744cf 100755
--- a/www-ssl/inc/funktion_user.php
+++ b/www-ssl/inc/funktion_user.php
@@ -58,21 +58,40 @@ function ReplaceSmilies($eckig) {
}
+function GetPicturShow($UID)
+{
+ global $con;
+
+ $SQL= "SELECT `show` FROM `UserPicture` WHERE `UID`='$UID'";
+ $res = mysql_query( $SQL, $con);
+ if( mysql_num_rows($res) == 1)
+ return mysql_result( $res, 0, 0);
+ else
+ return "";
+}
+
+
/* Parameter:
<UserID>
[<Höhe des Bildes (wenn die höhe kleiner 1 ist wird die höhe nicht begrenzt)>] */
-function displayavatar($UID, $height="30")
+function displayPictur($UID, $height="30")
+{
+ if( $height > 0)
+ return( "<img src=\"./inc/ShowUserPicture.php?UID=$UID\" height=\"$height\" alt=\"picture of USER$UID\">");
+ else
+ return( "<img src=\"./inc/ShowUserPicture.php?UID=$UID\" alt=\"picture of USER$UID\">");
+}
+
+
+/* Parameter:
+ <UserID>
+ [<Höhe des Bildes (wenn die höhe kleiner 1 ist wird die höhe nicht begrenzt)>] */
+function displayavatar( $UID, $height="30")
{
global $con;
- // ist ein foto hinterlegt?
- $SQL= "SELECT * FROM `UserPicture` WHERE `UID`='$UID' AND `show`='Y'";
- $res = mysql_query( $SQL, $con);
- if( mysql_num_rows($res) == 1)
- if( $height > 0)
- return( "&nbsp;<img src=\"./inc/ShowUserPicture.php?UID=$UID\" height=\"$height\" alt=\"picture of USER$UID\">");
- else
- return( "&nbsp;<img src=\"./inc/ShowUserPicture.php?UID=$UID\" alt=\"picture of USER$UID\">");
+ if( GetPicturShow($UID) == 'Y')
+ return "&nbsp;". displayPictur( $UID, $height);
// show avator
$asql = "select * from User where UID = $UID";