Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | daniel-mar | 1 | <?php |
2 | |||
3 | if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
||
4 | |||
5 | $my_str = ''; |
||
6 | $res = db_query("SELECT `id` FROM `".$WBConfig->getMySQLPrefix()."users`"); |
||
7 | while ($row = db_fetch($res)) |
||
8 | { |
||
9 | $my_str .= "'".$row['id']."', "; |
||
10 | } |
||
11 | $my_str = substr($my_str, 0, strlen($my_str)-2); |
||
12 | |||
13 | foreach ($tables_modules as $m1 => $m2) |
||
14 | { |
||
15 | if (isset($tables_modules[$m1]['user_cnid'])) |
||
16 | { |
||
17 | if ($my_str != '') |
||
18 | { |
||
19 | $add = " WHERE `user_cnid` NOT IN ($my_str)"; |
||
20 | } |
||
21 | else |
||
22 | { |
||
23 | $add = ''; |
||
24 | } |
||
25 | |||
26 | db_query("DELETE FROM `$m1`$add"); |
||
27 | if (db_affected_rows() > 0) |
||
28 | { |
||
29 | db_query("OPTIMIZE TABLE `$m1`"); |
||
30 | } |
||
31 | } |
||
32 | } |
||
33 | |||
34 | ?> |