1 Star 3 Fork 2

mojie126/HDCN-PT

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
opensearch.php 2.27 KB
一键复制 编辑 原始数据 按行查看 历史
mojie126 提交于 2015-12-05 12:05 . 无主题
<?php
require "include/bittorrent.php";
dbconn();
function data_url($file, $mime) {
$contents = file_get_contents($file);
$base64 = base64_encode($contents);
return ('data:' . $mime . ';base64,' . $base64);
}
$url = get_protocol_prefix() . $BASEURL;
$year = substr($datefounded, 0, 4);
$yearfounded = ($year ? $year : 2014);
$attribution = "Copyright (c) " . $SITENAME . " " . (date("Y") != $yearfounded ? $yearfounded . "-" : "") . date("Y") . ", all rights reserved";
header("Content-type: text/xml");
$Cache->new_page('opensearch_description', 86400);
if (!$Cache->get_page()) {
$Cache->add_whole_row();
print("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName><?= $SITENAME ?> Torrents</ShortName>
<Description>Search Torrents at <?= $SITENAME ?> - <?= htmlspecialchars($SLOGAN) ?>.</Description>
<Url type="text/html"
rel="results"
pageOffset="0"
template="<?= $url ?>/torrents.php?search={searchTerms}&amp;page={startPage?}" />
<Url type="application/rss+xml"
rel="results"
indexOffset="0"
template="<?= $url ?>/torrentrss.php?search={searchTerms}&amp;rows={count?}&amp;startindex={startIndex?}" />
<Url type="application/opensearchdescription+xml"
rel="self"
template="<?= $url ?>/opensearch.php" />
<Url type="application/x-suggestions+json"
rel="suggestions"
template="<?= $url ?>/searchsuggest.php?q={searchTerms}" />
<Contact><?= $SITEEMAIL ?></Contact>
<Tags>Torrents <?= PROJECTNAME ?></Tags>
<LongName><?= $SITENAME ?> Torrents Search</LongName>
<Image height="32" width="32" type="image/x-icon"><?= data_url('favicon.ico', 'image/x-icon') ?></Image>
<Image height="32" width="32" type="image/x-icon"><?= $url ?>/favicon.ico</Image>
<moz:SearchForm><?= $url ?>/torrents.php</moz:SearchForm>
<Query role="example" searchTerms="batman" />
<Developer><?= $SITENAME ?> Staff</Developer>
<Attribution><?= $attribution ?></Attribution>
<SyndicationRight>limited</SyndicationRight>
<Language>*</Language>
<InputEncoding>UTF-8</InputEncoding>
<OutputEncoding>UTF-8</OutputEncoding>
</OpenSearchDescription>
<?php
$Cache->end_whole_row();
$Cache->cache_page();
}
echo $Cache->next_row();
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/mojie126/HDCN-PT.git
git@gitee.com:mojie126/HDCN-PT.git
mojie126
HDCN-PT
HDCN-PT
master

搜索帮助