Ejemplo n.º 1
0
             $attach_id[] = intval($attach_ids[$j]['attach_id']);
         }
         if (sizeof($attach_id)) {
             // Now get the total filesize
             $sql = "SELECT sum(filesize) as total_size\n\t\t\t\t\tFROM " . ATTACHMENTS_DESC_TABLE . "\n\t\t\t\t\tWHERE attach_id IN (" . implode(', ', $attach_id) . ")";
             if (!($result = $db->sql_query($sql))) {
                 message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
             }
             $row = $db->sql_fetchrow($result);
             $db->sql_freeresult($result);
             $members[$i]['total_size'] = (int) $row['total_size'];
         }
     }
     if ($mode == 'filesize') {
         $members = sort_multi_array($members, 'total_size', $sort_order, FALSE);
         $members = limit_array($members, $start, $board_config['topics_per_page']);
     }
     for ($i = 0; $i < count($members); $i++) {
         $username = $members[$i]['username'];
         $total_attachments = $members[$i]['total_attachments'];
         $total_size = $members[$i]['total_size'];
         // Begin PNphpBB2 Module
         //			$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
         //			$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
         $row_color = !($i % 2) ? $phpbb_theme['td_color1'] : $phpbb_theme['td_color2'];
         $row_class = !($i % 2) ? $phpbb_theme['td_class1'] : $phpbb_theme['td_class2'];
         // End PNphpBB2 Module
         $template->assign_block_vars('memberrow', array('ROW_NUMBER' => $i + ($_GET['start'] + 1), 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'USERNAME' => DataUtil::formatForDisplay($username), 'TOTAL_ATTACHMENTS' => $total_attachments, 'TOTAL_SIZE' => round($total_size / MEGABYTE, 2), 'U_VIEW_MEMBER' => append_sid('admin_attach_cp.' . $phpEx . '?view=attachments&amp;uid=' . $members[$i]['user_id'])));
     }
 }
 $sql = "SELECT user_id_1\n\t\tFROM " . ATTACHMENTS_TABLE . "\n\t\tGROUP BY user_id_1";
Ejemplo n.º 2
0
            for ($j = 0; $j < $num_attach_ids; $j++) {
                $attach_id[] = intval($attach_ids[$j]['attach_id']);
            }
            //
            // Now get the total filesize
            //
            $sql = "SELECT sum(filesize) as total_size\n\t\t\tFROM " . ATTACHMENTS_DESC_TABLE . "\n\t\t\tWHERE attach_id IN (" . implode(', ', $attach_id) . ")";
            if (!($result = DB()->sql_query($sql))) {
                message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql);
            }
            $row = DB()->sql_fetchrow($result);
            $members[$i]['total_size'] = (int) $row['total_size'];
        }
        if ($mode == 'filesize') {
            $members = sort_multi_array($members, 'total_size', $sort_order, FALSE);
            $members = limit_array($members, $start, $ft_cfg['topics_per_page']);
        }
        for ($i = 0; $i < count($members); $i++) {
            $username = $members[$i]['username'];
            $total_attachments = $members[$i]['total_attachments'];
            $total_size = $members[$i]['total_size'];
            $template->assign_block_vars('memberrow', array('ROW_NUMBER' => $i + ($HTTP_GET_VARS['start'] + 1), 'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2', 'USERNAME' => $username, 'TOTAL_ATTACHMENTS' => $total_attachments, 'TOTAL_SIZE' => round($total_size / MEGABYTE, 2), 'U_VIEW_MEMBER' => append_sid('admin_attach_cp.php?view=attachments&amp;uid=' . $members[$i]['user_id'])));
        }
    }
    $sql = "SELECT user_id_1\n\tFROM " . ATTACHMENTS_TABLE . "\n\tGROUP BY user_id_1";
    if (!($result = DB()->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
    }
    $total_rows = DB()->num_rows($result);
}
//