本文整理匯總了PHP中TPage::countPageByTitle方法的典型用法代碼示例。如果您正苦於以下問題:PHP TPage::countPageByTitle方法的具體用法?PHP TPage::countPageByTitle怎麽用?PHP TPage::countPageByTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TPage
的用法示例。
在下文中一共展示了TPage::countPageByTitle方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
<option value='sub'<?php
echo isset($search_type) && $search_type == 'sub' ? " selected" : '';
?>
>substring search</option>
</select>
<input type="submit" value="view page">
</form>
<?php
if (isset($page_title)) {
if (isset($search_type) && $search_type == 'sub') {
$page_title = "%{$page_title}%";
}
$limit_request = 100;
Piwidict::setLimitRequest($limit_request);
$tpage = new TPage();
$total_num = $tpage->countPageByTitle($page_title);
$pageObj_arr = $tpage->getByTitle($page_title);
if ($pageObj_arr == NULL) {
print "<p>The word has not founded.</p>\n";
} else {
if ($total_num > 1) {
print "<p>There are founded {$total_num} words.</p>\n";
if ($limit_request > 0 && $limit_request < $total_num) {
print "Restriction on the search for a maximum of {$limit_request} records";
}
//ограничение на поиск не более 100 записей
}
if (is_array($pageObj_arr)) {
foreach ($pageObj_arr as $pageObj) {
print "<h2 title=\"TPage->page_title\" style=\"color: #006a4e\">" . $pageObj->getPageTitle() . "</h2>\n" . "<p>Source page at " . TPage::getURLWithLinkText($pageObj->getPageTitle()) . "</p>";
$lang_pos_arr = $pageObj->getLangPOS();