-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmodblock.php
executable file
·166 lines (162 loc) · 5.75 KB
/
modblock.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?php
/**
*
* Duhok Forum 3.0
* @author Dilovan Matini (original founder)
* @copyright 2007 - 2021 Dilovan Matini
* @see df.lelav.com
* @see https://github.com/dilovanmatini/duhok-forum
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT ANY WARRANTY;
*
*/
if( _df_script == 'svc' && this_svc == 'modblock' && ulv > 2 ){
// ************ start page ****************
if( type == 'user' ){
$mod_bloc = $mysql->get("moderator", "block", u, "userid");
print $mod_bloc;
if($mod_bloc == 0){
$step=1;
?>
<script type="text/javascript">
DF.checkSubmit=function(frm){
if(frm.cause.value.length<5){
alert("يجب أن يكون السبب أطول من 5 حروف");
}
else{
frm.submit();
}
};
</script>
<?php
$button_title ="تجميد الإشراف";
}
elseif($mod_bloc == 1){
$step=0;
?>
<script type="text/javascript">
DF.checkSubmit=function(frm){
frm.submit();
};
</script>
<?php
$button_title ="إلغاء تجميد الإشراف";
}
$rs=$mysql->queryRow("SELECT name FROM ".prefix."user WHERE id = '".u."' AND status IN (0,1)", __FILE__, __LINE__);
if(!$rs){
$DF->goTo();
exit();
}
echo"
<table cellspacing=\"1\" cellpadding=\"4\" align=\"center\">
<tr>
<td class=\"asHeader asAC2\" colspan=\"5\">تفاصيل إشراف : {$Template->userNormalLink(u,$rs[0])}</td>
</tr>
<tr>
<td class=\"asDarkB\"><nobr>الرقم</nobr></td>
<td class=\"asDarkB\"><nobr>العملية</nobr></td>
<td class=\"asDarkB\"><nobr>السبب</nobr></td>
<td class=\"asDarkB\"><nobr>المستخدم</nobr></td>
<td class=\"asDarkB\">التاريخ</td>
</tr>";
$sql=$mysql->query("SELECT * FROM ".prefix."moderator_block where userid = ".u." ", __FILE__, __LINE__);
$count=0;
while($rs=$mysql->fetchAssoc($sql)){
echo"
<tr>
<td class=\"asNormalB asS12 asCenter\"><nobr>{$rs['id']}</nobr></td>
<td class=\"asNormalB asS12 asCenter\"><nobr>{$DF->iff($rs['type'] == 0,'<font color="green">إلغاء التجميد</font>','<font color="red">تجميد الإشراف </font>')}</nobr></td>
<td class=\"asNormalB asAS12 asCenter\"><nobr>{$DF->iff($rs['cause'] == '','--',$rs['cause'])}</nobr></td>
<td class=\"asNormalB asCenter\"><nobr>{$Template->userColorLink($rs['block_id'])}</nobr></td>
<td class=\"asNormalB asCenter\"><nobr>{$DF->date($rs['date'])}</nobr></td>
</tr>";
$count++;
}
if($count == 0){
echo"
<tr>
<td class=\"asNormalB asS12 asCenter\" colspan=\"5\"><br>لا توجد بيانات في سجل هذا العضو<br><br></td>
</tr>";
}
echo"
</table>";
}
$user_level = $mysql->get( "user", "level", u );
if( $user_level == 2 ){
echo"<br>
<table width=\"50%\" cellspacing=\"1\" cellpadding=\"4\" align=\"center\">
<form name=\"titleInfo\" method=\"post\" action=\"svc.php?svc=modblock&type=update\">
<input type=\"hidden\" name=\"redeclare\" value=\"".rand."\">
<input type=\"hidden\" name=\"userid\" value=\"".u."\">
<input type=\"hidden\" name=\"step\" value=\"$step\">
<tr>
<td class=\"asHeader\" colspan=\"4\"><nobr>خيارات</nobr></td>
</tr>";
if($mod_bloc == 0){
echo"
<tr>
<td class=\"asFixedB\"><nobr>السبب</nobr></td>
<td class=\"asNormalB\" colspan=\"3\"><input type=\"text\" style=\"width:400px;\" name=\"cause\"></td>
</tr>";
}
echo"
<tr>
<td class=\"asNormalB asCenter\" colspan=\"4\">
{$Template->button($button_title," onClick=\"DF.checkSubmit(this.form)\"")}
</td>
</tr>
</form>
</table>";
}
if(type == 'update'){
$userid = (int)$_POST['userid'];
$type = $_POST['step'];
$cause = $DF->cleanText($_POST['cause']);
$mysql->insert("moderator_block (userid,type,block_id,cause,date) VALUES ('".$userid."','".$type."','".uid."','".$cause."','".time."')", __FILE__, __LINE__);
$mysql->update("moderator SET block = '$type' WHERE userid = '".$userid."'", __FILE__, __LINE__);
if($type == 0){
$mysql->update("moderator_block SET step = '0' WHERE userid = '".$userid."'", __FILE__, __LINE__);
}
$Template->msg("تم تحديث البيانات بنجاح");
}
if(type == 'list'){
echo"
<table cellspacing=\"1\" cellpadding=\"4\" align=\"center\">
<tr>
<td class=\"asHeader asAC2\" colspan=\"4\">قائمة المشرفين المجمدين</td>
</tr>
<tr>
<td class=\"asDarkB\"><nobr>المشرف</nobr></td>
<td class=\"asDarkB\"><nobr>السبب</nobr></td>
<td class=\"asDarkB\"><nobr>المستخدم</nobr></td>
<td class=\"asDarkB\">خيارات</td>
</tr>";
$sql=$mysql->query("SELECT * FROM ".prefix."moderator_block AS b
LEFT JOIN ".prefix."user AS u ON( u.id = b.userid )
WHERE b.type = 1 AND b.step = 1 AND u.level = 2", __FILE__, __LINE__);
$count=0;
while($rs=$mysql->fetchAssoc($sql)){
echo"
<tr>
<td class=\"asNormalB asCenter\"><nobr>{$Template->userColorLink($rs['userid'])}</nobr></td>
<td class=\"asNormalB asAS12 asCenter\"><nobr>{$DF->iff($rs['cause'] == '','--',$rs['cause'])}</nobr></td>
<td class=\"asNormalB asCenter\"><nobr>{$Template->userColorLink($rs['block_id'])}</nobr></td>
<td class=\"asNormalB asCenter\"><nobr><a href=\"svc.php?svc=modblock&type=user&u={$rs['userid']}\" title=\"التفاصيل\"><img src=\"{$DFImage->i['post']}\" alt=\"التفاصيل\" hspace=\"2\" border=\"0\"></a></nobr></td>
</tr>";
$count++;
}
if($count == 0){
echo"
<tr>
<td class=\"asNormalB asS12 asCenter\" colspan=\"5\"><br>لا يوجد حاليا أي مشرف مجمد<br><br></td>
</tr>";
}
echo"
</table>";
}
// ************ end page ****************
}
else{
header("HTTP/1.0 404 Not Found");
}
?>