本文整理汇总了PHP中POD::queryCount方法的典型用法代码示例。如果您正苦于以下问题:PHP POD::queryCount方法的具体用法?PHP POD::queryCount怎么用?PHP POD::queryCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类POD
的用法示例。
在下文中一共展示了POD::queryCount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CountAndShow
function CountAndShow($target, $mother)
{
global $database, $service, $suri, $blogid;
$now_timestamp = time();
$output = '';
if ($suri['directive'] != "/rss" && $suri['directive'] != "/m" && $suri['directive'] != "/i/entry" && $suri['directive'] != "/atom" && $suri['directive'] != "/sync") {
if (SaveReadToCookie($blogid, $mother)) {
if (!POD::queryCount("UPDATE {$database['prefix']}EntryReadCount SET readcounts = readcounts + 1, lastaccess = {$now_timestamp} WHERE blogid={$blogid} AND id={$mother}")) {
POD::query("INSERT INTO {$database['prefix']}EntryReadCount (blogid, id, readcounts, lastaccess) VALUES ({$blogid}, {$mother}, 1, {$now_timestamp})");
}
}
$readcount = POD::queryCell("SELECT readcounts FROM {$database['prefix']}EntryReadCount WHERE blogid={$blogid} AND id={$mother}");
$output .= "<span class=\"c_cnt\">views: {$readcount} times </span><br />";
}
return $output . $target;
}
示例2: doesExist
function doesExist($tag)
{
global $database;
return POD::queryCount("SELECT id FROM {$database['prefix']}Tags WHERE name = '" . $tag . "' LIMIT 1");
}
示例3: deleteRemoteResponseLog
function deleteRemoteResponseLog($blogid, $id)
{
global $database;
$result = POD::queryCount("DELETE FROM {$database['prefix']}RemoteResponseLogs WHERE blogid = {$blogid} AND id = {$id}");
return $result == 1 ? true : false;
}
示例4: protectEntry
function protectEntry($id, $password)
{
global $database;
$password = POD::escapeString($password);
$result = POD::queryCount("UPDATE {$database['prefix']}Entries SET password = '{$password}', modified = UNIX_TIMESTAMP() WHERE blogid = " . getBlogId() . " AND id = {$id} AND visibility = 1");
if ($result > 0) {
CacheControl::flushEntry($id);
CacheControl::flushDBCache('entry');
CacheControl::flushDBCache('comment');
CacheControl::flushDBCache('trackback');
return true;
} else {
return false;
}
}
示例5: deleteFeedGroup
function deleteFeedGroup($blogid, $id)
{
global $database;
if ($id == 0) {
return -1;
}
POD::query("UPDATE {$database['prefix']}FeedGroupRelations SET groupid = 0 WHERE blogid = {$blogid} AND groupid = {$id}");
$result = POD::queryCount("DELETE FROM {$database['prefix']}FeedGroups WHERE id = {$id}");
if ($result != 1) {
return 1;
}
return 0;
}
示例6: updateVisitorStatistics
static function updateVisitorStatistics($blogid)
{
global $database, $blogURL;
if (!fireEvent('UpdatingVisitorStatistics', true)) {
return;
}
if (doesHaveOwnership()) {
return;
}
$id = session_id();
if (POD::queryCount("SELECT blogid FROM {$database['prefix']}SessionVisits WHERE id = '{$id}' AND address = '{$_SERVER['REMOTE_ADDR']}' AND blogid = {$blogid}") > 0) {
return;
}
if (POD::queryCount("INSERT INTO {$database['prefix']}SessionVisits values('{$id}', '{$_SERVER['REMOTE_ADDR']}', {$blogid})") > 0) {
if (POD::queryCount("UPDATE {$database['prefix']}BlogStatistics SET visits = visits + 1 WHERE blogid = {$blogid}") < 1) {
POD::execute("INSERT into {$database['prefix']}BlogStatistics values({$blogid}, 1)");
}
$period = Timestamp::getDate();
if (POD::queryCount("UPDATE {$database['prefix']}DailyStatistics SET visits = visits + 1 WHERE blogid = {$blogid} AND datemark = {$period}") < 1) {
POD::execute("INSERT INTO {$database['prefix']}DailyStatistics VALUES ({$blogid}, {$period}, 1)");
}
if (!empty($_SERVER['HTTP_REFERER'])) {
$referer = parse_url($_SERVER['HTTP_REFERER']);
if (!empty($referer['host']) && ($referer['host'] != $_SERVER['HTTP_HOST'] || strncmp($referer['path'], $blogURL, strlen($blogURL)) != 0)) {
if (Filter::isFiltered('ip', $_SERVER['REMOTE_ADDR']) || Filter::isFiltered('url', $_SERVER['HTTP_REFERER'])) {
return;
}
if (!fireEvent('AddingRefererLog', true, array('host' => $referer['host'], 'url' => $_SERVER['HTTP_REFERER']))) {
return;
}
$host = POD::escapeString(Utils_Unicode::lessenAsEncoding($referer['host'], 64));
$url = POD::escapeString(Utils_Unicode::lessenAsEncoding($_SERVER['HTTP_REFERER'], 255));
POD::query("INSERT INTO {$database['prefix']}RefererLogs values({$blogid}, '{$host}', '{$url}', UNIX_TIMESTAMP())");
// POD::query("DELETE FROM {$database['prefix']}RefererLogs WHERE referred < UNIX_TIMESTAMP() - 604800"); // Moved to trashVan
if (!POD::queryCount("UPDATE {$database['prefix']}RefererStatistics SET count = count + 1 WHERE blogid = {$blogid} AND host = '{$host}' LIMIT 1")) {
POD::execute("INSERT into {$database['prefix']}RefererStatistics values({$blogid}, '{$host}', 1)");
}
}
}
}
}
示例7: remove
function remove($id = null)
{
// attachment & category is own your risk!
global $database, $gCacheStorage;
$this->init();
if (!empty($id)) {
$this->id = $id;
}
// step 0. Get Information
if (!isset($this->id) || !Validator::number($this->id, 1)) {
return $this->_error('id');
}
if (!($query = $this->_buildQuery())) {
return false;
}
if (!($entry = $query->getRow('category, visibility'))) {
return $this->_error('id');
}
// step 1. Check Syndication
if ($entry['visibility'] == 3) {
requireComponent('Eolin.API.Syndication');
Syndication::leave($this->getLink());
}
CacheControl::flushEntry($this->id);
CacheControl::flushDBCache('entry');
CacheControl::flushDBCache('comment');
CacheControl::flushDBCache('trackback');
$gCacheStorage->purge();
// step 2. Delete Entry
$sql = "DELETE FROM " . $database['prefix'] . "Entries WHERE blogid = " . $this->blogid . " AND id = " . $this->id;
if (POD::queryCount($sql)) {
// step 3. Delete Comment
POD::execute("DELETE FROM {$database['prefix']}Comments WHERE blogid = " . $this->blogid . " AND entry = " . $this->id);
// step 4. Delete Trackback
POD::execute("DELETE FROM {$database['prefix']}RemoteResponses WHERE blogid = " . $this->blogid . " AND entry = " . $this->id);
// step 5. Delete Trackback Logs
POD::execute("DELETE FROM {$database['prefix']}RemoteResponseLogs WHERE blogid = " . $this->blogid . " AND entry = " . $this->id);
// step 6. update Category
if (isset($entry['category'])) {
$target = ($parentCategory = Category::getParent($entry['category'])) ? '(id = ' . $entry['category'] . ' OR id = ' . $parentCategory . ')' : 'id = ' . $entry['category'];
if (isset($entry['visibility']) && $entry['visibility'] != 1) {
POD::query("UPDATE {$database['prefix']}Categories SET entries = entries - 1, entriesinlogin = entriesinlogin - 1 WHERE blogid = " . $this->blogid . " AND " . $target);
} else {
POD::query("UPDATE {$database['prefix']}Categories SET entriesinlogin = entriesinlogin - 1 WHERE blogid = " . $this->blogid . " AND " . $target);
}
}
// step 7. Delete Attachment
$attachNames = POD::queryColumn("SELECT name FROM {$database['prefix']}Attachments\n\t\t\t\tWHERE blogid = " . getBlogId() . " AND parent = " . $this->id);
if (POD::execute("DELETE FROM {$database['prefix']}Attachments WHERE blogid = " . getBlogId() . " AND parent = " . $this->id)) {
foreach ($attachNames as $attachName) {
if (file_exists(__TEXTCUBE_ATTACH_DIR__ . "/" . getBlogId() . "/{$attachName}")) {
@unlink(__TEXTCUBE_ATTACH_DIR__ . "/" . getBlogId() . "/{$attachName}");
}
}
}
// step 8. Delete Tags
$this->deleteTags();
// step 9. Clear RSS
requireComponent('Textcube.Control.RSS');
RSS::refresh();
return true;
}
return false;
}
示例8: delete
public function delete($count = null, $option = null)
{
if (empty($this->table)) {
return false;
}
if (!is_null($count)) {
$this->setLimit($count);
}
$this->_query = 'DELETE FROM ' . $this->table . $this->_makeWhereClause();
if ($option == 'count') {
return POD::queryCount($this->_query);
}
if (POD::query($this->_query)) {
return true;
}
return false;
}
示例9: DBQuery
private static function DBQuery($mode = 'query', $sql)
{
switch ($mode) {
case 'cell':
return POD::queryCell($sql);
case 'row':
return POD::queryRow($sql);
case 'execute':
return POD::execute($sql);
case 'count':
return POD::queryCount($sql);
case 'all':
return POD::queryAll($sql);
case 'query':
default:
return POD::query($sql);
}
return null;
}
示例10: addBlog
function addBlog($blogid, $userid, $identify)
{
global $database, $service;
if (empty($userid)) {
$userid = 1;
// If no userid, choose the service administrator.
} else {
if (!POD::queryExistence("SELECT userid\n\t\t\tFROM {$database['prefix']}Users\n\t\t\tWHERE userid = " . $userid)) {
return 3;
}
// 3: No user exists with specific userid
}
if (!empty($blogid)) {
// If blogid,
if (!POD::queryExistence("SELECT blogid\n\t\t\tFROM {$database['prefix']}BlogSettings\n\t\t\tWHERE blogid = " . $blogid)) {
return 2;
// 2: No blog exists with specific blogid
}
// Thus, blog and user exists. Now combine both.
$result = POD::query("INSERT INTO {$database['prefix']}Privileges\n\t\t\t(blogid,userid,acl,created,lastlogin) \n\t\t\tVALUES({$blogid}, {$userid}, 0, UNIX_TIMESTAMP(), 0)");
return $result;
} else {
// If no blogid, create a new blog.
if (!preg_match('/^[a-zA-Z0-9]+$/', $identify)) {
return 4;
}
// Wrong Blog name
$identify = POD::escapeString(UTF8::lessenAsEncoding($identify, 32));
$blogName = $identify;
$result = POD::queryCount("SELECT * \n\t\t\tFROM {$database['prefix']}ReservedWords\n\t\t\tWHERE word = '{$blogName}'");
if ($result && $result > 0) {
return 60;
// Reserved blog name.
}
$result = POD::queryCount("SELECT value \n\t\t\tFROM {$database['prefix']}BlogSettings \n\t\t\tWHERE name = 'name' AND value = '{$blogName}'");
if ($result && $result > 0) {
return 61;
// Same blogname is already exists.
}
$blogid = POD::queryCell("SELECT max(blogid)\n\t\t\tFROM {$database['prefix']}BlogSettings") + 1;
$baseTimezone = POD::escapeString($service['timezone']);
$basicInformation = array('name' => $identify, 'defaultDomain' => 0, 'title' => '', 'description' => '', 'logo' => '', 'logoLabel' => '', 'logoWidth' => 0, 'logoHeight' => 0, 'useFeedViewOnCategory' => 1, 'useSloganOnPost' => 1, 'useSloganOnCategory' => 1, 'useSloganOnTag' => 1, 'entriesOnPage' => 10, 'entriesOnList' => 10, 'entriesOnRSS' => 10, 'commentsOnRSS' => 10, 'publishWholeOnRSS' => 1, 'publishEolinSyncOnRSS' => 1, 'allowWriteOnGuestbook' => 1, 'allowWriteDblCommentOnGuestbook' => 1, 'visibility' => 2, 'language' => $service['language'], 'blogLanguage' => $service['language'], 'timezone' => $baseTimezone);
$isFalse = false;
foreach ($basicInformation as $fieldname => $fieldvalue) {
if (setBlogSettingDefault($fieldname, $fieldvalue, $blogid) === false) {
$isFalse = true;
}
}
if ($isFalse == true) {
POD::query("DELETE FROM {$database['prefix']}BlogSettings WHERE blogid = {$blogid}");
return 12;
}
if (!POD::query("INSERT INTO {$database['prefix']}SkinSettings (blogid) VALUES ({$blogid})")) {
deleteBlog($blogid);
return 13;
}
if (!POD::query("INSERT INTO {$database['prefix']}FeedSettings \n\t\t\t(blogid) VALUES ({$blogid})")) {
deleteBlog($blogid);
return 62;
}
if (!POD::query("INSERT INTO {$database['prefix']}FeedGroups \n\t\t\t(blogid, id) \n\t\t\tVALUES ({$blogid}, 0)")) {
deleteBlog($blogid);
return 62;
}
setBlogSetting('defaultEditor', 'modern', $blogid);
setBlogSetting('defaultFormatter', 'ttml', $blogid);
//Combine user and blog.
if (POD::query("INSERT INTO {$database['prefix']}Privileges \n\t\t\t(blogid,userid,acl,created,lastlogin) \n\t\t\tVALUES({$blogid}, {$userid}, 16, UNIX_TIMESTAMP(), 0)")) {
setDefaultPost($blogid, $userid);
return true;
} else {
return 65;
}
}
//return true; // unreachable code
}
示例11: delete
public function delete($count = null, $option = null)
{
if (empty($this->table)) {
return false;
}
$this->_called = true;
if (!is_null($count)) {
$this->setLimit($count);
}
$this->_query = 'DELETE FROM ' . $this->_getTableName() . $this->_makeWhereClause();
if ($option == 'count') {
$result = POD::queryCount($this->_query);
$this->_manage_pool_stack();
return $result;
}
$result = POD::query($this->_query);
if ($result) {
$this->_manage_pool_stack();
return true;
}
return false;
}
示例12: updateSubscriptionStatistics
function updateSubscriptionStatistics($target, $mother)
{
global $database, $blogURL;
$blogid = getBlogId();
$period = Timestamp::getDate();
requireComponent('Textcube.Data.Filter');
if (Filter::isFiltered('ip', $_SERVER['REMOTE_ADDR'])) {
return;
}
$ip = POD::escapeString($_SERVER['REMOTE_ADDR']);
$host = POD::escapeString(isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : '');
$useragent = POD::escapeString(isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '');
POD::query("INSERT INTO {$database['prefix']}SubscriptionLogs values({$blogid}, '{$ip}', '{$host}', '{$useragent}', UNIX_TIMESTAMP())");
POD::query("DELETE FROM {$database['prefix']}SubscriptionLogs WHERE referred < UNIX_TIMESTAMP() - 604800");
if (!POD::queryCount("UPDATE {$database['prefix']}SubscriptionStatistics SET referred = UNIX_TIMESTAMP() WHERE blogid = {$blogid} AND ip = '{$ip}' AND host = '{$host}' AND useragent = '{$useragent}'")) {
POD::query("INSERT INTO {$database['prefix']}SubscriptionStatistics VALUES ({$blogid}, '{$ip}', '{$host}', '{$useragent}', UNIX_TIMESTAMP(),UNIX_TIMESTAMP())");
}
return $target;
}
示例13: clearPluginTable
function clearPluginTable($name)
{
global $database;
$name = POD::escapeString($name);
$count = POD::queryCount("DELETE FROM {$database['prefix']}{$name} WHERE blogid = " . getBlogId());
return $count == 1;
}
示例14: isLoginId
function isLoginId($blogid, $loginid)
{
global $database;
$loginid = POD::escapeString($loginid);
// 팀블로그 :: 팀원 확인
$result = POD::queryCount("SELECT u.userid \n\t\t\tFROM {$database['prefix']}Users u, \n\t\t\t\t{$database['prefix']}Privileges t \n\t\t\tWHERE t.blogid = {$blogid} \n\t\t\t\tAND u.loginid = '{$loginid}' \n\t\t\t\tAND t.userid = u.userid");
// End TeamBlog
if ($result && $result === 1) {
return true;
}
return false;
}
示例15: _t
if ($service['type'] != "single") {
?>
<th><?php
echo _t('바로 가기');
?>
</th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
$row = 25;
$bloglist = POD::queryColumn("SELECT blogid,name FROM `{$database['prefix']}BlogSettings` WHERE name = 'name' ORDER BY blogid ASC LIMIT " . ($page - 1) * $row . " ,{$row}");
$blogcount = POD::queryCount("SELECT blogid FROM `{$database['prefix']}BlogSettings` WHERE name = 'name'");
$pages = (int) (($blogcount - 0.5) / $row) + 1;
if ($pages < $page) {
printRespond(array('error' => -2, 'result' => $pages));
}
if ($bloglist) {
$tempString = "";
foreach ($bloglist as $itemBlogId) {
$result = POD::queryAll("SELECT * FROM `{$database['prefix']}BlogSettings` WHERE blogid = {$itemBlogId}");
foreach ($result as $row) {
$bsetting[$row['name']] = $row['value'];
}
$bsetting['owner'] = POD::queryCell("SELECT userid FROM `{$database['prefix']}Privileges` WHERE acl & " . BITWISE_OWNER . " != 0 AND blogid = " . $itemBlogId);
?>
<tr id="table-blog-list_<?php
echo $itemBlogId;