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


PHP SearchEngine::getMainCategories方法代碼示例

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


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

示例1: buildSearchEngineLinks

echo "</script>\n";
echo "&nbsp;&nbsp;<a href=\"#\" onclick=\"javascript:getLatest()\");\"><img src=\"images/properties.png\" width=18 height=13 title=\"Show Latest Torrents\" align=\"absmiddle\" border=0>Show Latest Torrents</a>";
echo "</form>";
echo "* Click on Torrent Links to add them to the Torrent Download List";
echo "</td>";
echo "</td><td bgcolor=\"" . $cfg["table_header_bg"] . "\" align=right valign=top>Visit: &nbsp; &nbsp;" . buildSearchEngineLinks($searchEngine) . "</td></tr>";
if (is_file('searchEngines/' . $searchEngine . 'Engine.php')) {
    include_once 'searchEngines/' . $searchEngine . 'Engine.php';
    $sEngine = new SearchEngine(serialize($cfg));
    if ($sEngine->initialized) {
        echo "<div align=center valign=top>";
        $mainStart = true;
        $catLinks = '';
        $tmpCatLinks = '';
        $tmpLen = 0;
        foreach ($sEngine->getMainCategories() as $mainId => $mainName) {
            if (strlen($tmpCatLinks) >= 500 && $mainStart == false) {
                $catLinks .= $tmpCatLinks . "<br>";
                $tmpCatLinks = '';
                $mainStart = true;
            }
            if ($mainStart == false) {
                $tmpCatLinks .= " | ";
            }
            $tmpCatLinks .= "<a href=\"torrentSearch.php?searchEngine=" . $searchEngine . "&mainGenre=" . $mainId . "\">" . $mainName . "</a>";
            $mainStart = false;
        }
        echo $catLinks . $tmpCatLinks;
        if ($mainStart == false) {
            echo "<br><br>";
        }
開發者ID:BackupTheBerlios,項目名稱:tf-b4rt-svn,代碼行數:31,代碼來源:torrentSearch.php

示例2: searchSettings


//.........這裏部分代碼省略.........
    }
    echo buildSearchEngineDDL($searchEngine, true);
    ?>
			</td>
		</tr>
		</form>
		</table>

		<table cellpadding="0" cellspacing="0" border="0" width="100%">
		<tr><td>
<?php 
    if (is_file('searchEngines/' . $searchEngine . 'Engine.php')) {
        include_once 'searchEngines/' . $searchEngine . 'Engine.php';
        $sEngine = new SearchEngine(serialize($cfg));
        if ($sEngine->initialized) {
            echo "<table width=\"100%\" border=1 bordercolor=\"" . $cfg["table_admin_border"] . "\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"" . $cfg["table_data_bg"] . "\"><tr>";
            echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\" background=\"themes/" . $cfg["theme"] . "/images/bar.gif\"><img src=\"images/properties.png\" width=18 height=13 border=0>&nbsp;&nbsp;<font class=\"title\">" . $sEngine->mainTitle . " Search Settings</font></td>";
            echo "</tr></table></td>";
            echo "<form name=\"theSearchEngineSettings\" action=\"admin.php?op=updateSearchSettings\" method=\"post\">\n";
            echo "<input type=\"hidden\" name=\"searchEngine\" value=\"" . $searchEngine . "\">";
            ?>
			</td>
		</tr>
		<tr>
			<td>

		<table cellpadding="5" cellspacing="0" border="0" width="100%">
		<tr>
			<td align="left" width="350" valign="top"><strong>Search Engine URL:</strong></td>
			<td valign="top">
				<?php 
            echo "<a href=\"http://" . $sEngine->mainURL . "\" target=\"_blank\">" . $sEngine->mainTitle . "</a>";
            ?>
			</td>
		</tr>
		<tr>
			<td align="left" width="350" valign="top"><strong>Search Module Author:</strong></td>
			<td valign="top">
				<?php 
            echo $sEngine->author;
            ?>
			</td>
		</tr>
		<tr>
			<td align="left" width="350" valign="top"><strong>Version:</strong></td>
			<td valign="top">
				<?php 
            echo $sEngine->version;
            ?>
			</td>
		</tr>
<?php 
            if (strlen($sEngine->updateURL) > 0) {
                ?>
		<tr>
			<td align="left" width="350" valign="top"><strong>Update Location:</strong></td>
			<td valign="top">
				<?php 
                echo "<a href=\"" . $sEngine->updateURL . "\" target=\"_blank\">Check for Update</a>";
                ?>
			</td>
		</tr>
<?php 
            }
            if (!$sEngine->catFilterName == '') {
                ?>
		<tr>
			<td align="left" width="350" valign="top"><strong>Search Filter:</strong><br>
			Select the items that you DO NOT want to show in the torrent search:
			</td>
			<td valign="top">
<?php 
                echo "<select multiple name=\"" . $sEngine->catFilterName . "[]\" size=\"8\" STYLE=\"width: 125px\">";
                echo "<option value=\"\">[NO FILTER]</option>";
                foreach ($sEngine->getMainCategories(false) as $mainId => $mainName) {
                    echo "<option value=\"" . $mainId . "\" ";
                    if (@in_array($mainId, $sEngine->catFilter)) {
                        echo " selected";
                    }
                    echo ">" . $mainName . "</option>";
                }
                echo "</select>";
                echo "\t\t\t  </td>\n";
                echo "\t\t  </tr>\n";
            }
        }
    }
    ?>
	</table>
		</td></tr></table>
			<br
			<input type="Submit" value="Update Settings">
			</form>
			</div>
			<br>
		</td></tr>
	</table></div>
<?php 
    DisplayFoot(true, true);
}
開發者ID:BackupTheBerlios,項目名稱:tf-b4rt-svn,代碼行數:101,代碼來源:admin.php


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