Commit Graph

283 Commits

Author SHA1 Message Date
David Anderson f69d38f415 Web: fix some PHP warnings
There were lots of PHP warnings in the apache error log.
Fix most of these.
2020-04-09 13:54:16 -07:00
David Anderson 515d407e6e web: if view empty thread, mark it as read 2019-05-06 16:48:46 -07:00
Kevin Reed 346e7cd1a6
Merge pull request #2743 from BOINC/dpa_forum2
web: fix layout problem with forum tables
2019-03-05 15:51:55 -06:00
David Anderson ff91f05aa6 Tweaks to user URL/country flags
- Put flags in config.xml instead of project.inc
- Make them positive instead of negative
- make db_dump respect them.
2018-12-14 20:20:24 -08:00
David Anderson b45e89e9af web: add options for not collecting or showing URL and country
Add constants NO_USER_URL and NO_USER_COUNTRY.
If you set these to true (in project.inc)
there will be no query or display of user web site URL
and user country, respectively.
2018-12-10 16:58:56 -08:00
David Anderson 730d1c7fcf web: break in forum posts only at words 2018-11-07 19:29:22 -08:00
David Anderson fccea89f81 web: fix display problem caused by long strings in forum posts 2018-11-07 13:11:43 -08:00
David Anderson 3b9c9f9155 web: don't word-break user attributes (Project developer etc.) in forums. 2018-10-12 14:52:00 -07:00
David Anderson 3d06fbf763 web: fix layout problem with forum tables
Forum messages are shown in a table: left column is sender info,
right column is the message.

The left column was fixed width (10em).
On very hi-res monitors people increase their font size.
This causes the "Send message" button to overflow the column.

Solution: don't use fixed width, and make the right column 100% width.
This makes the left column wide enough for its contents to fit, but no wider.

This solves the problem, but introduces a (minor) new one:
some users have extremely long user names,
and this makes the left column too wide,
not just for that post but for the whole thread.

Solution: in this particular place, if name is > 30 chars,
show only the first 30 chars followed by ellipsis.
2018-10-08 11:03:06 -07:00
David Anderson 94fade4c09 web: if a thread or post creation fails
(e.g. because it has too many links) show the user an explanation.

Aside: the forum code (which was written by students a long time ago)
uses a hodge-podge of return conventions.
At some point we should standardize on 0 = success, nonzero = error code
2018-08-02 20:04:30 -07:00
David Anderson 4ea237589a web: add option for limiting # of links per post
One form of spam involves putting lots of links in a post.
This lets you limit it by setting POST_MAX_LINKS in project.inc.
Limit doesn't apply to moderators.
2017-11-27 14:12:31 -08:00
David Anderson 0a94ab9d30 web: fixes for dark background; make button text normal size 2017-08-20 01:39:39 -07:00
David Anderson dfe7261cda web: improve button colors and appearance
principles:
- primary action buttons are green (btn-success)
- secondary action buttons are blue (btn-primary)
- potentially risky action buttons are yellow (btn-warning)
- if there are a lot of buttons (e.g. forum posts) use btn-xs
2017-08-20 01:17:21 -07:00
David Anderson bc536494dd Web: small changes
- make the filename of user home page configurable
- make some strings translatable
2017-07-13 01:17:21 -07:00
David Anderson ac552ea8cf web: clean up some translatable strings.
Principle: translatable strings should not contain HTML tags.

moderation.php was verbose, and it linked to from the wrong place:
its target audience is forum readers, not writers.
2017-07-09 02:51:55 -07:00
Christian Beer 11a37bd1d0 Web: add extra space around placeholders
Our current translation system (Transifex) introduced a new editor feature which autodetects C-style placeholders in PO files. This wrongly detects our placeholders in the web code where a word immediately follows the digit. This leads to wrong translations if the placeholder is copied using this new transifex feature. The feature can not be globally disabled for our project. Instead every translator would need to use "raw" mode to disable it which is hard to communicate. Instead I added a space around problematic placeholders which is possing a smaller problem than wrong translations.
2017-07-04 13:13:01 +02:00
David Anderson e76e339c64 web: fix error when user updates email addr
Also fix error that showed credit in non-computing projects
2017-06-26 13:48:38 -07:00
David Anderson 4093be9579 web: fix PHP warning in sending "report post" emails 2017-06-24 14:41:07 -07:00
David Anderson c730e78159 web: fix PHP warnings in report-post page 2017-05-10 19:39:23 -07:00
David Anderson 7bf9e59981 web: show correct page when view hidden post 2017-04-29 15:27:00 -07:00
David Anderson 5565aa1881 enhance spam deleter; tweak moderation message 2017-03-26 18:49:29 -07:00
David Anderson b327ec3789 web: bug fixes and improvements
- The table structure for message-board posts was messed up.  Simplify it.
- make buttons x-small
- make button text white
2016-12-09 00:44:26 -08:00
David Anderson 330a8aa95b web: fix column widths in several places 2016-12-07 18:46:11 -08:00
David Anderson 3641a319fc web: improve message display
In messages (forum or PM) a [pre] section with a long line
would stretch the table cell,
causing that message and others to run off the edge of the window.

The solution, as Juha pointed out, is to use table-layout:fixed
for those tables, and to explicitly set the width of the other columns.
This causes the long lines to be put in boxes with a horizontal scrollbar,
and nothing overflows.
2016-12-07 18:17:57 -08:00
David Anderson c054358a6e web: tweaks to fix Scrutinizer complaints; few visible effects 2016-12-07 11:32:25 -08:00
David Anderson 5df6cda994 web: fix list=1 bbcode function 2016-11-29 13:00:21 -08:00
David Anderson 58be631b7c web tweaks; make BOINC page strings translatable 2016-11-28 16:45:24 -08:00
David Anderson 1d1c9eb444 web: tweaks for bootstrap
A bunch of little things.
Also new BOINC front page, by accident.
2016-11-28 00:47:25 -08:00
David Anderson 7be1f5d894 web: tweaks
- highlight admins in msg boards using green stripe
- show code in posts without scrollbars
- default button size: sm
2016-11-25 01:11:04 -08:00
David Anderson 28a8014df0 web tweaks
- fix display of BBcode links and menus
- change textareas to class form-control
- add color to select so they work with dark and light backgrounds

Note: I'm becoming somewhat less enamored of Bootstrap.
2016-11-24 20:32:01 -08:00
David Anderson 2cb7633acd web: fix forum color 2016-11-23 18:20:32 -08:00
David Anderson 02fed20833 web: fix forum jump-to-post 2016-11-22 15:51:55 -08:00
David Anderson df8e221287 web: various tweaks
Please enter the commit message for your changes. Lines starting
2016-11-20 15:38:19 -08:00
David Anderson b33c463cf3 web: various bug fixes
- fix "jump to first unread post" feature
- use <pre> for bbcode [code]
- don't use table-responsive class for tables.
  It does bad/funky things, especially on small displays
- remove start_table_noborder()
2016-11-11 19:11:57 -08:00
David Anderson c5b948020d Initial commit for Bootstrap 2016-11-11 12:36:27 -08:00
Christian Beer d806276335 Allow admins to post even if not enough RAC
[skip-ci]
2016-02-22 17:11:58 +01:00
David Anderson d32e42397c web: use HTTPS for gravatar avatars 2015-12-29 12:19:19 -08:00
David Anderson 6741bd0ced web: message tweak 2015-12-12 20:55:02 -08:00
Christian Beer ea7df2637e Web: use https urls everywhere
Modern Browser complain if there are non-https elements in https websites. This makes sure that if the user visits via https all elements of the page are also retrieved using SSL. Furthermore it uses https urls in emails that are send to the user, if SECURE_URL_BASE is set in project/project.inc.
The only remaining places where URL_BASE is used is when it is used as master_url where it is important that it is in sync with what the scheduler uses.
2015-11-30 09:36:29 +01:00
David Anderson bf24331c05 Web: message tweak 2015-11-25 22:47:40 -08:00
David Anderson 89b11f4158 web: initialize post.modified to zero, not current time 2015-10-20 14:08:09 -07:00
David Anderson 98bfcdb2d3 web: don't accidentally write to read-only DB replica
BOINC lets you maintain a read-only DB replica,
and certain read-only web pages (like top_users.php)
use the replica in preferences to the master.
But it turns out that these pages aren't actually read-only
because of the too-clever forum_preferences logic.
So sometimes it would add forum_preferences records to the replica,
leading to errors it later copies the same item from the master.

Solution: skip the forum preferences logic if we're using the replica.

We could make this more bulletproof by putting in checks
in insert(), update(), delete() etc.
2015-10-19 14:02:55 -07:00
David Anderson ad83e9e0e1 web: supply defaults for thread/post inserts; for MySQL strict mode 2015-07-29 16:26:25 -07:00
David Anderson b9cbb1d4a5 web: prevent thread/post counts from going negative
Because we don't use transactions, there are situations
(like if a moderator clicks "OK" repeatedly)
where decrementing thread/post counts makes them negative.
Prevent this.
2015-07-05 12:09:51 -07:00
David Anderson 659af28fd8 Web and BOINC Web: add comments for translated strings 2015-06-24 12:26:06 -07:00
David Anderson cc6e2f573e web: remove PHP warning and fix forum display glitch
The stuff in a forum post footer (ID: x Rating: x etc.)
wasn't vertically aligned.
Putting it inside a <span> fixed it, not sure why.
2015-04-27 10:08:21 -07:00
David Anderson b6e60311ea web: add "Help desk expert" user flag
This doesn't give any moderator rights; it's for display only.

Also, make the special-user strings translatable.
2015-04-04 14:35:18 -07:00
David Anderson 0e9e5f7145 web: add optional project_form_post_info($forum) function
For showing posting instructions for particular forums, e.g. Q&A
2015-03-20 14:54:35 -07:00
David Anderson cebd2f853a web: notify subscribed users if post is moved into a thread 2014-11-03 12:37:16 -08:00
David Anderson e6ecb981b3 web: change CSS usage to partly match Twitter Bootstrap. From Christian Beer. 2014-10-02 12:15:54 -07:00