I figured it out!
Since widgetz's mod returned the value of <%category_name_escaped%> to search.cgi,
but the non-English mod make some change on $category_name_escaped,
the problem happen thus.
Somebody may have fixed it already, but I just think no harm to share my code:
Step 1:
in nph-build.cgi, sub build_category_pages,
find:
Code:
if ($nonenglish eq "") {
$title_linked = &build_linked_title ($cat);
$title = &build_unlinked_title ($cat);
$category_name = $cat;
$category_name_escaped = &urlencode ($cat);
$category_clean = &build_clean ($cat);
}
else {
$title_linked = &build_linked_title_mb ($cat, $nonenglish);
$title = &build_clean_mb ($nonenglish);
$category_name = &build_last_title_mb ($nonenglish);
$category_name_escaped = &build_last_title_mb ($nonenglish);
$category_clean = &build_clean_mb ($nonenglish);
}
Add the follow code after it:
Code:
$category_name_escaped_2 = &urlencode ($cat);
Step 2:
in site_html_templates.pl, sub site_html_category,
Add
Code:
category_name_escaped_2 => $category_name_escaped_2,
Step 3:
Modify Widgetz's code to
Code:
<option value="All" selected>anything</option>
<option value="<%category_name_escaped_2%>">anything</option>
Is my code stable? Would it cause any harm?
Did any code better than mine?
I'm just a perl beginner, please give some coaching.
Thanks.
-- Adam Hui