本文整理汇总了PHP中post::get_post_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP post::get_post_by_id方法的具体用法?PHP post::get_post_by_id怎么用?PHP post::get_post_by_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类post
的用法示例。
在下文中一共展示了post::get_post_by_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlentities
</div>
<?php
} else {
if (count($post) > post_per_page) {
?>
<div class='next-page'>
<div style='float: right;'>
<button class='button' onclick='location.href="./index.php?order='.post_per_page.'"'>NEXT PAGE</button>
</div>
</div>
<?php
}
}
}
} else {
$post_id = $post_inst->get_post_by_id($db, $_GET['id']);
if ($post_id) {
?>
<title><?php
echo htmlentities($post_id['Title'] . " - " . $title['Value']);
?>
</title>
<div class="formhead post-id post-id-font">
<?php
echo htmlentities($post_id['Title']);
?>
<div class='post-head-view'>
[ <?php
echo $post_id['View'];
?>
ViEWS ]
示例2: elseif
if (isset($_GET['edit-post']) && !empty($_GET['edit-post'])) {
if (isset($_POST['submit-edit-post']) && !empty($_POST['submit-edit-post']) && $admcl->check_key_from_id($db, $id, $_POST['auth_key'])) {
$ret = $post->update_post($db, $_GET['edit-post'], $_POST['edit_post_title'], $_POST['edit_post_content']);
if ($ret) {
if (isset($_GET['return']) && $_GET['return'] == 'main') {
$htmlinst->change_location('./index.php');
} elseif (isset($_GET['return']) && $_GET['return'] == 'mainid') {
$htmlinst->change_location('./index.php?id=' . htmlentities($_GET['edit-post']));
} else {
$htmlinst->admin_inform_ok_url(array('P0ST SUCCESSFULLY UPDATED!'), 'G0 BACK', '?list-post');
}
} else {
$htmlinst->error_admin_url(array('P0ST UPDATE FAiLED', 'TRY AGAiN'), 'G0 BACK', '?list-post');
}
} else {
$r_post = $post->get_post_by_id($db, $_GET['edit-post']);
?>
<form method='post'>
<div class="formhead post-box post-head">EDiT P0ST</div>
<div class="formwrap post-title">
<input type='text' name='edit_post_title' value='<?php
echo htmlentities($r_post['Title']);
?>
' id='title-new-post' class='post-title-box' />
</div>
<div class="formwrap post-box">
<textarea onkeydown="return insertTab(event,this);"
onkeyup="return insertTab(event,this);"
onkeypress="return insertTab(event,this);"
name='edit_post_content' id='textarea-new-post' class='textarea'><?php
echo htmlentities($r_post['Value']);