Problem search multiple categories
Problem search multiple categories
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
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.
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
Hi. As an easy solution, I have added "Tried but unsolved" status.
Re: Problem search multiple categories
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)
and in the PHP:
Note that my PHP + HTML is a bit rusty, so there may be errors, but this is at least very close.
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...
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 += ";";
Re: Problem search multiple categories
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.
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
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
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
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
looks nice to me... what do others think?
Re: Problem search multiple categories
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
The old page will be available for a while at:
http://www.goproblems.com/problems-old.php3
Re: Problem search multiple categories
Awesome! Thanks!