for ($j = 0; $j < $num_attach_ids; $j++) { $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&uid=' . $members[$i]['user_id']))); } }
$db->sql_freeresult($result); $attach_id = array(); for ($j = 0; $j < $num_attach_ids; $j++) { $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) . ")"; $result = $db->sql_query($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, $config['topics_per_page']); } for ($i = 0; $i < sizeof($members); $i++) { $username = $members[$i]['username']; $total_attachments = $members[$i]['total_attachments']; $total_size = $members[$i]['total_size']; $row_class = !($i % 2) ? $theme['td_class1'] : $theme['td_class2']; $template->assign_block_vars('memberrow', array('ROW_NUMBER' => $i + (intval($_GET['start']) + 1), 'ROW_CLASS' => $row_class, 'USERNAME' => $username, 'TOTAL_ATTACHMENTS' => $total_attachments, 'TOTAL_SIZE' => round($total_size / MEGABYTE, 2), 'U_VIEW_MEMBER' => append_sid('admin_attach_cp.' . PHP_EXT . '?view=attachments&uid=' . $members[$i]['user_id']))); } } $sql = "SELECT user_id_1\n\t\tFROM " . ATTACHMENTS_TABLE . "\n\t\tGROUP BY user_id_1"; $result = $db->sql_query($sql); $total_rows = $db->sql_numrows($result); $db->sql_freeresult($result); }
if ($submit) { $template->assign_vars(array('S_ADD_GROUP_SELECT' => group_select('add_group_select', $extension_group))); } else { $template->assign_vars(array('S_ADD_GROUP_SELECT' => group_select('add_group_select'))); } $sql = 'SELECT * FROM ' . EXTENSIONS_TABLE . ' ORDER BY group_id'; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, 'Couldn\'t get Extension informations', '', __LINE__, __FILE__, $sql); } $extension_row = $db->sql_fetchrowset($result); $num_extension_row = $db->sql_numrows($result); $db->sql_freeresult($result); if ($num_extension_row > 0) { $extension_row = sort_multi_array($extension_row, 'group_name', 'ASC'); for ($i = 0; $i < $num_extension_row; $i++) { if ($submit) { $template->assign_block_vars('extension_row', array('EXT_ID' => $extension_row[$i]['ext_id'], 'EXTENSION' => $extension_row[$i]['extension'], 'EXTENSION_EXPLAIN' => $extension_explain_list[$i], 'S_GROUP_SELECT' => group_select('group_select[]', $group_select_list[$i]))); } else { $template->assign_block_vars('extension_row', array('EXT_ID' => $extension_row[$i]['ext_id'], 'EXTENSION' => $extension_row[$i]['extension'], 'EXTENSION_EXPLAIN' => $extension_row[$i]['comment'], 'S_GROUP_SELECT' => group_select('group_select[]', $extension_row[$i]['group_id']))); } } } } // Extension Groups if ($submit && $mode == 'groups') { // Change Extension Groups ? $group_change_list = get_var('group_change_list', array(0)); $extension_group_list = get_var('extension_group_list', array('')); $group_allowed_list = get_var('allowed_list', array(0));
if (isset($SITE['geoKey']) && $SITE['geoKey'] != '') { echo ' <th style="text-align: center; cursor: n-resize;">' . $online['0.0.0.0']['country'] . '</th> <th style="text-align: center; cursor: n-resize;">' . $online['0.0.0.0']['flag'] . '</th>'; } echo ' <th style="text-align: center; cursor: n-resize;">' . $online['0.0.0.0']['ip'] . '</th> <th style="text-align: center; cursor: n-resize;">' . $online['0.0.0.0']['starttime'] . '</th> <th style="text-align: center; cursor: n-resize;">' . $online['0.0.0.0']['time'] . '</th> <th style="text-align: center; cursor: n-resize;">' . $online['0.0.0.0']['page'] . '</th> <th style="text-align: center; cursor: n-resize;">' . $online['0.0.0.0']['active'] . '</th> </tr> </thead> <tbody>' . PHP_EOL; $style = 'background-color: #FFFFFF;'; $online2 = sort_multi_array($online, 'time'); $online3 = array(); $oldrecordsExist = false; $class = '"row-light"'; $rowcolor = 0; $x = 4; $toOld = time() - 60 * 60 * 24 * $x; // to delete records older than x days foreach ($online2 as $key => $record) { if ($record['ip'] === 'ip') { // skip the row with the headings $online3['0.0.0.0'] = $record; } else { if ($record['time'] <= $toOld) { $oldrecordsExist = true; } else {