Commit ce0f6c2e authored by jpgimenez's avatar jpgimenez

- Better FAQ-questions ordering, preliminary support for position field

parent b1a6b932
...@@ -68,7 +68,7 @@ $smarty->assign('question',$info["question"]); // moved from above ...@@ -68,7 +68,7 @@ $smarty->assign('question',$info["question"]); // moved from above
$smarty->assign('answer',$info["answer"]); // moved from above $smarty->assign('answer',$info["answer"]); // moved from above
if(!isset($_REQUEST["sort_mode"])) { if(!isset($_REQUEST["sort_mode"])) {
$sort_mode = 'question_asc'; $sort_mode = 'position,questionId_asc';
} else { } else {
$sort_mode = $_REQUEST["sort_mode"]; $sort_mode = $_REQUEST["sort_mode"];
} }
...@@ -97,7 +97,7 @@ if(isset($_REQUEST["approve_suggested"])) { ...@@ -97,7 +97,7 @@ if(isset($_REQUEST["approve_suggested"])) {
$smarty->assign_by_ref('sort_mode',$sort_mode); $smarty->assign_by_ref('sort_mode',$sort_mode);
$channels = $faqlib->list_faq_questions($_REQUEST["faqId"],0,-1,$sort_mode,$find); $channels = $faqlib->list_faq_questions($_REQUEST["faqId"],0,-1,$sort_mode,$find);
$allq = $faqlib->list_all_faq_questions(0,-1,'question_asc',$_REQUEST["filter"]); $allq = $faqlib->list_all_faq_questions(0,-1,'position,questionId_asc',$_REQUEST["filter"]);
$smarty->assign_by_ref('allq',$allq["data"]); $smarty->assign_by_ref('allq',$allq["data"]);
$cant_pages = ceil($channels["cant"] / $maxRecords); $cant_pages = ceil($channels["cant"] / $maxRecords);
......
...@@ -27,6 +27,11 @@ $smarty->assign('faqId',$_REQUEST["faqId"]); ...@@ -27,6 +27,11 @@ $smarty->assign('faqId',$_REQUEST["faqId"]);
$faq_info = $tikilib->get_faq($_REQUEST["faqId"]); $faq_info = $tikilib->get_faq($_REQUEST["faqId"]);
$smarty->assign('faq_info',$faq_info); $smarty->assign('faq_info',$faq_info);
if(!isset($_REQUEST["sort_mode"])) {
$sort_mode = 'position,questionId_asc';
} else {
$sort_mode = $_REQUEST["sort_mode"];
}
if(isset($_REQUEST["find"])) { if(isset($_REQUEST["find"])) {
$find = $_REQUEST["find"]; $find = $_REQUEST["find"];
...@@ -35,7 +40,7 @@ if(isset($_REQUEST["find"])) { ...@@ -35,7 +40,7 @@ if(isset($_REQUEST["find"])) {
} }
$smarty->assign('find',$find); $smarty->assign('find',$find);
$channels = $faqlib->list_faq_questions($_REQUEST["faqId"],0,-1,'question_asc',$find); $channels = $faqlib->list_faq_questions($_REQUEST["faqId"],0,-1,'position,questionId_asc',$find);
$smarty->assign_by_ref('channels',$channels["data"]); $smarty->assign_by_ref('channels',$channels["data"]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment