function content_get_content_for_faculty_id
Search API
7.x content.module | content_get_content_for_faculty_id($content_type, $faculty_id, $order_by = "title ASC", $bool_published_only = TRUE) |
6.x content.module | content_get_content_for_faculty_id($content_type, $faculty_id, $order_by = "title ASC", $bool_published_only = TRUE) |
This function will look for content (in the content tables) for a field called field__faculty_id, and return an array of fully loaded content objects.
4 calls to content_get_content_for_faculty_id()
- calendar_display_schedule_appointment_page in modules/
calendar/ calendar.module - This is the page which lets students schedule an appointment with the faculty member supplied in the user_id.
- calendar_display_schedule_staff_page in modules/
calendar/ calendar.module - This page (primarily meant for students) is for quickly finding your advisor or professor or whomever, and finding their link to schedule an appointment with them.
- calendar_display_user_appointment_settings_page in modules/
calendar/ calendar.module - This page is where the user can configure their various appointment settings (like when they offer them)
- calendar_get_available_faculty_schedule in modules/
calendar/ calendar.module - Returns back an array of time slots available for this faculty member and event_type
File
- modules/
content/ content.module, line 2072
Code
function content_get_content_for_faculty_id($content_type, $faculty_id, $order_by = "title ASC", $bool_published_only = TRUE) {
$rtn = array();
$published_line = " AND n.published = 1 ";
if (!$bool_published_only) {
$published_line = "";
}
// Display all of the event types for this faculty member.
$res = db_query("SELECT DISTINCT(a.cid) FROM content__$content_type a, content n
WHERE field__faculty_id = ?
AND a.vid = n.vid
AND a.cid = n.cid
AND n.delete_flag = 0
$published_line
ORDER BY $order_by, a.vid DESC", array($faculty_id));
while ($cur = db_fetch_object($res)) {
$cid = $cur->cid;
$content = content_load($cid);
$rtn [$cid] = $content;
}
return $rtn;
}