adtype; if (!$adtype) { $adtype_array = array("job_offering", "job_wanted_ad", "course"); } else { $adtype_array = array($adtype); } $adstate = $vars['entity']->adstate; if ($adstate == "published") $adstate = "1"; if ($adstate == "pending") $adstate = "0"; if (!$adstate) { $count = get_entities_from_metadata_and_subtypes("", "object", $adtype_array, $owner->getGUID(), $limit, false, false, false, true); $ads = list_entities_from_metadata_and_subtypes("", "object", $adtype_array, $owner->getGUID(), $limit, false, false, false); } else { $count = get_entities_from_metadata_and_subtypes(array("approved" => $adstate), "object", $adtype_array, $owner->getGUID(), $limit, false, false, false, true); $ads = list_entities_from_metadata_and_subtypes(array("approved" => $adstate), "object", $adtype_array, $owner->getGUID(), $limit, false, false, false); } echo $ads; if ($count > 5) { $url = $CONFIG->wwwroot . "pg/poster/my_ads?filter=" . $adtype; /*translation:more...*/ echo "
"; } ?>