/[LeafOK_CVS]/fenglin/manage/photo_process.php
ViewVC logotype

Contents of /fenglin/manage/photo_process.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (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.3: +0 -1 lines
Remove redundant PHP closing tag

1 <?php
2 require_once "../lib/db_open.inc.php";
3 require_once "../bbs/session_init.inc.php";
4
5 force_login();
6
7 $result_set = array(
8 "return" => array(
9 "code" => 0,
10 "message" => "",
11 "errorFields" => array(),
12 ),
13 );
14
15 $p_id = ($_GET["p_id"] ? intval($_GET["p_id"]) : 0);
16 $enable = (isset($_GET["enable"]) && $_GET["enable"] == "1");
17
18 if (!$_SESSION["BBS_priv"]->checklevel(P_ADMIN_M | P_ADMIN_S))
19 {
20 $result_set["return"]["code"] = -1;
21 $result_set["return"]["message"] = "没有权限";
22
23 mysqli_close($db_conn);
24 exit(json_encode($result_set));
25 }
26
27 if ($enable)
28 {
29 $sql = "UPDATE user_pubinfo SET photo_enable = 1 WHERE UID = $p_id
30 AND photo = 999 AND photo_enable = 0 AND photo_ext <> ''";
31 }
32 else
33 {
34 $sql = "UPDATE user_pubinfo SET photo_ext = '' WHERE UID = $p_id
35 AND photo = 999 AND photo_enable = 0 AND photo_ext <> ''";
36 }
37
38 $rs = mysqli_query($db_conn, $sql);
39 if ($rs == false)
40 {
41 $result_set["return"]["code"] = -2;
42 $result_set["return"]["message"] = "Update photo error: " . mysqli_error($db_conn);
43
44 mysqli_close($db_conn);
45 exit(json_encode($result_set));
46 }
47
48 mysqli_close($db_conn);
49
50 header("Location: photo_list.php");

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