Guest User

Untitled

a guest
Sep 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. diff --git a/a/a.php b/b/a.php
  2. index a787317..e24a541 100644
  3. --- a/a/a.php
  4. +++ b/b/a.php
  5. @@ -1,7 +1,7 @@
  6. //from ucp_prefs.php
  7. if ($submit)
  8. {
  9. - $data['style'] = ($config['override_user_style']) ? $config['default_style'] : $data['style'];
  10. + $data['style'] = ($config['override_user_style']) ? $config['default_style'] : ((!style_select('', false, $data['style'])) ? $data['style'] : ((int) $user->data['user_style']));
  11.  
  12. $error = validate_data($data, array(
  13. 'dateformat' => array('string', false, 1, 30),
  14. @@ -15,17 +15,21 @@ if ($submit)
  15. }
  16.  
  17. //from functions.php
  18. -function style_select($default = '', $all = false)
  19. +function style_select($default = '', $all = false, $pick = false)
  20. {
  21. global $db;
  22.  
  23. $sql_where = (!$all) ? 'WHERE style_active = 1 ' : '';
  24. + $sql_where .= (!$pick) ? '' : "AND style_id = $pick";
  25. $sql = 'SELECT style_id, style_name
  26. FROM ' . STYLES_TABLE . "
  27. $sql_where
  28. ORDER BY style_name";
  29. $result = $db->sql_query($sql);
  30.  
  31. + if(!$pick)
  32. + return !count($db->sql_fetchrow($result));
  33. +
  34. $style_options = '';
  35. while ($row = $db->sql_fetchrow($result))
  36. {
Add Comment
Please, Sign In to add comment