1) { $channel = Channel::from_username(argv(1)); if (!$channel) { killme(); } } header("Content-type: application/opensearchdescription+xml"); if($channel) { $html = replace_macros(Theme::get_template('opensearch.tpl'), [ '$project' => xmlify($channel['channel_address'] . '@' . App::get_hostname()), '$search_project' => xmlify(t('Search $Projectname') . '|' . $channel['channel_address'] . '@' . App::get_hostname()), '$searchurl' => xmlify(zid(z_root() . '/search/' . $channel['channel_address'] . '?search={searchTerms}')), '$aptype' => xmlify('application/ld+json; profile="https://www.w3.org/ns/activitystreams"'), '$photo' => xmlify($channel['xchan_photo_s']), ]); } else { $html = replace_macros(Theme::get_template('opensearch.tpl'), [ '$project' => xmlify(App::get_hostname()), '$search_project' => xmlify(t('Search $Projectname') . '|' . App::get_hostname()), '$searchurl' => xmlify(zid(z_root() . '/search?search={searchTerms}')), '$aptype' => xmlify('application/ld+json; profile="https://www.w3.org/ns/activitystreams"'), '$photo' => xmlify($icon), ]); } echo $html; killme(); } }