本文整理汇总了PHP中POD::queryRow方法的典型用法代码示例。如果您正苦于以下问题:PHP POD::queryRow方法的具体用法?PHP POD::queryRow怎么用?PHP POD::queryRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类POD
的用法示例。
在下文中一共展示了POD::queryRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getKeylogByTitle
function getKeylogByTitle($blogid, $title)
{
global $database;
$title = POD::escapeString($title);
$visibility = doesHaveOwnership() ? '' : 'AND visibility > 0';
return POD::queryRow("SELECT * \n\t\t\tFROM {$database['prefix']}Entries \n\t\t\tWHERE blogid = {$blogid} \n\t\t\t\tAND draft = 0 {$visibility} \n\t\t\t\tAND category = -1 \n\t\t\t\tAND title = '{$title}' \n\t\t\tORDER BY published DESC");
}
示例2: queryRowWithDBCache
public static function queryRowWithDBCache($query, $prefix = null, $type = 'both', $count = -1)
{
$cache = queryCache::getInstance();
$cache->reset($query, $prefix);
if (!$cache->load()) {
$cache->contents = POD::queryRow($query, $type, $count);
$cache->update();
}
return $cache->contents;
}
示例3: EAS_Call
function EAS_Call($type, $name, $title, $url, $content)
{
global $hostURL, $blogURL, $database;
$blogstr = $hostURL . $blogURL;
$rpc = new XMLRPC();
$rpc->url = 'http://antispam.eolin.com/RPC/index.php';
if ($rpc->call('checkSpam', $blogstr, $type, $name, $title, $url, $content, $_SERVER['REMOTE_ADDR']) == false) {
// call fail
// Do Local spam check with "Thief-cat algorithm"
$count = 0;
$tableName = $database['prefix'] . 'RemoteResponses';
if ($type == 2) {
$sql = 'SELECT COUNT(id) as cc FROM ' . $database['prefix'] . 'RemoteResponses WHERE';
$sql .= ' url = \'' . POD::escapeString($url) . '\'';
$sql .= ' AND isfiltered > 0';
if ($row = POD::queryRow($sql)) {
$count += @$row[0];
}
} else {
// Comment Case
$tableName = $database['prefix'] . 'Comments';
$sql = 'SELECT COUNT(id) as cc FROM ' . $database['prefix'] . 'Comments WHERE';
$sql .= ' comment = \'' . POD::escapeString($content) . '\'';
$sql .= ' AND homepage = \'' . POD::escapeString($url) . '\'';
$sql .= ' AND name = \'' . POD::escapeString($name) . '\'';
$sql .= ' AND isfiltered > 0';
if ($row = POD::queryRow($sql)) {
$count += @$row[0];
}
}
// Check IP
$sql = 'SELECT COUNT(id) as cc FROM ' . $tableName . ' WHERE';
$sql .= ' ip = \'' . POD::escapeString($_SERVER['REMOTE_ADDR']) . '\'';
$sql .= ' AND isfiltered > 0';
if ($row = POD::queryRow($sql)) {
$count += @$row[0];
}
if ($count >= 10) {
return false;
}
return true;
}
if (!is_null($rpc->fault)) {
// EAS has some problem
return true;
}
if ($rpc->result['result'] == true) {
return false;
// it's spam
}
return true;
}
示例4: CT_Start_Default_getEntry
function CT_Start_Default_getEntry($blogid, $id)
{
global $database;
if ($id == 0) {
return null;
}
$visibility = doesHaveOwnership() ? '' : 'AND visibility > 0';
$entry = POD::queryRow("SELECT id,title,visibility FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND id = {$id} AND draft = 0 {$visibility}");
if (!$entry) {
return false;
}
return $entry;
}
示例5: sendAbstractToEolin
/**
* @brief Send abstract about specific entry.
* @see Tag, User, DBModel, Model_Context
*/
function sendAbstractToEolin()
{
// TODO : Rewrite routines to fit Textcube 1.8 or later.
requireModel('blog.category');
$entryId = $_GET['entryId'];
$context = Model_Context::getInstance();
$blogid = $context->getProperty('blog.id');
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<response>\r\n";
list($allComments, $allTrackbacks) = POD::queryRow("SELECT \n\t\t\tSUM(comments), SUM(trackbacks) \n\t\t\tFROM {$context->getProperty('database.prefix')}Entries \n\t\t\tWHERE blogid = " . $blogid . " AND draft = 0 AND visibility = 3", 'num');
if ($entry = POD::queryRow("SELECT e.*, c.name AS categoryName \n\t\t\t\tFROM {$context->getProperty('database.prefix')}Entries e \n\t\t\t\tLEFT JOIN {$context->getProperty('database.prefix')}Categories c ON e.blogid = c.blogid AND e.category = c.id \n\t\t\t\tWHERE e.blogid = " . $blogid . " AND e.id = " . $entryId . " AND e.draft = 0 AND e.visibility = 3" . getPrivateCategoryExclusionQuery($blogid))) {
header('Content-Type: text/xml; charset=utf-8');
echo '<version>1.1</version>', "\r\n";
echo '<status>1</status>', "\r\n";
echo '<blog>', "\r\n";
echo '<generator>' . TEXTCUBE_NAME . '/' . TEXTCUBE_VERSION . '</generator>', "\r\n";
echo '<language>', htmlspecialchars($context->getProperty('blog.language')), '</language>', "\r\n";
echo '<url>', htmlspecialchars($context->getProperty('uri.default')), '</url>', "\r\n";
echo '<title>', htmlspecialchars($context->getProperty('blog.title')), '</title>', "\r\n";
echo '<description>', htmlspecialchars($context->getProperty('blog.description')), '</description>', "\r\n";
echo '<comments>', $allComments, '</comments>', "\r\n";
echo '<trackbacks>', $allTrackbacks, '</trackbacks>', "\r\n";
echo '</blog>', "\r\n";
echo '<entry>', "\r\n";
echo '<permalink>', htmlspecialchars($context->getProperty('uri.default') . "/" . ($context->getProperty('blog.useSloganOnPost') ? "entry/{$entry['slogan']}" : $entry['id'])), '</permalink>', "\r\n";
echo '<title>', htmlspecialchars($entry['title']), '</title>', "\r\n";
echo '<content>', htmlspecialchars(getEntryContentView($blogid, $entryId, $entry['content'], $entry['contentformatter'])), '</content>', "\r\n";
echo '<author>', htmlspecialchars(User::authorName($blogid, $entryId)), '</author>', "\r\n";
echo '<category>', htmlspecialchars($entry['categoryName']), '</category>', "\r\n";
$tags = Tag::getTagsWithEntryId($blogid, $entry);
foreach ($tags as $tag) {
echo '<tag>', htmlspecialchars($tag), '</tag>', "\r\n";
}
echo '<location>', htmlspecialchars($entry['location']), '</location>', "\r\n";
echo '<comments>', $entry['comments'], '</comments>', "\r\n";
echo '<trackbacks>', $entry['trackbacks'], '</trackbacks>', "\r\n";
echo '<written>', Timestamp::getRFC1123($entry['published']), '</written>', "\r\n";
foreach (getAttachments($blogid, $entry['id']) as $attachment) {
echo '<attachment>', "\r\n";
echo '<mimeType>', $attachment['mime'], '</mimeType>', "\r\n";
echo '<filename>', $attachment['label'], '</filename>', "\r\n";
echo '<length>', $attachment['size'], '</length>', "\r\n";
echo '<url>', $context->getProperty('uri.service'), '/attachment/', $attachment['name'], '</url>', "\r\n";
echo '</attachment>', "\r\n";
}
echo '</entry>', "\r\n";
} else {
echo '<version>1.1</version>', "\r\n", '<status>0</status>', "\r\n";
}
echo "</response>";
exit;
}
示例6: EntriesWithTags
function EntriesWithTags($target, $mother)
{
global $suri, $defaultURL, $blogURL, $pluginURL, $configVal, $blog, $service, $blogid, $database;
requireComponent('Textcube.Function.misc');
$html = '';
if ($suri['directive'] != "/rss" && $suri['directive'] != "/atom" && $suri['directive'] != "/m" && $suri['directive'] != "/i/entry" && $suri['directive'] != "/sync") {
$html = '
<div class="entries-with-tags-box">
<strong> ' . _t("Related entries") . ' </strong>
<ul>';
$data = misc::fetchConfigVal($configVal);
$entries = isset($data['entries']) ? $data['entries'] : 5;
$conEntry = POD::queryRow("SELECT userid, category FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND id = {$mother}");
$result = POD::query("SELECT DISTINCT e.id, e.slogan, e.title, e.created, e.comments, e.trackbacks\n\t\t\t\t\t\t\t\tFROM {$database['prefix']}TagRelations AS r\n\t\t\t\t\t\t\t\tLEFT JOIN {$database['prefix']}TagRelations AS t ON t.tag = r.tag \n\t\t\t\t\t\t\t\tLEFT JOIN {$database['prefix']}Entries AS e ON e.id = t.entry \n\t\t\t\t\t\t\t\tWHERE r.entry ={$mother}\n\t\t\t\t\t\t\t\tAND r.blogid ={$blogid}\n\t\t\t\t\t\t\t\tAND t.entry !={$mother}\n\t\t\t\t\t\t\t\tAND e.userid ={$conEntry['userid']} \n\t\t\t\t\t\t\t\tAND e.category = {$conEntry['category']} \n\t\t\t\t\t\t\t\tORDER BY t.entry DESC\n\t\t\t\t\t\t\t\tLIMIT {$entries}");
if (POD::num_rows($result) > 0) {
while ($row = POD::fetch($result, 'array')) {
$entry = $row['id'];
$slogan = rawurlencode($row['slogan']);
$title = $row['title'];
$created = date("Y/m/d H:m", $row['created']);
$comments = $row['comments'];
$trackbacks = $row['trackbacks'];
if ($suri['directive'] == "/category") {
$permalink = $blog['useSloganOnCategory'] ? "{$defaultURL}/entry/{$slogan}" : "{$defaultURL}/{$entry}";
} elseif ($suri['directive'] == "/tag") {
$permalink = $blog['useSloganOnTag'] ? "{$defaultURL}/entry/{$slogan}" : "{$defaultURL}/{$entry}";
} else {
$permalink = $blog['useSloganOnPost'] ? "{$defaultURL}/entry/{$slogan}" : "{$defaultURL}/{$entry}";
}
$html .= "<li><a href=\"{$permalink}\">{$title}</a>,<span>Comments: {$comments} | Trackbacks: {$trackbacks} | {$created}</span></li>";
}
} else {
$html .= "<li>" . _t("No related entries.") . "</li>";
}
$html .= <<<EOF
\t\t</ul>
\t</div>
EOF;
}
return $target . $html;
}
示例7: DEFNENSIO_FILTER
function DEFNENSIO_FILTER($type, $name, $title, $url, $content, $openid = false)
{
global $hostURL, $blogURL, $database, $configVal, $defensio_conf;
//if ( doesHaveOwnership() ) return true; // owner
DEFENSIO_Init();
$defensio_meta = array();
$comment = array();
$comment['referrer'] = $_SERVER['HTTP_REFERER'];
$comment['user-ip'] = preg_replace('/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR']);
$comment['user-ip'] = '168.126.63.1';
$comment['owner-url'] = $defensio_conf['blog'];
$comment['comment_type'] = $type == 2 ? 'trackback' : 'comment';
$comment['comment-author'] = $name;
$comment['article-date'] = strftime("%Y/%m/%d", time());
// $comment['permalink'] = $comment_perma_link;
// Make sure it we don't send an SQL escaped string to the server
$comment['comment-content'] = defensio_unescape_string($content);
$comment['comment-author-url'] = $url;
//$comment['comment-author-email'] = $email; // optional field
$next_id = $type == 2 ? getTrackBacksNextId() : getCommentsNextId();
$comment_TYPE = $type == 2 ? 'T' : 'C';
// to using openid
if ($openid) {
$comment['openid'] = Acl::getIdentity('openid');
$comment['user-logged-in'] = 'true';
}
// to testing
// $comment['test-force'] = 'spam,x.xxxx'; // | 'ham,x.xxxx' ( 0 ~ 1)
if ($r = defensio_post('audit-comment', $comment)) {
$ar = Spyc::YAMLLoad($r);
if (isset($ar['defensio-result'])) {
if ($ar['defensio-result']['status'] == DF_SUCCESS) {
// Set metadata about the comment
$defensio_meta['spaminess'] = $ar['defensio-result']['spaminess'];
$defensio_meta['signature'] = $ar['defensio-result']['signature'];
error_log(print_r($ar, true));
if ($ar['defensio-result']['spam']) {
$defensio_meta['spam'] = true;
defensio_save_meta_data($comment_TYPE, $next_id, $defensio_meta);
return false;
} else {
// not spam
$defensio_meta['spaminess'] = 0;
// if do you want check with Thief-cat algorithm, comment out the following two lines.
if (!$defensio_conf['force_with_tca']) {
defensio_save_meta_data($comment_TYPE, $next_id, $defensio_meta);
return true;
}
}
}
}
/* else {
// Succesful http request, but Defensio failed.
} */
}
/* else {
// Unsuccesful POST to the server. Defensio might be down.
} */
//defensio_save_meta_data($comment_TYPE, $next_id, $defensio_meta); // there is problem in defensio.
///////////////////////
// call fail
// Do Local spam check with "Thief-cat algorithm"
$count = 0;
$tableName = $database['prefix'] . 'Trackbacks';
if ($type == 2) {
$sql = 'SELECT COUNT(id) as cc FROM ' . $database['prefix'] . 'Trackbacks WHERE';
$sql .= ' url = \'' . POD::escapeString($url) . '\'';
$sql .= ' AND isFiltered > 0';
if ($row = POD::queryRow($sql)) {
$count += @$row[0];
}
} else {
// Comment Case
$tableName = $database['prefix'] . 'Comments';
$sql = 'SELECT COUNT(id) as cc FROM ' . $database['prefix'] . 'Comments WHERE';
$sql .= ' comment = \'' . POD::escapeString($content) . '\'';
$sql .= ' AND homepage = \'' . POD::escapeString($url) . '\'';
$sql .= ' AND name = \'' . POD::escapeString($name) . '\'';
$sql .= ' AND isFiltered > 0';
if ($row = POD::queryRow($sql)) {
$count += @$row[0];
}
}
// Check IP
$sql = 'SELECT COUNT(id) as cc FROM ' . $tableName . ' WHERE';
$sql .= ' ip = \'' . POD::escapeString($_SERVER['REMOTE_ADDR']) . '\'';
$sql .= ' AND isFiltered > 0';
if ($row = POD::queryRow($sql)) {
$count += @$row[0];
}
$is_spam = $count >= 10 ? 1 : 0;
if (isset($defensio_meta['spaminess']) and isset($defensio_meta['signature']) && $is_spam) {
defensio_submit_spam($defensio_meta['signature']);
}
$defensio_meta['spam'] = $defensio_meta['spaminess'] = $is_spam;
defensio_save_meta_data($comment_TYPE, $next_id, $defensio_meta);
return !$is_spam;
}
示例8: updateRandomFeed
function updateRandomFeed()
{
global $database;
$updatecycle = POD::queryCell("SELECT updatecycle FROM {$database['prefix']}FeedSettings LIMIT 1");
if ($updatecycle != 0) {
if ($feed = POD::queryRow("SELECT * FROM {$database['prefix']}Feeds WHERE modified < " . (gmmktime() - $updatecycle * 60) . " ORDER BY RAND() LIMIT 1")) {
Setting::setServiceSetting('lastFeedUpdate', gmmktime(), true);
return array(updateFeed($feed), $feed['xmlurl']);
}
}
return array(1, 'No feeds to update');
}
示例9: notifyComment
function notifyComment()
{
global $database, $service, $blog, $defaultURL;
$blogid = getBlogId();
$sql = "SELECT\n\t\t\t\tCN.*,\n\t\t\t\tCNQ.id AS queueId,\n\t\t\t\tCNQ.commentid AS commentid,\n\t\t\t\tCNQ.sendstatus AS sendstatus,\n\t\t\t\tCNQ.checkdate AS checkdate,\n\t\t\t\tCNQ.written AS queueWritten\n\t\t\tFROM\n\t\t\t\t{$database['prefix']}CommentsNotifiedQueue AS CNQ\n\t\t\tLEFT JOIN\n\t\t\t\t{$database['prefix']}Comments AS CN ON CNQ.commentid = CN.id\n\t\t\tWHERE\n\t\t\t\tCNQ.sendstatus = 0\n\t\t\t\tand CN.parent is not null\n\t\t\tORDER BY CNQ.id ASC LIMIT 1 OFFSET 0";
$queue = POD::queryRow($sql);
if (empty($queue) && empty($queue['queueId'])) {
return false;
}
$comments = POD::queryRow("SELECT * FROM {$database['prefix']}Comments WHERE blogid = {$blogid} AND id = {$queue['commentid']}");
if (empty($comments['parent']) || $comments['secret'] == 1) {
POD::execute("DELETE FROM {$database['prefix']}CommentsNotifiedQueue WHERE id={$queue['queueId']}");
return false;
}
$parentComments = POD::queryRow("SELECT * FROM {$database['prefix']}Comments WHERE blogid = {$blogid} AND id = {$comments['parent']}");
if (empty($parentComments['homepage'])) {
POD::execute("DELETE FROM {$database['prefix']}CommentsNotifiedQueue WHERE id={$queue['queueId']}");
return false;
}
$entry = POD::queryRow("SELECT * FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND id={$comments['entry']}");
if (is_null($entry)) {
$r1_comment_check_url = rawurlencode("{$defaultURL}/guestbook/" . $parentComments['id'] . "#guestbook" . $parentComments['id']);
$r2_comment_check_url = rawurlencode("{$defaultURL}/guestbook/" . $comments['id'] . "#guestbook" . $comments['id']);
$entry['title'] = _textf('%1 블로그의 방명록', $blog['title']);
$entryPermaLink = "{$defaultURL}/guestbook/";
$entry['id'] = 0;
} else {
$r1_comment_check_url = rawurlencode("{$defaultURL}/" . ($blog['useSloganOnPost'] ? "entry/{$entry['slogan']}" : $entry['id']) . "#comment" . $parentComments['id']);
$r2_comment_check_url = rawurlencode("{$defaultURL}/" . ($blog['useSloganOnPost'] ? "entry/{$entry['slogan']}" : $entry['id']) . "#comment" . $comments['id']);
$entryPermaLink = "{$defaultURL}/" . ($blog['useSloganOnPost'] ? "entry/{$entry['slogan']}" : $entry['id']);
}
$data = "url=" . rawurlencode($defaultURL) . "&mode=fb" . "&s_home_title=" . rawurlencode($blog['title']) . "&s_post_title=" . rawurlencode($entry['title']) . "&s_name=" . rawurlencode($comments['name']) . "&s_no=" . rawurlencode($comments['entry']) . "&s_url=" . rawurlencode($entryPermaLink) . "&r1_name=" . rawurlencode($parentComments['name']) . "&r1_no=" . rawurlencode($parentComments['id']) . "&r1_pno=" . rawurlencode($comments['entry']) . "&r1_rno=0" . "&r1_homepage=" . rawurlencode($parentComments['homepage']) . "&r1_regdate=" . rawurlencode($parentComments['written']) . "&r1_url=" . $r1_comment_check_url . "&r2_name=" . rawurlencode($comments['name']) . "&r2_no=" . rawurlencode($comments['id']) . "&r2_pno=" . rawurlencode($comments['entry']) . "&r2_rno=" . rawurlencode($comments['parent']) . "&r2_homepage=" . rawurlencode($comments['homepage']) . "&r2_regdate=" . rawurlencode($comments['written']) . "&r2_url=" . $r2_comment_check_url . "&r1_body=" . rawurlencode($parentComments['comment']) . "&r2_body=" . rawurlencode($comments['comment']);
if (strpos($parentComments['homepage'], "http://") === false) {
$homepage = 'http://' . $parentComments['homepage'];
} else {
$homepage = $parentComments['homepage'];
}
$request = new HTTPRequest('POST', $homepage);
$request->contentType = 'application/x-www-form-urlencoded; charset=utf-8';
$request->content = $data;
if ($request->send()) {
$xmls = new XMLStruct();
if ($xmls->open($request->responseText)) {
$result = $xmls->selectNode('/response/error/');
if ($result['.value'] != '1' && $result['.value'] != '0') {
$homepage = rtrim($homepage, '/') . '/index.php';
$request = new HTTPRequest('POST', $homepage);
$request->contentType = 'application/x-www-form-urlencoded; charset=utf-8';
$request->content = $data;
if ($request->send()) {
}
}
}
} else {
}
POD::execute("DELETE FROM {$database['prefix']}CommentsNotifiedQueue WHERE id={$queue['queueId']}");
}
示例10: authenticate
function authenticate($blogid, $loginid, $password, $blogapi = false)
{
global $database;
$session = array();
Acl::clearAcl();
$loginid = POD::escapeString($loginid);
$blogApiPassword = Setting::getBlogSettingGlobal("blogApiPassword", "");
if (strlen($password) == 32 && preg_match('/[0-9a-f]{32}/i', $password)) {
// Raw login. ( with/without auth token)
$userid = User::getUserIdByEmail($loginid);
if (!empty($userid) && !is_null($userid)) {
$query = DBModel::getInstance();
$query->reset('UserSettings');
$query->setQualifier('userid', 'equals', intval($userid));
$query->setQualifier('name', 'equals', 'AuthToken', true);
$authtoken = $query->getCell('value');
if (!empty($authtoken) && $authtoken === $password) {
// If user requested auth token, use it to confirm.
$session['userid'] = $userid;
} else {
// login with md5 hash
$secret = 'password = \'' . md5($password) . '\'';
}
} else {
return false;
}
} else {
if ($blogapi && !empty($blogApiPassword)) {
// BlogAPI login
$password = POD::escapeString($password);
$secret = '(password = \'' . md5($password) . '\' OR \'' . $password . '\' = \'' . $blogApiPassword . '\')';
} else {
// Normal login
$secret = 'password = \'' . md5($password) . '\'';
}
}
if (empty($session)) {
$session = POD::queryRow("SELECT userid, loginid, name FROM {$database['prefix']}Users WHERE loginid = '{$loginid}' AND {$secret}");
}
if (empty($session)) {
/* You should compare return value with '=== false' which checks with variable types*/
return false;
}
$userid = $session['userid'];
Acl::authorize('textcube', $userid);
POD::execute("UPDATE {$database['prefix']}Users SET lastlogin = " . Timestamp::getUNIXtime() . " WHERE loginid = '{$loginid}'");
// POD::execute("DELETE FROM {$database['prefix']}UserSettings WHERE userid = '$userid' AND name = 'AuthToken' LIMIT 1");
return $userid;
}
示例11: queryRowWithDBCache
function queryRowWithDBCache($query, $prefix = null, $type = MYSQL_BOTH, $count = -1)
{
// requireComponent('Needlworks.Cache.PageCache');
$cache = new queryCache($query, $prefix);
if (!$cache->load()) {
$cache->contents = POD::queryRow($query, $type, $count);
$cache->update();
}
return $cache->contents;
}
示例12: getRemoteResponseCount
function getRemoteResponseCount($blogid, $entryId = null)
{
global $database;
if (is_null($entryId)) {
$result = POD::queryRow("SELECT SUM(trackbacks) AS t, SUM(pingbacks) AS p\n\t\t\t\tFROM {$database['prefix']}Entries \n\t\t\t\tWHERE blogid = {$blogid} \n\t\t\t\t\tAND draft= 0");
return $result['t'] + $result['p'];
} else {
$result = POD::queryRow("SELECT trackbacks, pingbacks \n\t\t\tFROM {$database['prefix']}Entries \n\t\t\tWHERE blogid = {$blogid} \n\t\t\t\tAND id = {$entryId} \n\t\t\t\tAND draft= 0");
return $result['trackbacks'] + $result['pingbacks'];
}
}
示例13: flushEntry
function flushEntry($entryId = null)
{
global $database;
if (empty($entryId)) {
$entryId = '';
} else {
$entryId = $entryId . '\\_';
}
$cache = pageCache::getInstance();
$Entries = POD::queryColumn("SELECT name\n\t\t\tFROM {$database['prefix']}PageCacheLog\n\t\t\tWHERE blogid = " . getBlogId() . "\n\t\t\tAND (name like 'entry\\_" . $entryId . "%' OR name = 'commentRSS_" . $entryId . "')");
CacheControl::purgeItems($Entries);
if (!empty($entryId)) {
$entry = POD::queryRow("SELECT userid, category FROM {$database['prefix']}Entries\n\t\t\t\tWHERE blogid = " . getBlogId() . " AND id = {$entryId}");
if (!empty($entry)) {
CacheControl::flushAuthor($entry['userid']);
CacheControl::flushCategory($entry['category']);
CacheControl::flushDBCache();
}
} else {
CacheControl::flushAuthor();
CacheControl::flushCategory();
CacheControl::flushDBCache();
}
unset($cache);
return true;
}
示例14: getPluginTableName
function getPluginTableName()
{
requireModel('common.setting');
$ctx = Model_Context::getInstance();
$likeEscape = array('/_/', '/%/');
$likeReplace = array('\\_', '\\%');
$escapename = preg_replace($likeEscape, $likeReplace, $ctx->getProperty('database.prefix'));
$dbtables = POD::tableList($escapename);
$dbCaseInsensitive = Setting::getServiceSetting('lowercaseTableNames', true);
if ($dbCaseInsensitive === null) {
$result = POD::queryRow("SHOW VARIABLES LIKE 'lower_case_table_names'");
$dbCaseInsensitive = $result['Value'] == 1 ? 1 : 0;
Setting::setServiceSetting('lowercaseTableNames', $dbCaseInsensitive, true);
}
$definedTables = getDefinedTableNames();
$dbtables = array_values(array_diff($dbtables, $definedTables));
if ($dbCaseInsensitive == 1) {
$tempTables = $definedTables;
$definedTables = array();
foreach ($tempTables as $table) {
$table = strtolower($table);
array_push($definedTables, $table);
}
$tempTables = $dbtables;
$dbtables = array();
foreach ($tempTables as $table) {
$table = strtolower($table);
array_push($dbtables, $table);
}
$dbtables = array_values(array_diff($dbtables, $definedTables));
}
return $dbtables;
}
示例15: flushEntry
function flushEntry($entryId = null)
{
global $database;
if (empty($entryId)) {
$entryId = '';
} else {
$entryId = intval($entryId);
}
$Entries = POD::queryColumn("SELECT name\n\t\t\tFROM {$database['prefix']}PageCacheLog\n\t\t\tWHERE blogid = " . getBlogId() . "\n\t\t\tAND (name like 'entry-" . $entryId . "-%' OR name like '%RSS-" . $entryId . "' OR name like '%ATOM-" . $entryId . "')");
if (!empty($Entries)) {
CacheControl::purgeItems($Entries);
}
if (!empty($entryId)) {
$entry = POD::queryRow("SELECT userid, category, published FROM {$database['prefix']}Entries\n\t\t\t\tWHERE blogid = " . getBlogId() . " AND id = {$entryId}");
if (!empty($entry)) {
$entry['period'] = Timestamp::getYearMonth($entry['published']);
CacheControl::flushAuthor($entry['userid']);
CacheControl::flushCategory($entry['category']);
CacheControl::flushArchive($entry['period']);
CacheControl::flushDBCache('entry');
}
} else {
CacheControl::flushAuthor();
CacheControl::flushCategory();
CacheControl::flushDBCache('entry');
}
return true;
}