function comments_get_comments
Search API
| 7.x comments.module | comments_get_comments($student_id, $bool_included_deleted = FALSE, $access_types = array()) |
| 6.x comments.module | comments_get_comments($student_id, $bool_included_deleted = FALSE, $access_types = array()) |
| 5.x comments.module | comments_get_comments($student_id, $bool_included_deleted = FALSE, $access_types = array()) |
Returns an array of comments for this student, sorted most recent first.
7 calls to comments_get_comments()
- advise.history.inc in modules/
advise/ advise.history.inc - advise_display_history in modules/
advise/ advise.history.inc - Displays the history tab on screen.
- audit.module in modules/
audit/ audit.module - This is the Audit module, which provides functionality relating to degree audits.
- audit_display_audit in modules/
audit/ audit.module - comments.module in modules/
comments/ comments.module
File
- modules/
comments/ comments.module, line 393
Code
function comments_get_comments($student_id, $bool_included_deleted = FALSE, $access_types = array()) {
$rtn = array();
$deleted_line = "AND delete_flag = 0";
if ($bool_included_deleted) {
$deleted_line = "";
}
$access_type_line = "";
// Build up the "access_type_line" for the query, based on the values
// in the access_types array.
if (count($access_types) > 0) {
$access_type_line = "AND ( ";
foreach ($access_types as $access_type) {
$access_type_line .= " access_type = '$access_type' OR";
}
// remove the last OR
$access_type_line = substr($access_type_line, 0, -2);
$access_type_line .= ")";
}
//if ($access_type == "public" || $access_type == "faculty") {
// $access_type_line = "AND access_type = '$access_type' ";
//}
$res = db_query("SELECT * FROM advising_comments
WHERE student_id = ?
$deleted_line
$access_type_line
ORDER BY posted DESC", array($student_id));
while ($cur = db_fetch_array($res)) {
$rtn [$cur ["id"]] = $cur;
}
return $rtn;
}
