本文整理汇总了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();