mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
- 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
This commit is contained in:
parent
9c4b9d9dae
commit
52f17c49d7
2 changed files with 51 additions and 3 deletions
|
@ -578,8 +578,10 @@ if ($mode == 'attach')
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
$supported_types = get_supported_image_types();
|
||||||
|
|
||||||
// Check Thumbnail Support
|
// 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';
|
$new['img_create_thumbnail'] = '0';
|
||||||
}
|
}
|
||||||
|
|
|
@ -279,6 +279,50 @@ elseif ($pane == 'right')
|
||||||
add_log('admin', 'LOG_RESYNC_STATS');
|
add_log('admin', 'LOG_RESYNC_STATS');
|
||||||
break;
|
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':
|
case 'date':
|
||||||
if (!$auth->acl_get('a_defaults'))
|
if (!$auth->acl_get('a_defaults'))
|
||||||
{
|
{
|
||||||
|
@ -373,7 +417,7 @@ elseif ($pane == 'right')
|
||||||
$dbsize = 0;
|
$dbsize = 0;
|
||||||
while ($row = $db->sql_fetchrow($result))
|
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 != '')
|
if ($table_prefix != '')
|
||||||
{
|
{
|
||||||
|
@ -489,7 +533,9 @@ elseif ($pane == 'right')
|
||||||
<td class="row2"> </td>
|
<td class="row2"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<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>
|
</tr>
|
||||||
</table></form>
|
</table></form>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue