diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2005-01-02 19:12:14 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2005-01-02 19:12:14 +0000 |
commit | 52f17c49d7209b686c4733b8b3908ec4e9ca4b06 (patch) | |
tree | 0ffba489fde36d2e90e9761507de8672020450d1 /phpBB/adm/index.php | |
parent | 9c4b9d9dae63367410f152e1250b3ace48aaf0de (diff) | |
download | forums-52f17c49d7209b686c4733b8b3908ec4e9ca4b06.tar forums-52f17c49d7209b686c4733b8b3908ec4e9ca4b06.tar.gz forums-52f17c49d7209b686c4733b8b3908ec4e9ca4b06.tar.bz2 forums-52f17c49d7209b686c4733b8b3908ec4e9ca4b06.tar.xz forums-52f17c49d7209b686c4733b8b3908ec4e9ca4b06.zip |
- make use of new get_supported_image_types format
- added mysql 4.1.x support for database size
git-svn-id: file:///svn/phpbb/trunk@5040 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/adm/index.php')
-rw-r--r-- | phpBB/adm/index.php | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index c1a5004ac1..e94f027064 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -279,6 +279,50 @@ elseif ($pane == 'right') add_log('admin', 'LOG_RESYNC_STATS'); break; + // TODO: Temporary or a useful function? + case 'user': + if (!$auth->acl_get('a_defaults')) + { + trigger_error($user->lang['NO_ADMIN']); + } + + $post_count_ary = $auth->acl_getf('f_postcount'); + + $forum_ary = array(); + foreach ($post_count_ary as $forum_id => $allowed) + { + if ($allowed['f_read'] && $allowed['f_postcount']) + { + $forum_ary[] = $forum_id; + } + } + $post_count_sql = (sizeof($forum_ary)) ? 'AND f.forum_id IN (' . implode(', ', $forum_ary) . ')' : ''; + unset($forum_ary, $post_count_ary); + + $sql = 'SELECT user_id FROM ' . USERS_TABLE . ' + WHERE user_type NOT IN (' . USER_INACTIVE . ')'; + $result = $db->sql_query($sql); + + while ($user_row = $db->sql_fetchrow($result)) + { + $user_id = (int) $user_row['user_id']; + + $sql = 'SELECT COUNT(p.post_id) AS num_posts + FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f + WHERE p.poster_id = ' . $user_id . " + AND f.forum_id = p.forum_id + $post_count_sql"; + $result2 = $db->sql_query($sql); + $num_real_posts = (int) $db->sql_fetchfield('num_posts', 0, $result2); + $db->sql_freeresult($result2); + + $db->sql_query('UPDATE ' . USERS_TABLE . " SET user_posts = $num_real_posts WHERE user_id = $user_id"); + } + $db->sql_freeresult($result); + + add_log('admin', 'LOG_RESYNC_USER'); + break; + case 'date': if (!$auth->acl_get('a_defaults')) { @@ -373,7 +417,7 @@ elseif ($pane == 'right') $dbsize = 0; while ($row = $db->sql_fetchrow($result)) { - if ($row['Type'] != 'MRG_MyISAM') + if ((isset($row['Type']) && $row['Type'] != 'MRG_MyISAM') || (isset($row['Engine']) && $row['Engine'] == 'MyISAM')) { if ($table_prefix != '') { @@ -489,7 +533,9 @@ elseif ($pane == 'right') <td class="row2"> </td> </tr> <tr> - <td class="cat" colspan="4" align="right"><select name="action"><option value="online"><?php echo $user->lang['RESET_ONLINE']; ?></option><option value="date"><?php echo $user->lang['RESET_DATE']; ?></option><option value="stats"><?php echo $user->lang['RESYNC_STATS']; ?></option></select> <input class="btnlite" type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" /> </td> + <td class="cat" colspan="4" align="right"><select name="action"><option value="online"><?php echo $user->lang['RESET_ONLINE']; ?></option><option value="date"><?php echo $user->lang['RESET_DATE']; ?></option><option value="stats"><?php echo $user->lang['RESYNC_STATS']; ?></option> + <!-- option value="user"><?php echo $user->lang['RESYNC_USER_POSTS']; ?></option --> + </select> <input class="btnlite" type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" /> </td> </tr> </table></form> |