Skip to content

Commit a19b5dd

Browse files
authored
Merge pull request #6626 from BOINC/dpa_web30
web: minor changes
2 parents 6d87d2d + d084d7c commit a19b5dd

File tree

4 files changed

+24
-17
lines changed

4 files changed

+24
-17
lines changed

html/inc/forum_db.inc

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,22 +155,20 @@ class BoincForumPrefs {
155155
} else {
156156
$prefs = self::lookup_userid($user->id);
157157
if (!$prefs) {
158-
$db = BoincDb::get();
159-
// is DB readonly? (shouldn't ever happen)
160-
if ($db->dbnum) {
161-
return;
162-
}
163-
self::insert("(userid, last_post, forum_sorting, thread_sorting, rated_posts, ignorelist, pm_notification) values ($user->id, 0, 0, 8, '', '', 0)");
158+
self::insert(
159+
sprintf(
160+
"(userid, last_post, forum_sorting, thread_sorting, rated_posts, ignorelist, pm_notification) values (%d, 0, 0, %d, '', '', 0)",
161+
$user->id, CREATE_TIME_OLD
162+
)
163+
);
164164
$prefs = self::lookup_userid($user->id);
165-
$prefs->userid = $user->id;
166-
$prefs->thread_sorting = 6;
167165
}
168166
self::$cache[$user->id] = $prefs;
169167
}
170168
$user->prefs = $prefs;
171169
}
172170
function privilege($specialbit) {
173-
return (substr($this->special_user, $specialbit,1)==1);
171+
return (substr($this->special_user, $specialbit, 1) == '1');
174172
}
175173
function update($clause) {
176174
$db = BoincDb::get();

html/inc/util.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -916,11 +916,11 @@ function button_style($color='green', $font_size=null) {
916916
if ($font_size) {
917917
$fs = sprintf('; font-size:%dpx', $font_size);
918918
}
919-
$c = 'seagreen';
920-
if ($color == 'blue') $c = 'steelblue';
919+
if ($color == 'green') $color = 'seagreen';
920+
if ($color == 'blue') $color = 'steelblue';
921921
return sprintf(
922922
'style="background-color:%s; color:white; text-decoration:none%s"',
923-
$c, $fs
923+
$color, $fs
924924
);
925925
}
926926
// Show a link formatted to look like a button.

html/user/download_software.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ function download_button($v, $project_id, $token, $user) {
127127
<input type=hidden name=token value="%s">
128128
<input type=hidden name=user_id value="%d">
129129
<input type=hidden name=filename value="%s">
130-
<button class="btn" %s>
131-
<font size=+1><u>Download BOINC</u></font>
130+
<button %s class="btn">
131+
<font size=2><u>Download BOINC</u></font>
132132
<br>for %s (%s MB)
133133
<br>BOINC %s</button>
134134
</form>
@@ -137,7 +137,7 @@ function download_button($v, $project_id, $token, $user) {
137137
$token,
138138
$user->id,
139139
(string)$v->filename,
140-
button_style('green', 14),
140+
button_style(),
141141
(string)$v->platform,
142142
(string)$v->size_mb,
143143
(string)$v->version_num

html/user/edit_forum_preferences_form.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,21 @@
196196
row1(tra("Update"));
197197
row2(
198198
tra("Click here to update preferences"),
199-
"<input class=\"btn btn-success\" type=submit value=\"".tra("Update")."\">"
199+
sprintf('<input %s class="btn" type=submit value="%s">',
200+
button_style(),
201+
tra("Update")
202+
)
200203
);
201204
echo "</form>\n";
202205
row1(tra("Reset"));
203206
row2(tra("Or click here to reset preferences to the defaults"),
204-
"<form method=\"post\" action=\"edit_forum_preferences_action.php\"><input class=\"btn btn-warning\" type=\"submit\" value=\"".tra("Reset")."\"><input type=\"hidden\" name=\"action\" value=\"reset_confirm\"></form>"
207+
sprintf('<form method="post" action="edit_forum_preferences_action.php">
208+
<input %s class="btn" type="submit" value="%s">
209+
<input type="hidden" name="action" value="reset_confirm">
210+
</form>',
211+
button_style('darkgoldenrod'),
212+
tra("Reset")
213+
)
205214
);
206215
end_table();
207216
page_tail();

0 commit comments

Comments
 (0)