本文整理汇总了PHP中Releases::cleanReleaseName方法的典型用法代码示例。如果您正苦于以下问题:PHP Releases::cleanReleaseName方法的具体用法?PHP Releases::cleanReleaseName怎么用?PHP Releases::cleanReleaseName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Releases
的用法示例。
在下文中一共展示了Releases::cleanReleaseName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
} else {
$groupID = -1;
foreach ($nzbInfo->groups as $group) {
$group = (string) $group;
if (array_key_exists($group, $siteGroups)) {
$groupID = $siteGroups[$group];
$groupName = $group;
break;
}
}
if ($groupID == -1) {
$retval .= "Missing Group for NZB : " . $browserpostednames[$nzbFile] . " - " . join(", ", $nzbInfo->groups) . "<br/>";
continue;
}
$relguid = md5(uniqid());
$name = $releases->cleanReleaseName(str_replace(".nzb", "", $browserpostednames[$nzbFile]));
$catId = $cat->determineCategory($groupName, $name);
$relid = $releases->insertRelease($name, $nzbInfo->filecount, $groupID, $relguid, $catId, "", date("Y-m-d H:i:s", $nzbInfo->postedlast), $nzbInfo->poster, "", $page->site);
$db->exec(sprintf("update releases set totalpart = %d, size = %s, completion = %d, GID=%s where ID = %d", $nzbInfo->filecount, $nzbInfo->filesize, $nzbInfo->completion, $db->escapeString($nzbInfo->gid), $relid));
$nzbfilename = $nzb->getNZBPath($relguid, $page->site->nzbpath, true);
$fp = _gzopen($nzbfilename, "w");
if ($fp) {
gzwrite($fp, $nzbInfo->toNzb());
gzclose($fp);
$retval .= sprintf(" Imported %s<br/>", $name);
}
}
}
}
}
$page->smarty->assign('output', $retval);
示例2: sprintf
if ($groupID == -1) {
echo sprintf("%0" . $digits . "d %.2f%% Error : Missing group %s - Group(%s)\n", $items - $num, $num / $items * 100, $nzbFile, str_replace("alt.binaries.", "a.b.", implode(",", $nzbInfo->groups)));
if ($movefiles) {
if (!file_exists($nogrouppath)) {
mkdir($nogrouppath);
}
if (!file_exists($nogrouppath . basename($nzbFile))) {
rename($nzbFile, $nogrouppath . basename($nzbFile));
}
$missinggroups = array_merge($missinggroups, $nzbInfo->groups);
}
continue;
} else {
if ($usefilename) {
$relguid = md5(uniqid());
$name = $releases->cleanReleaseName(str_replace(".nzb", "", basename($nzbFile)));
$catId = $cat->determineCategory($groupName, $name);
$relid = $releases->insertRelease($name, $nzbInfo->filecount, $groupID, $relguid, $catId, "", date("Y-m-d H:i:s", $nzbInfo->postedlast), $nzbInfo->poster, "", $page->settings);
$db->queryExec(sprintf("update releases set totalpart = %d, size = %s, completion = %d, GID=%s where id = %d", $nzbInfo->filecount, $nzbInfo->filesize, $nzbInfo->completion, $db->escapeString($nzbInfo->gid), $relid));
$nzbfilename = $nzb->getNZBPath($relguid, $page->settings->getSetting('nzbpath'), true);
$fp = gzopen($nzbfilename, "w");
if ($fp) {
gzwrite($fp, $nzbInfo->toNzb());
gzclose($fp);
echo sprintf("%0" . $digits . "d %.2f%% Imported %s\n", $items - $num, $num / $items * 100, $name);
if ($movefiles) {
if (!file_exists($importedpath)) {
mkdir($importedpath);
}
if (!file_exists($importedpath . basename($nzbFile))) {
rename($nzbFile, $importedpath . basename($nzbFile));