/[LeafOK_CVS]/fenglin/bbs/user_photo_path.inc.php
ViewVC logotype

Contents of /fenglin/bbs/user_photo_path.inc.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Tue Apr 29 11:55:32 2025 UTC (10 months, 2 weeks ago) by sysadm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +0 -1 lines
Remove redundant PHP closing tag

1 <?php
2 function photo_path(int $uid, mysqli $db_conn) : string | false
3 {
4 $photo_id = 0;
5 $photo_enable = 0;
6 $photo_ext = "";
7
8 $sql = "SELECT photo, photo_enable, photo_ext FROM user_pubinfo WHERE UID = $uid";
9
10 $rs = mysqli_query($db_conn, $sql);
11 if ($rs == false)
12 {
13 return false;
14 }
15
16 if ($row = mysqli_fetch_array($rs))
17 {
18 $photo_id = $row["photo"];
19 $photo_enable = $row["photo_enable"];
20 $photo_ext = $row["photo_ext"];
21 }
22 mysqli_free_result($rs);
23
24 if ($photo_id != 999)
25 {
26 $path = "images/face/" . str_repeat("0", 3 - strlen($photo_id)) . $photo_id . ".gif";
27 }
28 else
29 {
30 if ($photo_enable)
31 {
32 if ($photo_ext == "")
33 {
34 $path = "images/face/000.gif";
35 }
36 else
37 {
38 $path = "images/face/upload_photo/face_" . $uid . "." . $row["photo_ext"];
39 }
40 }
41 else
42 {
43 $path = "images/face/check.gif";
44 }
45 }
46
47 return $path;
48 }

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1