getSubtype() == "disctopic" && $entity->canEdit()) { if (get_input("frontpage")) { // get previous frontpage topic and remove from frontpage $frontpage_topic = get_entities_from_metadata("frontpage", "1", "object", "disctopic"); foreach ($frontpage_topic as $topic) { $topic->frontpage = 0; $topic->save(); } // add chosen topic to frontpage $entity->frontpage = 1; $entity->save(); forward($CONFIG->wwwroot . "pg/info"); } else { $entity->frontpage = 0; $entity->save(); forward($CONFIG->wwwroot . "pg/info"); } } forward($CONFIG->wwwroot . "pg/discussions/read/" . $guid); ?>