代码拉取完成,页面将自动刷新
同步操作将从 jink2005/AISTeam 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
require("init.php");
$action = getArrayVal($_GET, "action");
$project = getArrayVal($_GET, "project");
$query = getArrayVal($_GET, "query");
$query = urldecode($query);
$strlim = 19;
$such = (object) new search();
if ($action == "search")
{
$result = $such->dosearch($query);
if (!empty($result))
{
$finresult = $such->limitResult($result, $userid);
$num = count($finresult);
$template->assign("result", $finresult);
}
else
{
$num = 0;
}
$template->assign("title", $langfile["results"]);
$template->assign("num", $num);
$template->display("search.tpl");
} elseif ($action == "projectsearch")
{
$result = $such->dosearch($query, $project);
$num = count($result);
$template->assign("num", $num);
$template->assign("title", $langfile["results"]);
$template->assign("result", $result);
$template->display("search.tpl");
} elseif ($action == "ajaxsearch")
{
$query = getArrayVal($_POST, "query");
$result = $such->dosearch($query);
if (!empty($result))
{
$finresult = $such->limitResult($result, $userid);
}
if (!empty($finresult))
{
echo "<ul>";
foreach($finresult as $res)
{
if (!empty($res))
{
if ($res["type"] == "file")
{
if (strlen($res["name"]) > $strlim)
{
$res["name"] = substr($res["name"], 0, $strlim);
}
echo "<li><img src = \"templates/$settings[template]/images/files/$res[ftype].png\">$res[name]</li>";
} elseif ($res["type"] != "task" and $res["type"] != "message")
{
if (strlen($res["name"]) > $strlim)
{
$res["name"] = substr($res["name"], 0, $strlim);
}
// style = \"list-style-image: url(templates/standard/img/symbols/$res[icon]);\"
echo "<li><img src = \"templates/$settings[template]/images/symbols/$res[icon]\">$res[name]</li>";
}
else
{
if (strlen($res["title"]) > $strlim)
{
$res["title"] = substr($res["title"], 0, $strlim);
}
// style = \"list-style-image: url(templates/standard/img/symbols/$res[icon]);\"
echo "<li><img src = \"templates/$settings[template]/images/symbols/$res[icon]\" >$res[title]</li>";
}
}
}
}
else
{
echo "<li></li>";
}
echo "</ul>";
// echo "<ul><li>$query</li></ul>";
} elseif ($action == "ajaxsearch-p")
{
$query = getArrayVal($_POST, "query");
$result = $such->dosearch($query, $project);
if (!empty($result))
{
echo "<ul>";
foreach($result as $res)
{
if (!empty($res))
{
if ($res["type"] == "file")
{
if (strlen($res["name"]) > $strlim)
{
$res["name"] = substr($res["name"], 0, $strlim);
}
echo "<li><img src = \"templates/$settings[template]/images/files/$res[ftype].png\">$res[name]</li>";
} elseif ($res["type"] != "task" and $res["type"] != "message")
{
if (strlen($res["name"]) > $strlim)
{
$res["name"] = substr($res["name"], 0, $strlim);
}
// style = \"list-style-image: url(templates/standard/img/symbols/$res[icon]);\"
echo "<li><img src = \"templates/$settings[template]/images/symbols/$res[icon]\">$res[name]</li>";
}
else
{
if (strlen($res["title"]) > $strlim)
{
$res["title"] = substr($res["title"], 0, $strlim);
}
// style = \"list-style-image: url(templates/standard/img/symbols/$res[icon]);\"
echo "<li><img src = \"templates/$settings[template]/images/symbols/$res[icon]\" >$res[title]</li>";
}
}
}
}
else
{
echo "<li></li>";
}
echo "</ul>";
} elseif ($action == "searchjson")
{
$result = $such->dosearch($query);
if (!empty($result))
{
$finresult = $such->limitResult($result, $userid);
}
if (!empty($finresult))
{
$json = "[\"$query\",[";
foreach($finresult as $res)
{
if (isset($res["name"]))
{
$json .= "\"$res[name]\",";
} elseif (isset($res["title"]))
{
$json .= "\"$res[title]\",";
}
}
$json = substr($json, 0, strlen($json)-1);
$json .= "]]";
echo $json;
}
} elseif ($action == "searchjson-project")
{
$result = $such->dosearch($query, $project);
if (!empty($result))
{
$json = "[\"$query\",[";
foreach($result as $res)
{
if (isset($res["name"]))
{
$json .= "\"$res[name]\",";
} elseif (isset($res["title"]))
{
$json .= "\"$res[title]\",";
}
}
$json = substr($json, 0, strlen($json)-1);
$json .= "]]";
echo $json;
}
}
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。