本文整理汇总了PHP中cache::create_page_cache方法的典型用法代码示例。如果您正苦于以下问题:PHP cache::create_page_cache方法的具体用法?PHP cache::create_page_cache怎么用?PHP cache::create_page_cache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cache
的用法示例。
在下文中一共展示了cache::create_page_cache方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
$id = $db->real_escape_string($_GET['id']);
if (!is_numeric($id)) {
$id = str_replace("#", "", $id);
}
$id = (int) $id;
$date = date("Ymd");
//Load post_table data and the previous next values in array. 0 previous, 1 next.
$post_data = $post->show($id);
//Check if data exists in array, if so, kinda ignore it.
if ($post_data == "" || is_null($post_data)) {
header('Location: index.php?page=post&s=list');
exit;
}
$prev_next = $post->prev_next($id);
if (!is_dir("{$main_cache_dir}" . "" . "\\cache/{$id}")) {
$cache->create_page_cache("cache/{$id}");
}
$data = $cache->load("cache/" . $id . "/post.cache");
if ($data !== false) {
echo str_replace("f6ca1c7d5d00a2a3fb4ea2f7edfa0f96a6d09c11717f39facabad2d724f16fbb", $domain, $data);
flush();
$tcount = 1;
} else {
ob_start();
$tags = mb_trim(html_entity_decode($post_data['tags'], ENT_QUOTES, "UTF-8"));
$ttags = explode(" ", $tags);
$rating = $post_data['rating'];
$lozerisdumb = "- " . str_replace('_', ' ', str_replace('"', '\\"', $tags));
$pg = "post";
require "includes/header.php";
echo '<div id="content"><div id="post-view">';
示例2: header
if (is_dir("{$main_cache_dir}" . "" . "cache/" . $next_id) && "{$main_cache_dir}" . "" . "cache/" . $next_id != "{$main_cache_dir}" . "" . "cache/") {
$cache->destroy_page_cache("cache/" . $next_id);
}
header("Location:../index.php?page=post&s=list");
} else {
header("Location:../index.php?page=post&s=view&id={$id}");
}
} else {
if (isset($_GET['removecomment']) && $_GET['removecomment'] == 1) {
$permission = $user->gotpermission('delete_comments');
if ($permission == true) {
$post_id = $db->real_escape_string($_GET['post_id']);
$query = "SELECT * FROM {$comment_table} WHERE id='{$id}' LIMIT 1";
$result = $db->query($query);
if ($result->num_rows == "1") {
$query = "DELETE FROM {$comment_table} WHERE id='{$id}'";
$db->query($query);
$query = "DELETE FROM {$comment_vote_table} WHERE comment_id='{$id}'";
$db->query($query);
$query = "UPDATE {$post_count_table} SET pcount=pcount-1 WHERE access_key = 'comment_count'";
$db->query($query);
}
$cache = new cache();
$cache->destroy_page_cache("cache/" . $post_id);
$cache->create_page_cache("cache/" . $post_id);
}
header("Location:../index.php?page=post&s=view&id={$post_id}");
}
}
}
}
示例3: header
if (!$user->check_log() && !$anon_report) {
header('Location: index.php?page=account&s=home');
exit;
}
if (isset($_GET['type']) && $_GET['type'] != "" && isset($_GET['rid']) && is_numeric($_GET['rid'])) {
$type = $db->real_escape_string($_GET['type']);
$rid = $db->real_escape_string($_GET['rid']);
if ($type == "comment") {
$query = "UPDATE {$comment_table} SET spam=TRUE WHERE id='{$rid}'";
if ($db->query($query)) {
$cache = new cache();
$query = "SELECT post_id FROM {$comment_table} where id='{$rid}'";
$result = $db->query($query);
$row = $result->fetch_assoc();
$cache->destroy_page_cache("cache/" . $row['post_id']);
$cache->create_page_cache("cache/" . $row['post_id']);
print "pass";
} else {
print "fail";
}
} else {
if ($type == "post") {
$user = new user();
if (!$user->check_log()) {
header("Location: ../index.php?page=post&s=view&id={$rid}");
exit;
}
$reason = $db->real_escape_string(htmlentities($_POST['reason'], ENT_QUOTES, 'UTF-8'));
if (strlen($reason) > 0) {
$query = "UPDATE {$post_table} SET spam=TRUE, reason='{$reason}' WHERE id='{$rid}'";
$db->query($query);
示例4: cache
$cache = new cache();
$cache->destroy_page_cache("cache/" . $id);
$cache->create_page_cache("cache/" . $id);
header("Location:index.php?page=post&s=view&id={$id}");
} else {
if (isset($_GET['s']) && isset($_GET['cid']) && is_numeric($_GET['cid']) && isset($_GET['vote'])) {
$vote = $_GET['vote'];
$id = $_GET['post_id'];
$cid = $_GET['cid'];
if ($user == "Anonymous" && !$anon_vote) {
header('Location: index.php?page=account&s=home');
exit;
}
$cache = new cache();
@$cache->destroy_page_cache("cache/" . $id);
@$cache->create_page_cache("cache/" . $id);
$comment->vote($cid, $vote, $user, $id, $user_id);
} else {
if (isset($_GET['s']) && $_GET['s'] === "view" && isset($_GET['cid']) && is_numeric($_GET['cid'])) {
header("Cache-Control: store, cache");
header("Pragma: cache");
require "includes/header.php";
$cid = $db->real_escape_string($_GET['cid']);
$query = "SELECT post_id, comment, user, posted_at, score FROM {$comment_table} WHERE id='{$cid}'";
$result = $db->query($query);
$row = $result->fetch_assoc();
echo '<a href="index.php?page=post&s=view&id=' . $row['post_id'] . '">' . $row['post_id'] . '</a> ' . $misc->swap_bbs_tags($misc->linebreaks($misc->short_url(htmlentities($row['comment'], ENT_QUOTES, "UTF-8")))) . ' ' . $row['user'] . ' ' . $row['posted_at'] . ' ' . $row['score'];
$result->free_result();
}
}
}