From 8451166cfb23e4a820268d4fc5bf83b8d10dceb7 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Mon, 30 Oct 2006 19:32:44 +0000 Subject: [PATCH] Fixing display of pivots when they are author names Merged from MOODLE_17_STABLE --- mod/glossary/print.php | 2 +- mod/glossary/sql.php | 3 ++- mod/glossary/view.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mod/glossary/print.php b/mod/glossary/print.php index 3fb99a46ad..e3745d3a87 100644 --- a/mod/glossary/print.php +++ b/mod/glossary/print.php @@ -167,7 +167,7 @@ $currentpivot = $upperpivot; $pivottoshow = $currentpivot; - if ( isset($entry->userid) ) { + if ( isset($entry->userispivot) ) { // printing the user icon if defined (only when browsing authors) $user = get_record("user","id",$entry->userid); $pivottoshow = fullname($user); diff --git a/mod/glossary/sql.php b/mod/glossary/sql.php index b24f614052..c78ed29dc8 100644 --- a/mod/glossary/sql.php +++ b/mod/glossary/sql.php @@ -91,7 +91,7 @@ $where = ''; } - $sqlselect = "SELECT ge.*, $usernamefield AS glossarypivot "; + $sqlselect = "SELECT ge.*, $usernamefield AS glossarypivot, 1 AS userispivot "; $sqlfrom = "FROM {$CFG->prefix}glossary_entries ge, {$CFG->prefix}user u"; $sqlwhere = "WHERE ge.userid = u.id AND (ge.approved != 0 $userid) @@ -268,5 +268,6 @@ if ( $offset >= 0 ) { $limitnum = $entriesbypage; } + $allentries = get_records_sql("$sqlselect $sqlfrom $sqlwhere $sqlorderby", $limitfrom, $limitnum); ?> diff --git a/mod/glossary/view.php b/mod/glossary/view.php index 1df6a5a70a..cfd401e931 100644 --- a/mod/glossary/view.php +++ b/mod/glossary/view.php @@ -354,7 +354,7 @@ echo ''; $pivottoshow = $currentpivot; - if ( isset($entry->userid) ) { + if ( isset($entry->userispivot) ) { // printing the user icon if defined (only when browsing authors) echo ''; -- 2.39.5