本文整理汇总了PHP中POD::queryAll方法的典型用法代码示例。如果您正苦于以下问题:PHP POD::queryAll方法的具体用法?PHP POD::queryAll怎么用?PHP POD::queryAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类POD
的用法示例。
在下文中一共展示了POD::queryAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEntriesByKeyword
function getEntriesByKeyword($blogid, $keyword)
{
global $database;
$keyword = POD::escapeString($keyword);
$visibility = doesHaveOwnership() ? '' : 'AND visibility > 1';
return POD::queryAll("SELECT id, userid, title, category, comments, published \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 >= 0 \n\t\t\t\tAND (title LIKE '%{$keyword}%' OR content LIKE '%{$keyword}%')\n\t\t\tORDER BY published DESC");
}
示例2: getTrackbackTrash
function getTrackbackTrash($entry)
{
global $database;
$trackbacks = array();
$result = POD::queryAll("SELECT * \n\t\t\tFROM {$database['prefix']}RemoteResponses \n\t\t\tWHERE blogid = " . getBlogId() . "\n\t\t\t\tAND entry = {$entry} \n\t\t\tORDER BY written", 'assoc');
if (!empty($result)) {
return $result;
} else {
return array();
}
}
示例3: suggestLocatives
function suggestLocatives($blogid, $filter)
{
global $database;
$locatives = array();
$result = POD::queryAll('SELECT DISTINCT location, COUNT(*) cnt FROM ' . $database['prefix'] . 'Entries WHERE blogid = ' . $blogid . ' AND location LIKE "' . POD::escapeString($filter) . '%" GROUP BY location ORDER BY cnt DESC LIMIT 10');
if ($result) {
foreach ($result as $locative) {
$locatives[] = $locative[0];
}
}
return $locatives;
}
示例4: ViewCounterList
function ViewCounterList($target)
{
global $database, $blogid, $blogURL, $skinSetting;
$result = POD::queryAll("SELECT b.id, b.title, a.readcounts FROM {$database['prefix']}EntryReadCount a INNER JOIN {$database['prefix']}Entries b ON a.blogid = b.blogid AND a.id = b.id WHERE a.blogid={$blogid} AND b.visibility >= 2 AND b.draft = 0 AND b.category >=0 ORDER BY a.readcounts DESC LIMIT 0,5");
$target = "<ul>";
foreach ((array) $result as $row) {
$articleid = $row['id'];
$articletitle = htmlspecialchars(UTF8::lessenAsEm($row['title'], $skinSetting['recentEntryLength']));
$readcounts = $row['readcounts'];
$rsurl = "{$blogURL}/{$articleid}";
$target .= "<li><a href=\"{$rsurl}\">{$articletitle}</a> <span class=\"cnt\">({$readcounts})</span></li>\n";
}
$target .= "</ul>";
return $target;
}
示例5: str_repeat
";
//]]>
</script>
</head>
<body>
<?php
echo str_repeat('<!-- flush buffer -->', 400);
?>
<script type="text/javascript">
//<![CDATA[
var progress = parent.document.getElementById("progress");
progress.innerHTML = "(0%)";
//]]>
</script>
<?php
$feeds = POD::queryAll("SELECT f.*\n\t\tFROM {$database['prefix']}Feeds f,\n\t\t\t{$database['prefix']}FeedGroups g,\n\t\t\t{$database['prefix']}FeedGroupRelations gr\n\t\tWHERE g.blogid = {$blogid}\n\t\t\tAND gr.feed = f.id\n\t\t\tAND gr.blogid = g.blogid\n\t\t\tAND gr.groupid = g.id\n\t\tORDER BY f.title");
$count = 0;
foreach ($feeds as $feed) {
?>
<script type="text/javascript">
//<![CDATA[
var icon = parent.document.getElementById("iconFeedStatus<?php
echo $feed['id'];
?>
");
if(icon) {
try{
parent.Reader.startScroll("feedBox", getOffsetTop(icon) - getOffsetTop(parent.document.getElementById("feedBox")) - 50);
} catch(e) {alert(e.message);}
icon.src = servicePath + "/resources/style/default/image/reader/iconUpdateIng.gif";
}
示例6: getTagsWithEntryId
function getTagsWithEntryId($blogid, $entry)
{
global $database;
$tags = array();
foreach (POD::queryAll("SELECT DISTINCT name FROM {$database['prefix']}Tags, {$database['prefix']}TagRelations WHERE id = tag AND blogid = {$blogid} AND entry = {$entry['id']} ORDER BY name") as $tag) {
array_push($tags, $tag['name']);
}
return $tags;
}
示例7: PN_Blog_Statistics_Default
function PN_Blog_Statistics_Default()
{
global $database, $blogid, $defaultURL, $blogURL, $pluginURL, $pluginMenuURL, $configVal;
requireComponent('Textcube.Model.Statistics');
requireComponent('Textcube.Function.misc');
$data = misc::fetchConfigVal($configVal);
if (is_null($data)) {
$data['privateChk'] = 2;
}
$getVisibility = $data['privateChk'] == 2 ? " AND visibility > 0 " : "";
$stats = Statistics::getStatistics($blogid);
$getDate = isset($_GET['date']) ? $_GET['date'] : date('Y', strtotime("now"));
$getMenu = isset($_GET['menu']) ? $_GET['menu'] : "entry";
$getYear = substr($getDate, 0, 4);
$getMonth = substr($getDate, 4);
$yearRow = POD::queryAll("SELECT EXTRACT(YEAR FROM FROM_UNIXTIME(published)) period, COUNT(*) count FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND draft = 0 {$getVisibility} AND category >= 0 GROUP BY period ORDER BY period DESC");
$yearCell = POD::queryCell("SELECT COUNT(*) FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND draft = 0 {$getVisibility} AND category >= 0 AND EXTRACT(YEAR FROM FROM_UNIXTIME(published)) = '" . date('Y', strtotime("now")) . "'");
$yearAll = POD::queryCell("SELECT COUNT(*) FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND draft = 0 {$getVisibility} AND category >= 0");
$yearSelect = "<select id=\"yearSelect\" onchange=\"execDate(this);\">\n";
$yearSelect .= "<option value=\"\">" . _t(' - 년 도 -') . "</option>\n";
$selected = $getYear == 9999 ? " selected" : "";
$yearSelect .= "<option value=\"9999\" style=\"font-weight:bold;\" {$selected}>" . _t('#전체') . "({$yearAll})</option>\n";
if (!$yearCell) {
$selected = $getYear == date('Y', strtotime("now")) ? " selected" : "";
$yearSelect .= "<option value=\"" . date('Y', strtotime("now")) . "\" {$selected}>" . date('Y', strtotime("now")) . _t('년') . "(0)</option>\n";
}
foreach ($yearRow as $items) {
$selected = $getYear == $items['period'] ? " selected" : "";
$yearSelect .= "<option value=\"{$items['period']}\" {$selected}>{$items['period']}" . _t('년') . "({$items['count']})</option>\n";
}
$yearSelect .= "</select>\n";
$monthSelect = "<select id=\"monthSelect\" onchange=\"execDate(this);\">\n";
$monthSelect .= "<option value=\"\">- " . _t('월') . " -</option>\n";
$monthSelect .= "<option value=\"{$getYear}\" " . (strlen($getDate) == 4 ? " selected" : "") . ">" . _t('#전체') . "</option>\n";
for ($i = 1; $i <= 12; $i++) {
$gMonth = strlen($i) == 1 ? "0" . $i : $i;
$gValue = $getYear . $gMonth;
$selected = $getMonth == $gMonth ? " selected" : "";
$monthSelect .= "<option value=\"{$gValue}\" {$selected}>" . $gMonth . _t('월') . "</option>\n";
}
$monthSelect .= "</select>\n";
$noticeRow = POD::queryCell("SELECT COUNT(*) FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND draft = 0 {$getVisibility} AND category = -2");
//공지
$keywordRow = POD::queryCell("SELECT COUNT(*) FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND draft = 0 {$getVisibility} AND category = -1");
//키워드
?>
<script type="text/javascript">
//<![CDATA[
function execLoadFunction() {
tempDiv = document.createElement("DIV");
tempDiv.style.clear = "both";
document.getElementById("part-statistics-blog").appendChild(tempDiv);
}
function execDate(selectObject){
if(selectObject.options[selectObject.selectedIndex].value){
location.href="<?php
echo $pluginMenuURL;
?>
&date="+selectObject.options[selectObject.selectedIndex].value+"&menu=<?php
echo $getMenu;
?>
";
}
}
window.addEventListener("load", execLoadFunction, false);
//]]>
</script>
<div id="part-statistics-blog" class="part">
<h2 class="caption"><span class="main-text"><?php
echo _t('블로그 통계정보를 보여줍니다');
?>
</span></h2>
<div id="statistics-main">
<div id="statistics-counter-inbox">
<div class="title"><h3><?php
echo _t('종 합 정 보');
?>
</h3></div>
<table width="100%">
<tbody>
<tr class="tr">
<td colspan="2"><?php
echo _t('년/월별 선택');
?>
<br />
<?php
echo $yearSelect;
?>
<?php
echo $monthSelect;
?>
</td>
</tr>
<tr height="5"><td colspan="2"></td></tr>
<tr height="1" bgcolor="#dddddd"><td colspan="2"></td></tr>
<tr class="tr">
<td><?php
//.........这里部分代码省略.........
示例8: list
list($entries, $paging) = getEntriesWithPagingForOwner(getBlogId(), $categoryIdforPrint, $searchKeyword, $suri['page'], $perPage, $visibility, $starred, null, $tag);
// query string 생성.
$paging['postfix'] = NULL;
if ($categoryId != 0) {
$paging['postfix'] .= "&category={$categoryId}";
}
if (!empty($searchKeyword)) {
$paging['postfix'] .= '&search=' . urlencode($searchKeyword);
}
$tab['postfix'] = $paging['postfix'];
if (isset($_POST['visibility'])) {
$paging['postfix'] .= '&visibility=' . urlencode($_POST['visibility']);
}
$teamblog_users = null;
if (Acl::check('group.administrators')) {
$teamblog_users = POD::queryAll("SELECT u.*, p.acl FROM {$database['prefix']}Users AS u INNER JOIN {$database['prefix']}Privileges AS p ON u.userid = p.userid AND p.blogid = {$blogid} ORDER BY p.acl DESC, name ASC");
}
require ROOT . '/interface/common/owner/header.php';
?>
<script type="text/javascript">
//<![CDATA[
<?php
printScriptCheckTextcubeVersion();
?>
function setEntryVisibility(entry, visibility) {
if ((visibility < 0) || (visibility > 3))
return false;
<?php
if (Setting::getBlogSettingGlobal('visibility', 2) < 2) {
?>
if(visibility == 3) {
示例9: printIphoneTags
function printIphoneTags($blogid, $flag = 'random', $max = 10)
{
global $database, $skinSetting;
$tags = array();
$aux = "limit {$max}";
if ($flag == 'count') {
// order by count
$tags = POD::queryAll("SELECT name, count(*) AS cnt, t.id FROM {$database['prefix']}Tags t,\n\t\t\t\t{$database['prefix']}TagRelations r, \n\t\t\t\t{$database['prefix']}Entries e \n\t\t\t\tWHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.blogid = {$blogid} \n\t\t\t\tGROUP BY r.tag, name, cnt, t.id\n\t\t\t\tORDER BY cnt DESC {$aux}");
} else {
if ($flag == 'name') {
// order by name
$tags = POD::queryAll("SELECT DISTINCT name, count(*) AS cnt, t.id FROM {$database['prefix']}Tags t, \n\t\t\t\t{$database['prefix']}TagRelations r,\n\t\t\t\t{$database['prefix']}Entries e \n\t\t\t\tWHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.blogid = {$blogid} \n\t\t\t\tGROUP BY r.tag, name, cnt, t.id \n\t\t\t\tORDER BY t.name {$aux}");
} else {
// random
$tags = POD::queryAll("SELECT name, count(*) AS cnt, t.id FROM {$database['prefix']}Tags t,\n\t\t\t\t{$database['prefix']}TagRelations r,\n\t\t\t\t{$database['prefix']}Entries e\n\t\t\t\tWHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.blogid = {$blogid} \n\t\t\t\tGROUP BY r.tag \n\t\t\t\tORDER BY RAND() {$aux}");
}
}
return $tags;
}
示例10: getEntriesByTagId
function getEntriesByTagId($blogid, $tagId)
{
global $database;
return POD::queryAll('SELECT e.blogid, e.userid, e.id, e.title, e.comments, e.slogan, e.published FROM ' . $database['prefix'] . 'Entries e LEFT JOIN ' . $database['prefix'] . 'TagRelations t ON e.id = t.entry AND e.blogid = t.blogid WHERE e.blogid = ' . $blogid . ' AND t.tag = ' . $tagId);
}
示例11: removeBlog
function removeBlog($blogid)
{
global $database;
if (getServiceSetting("defaultBlogId", 1) == $blogid) {
return false;
}
$tags = POD::queryColumn("SELECT DISTINCT tag FROM {$database['prefix']}TagRelations WHERE blogid = {$blogid}");
$feeds = POD::queryColumn("SELECT DISTINCT feeds FROM {$database['prefix']}FeedGroupRelations WHERE blogid = {$blogid}");
//Clear Tables
POD::execute("DELETE FROM {$database['prefix']}Attachments WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}BlogSettings WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}BlogStatistics WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}Categories WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}Comments WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}CommentsNotified WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}CommentsNotifiedQueue WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}DailyStatistics WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}Entries WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}EntriesArchive WHERE blogid = {$blogid}");
// POD::execute("DELETE FROM {$database['prefix']}FeedGroupRelations WHERE blogid = $blogid");
POD::execute("DELETE FROM {$database['prefix']}FeedGroups WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}FeedReads WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}FeedStarred WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}FeedSettings WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}Filters WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}Links WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}LinkCategories WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}PageCacheLog WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}Plugins WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}RefererLogs WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}RefererStatistics WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}RemoteResponses WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}RemoteResponseLogs WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}SkinSettings WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}TagRelations WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}Privileges WHERE blogid = {$blogid}");
POD::execute("DELETE FROM {$database['prefix']}XMLRPCPingSettings WHERE blogid = {$blogid}");
//Delete Tags
if (count($tags) > 0) {
$tagliststr = implode(', ', $tags);
// Tag id used at deleted blog.
$nottargets = POD::queryColumn("SELECT DISTINCT tag FROM {$database['prefix']}TagRelations WHERE tag in ( {$tagliststr} )");
// Tag id used at other blogs.
if (count($nottargets) > 0) {
$nottargetstr = implode(', ', $nottargets);
POD::execute("DELETE FROM {$database['prefix']}Tags WHERE id IN ( {$tagliststr} ) AND id NOT IN ( {$nottargetstr} )");
} else {
POD::execute("DELETE FROM {$database['prefix']}Tags WHERE id IN ( {$tagliststr} ) ");
}
}
//Delete Feeds
if (count($feeds) > 0) {
foreach ($feeds as $feedId) {
deleteFeed($blogid, $feedId);
}
}
//Clear Plugin Database
// TODO : encapsulate with 'value'
$query = "SELECT name, value FROM {$database['prefix']}ServiceSettings WHERE name like 'Database\\_%'";
$plugintablesraw = POD::queryAll($query);
foreach ($plugintablesraw as $table) {
$dbname = $database['prefix'] . substr($table['name'], 9);
POD::execute("DELETE FROM {$database['prefix']}{$dbname} WHERE blogid = {$blogid}");
}
//Clear RSS Cache
if (file_exists(ROOT . "/cache/rss/{$blogid}.xml")) {
unlink(ROOT . "/cache/rss/{$blogid}.xml");
}
//Delete Attachments
Path::removeFiles(Path::combine(ROOT, 'attach', $blogid));
return true;
}
示例12: getAll
public function getAll($field = '*', $options = null)
{
$field = $this->_treatReservedFields($field);
$options = $this->_treatOptions($options);
if ($options['usedbcache'] == true) {
$result = POD::queryAllWithDBCache('SELECT ' . $options['filter'] . $field . ' FROM ' . $this->_getTableName() . $this->_extendClause() . $this->_makeWhereClause(), $options['cacheprefix']);
} else {
$result = POD::queryAll('SELECT ' . $options['filter'] . $field . ' FROM ' . $this->_getTableName() . $this->_extendClause() . $this->_makeWhereClause());
}
$this->_manage_pool_stack();
return $result;
}
示例13: array
<?php
/// Copyright (c) 2004-2012, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('GET' => array('id' => array('string'), 'input' => array('string', 'default' => ''), 'cursor' => array('number', 'min' => 1)));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
global $database;
header('Content-type: text/javascript');
$result = POD::queryAll("SELECT loginid,name FROM `{$database['prefix']}Users` WHERE name LIKE \"%" . $_GET['input'] . "%\" or loginid LIKE \"%" . $_GET['input'] . "%\" LIMIT 5");
if ($result) {
echo 'ctlUserSuggestFunction_showSuggestion("' . $_GET['id'] . '","' . $_GET['cursor'] . '",';
echo '"0"';
//TODO : clear
foreach ($result as $row) {
echo ',"' . $row['loginid'] . " - " . $row['name'] . '"';
}
echo ');';
} else {
echo 'ctlUserSuggestFunction_showSuggestion("' . $_GET['id'] . '","' . $_GET['cursor'] . '",';
echo '"-1"';
//TODO : clear
echo ');';
}
示例14: getSubscriptionLogs
function getSubscriptionLogs()
{
global $database;
$blogid = getBlogId();
return POD::queryAll("SELECT ip, host, useragent, referred FROM {$database['prefix']}SubscriptionLogs WHERE blogid = {$blogid} ORDER BY referred DESC LIMIT 1000");
}
示例15: getRecentGuestbook
function getRecentGuestbook($blogid, $count = false)
{
$ctx = Model_Context::getInstance();
$comments = array();
$sql = "SELECT r.*\n\t\tFROM\n\t\t\t" . $ctx->getProperty('database.prefix') . "Comments r\n\t\tWHERE\n\t\t\tr.blogid = {$blogid} AND r.entry = 0 AND r.isfiltered = 0\n\t\tORDER BY\n\t\t\tr.written\n\t\tDESC LIMIT " . ($count != false ? $count : $ctx->getProperty('skin.commentsOnRecent'));
if ($result = POD::queryAll($sql)) {
foreach ($result as $comment) {
if ($comment['secret'] == 1 && !doesHaveOwnership()) {
if (!doesHaveOpenIDPriv($comment)) {
$comment['name'] = '';
$comment['homepage'] = '';
$comment['comment'] = _text('관리자만 볼 수 있는 댓글입니다.');
}
}
array_push($comments, $comment);
}
}
return $comments;
}