mirror of
https://gitlab.com/CodeSolutionsProject/CodeShare.git
synced 2026-02-25 06:13:48 +01:00
Add languages, categorized them, add rechaptcha
This commit is contained in:
@@ -49,4 +49,32 @@ function ksonParse($path){
|
||||
}else{
|
||||
die('<h3>Error, kson file not exist</h3>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Group by $supported
|
||||
*/
|
||||
function groupByCategory(&$supported){
|
||||
$grouped = Array();
|
||||
foreach($supported as $key => $val){
|
||||
if(!array_key_exists($val[1],$grouped)){
|
||||
switch($val[1]){
|
||||
case "Programming":
|
||||
$num=5;
|
||||
break;
|
||||
case "Config":
|
||||
case "Markup":
|
||||
$num=2;
|
||||
break;
|
||||
case "Script":
|
||||
case "Data":
|
||||
case "Mathematics":
|
||||
$num=1;
|
||||
break;
|
||||
}
|
||||
$grouped[$val[1]] = Array(Array(),$num);
|
||||
}
|
||||
array_push($grouped[$val[1]][0],[$key,$val[0]]);
|
||||
}
|
||||
return $grouped;
|
||||
}
|
||||
Reference in New Issue
Block a user