diff options
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/adm/admin_attachments.php | 4 | ||||
-rw-r--r-- | phpBB/adm/index.php | 50 |
2 files changed, 51 insertions, 3 deletions
diff --git a/phpBB/adm/admin_attachments.php b/phpBB/adm/admin_attachments.php index cd90fd7ef0..2797fc29d3 100644 --- a/phpBB/adm/admin_attachments.php +++ b/phpBB/adm/admin_attachments.php @@ -578,8 +578,10 @@ if ($mode == 'attach') </tr> <?php + $supported_types = get_supported_image_types(); + // Check Thumbnail Support - if (!$new['img_imagick'] && !count(get_supported_image_types())) + if (!$new['img_imagick'] && (!isset($supported_types['format']) || !sizeof($supported_types['format']))) { $new['img_create_thumbnail'] = '0'; } 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> |