本文整理汇总了PHP中HtmlPage::addHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlPage::addHTML方法的具体用法?PHP HtmlPage::addHTML怎么用?PHP HtmlPage::addHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlPage
的用法示例。
在下文中一共展示了HtmlPage::addHTML方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$datetime = DateTime::createFromFormat('YmdHis', $l1['rev_timestamp']);
$dateform = $datetime->format('Y-m-d H:i');
$dateraw = $datetime->format('Ymd');
if (isset($par['since']) && $par['since'] != '0000-00-00') {
$timestamp = str_replace('-', '', $par['since']);
if ($dateraw < $timestamp) {
continue;
}
}
if (isset($par['until']) && $par['until'] != '0000-00-00') {
$timestamp = str_replace('-', '', $par['until']);
if ($dateraw > $timestamp) {
continue;
}
}
$page->addHTML('* [[Special:PermaLink/' . $l1['rev_id'] . '|' . $dateform . ']]');
$page->addHTML(' . . [[User:' . $l1['rev_user_text'] . '|' . $l1['rev_user_text'] . ']]');
if (isset($l1['rev_comment']) && $l1['rev_comment'] != '') {
$comment = $l1['rev_comment'];
$comment = str_replace('[[', '[[:', $comment);
$comment = preg_replace('/\\{\\{(.+)\\}\\}/', '<nowiki>{{$1}}}</nowiki>', $comment);
$comment = preg_replace('/\\/\\*\\s(.+)\\s\\*\\//', '[[Special:PermaLink/' . $l1['rev_id'] . '#$1|→]]$1:', $comment);
$page->addHTML(' \'\'(' . $comment . ')\'\' ');
}
$page->addHTML('<br />');
}
$page->closeBlock();
}
$q1->close();
$page->closeBlock();
}
示例2: HtmlPage
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require_once '/data/project/hgztools/public_html/general.php';
// create new page object
$page = new HtmlPage('Useless protections');
// create new database object
$db = new Database();
// create new request validator
$rq = new RequestValidator();
// get parameters
$rq->addAllowed('GET', 'lang', '', '/^[a-z]{1,7}$/', true);
$rq->addAllowed('GET', 'project', '', '/^[a-z]{1,15}$/', true);
$par = $rq->getParams();
$page->openBlock('div', 'iw-content');
$page->openBlock('p');
$page->addHTML('This tool shows pages that meet the following criteria:');
$page->openBlock('ol');
$page->addInline('li', 'The page is protected from moves through non-autoconfirmed users');
$page->addInline('li', 'The page is not protected from editing through non-autoconfirmed users or sysops');
$page->closeBlock();
$page->addHTML('In most wikis, the autoconfirmed right is required for moving pages, so a single move protection for non-autoconfirmed users will never be effective.');
$page->closeBlock();
$page->addInline('h2', 'Options');
$optionForm = new HtmlForm('index.php', 'GET');
$optionForm->addHTML('<table class="iw-nostyle">');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('lang', 'Language');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('lang', $par['lang'], 'Language code of the project, e.g. de', 7, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td>');