require_variable($id); // Course Module ID
optional_variable($sortorder,"asc"); // Sorting order
- optional_variable($offset); // number of entries to bypass
+ optional_variable($offset,0,PARAM_INT); // number of entries to bypass
optional_variable($displayformat,-1);
$mode = required_param('mode'); // mode to show the entries
/// Creating the SQL statements
+/// Initialise some variables
+ $sqlorderby = '';
+
/// Pivot is the field that set the break by groups (category, initial, author name, etc)
/// fullpivot indicate if the whole pivot should be compared agasint the db or just the first letter
case 'entry':
$printpivot = 0;
- $where = "AND ge.id = $hook";
+ $where = "AND ge.id = '$hook'";
break;
case 'letter':
$fullsearch = optional_param('fullsearch',0);// full search (concept and definition) when searching?
$sortkey = optional_param('sortkey'); // Sorted view: CREATION | UPDATE | FIRSTNAME | LASTNAME...
$sortorder = optional_param('sortorder'); // it defines the order of the sorting (ASC or DESC)
- $offset = optional_param('offset',0); // entries to bypass (for paging purpouses)
- $page = optional_param('page',0); // Page to show (for paging purpouses)
+ $offset = optional_param('offset',0,PARAM_INT); // entries to bypass (for paging purpouses)
+ $page = optional_param('page',0,PARAM_INT); // Page to show (for paging purpouses)
$show = optional_param('show'); // [ concept | alias ] => mode=term hook=$show
if (!empty($id)) {