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


PHP SearchEngine::getLatest方法代碼示例

本文整理匯總了PHP中SearchEngine::getLatest方法的典型用法代碼示例。如果您正苦於以下問題:PHP SearchEngine::getLatest方法的具體用法?PHP SearchEngine::getLatest怎麽用?PHP SearchEngine::getLatest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SearchEngine的用法示例。


在下文中一共展示了SearchEngine::getLatest方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

             echo "<td colspan=6><form method=get id=\"subLatest\" name=\"subLatest\" action=torrentSearch.php?>";
             echo "<input type=hidden name=\"searchEngine\" value=\"" . $searchEngine . "\">";
             $mainGenreName = $sEngine->GetMainCatName($mainGenre);
             echo "Category: <b>" . $mainGenreName . "</a></b> -> ";
             echo "<select name=subGenre>";
             foreach ($subCats as $subId => $subName) {
                 echo "<option value=" . $subId . ">" . $subName . "</option>\n";
             }
             echo "</select> ";
             echo "<input type=submit value='Show Latest'>";
             echo "</form>\n";
         } else {
             echo "</td></tr></table></div>";
             // Set the Sub to equal the main for groups that don't have subs.
             $_REQUEST["subGenre"] = $mainGenre;
             echo $sEngine->getLatest();
         }
     } else {
         echo "</td></tr></table></div>";
         if (array_key_exists("LATEST", $_REQUEST) && $_REQUEST["LATEST"] == "1") {
             echo $sEngine->getLatest();
         } else {
             echo $sEngine->performSearch($searchterm);
         }
     }
 } else {
     // there was an error connecting
     echo "</td></tr>";
     echo "<tr><td><br><br><div align=center><strong>" . $sEngine->msg . "</strong></div><br><br></td></tr>";
     echo "</table></div>";
 }
開發者ID:BackupTheBerlios,項目名稱:tf-b4rt-svn,代碼行數:31,代碼來源:torrentSearch.php

示例2: array

    } else {
        // Search Engine ready to go
        $mainStart = true;
        $catLinks = '';
        $tmpCatLinks = '';
        $tmpLen = 0;
        $link_list = array();
        foreach ($sEngine->getMainCategories() as $mainId => $mainName) {
            array_push($link_list, array('searchEngine' => $searchEngine, 'mainId' => $mainId, 'mainName' => $mainName));
        }
        $tmpl->setloop('link_list', $link_list);
        $mainGenre = tfb_getRequestVar('mainGenre');
        $subCats = $sEngine->getSubCategories($mainGenre);
        if (empty($mainGenre) && array_key_exists("subGenre", $_REQUEST) || count($subCats) <= 0) {
            $tmpl->setvar('no_genre', 1);
            $tmpl->setvar('performSearch', array_key_exists("LATEST", $_REQUEST) && $_REQUEST["LATEST"] == "1" ? $sEngine->getLatest() : $sEngine->performSearch($searchterm));
        } else {
            $mainGenreName = $sEngine->GetMainCatName($mainGenre);
            $tmpl->setvar('mainGenreName', $mainGenreName);
            $list_cats = array();
            foreach ($subCats as $subId => $subName) {
                array_push($list_cats, array('subId' => $subId, 'subName' => $subName));
            }
            $tmpl->setloop('list_cats', $list_cats);
        }
    }
}
//
$tmpl->setvar('_SEARCH', $cfg['_SEARCH']);
//
tmplSetTitleBar("Torrent " . $cfg['_SEARCH']);
開發者ID:BackupTheBerlios,項目名稱:tf-b4rt-svn,代碼行數:31,代碼來源:torrentSearch.php


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