[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/auth/provider/godb.php on line 137: Undefined array key "PHPSESSID"
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4129: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3008)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4129: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3008)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4129: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3008)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4129: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3008)
goproblems.com • Problem search multiple categories
Page 1 of 1

Problem search multiple categories

Posted: Sat Aug 22, 2009 9:57 pm
by ethanb
I don't see a reason why the Genre search list couldn't be checkboxes instead of radio buttons - that way you could search for, say, Joseki and Fuseki problems instead of just one or the other.

Re: Problem search multiple categories

Posted: Thu Nov 12, 2009 2:54 pm
by nait
Very much so :!: :!:

In status, this should also enable the option "tried" AND "not solved" which I would find very natural to use a lot.
In status, some combinations would make little sense, though (e.g. tried AND not tried). So, here, the common options could as well be radio buttons still, but with all the combinations that make sense:

- Any
- Tried and never failed / always solved
- Tried and failed as well as solved
- Tried and never solved / always failed
- Not tried
- Tried or not tried, but never solved

As it is, "not solved" means the latter, but this is not very clear when you read it.

Re: Problem search multiple categories

Posted: Sat Nov 14, 2009 3:40 am
by tails
Hi. As an easy solution, I have added "Tried but unsolved" status.

Re: Problem search multiple categories

Posted: Sun Dec 13, 2009 7:32 am
by ethanb
Er, sorry, but this is not a solution at all. (EDIT: oh, I see - nait suggested a new radio button for the solved status separate from the checkbox idea. In any case, the pseudocode below should help with the checkbox genre implementation.)

Rather than a new flag, it should be combinations of flags that are allowed. The site is in PHP, and I assume an SQL backend, so it would be something like:

(on pages)

Code: Select all

<input type="checkbox" name="genre[]" value="joseki">Joseki
<input type="checkbox" name="genre[]" value="fuseki">Fuseki
<input type="checkbox" name="genre[]" value="lifendeath">Life and Death
<input type="checkbox" name="genre[]" value="tesuji">Tesuji
etc...
and in the PHP:

Code: Select all

$sql = "SELECT * from problems ";
if ($_POST["genre"])
{
  $sql += "WHERE ";
  for ($i = 0; $i < sizeof($_POST["genre"]); $i++)
  {
    $sql += "genre = '" + $_POST["genre"][$i] + "'";
    if ($i < sizeof($_POST["genre"]))
      $sql += " OR ";
  }
}
$sql += ";";
Note that my PHP + HTML is a bit rusty, so there may be errors, but this is at least very close.

Re: Problem search multiple categories

Posted: Sun Dec 13, 2009 11:09 am
by tails
Yes, that's technically possible.

But I think there is a trade-off. Assume all the boxes are checked inintially. When you want joseki problems, you'll have to turn off all the boxes except joseki one. I think some people may feel it annoying.

I (as a mere maintener) can't decide which is better, so I must respect the fact that adum chose radio buttons. That's why I didn't implement your idea, sorry.

Re: Problem search multiple categories

Posted: Mon Dec 14, 2009 12:56 pm
by adum
i agree that checkboxes would probably be superior... especially for the tried/solved type stuff. it's probably radio buttons for the simple reason that i didn't think the design through carefully when i made it originally.

Re: Problem search multiple categories

Posted: Tue Dec 15, 2009 7:03 pm
by tails
Aye aye, sir :-)

Here is a candidate page that uses checkboxs for problem conditions:
http://www.goproblems.com/problems-test1.php3

Please comment if you have any suggestions. > all

Re: Problem search multiple categories

Posted: Wed Dec 16, 2009 1:39 pm
by adum
looks nice to me... what do others think?

Re: Problem search multiple categories

Posted: Sun Dec 20, 2009 5:25 am
by tails
Okay, I've replaced the page. (The URL above is no longer available.)

The old page will be available for a while at:
http://www.goproblems.com/problems-old.php3

Re: Problem search multiple categories

Posted: Wed Dec 23, 2009 8:18 am
by ethanb
Awesome! Thanks!