Files
Testing/include/functions_user.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

130 lines
3.6 KiB
PHP

<?php
if(!defined("IMAGECDN")){ include_once($_SERVER["DOCUMENT_ROOT"]."/include/database_config.php");}
function user_photo2($owner, $nophoto_image = "", $thumb = FALSE)
{
global $url;
//if( !$user->user_exists || !$this->user_info['user_photo'] )
if(!$owner['user_photo'] )
return $nophoto_image;
$user_photo = $url->url_userdir($owner['user_id']).$owner['user_photo'];
if( $thumb )
{
$user_thumb = substr($user_photo, 0, strrpos($user_photo, "."))."_thumb".substr($user_photo, strrpos($user_photo, "."));
if( file_exists($user_thumb) ){
$user_thumb=str_replace("./", "", $user_thumb);
return IMAGECDN.$user_thumb;
}
}
if( file_exists($user_photo) ){
$user_photo = $url->cloud_userdir($owner['user_id']).$owner['user_photo'];
return $user_photo;}
return $nophoto_image;
}
function userprofiledot($owner, $picture="", $width="", $height="", $lazod="1", $forcesize="0")
{
$image="
<div style='position: relative; margin:auto; display: inline-block;
";
if($width!=""){
//$image.="width:{$width}";
}
$image.="'><img ";
if($lazod=="1"){$image.=IMAGECDN."images/blank.gif' data-src='{$picture}'";
}else{$image.="src='{$picture}'";}
$image.=" class='photo";
if($lazod=="1"){$image.=" lozad";}
$image.="' style='";
if($width!=""){
$image.="max-width:{$width};";
if($forcesize==1)
{
$image.=" width:{$width};";
}
}
if($height!=""){
$image.="max-height:{$height};";
if($forcesize==1)
{
$image.=" height:{$height};";
}
}
$image.="' border='0' alt=' ' />";
$level=$owner["user_level_id"];
$verified=$owner["verified"];
if($level==2){
if($owner["staff"]==1){
$image.="<img src='".IMAGECDN."images/goldstar.png' style='position:absolute; bottom:25px; right:0; width:10px !important; height:auto!important;'>";
}else{
$image.="<img src='".IMAGECDN."images/goldstar.png' style='position:absolute; bottom:0px; right:0; width:10px !important; height:auto!important;'>";
}
}
if($verified==1)
{
$image.="<img src='".IMAGECDN."images/bwverification.png' style='position:absolute; top:0px; right:0; width:10px !important; height:auto!important;'>";
}
if(online_now($owner)){
$image.="<img src='".IMAGECDN."images/greendot.png' style='position:absolute; bottom:0px; left:0; width:5px !important; height:auto!important;'>";
}
if($owner["staff"]==1){$image.='<div style="background:red; color:yellow; font-weight:bold;">BateWorld Staff</div>';}
$image.="</div>";
return $image;
}
function online_now($owner)
{
global $database;
//$online_users_array = online_users();
//if(in_array($this->user_info['user_username'], $online_users_array[2])) { $this->is_online = 1; } else { $this->is_online = 0; }
$profile_query = "SELECT profilevalue_22 FROM se_profilevalues WHERE profilevalue_user_id='".$owner['user_id']."'";
$query=$database->database_query($profile_query);
$row=$database->database_fetch_array($query);
$profile_info["profilevalue_22"]=$row["profilevalue_22"];
if($profile_info["profilevalue_22"]==1){return false;}
if($owner['online']==""||$owner['online']==null)
{
$query=$database->database_query("SELECT `online` FROM se_users WHERE user_id='".$owner['user_id']."'");
$row=$database->database_fetch_array($query);
$owner['online']=$row["online"];
}
$is_online = $owner['online'];
return $is_online;
}