phpBB

Code Changes

File: phpbb/db/migration/data/v310/style_update_p1.php

  Unmodified   Added   Modified   Removed
Line 133Line 133
		}

// Remove old entries from styles table

		}

// Remove old entries from styles table

		if (!sizeof($valid_styles))

		if (!count($valid_styles))

		{
// No valid styles: remove everything and add prosilver
$this->sql_query('DELETE FROM ' . STYLES_TABLE);

		{
// No valid styles: remove everything and add prosilver
$this->sql_query('DELETE FROM ' . STYLES_TABLE);

Line 160Line 160
				FROM ' . STYLES_TABLE . "
WHERE style_name = 'prosilver'";
$result = $this->sql_query($sql);

				FROM ' . STYLES_TABLE . "
WHERE style_name = 'prosilver'";
$result = $this->sql_query($sql);

			$default_style = $this->db->sql_fetchfield('style_id');

			$default_style = (int) $this->db->sql_fetchfield('style_id');

			$this->db->sql_freeresult($result);

$this->config->set('default_style', $default_style);


			$this->db->sql_freeresult($result);

$this->config->set('default_style', $default_style);


			$sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = 0';

			$sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = ' .  (int) $default_style;

			$this->sql_query($sql);
}
else

			$this->sql_query($sql);
}
else

Line 183Line 183
			}

// Reset styles for users

			}

// Reset styles for users

			$this->sql_query('UPDATE ' . USERS_TABLE . '
SET user_style = 0
WHERE ' . $this->db->sql_in_set('user_style', $valid_styles, true));

			$this->sql_query('UPDATE ' . USERS_TABLE . "
SET user_style = '" . (int) $valid_styles[0] . "'
WHERE " . $this->db->sql_in_set('user_style', $valid_styles, true));

		}
}
}

		}
}
}