本文整理汇总了PHP中POD::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP POD::fetch方法的具体用法?PHP POD::fetch怎么用?PHP POD::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类POD
的用法示例。
在下文中一共展示了POD::fetch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shift
function shift()
{
$this->reset();
if ($this->_result && ($row = POD::fetch($this->_result))) {
foreach ($row as $name => $value) {
switch ($name) {
case 'blogid':
case 'draft':
case 'category':
unset($name);
break;
case 'visibility':
if ($value <= 0) {
$value = 'private';
} else {
$value = 'public';
}
break;
}
if (isset($name)) {
$this->{$name} = $value;
}
}
return true;
}
return false;
}
示例2: shift
function shift()
{
$this->reset();
if ($this->_result && ($row = POD::fetch($this->_result))) {
foreach ($row as $name => $value) {
if ($name == 'blogid') {
continue;
}
switch ($name) {
case 'name':
$name = 'name';
break;
case 'priority':
$name = 'priority';
break;
case 'visibility':
$name = 'visibility';
break;
}
$this->{$name} = $value;
}
return true;
}
return false;
}
示例3: shift
function shift()
{
$this->reset();
if ($this->_result && ($row = POD::fetch($this->_result))) {
foreach ($row as $name => $value) {
$this->{$name} = $value;
}
return true;
}
return false;
}
示例4: getTags
function getTags($blogid, $entry)
{
global $database;
$tags = array();
if (doesHaveOwnership()) {
$result = POD::query("SELECT t.* FROM {$database['prefix']}Tags t\n\t\t\tINNER JOIN {$database['prefix']}TagRelations r ON r.blogid = {$blogid} AND r.tag = t.id AND r.entry = {$entry} AND r.tag = t.id\n\t\t\tGROUP BY r.tag, t.id, t.name \n\t\t\tORDER BY t.name");
} else {
$result = POD::query("SELECT t.* FROM {$database['prefix']}Tags t\n\t\t\tINNER JOIN {$database['prefix']}TagRelations r ON r.blogid = {$blogid} AND r.entry = {$entry} AND r.tag = t.id\n\t\t\tINNER JOIN {$database['prefix']}Entries e ON e.id = r.entry AND e.visibility > 0\n\t\t\tGROUP BY r.tag, t.id, t.name\n\t\t\tORDER BY t.name");
}
if ($result) {
while ($tag = POD::fetch($result)) {
array_push($tags, $tag);
}
}
return $tags;
}
示例5: shift
function shift()
{
$this->reset();
if ($this->_result && ($row = POD::fetch($this->_result))) {
foreach ($row as $name => $value) {
switch ($name) {
case 'value':
$name = 'value';
break;
}
$this->{$name} = $value;
}
return true;
}
return false;
}
示例6: load
function load()
{
global $database;
$this->reset();
if ($result = POD::query("SELECT visits FROM {$database['prefix']}BlogStatistics WHERE blogid = " . getBlogId())) {
if ($row = POD::fetch($result)) {
foreach ($row as $name => $value) {
if ($name == 'owner') {
continue;
}
$this->{$name} = $value;
}
POD::free($result);
return true;
}
POD::free($result);
}
return false;
}
示例7: shift
function shift()
{
$this->reset();
if ($this->_result && ($row = POD::fetch($this->_result))) {
foreach ($row as $name => $value) {
if ($name == 'blogid') {
continue;
}
switch ($name) {
case 'settings':
$name = 'setting';
break;
}
$this->{$name} = $value;
}
return true;
}
return false;
}
示例8: 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;
}
示例9: getRemoteResponseLogs
function getRemoteResponseLogs($blogid, $entryId, $type = null)
{
global $database;
if ($type === null) {
$filter = '';
} else {
$filter = " AND responsetype = '" . POD::escapeString($type) . "'";
}
$logs = array();
$result = POD::query("SELECT * FROM {$database['prefix']}RemoteResponseLogs WHERE blogid = {$blogid} AND entry = {$entryId} {$filter}");
while ($log = POD::fetch($result)) {
array_push($logs, $log);
}
return $logs;
}
示例10: getRecentEntries
function getRecentEntries($blogid)
{
global $database, $skinSetting;
$entries = array();
$visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 0' . getPrivateCategoryExclusionQuery($blogid);
$result = POD::query("SELECT e.id, e.userid, e.title, e.slogan, e.comments, e.published \n\t\tFROM {$database['prefix']}Entries e\n\t\tWHERE e.blogid = {$blogid} AND e.draft = 0 {$visibility} AND e.category >= 0 \n\t\tORDER BY published DESC LIMIT {$skinSetting['entriesOnRecent']}");
while ($entry = POD::fetch($result)) {
array_push($entries, $entry);
}
return $entries;
}
示例11: checkStep
//.........这里部分代码省略.........
?>
"><img src="./resources/style/setup/image/icon_next.gif" width="74" height="24" alt="<?php
echo _t('다음');
?>
" /></a>
</div>
</div>
<?php
} else {
if ($step == 6) {
if ($check) {
if (!empty($_POST['email']) && !empty($_POST['password']) && !empty($_POST['password2']) && ($_POST['type'] == 'single' || !empty($_POST['blog'])) && isset($_POST['name'])) {
if (!preg_match('/^[^@]+@([-a-zA-Z0-9]+\\.)+[-a-zA-Z0-9]+$/', $_POST['email'])) {
$error = 51;
} else {
if ($_POST['password'] != $_POST['password2']) {
$error = 52;
} else {
if ($_POST['type'] != 'single' && !preg_match('/^[a-zA-Z0-9]+$/', $_POST['blog'])) {
$error = 53;
} else {
if (strlen($_POST['password']) < 6 || strlen($_POST['password2']) < 6) {
$error = 54;
} else {
return true;
}
}
}
}
}
} else {
@POD::query('SET CHARACTER SET utf8');
if ($result = @POD::query("SELECT loginid, password, name FROM {$_POST['dbPrefix']}Users WHERE userid = 1")) {
@(list($_POST['email'], $_POST['password'], $_POST['name']) = POD::fetch($result, 'row'));
$_POST['password2'] = $_POST['password'];
POD::free($result);
}
if ($result = @POD::queryCell("SELECT value FROM {$_POST['dbPrefix']}BlogSettings\n\t\t\t\t\t\tWHERE blogid = 1\n\t\t\t\t\t\t\tAND name = 'name'")) {
$_POST['blog'] = $result;
}
}
?>
<input type="hidden" name="step" value="<?php
echo $step;
?>
" />
<input type="hidden" name="mode" value="<?php
echo $_POST['mode'];
?>
" />
<input type="hidden" name="dbms" value="<?php
echo isset($_POST['dbms']) ? $_POST['dbms'] : '';
?>
" />
<input type="hidden" name="dbServer" value="<?php
echo isset($_POST['dbServer']) ? $_POST['dbServer'] : '';
?>
" />
<input type="hidden" name="dbPort" value="<?php
echo isset($_POST['dbPort']) ? $_POST['dbPort'] : '';
?>
" />
<input type="hidden" name="dbName" value="<?php
echo isset($_POST['dbName']) ? $_POST['dbName'] : '';
?>
" />
示例12: buildSitemap
public function buildSitemap()
{
global $blog, $database, $service, $hostURL, $blogid;
$this->runStart = $this->getMicrotime();
if (!is_dir(ROOT . '/cache/sitemap')) {
mkdir(ROOT . '/cache/sitemap');
chmod(ROOT . '/cache/sitemap', 0755);
}
if (!is_dir(ROOT . '/cache/sitemap/' . $blogid)) {
mkdir(ROOT . '/cache/sitemap/' . $blogid);
chmod(ROOT . '/cache/sitemap/' . $blogid, 0755);
}
$userid = getUserId();
$userBlogUrl = getBlogURL();
$cacheFile = ROOT . '/cache/sitemap/' . $blogid . '/' . $this->filename;
$gzcacheFile = $cacheFile . '.gz';
$rootgzFile = ROOT . '/cache/sitemap/' . $this->filename . '.gz';
/* xml-sitemap schemas */
ob_start();
echo '<?xml version="1.0" encoding="UTF-8"?>', CRLF;
echo '<urlset', CRLF;
echo ' xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"', CRLF;
echo ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"', CRLF;
echo ' xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9', CRLF;
echo ' http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">', CRLF, CRLF;
/// build blog root, subroot
echo '<url>', CRLF;
echo ' <loc>', $userBlogUrl, '/</loc>', CRLF;
echo ' <priority>0.8</priority>', CRLF;
echo ' <changefreq>daily</changefreq>', CRLF;
echo '</url>', CRLF;
echo '<url>', CRLF;
echo ' <loc>', $userBlogUrl, '/cover</loc>', CRLF;
echo ' <priority>0.8</priority>', CRLF;
echo ' <changefreq>daily</changefreq>', CRLF;
echo '</url>', CRLF;
echo '<url>', CRLF;
echo ' <loc>', $userBlogUrl, '/notice</loc>', CRLF;
echo ' <priority>0.8</priority>', CRLF;
echo ' <changefreq>daily</changefreq>', CRLF;
echo '</url>', CRLF;
echo '<url>', CRLF;
echo ' <loc>', $userBlogUrl, '/tag</loc>', CRLF;
echo ' <priority>0.8</priority>', CRLF;
echo ' <changefreq>daily</changefreq>', CRLF;
echo '</url>', CRLF;
echo '<url>', CRLF;
echo ' <loc>', $userBlogUrl, '/location</loc>', CRLF;
echo ' <priority>0.8</priority>', CRLF;
echo ' <changefreq>daily</changefreq>', CRLF;
echo '</url>', CRLF;
echo '<url>', CRLF;
echo ' <loc>', $userBlogUrl, '/keylog</loc>', CRLF;
echo ' <priority>0.8</priority>', CRLF;
echo ' <changefreq>daily</changefreq>', CRLF;
echo '</url>', CRLF;
echo '<url>', CRLF;
echo ' <loc>', $userBlogUrl, '/guestbook</loc>', CRLF;
echo ' <priority>0.8</priority>', CRLF;
echo ' <changefreq>daily</changefreq>', CRLF;
echo '</url>', CRLF;
echo '<url>', CRLF;
echo ' <loc>', $userBlogUrl, '/rss</loc>', CRLF;
echo ' <priority>0.8</priority>', CRLF;
echo ' <changefreq>daily</changefreq>', CRLF;
echo '</url>', CRLF;
$notices = POD::query("SELECT `id`,`slogan` FROM {$database['prefix']}Entries WHERE `category`=-2 AND `visibility`>=2 AND `userid`={$userid} AND `blogid`={$blogid} ORDER BY `created` ASC");
while ($row = POD::fetch($notices, 'array')) {
$permalink = $blog['useSloganOnPost'] ? urlencode($row['slogan']) : $row['id'];
echo '<url>', CRLF;
echo ' <loc>', $userBlogUrl, '/notice/', $permalink, '</loc>', CRLF;
echo ' <priority>0.8</priority>', CRLF;
echo ' <changefreq>daily</changefreq>', CRLF;
echo '</url>', CRLF;
}
$entries = POD::query("SELECT `id`,`slogan` FROM {$database['prefix']}Entries WHERE `category`>=0 AND `visibility`>=2 AND `userid`={$userid} AND `blogid`={$blogid} ORDER BY `created` ASC");
while ($row = POD::fetch($entries, 'array')) {
$permalink = $blog['useSloganOnPost'] ? urlencode($row['slogan']) : $row['id'];
echo '<url>', CRLF;
echo ' <loc>', $userBlogUrl, '/', $blog['useSloganOnPost'] ? 'entry/' : '', $permalink, '</loc>', CRLF;
echo ' <priority>0.5</priority>', CRLF;
echo ' <changefreq>daily</changefreq>', CRLF;
echo '</url>', CRLF;
}
echo '</urlset>', CRLF;
$sitemapIndexes = ob_get_contents();
ob_end_clean();
$this->runEnd = $this->getMicrotime();
$fp = fopen($cacheFile, "w+");
if (fwrite($fp, $sitemapIndexes)) {
fclose($fp);
chmod($cacheFile, 0644);
$zp = gzopen($gzcacheFile, "w9");
if (gzwrite($zp, $sitemapIndexes)) {
gzclose($zp);
chmod($gzcacheFile, 0644);
if (copy($gzcacheFile, $rootgzFile)) {
return true;
} else {
return false;
//.........这里部分代码省略.........
示例13: correctTagsAll
function correctTagsAll()
{
global $database;
$targetresult = POD::query("SELECT * FROM {$database['prefix']}TagRelations");
if ($targetresult != false) {
while ($target = POD::fetch($targetresult)) {
$oldtag = POD::queryRow("SELECT id, name FROM {$database['prefix']}Tags WHERE id = {$target['tag']}");
if (!is_null($oldtag)) {
$tagid = POD::queryCell("SELECT id FROM {$database['prefix']}Tags WHERE name = '" . POD::escapeString($oldtag['name']) . "' LIMIT 1 ");
if (is_null($tagid)) {
POD::execute("DELETE FROM {$database['prefix']}TagRelations WHERE blogid = {$target['blogid']} AND tag = {$target['tag']} AND entry = {$target['entry']}");
} else {
if ($tagid == $oldtag['id']) {
continue;
}
if (POD::execute("UPDATE {$database['prefix']}TagRelations SET tag = {$tagid} WHERE blogid = {$target['blogid']} AND tag = {$target['tag']} AND entry = {$target['entry']}") == false) {
// maybe duplicated tag
POD::execute("DELETE FROM {$database['prefix']}TagRelations WHERE blogid = {$target['blogid']} AND tag = {$target['tag']} AND entry = {$target['entry']}");
}
}
} else {
// Ooops!
POD::execute("DELETE FROM {$database['prefix']}TagRelations WHERE blogid = {$target['blogid']} AND tag = {$target['tag']} AND entry = {$target['entry']}");
}
}
POD::free($targetresult);
}
$targetresult = POD::query("SELECT id FROM {$database['prefix']}Tags LEFT JOIN {$database['prefix']}TagRelations ON id = tag WHERE tag IS NULL");
if ($targetresult != false) {
while ($target = POD::fetch($targetresult)) {
$tag = $target['id'];
POD::execute("DELETE FROM {$database['prefix']}Tags WHERE id = {$tag} ");
}
POD::free($targetresult);
}
}
示例14: deleteReaderTablesByOwner
function deleteReaderTablesByOwner($blogid)
{
global $database;
POD::query("DELETE FROM {$database['prefix']}FeedGroups WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}FeedSettings WHERE blogid = {$blogid}");
if ($result = POD::query("SELECT feed FROM {$database['prefix']}FeedGroupRelations WHERE blogid = {$blogid}")) {
while (list($feed) = POD::fetch($result)) {
deleteFeed($blogid, $feed);
}
}
return 0;
}
示例15: shift
function shift()
{
$this->reset();
if ($this->_result && ($row = POD::fetch($this->_result))) {
foreach ($row as $name => $value) {
if ($name == 'blogid') {
continue;
}
switch ($name) {
case 'permalink':
$name = 'link';
break;
case 'written':
$name = 'published';
break;
}
$this->{$name} = $value;
}
return true;
}
return false;
}