當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Releases::cleanReleaseName方法代碼示例

本文整理匯總了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);
開發者ID:scriptzteam,項目名稱:newzNZB-premium-indexer,代碼行數:31,代碼來源:nzb-import.php

示例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));
開發者ID:engine9-,項目名稱:newznab-tmux,代碼行數:31,代碼來源:import.php


注:本文中的Releases::cleanReleaseName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。