本文整理匯總了PHP中Posts::getPostTitleById方法的典型用法代碼示例。如果您正苦於以下問題:PHP Posts::getPostTitleById方法的具體用法?PHP Posts::getPostTitleById怎麽用?PHP Posts::getPostTitleById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Posts
的用法示例。
在下文中一共展示了Posts::getPostTitleById方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: makeSiteTitle
function makeSiteTitle()
{
if (URI::checkPage() == 'Home') {
return strip_tags(getSiteTitle());
} elseif (URI::checkPage() == '404') {
return strip_tags('404 - Not Found' . ' - ' . getSiteTitle());
} elseif (URI::checkPage() == 'Single' || URI::checkPage() == 'Page') {
return strip_tags(Posts::getPostTitleById(URI::getParams_single()['id'])) . ' - ' . getSiteTitle();
} elseif (URI::checkPage() == 'news.php') {
return strip_tags('News Archive' . ' - ' . getSiteTitle());
} elseif (URI::checkPage() == 'search.php') {
return strip_tags('Search' . ' - ' . getSiteTitle());
} elseif (URI::checkPage() == 'docs.php') {
return strip_tags('Documentation' . ' - ' . getSiteTitle());
} else {
return getSiteTitle();
}
}
示例2: while
</tr>
<?php
while ($row = $res->fetch_assoc()) {
if (isset($row['user_id'])) {
$user = Users::getUserById($row['user_id']);
}
if ($row['status'] == 'Trashed') {
$status = _e('trashed', '', '', true);
$statcolor = "style='text-align: center; color: red;'";
$t_button = "<a href='?switch=comments&sub=clean_comment&id=" . $row['ID'] . "'>" . _e('clean', '', '', true) . "</a>";
} else {
$status = _e('published', '', '', true);
$statcolor = "style='text-align: center;'";
$t_button = "<a href='?switch=comments&sub=trash_comment&id=" . $row['ID'] . "'>" . _e('trash', '', '', true) . "</a>";
}
echo "<tr><td style='text-align: center; vertical-align: middle;'>" . $row['ID'] . "</td><td style='text-align: center; vertical-align: middle;'><a href='?switch=users&sub=edit_user&id=" . $row['user_id'] . "'>" . $user['username'] . "</a></td><td>" . $row['content'] . "</td><td>" . Posts::getPostTitleById($row['post_id']) . "</td><td " . $statcolor . ">" . $status . "<br>" . "<span style='text-align: center;'><a onclick=\"return confirm('Are you sure?');\" href='?switch=comments&sub=delete_comment&id=" . $row['ID'] . "'>" . _e('delete', '', '', true) . "</a></span>" . "<br>" . "<span style='text-align: center;'>" . $t_button . "</span></td><td style='text-align: center; vertical-align: middle;'>" . addZerosToShow(LBDP($row['date'])) . "</td></tr>";
}
$res->free();
?>
</table>
<?php
$home = "?switch=users&sub=edit_user";
?>
<script>
function gotoEdit(ref)
{
var id = ref.id;
window.location.assign("<?php
echo $home;
?>
&id=" + id);