-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmove.php
46 lines (43 loc) · 1.29 KB
/
move.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
<?php
$title="Move Topics";
include("../config.php");
include("../header.php");
checks();
if ($lvl < 0) {
$url .= '/members/forums/vforum.php?page=1';
header("Location: $url");
exit();
} else {
$a = $_POST['checkbox'];
if ($a == NULL) {
echo "<div id=\"crimestext\" align=\"center\">No topics were selected!<br /><a href=\"vforum.php?page=1\">Go back.</a></div>";
include("../footer.php");
exit();
}
if ($_REQUEST['move']) {
foreach ($a as $id)
{
$query = mysql_query("SELECT id, sales FROM thread WHERE fid='$id'");
$row = mysql_fetch_array($query);
$car = $row[0];
$sales = $row[1];
if ($car == NULL) {
echo "<div id=\"crimestext\" align=\"center\">No topics were selected!<br /><a href=\"vforum.php?page=1\">Go back.</a></div>";
include("../footer.php");
exit();
}
if ($sales == 'yes') {
mysql_query("UPDATE thread SET sales='' WHERE fid='$id'");
echo "<div align=\"center\" id='crimestext'>The selected thread(s) were moved to the General forum.<br /><a href=\"sforum.php?page=1\">Go back.</a></div>";
include("../footer.php");
exit();
} else {
mysql_query("UPDATE thread SET sales='yes' WHERE fid='$id'");
echo "<div align=\"center\" id='crimestext'>The selected thread(s) were moved to the Sales forum.<br /><a href=\"vforum.php?page=1\">Go back.</a></div>";
include("../footer.php");
exit();
}
}
}
}
?>