includes/sessions.php
changeset 584 04a6ea3da279
parent 580 41c45314ac27
child 586 234ddd896555
equal deleted inserted replaced
583:c97d5f0d6636 584:04a6ea3da279
  2445          . "       COALESCE(ru.rank_style, rg.rank_style, rl.rank_style, rd.rank_style) AS rank_style,\n"
  2445          . "       COALESCE(ru.rank_style, rg.rank_style, rl.rank_style, rd.rank_style) AS rank_style,\n"
  2446          . "       ( ru.rank_id IS NULL AND rg.rank_id IS NULL ) AS using_default,"
  2446          . "       ( ru.rank_id IS NULL AND rg.rank_id IS NULL ) AS using_default,"
  2447          . "       ( ru.rank_id IS NULL AND rg.rank_id IS NOT NULL ) AS using_group,"
  2447          . "       ( ru.rank_id IS NULL AND rg.rank_id IS NOT NULL ) AS using_group,"
  2448          . "       $gid_col\n"
  2448          . "       $gid_col\n"
  2449          . "  FROM " . table_prefix . "users AS u\n"
  2449          . "  FROM " . table_prefix . "users AS u\n"
  2450          . "  LEFT JOIN groups AS g\n"
  2450          . "  LEFT JOIN " . table_prefix . "groups AS g\n"
  2451          . "    ON ( g.group_id = u.user_group )\n"
  2451          . "    ON ( g.group_id = u.user_group )\n"
  2452          . "  LEFT JOIN " . table_prefix . "group_members AS m\n"
  2452          . "  LEFT JOIN " . table_prefix . "group_members AS m\n"
  2453          . "    ON ( u.user_id = m.user_id )\n"
  2453          . "    ON ( u.user_id = m.user_id )\n"
  2454          . "  LEFT JOIN ranks AS ru\n"
  2454          . "  LEFT JOIN " . table_prefix . "ranks AS ru\n"
  2455          . "    ON ( u.user_rank = ru.rank_id )\n"
  2455          . "    ON ( u.user_rank = ru.rank_id )\n"
  2456          . "  LEFT JOIN ranks AS rg\n"
  2456          . "  LEFT JOIN " . table_prefix . "ranks AS rg\n"
  2457          . "    ON ( g.group_rank = rg.rank_id )\n"
  2457          . "    ON ( g.group_rank = rg.rank_id )\n"
  2458          . "  LEFT JOIN ranks AS rl\n"
  2458          . "  LEFT JOIN " . table_prefix . "ranks AS rl\n"
  2459          . "    ON (\n"
  2459          . "    ON (\n"
  2460          . $assoc
  2460          . $assoc
  2461          . "      )\n"
  2461          . "      )\n"
  2462          . "  LEFT JOIN ranks AS rd\n"
  2462          . "  LEFT JOIN " . table_prefix . "ranks AS rd\n"
  2463          . "    ON ( rd.rank_id = 1 )$append\n"
  2463          . "    ON ( rd.rank_id = 1 )$append\n"
  2464          . "  GROUP BY u.user_id, u.username, u.user_level, u.user_group, u.user_rank, u.user_title, g.group_rank,\n"
  2464          . "  GROUP BY u.user_id, u.username, u.user_level, u.user_group, u.user_rank, u.user_title, g.group_rank,\n"
  2465          . "       ru.rank_id, ru.rank_title, ru.rank_style,rg.rank_id, rg.rank_title, rg.rank_style,\n"
  2465          . "       ru.rank_id, ru.rank_title, ru.rank_style,rg.rank_id, rg.rank_title, rg.rank_style,\n"
  2466          . "       rl.rank_id, rl.rank_title, rl.rank_style,rd.rank_id, rd.rank_title, rd.rank_style;";
  2466          . "       rl.rank_id, rl.rank_title, rl.rank_style,rd.rank_id, rd.rank_title, rd.rank_style;";
  2467     
  2467