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