ad_subjects; $adtype = $vars['entity']->adtype; if (!$adtype) { $adtype_array = array("job_offering", "job_wanted_ad", "course"); } else { $adtype_array = array($adtype); } $limit = 5; // if no subject chosen, display all if (!($chosen_subjects)) { $count = get_entities_from_metadata_and_subtypes(array("approved" => "1", "archived" => "0"), "object", $adtype_array, "", $limit, false, false, false, true); $ads = list_entities_from_metadata_and_subtypes(array("approved" => "1", "archived" => "0"), "object", $adtype_array, "", $limit, false, false, false); } else { $subject_ids = split(",", $chosen_subjects); $count = get_entities_from_metadata_and_subtypes(array("approved" => 1, "subjects" => $subject_ids, "archived" => "0"), "object", $adtype_array, "", $limit, false, false, false, true); $ads = list_entities_from_metadata_and_subtypes(array("approved" => 1, "subjects" => $subject_ids, "archived" => "0"), "object", $adtype_array, "", $limit, false, false, false); } echo $ads; if ($count > 5) { $url = $CONFIG->wwwroot . "pg/poster/index"; if ($adtype == "job_offering") { $url .= $CONFIG->wwwroot . "pg/poster/job_offers"; } else if ($adtype == "job_wanted_ad") { $url .= $CONFIG->wwwroot . "pg/poster/job_wanted_ads"; } else if ($adtype == "course") { $url = $CONFIG->wwwroot . "pg/poster/courses"; } /*translation:more...*/ echo "
"; } ?>