当前位置: 首页>>代码示例>>PHP>>正文


PHP POD::num_rows方法代码示例

本文整理汇总了PHP中POD::num_rows方法的典型用法代码示例。如果您正苦于以下问题:PHP POD::num_rows方法的具体用法?PHP POD::num_rows怎么用?PHP POD::num_rows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在POD的用法示例。


在下文中一共展示了POD::num_rows方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: open

 function open($filter = '', $fields = '*', $sort = 'subscribed DESC')
 {
     global $database;
     if (is_numeric($filter)) {
         $filter = 'AND id = ' . $filter;
     } else {
         if (!empty($filter)) {
             $filter = 'AND ' . $filter;
         }
     }
     if (!empty($sort)) {
         $sort = 'ORDER BY ' . $sort;
     }
     $this->close();
     $this->_result = POD::query("SELECT {$fields} FROM {$database['prefix']}SubscriptionStatistics WHERE blogid = " . getBlogId() . " {$filter} {$sort}");
     if ($this->_result) {
         if ($this->_count = POD::num_rows($this->_result)) {
             return $this->shift();
         } else {
             POD::free($this->_result);
         }
     }
     unset($this->_result);
     return false;
 }
开发者ID:ni5am,项目名称:Textcube,代码行数:25,代码来源:Textcube.Data.SubscriptionStatistics.php

示例2: open

 function open($filter = '', $fields = '*', $sort = 'id')
 {
     global $database;
     if (is_numeric($filter)) {
         $filter = 'AND id = ' . $filter;
     } else {
         if (!empty($filter)) {
             $filter = 'AND ' . $filter;
         }
     }
     if (!empty($sort)) {
         $sort = 'ORDER BY ' . $sort;
     }
     $this->close();
     $this->_result = POD::query("SELECT {$fields}\n\t\t\tFROM {$database['prefix']}Comments\n\t\t\tWHERE blogid = " . getBlogId() . "\n\t\t\t\tAND entry = 0\n\t\t\t\t{$filter} {$sort}");
     if ($this->_result) {
         if ($this->_count = POD::num_rows($this->_result)) {
             return $this->shift();
         } else {
             POD::free($this->_result);
         }
     }
     unset($this->_result);
     return false;
 }
开发者ID:webhacking,项目名称:Textcube,代码行数:25,代码来源:Textcube.Data.GuestComment.php

示例3: open

 function open($filter = '', $fields = '*', $sort = 'datemark DESC')
 {
     $ctx = Model_Context::getInstance();
     if (is_numeric($filter)) {
         $filter = 'AND datemark = ' . $filter;
     } else {
         if (!empty($filter)) {
             $filter = 'AND ' . $filter;
         }
     }
     if (!empty($sort)) {
         $sort = 'ORDER BY ' . $sort;
     }
     $this->close();
     $this->_result = POD::query("SELECT {$fields} FROM " . $ctx->getProperty('database.prefix') . "DailyStatistics WHERE blogid = " . getBlogId() . " {$filter} {$sort}");
     if ($this->_result) {
         if ($this->_count = POD::num_rows($this->_result)) {
             return $this->shift();
         } else {
             POD::free($this->_result);
         }
     }
     unset($this->_result);
     return false;
 }
开发者ID:Avantians,项目名称:Textcube,代码行数:25,代码来源:Textcube.Data.DailyStatistics.php

示例4: open

 function open($filter = '', $fields = '*', $sort = 'written')
 {
     global $database;
     if (is_numeric($filter)) {
         $filter = 'AND id = ' . $filter;
     } else {
         if (!empty($filter)) {
             $filter = 'AND ' . $filter;
         }
     }
     if (!empty($sort)) {
         $sort = 'ORDER BY ' . $sort;
     }
     $this->close();
     $this->_result = POD::query("SELECT {$fields} FROM {$database['prefix']}RemoteResponses WHERE blogid = " . getBlogId() . " AND responsetype = 'trackback' {$filter} {$sort}");
     if ($this->_result) {
         if ($this->_count = POD::num_rows($this->_result)) {
             return $this->shift();
         } else {
             POD::free($this->_result);
         }
     }
     unset($this->_result);
     return false;
 }
开发者ID:ni5am,项目名称:Textcube,代码行数:25,代码来源:Textcube.Data.Trackback.php

示例5: open

 function open($filter = '', $sort = 'id')
 {
     global $database;
     if (is_numeric($filter)) {
         $filter = 'AND id = ' . $filter;
     } else {
         if (!empty($filter)) {
             $filter = 'AND filtertype = \'' . $filter . '\'';
         }
     }
     if (!empty($sort)) {
         $sort = 'ORDER BY ' . $sort;
     }
     $this->close();
     $this->_result = POD::query("SELECT * FROM {$database['prefix']}Filters WHERE blogid = " . getBlogId() . " {$filter} {$sort}");
     if ($this->_result) {
         if ($this->_count = POD::num_rows($this->_result)) {
             return $this->shift();
         } else {
             POD::free($this->_result);
         }
     }
     unset($this->_result);
     return false;
 }
开发者ID:webhacking,项目名称:Textcube,代码行数:25,代码来源:Textcube.Data.Filter.php

示例6: open

 function open($name = '', $fields = '*', $sort = 'name')
 {
     global $database;
     if (!empty($name)) {
         $name = 'WHERE name = \'' . $name . '\'';
     }
     if (!empty($sort)) {
         $sort = 'ORDER BY ' . $sort;
     }
     $this->close();
     $this->_result = POD::query("SELECT {$fields} FROM {$database['prefix']}ServiceSettings {$name} {$sort}");
     if ($this->_result) {
         $this->_count = POD::num_rows($this->_result);
     }
     return $this->shift();
 }
开发者ID:ni5am,项目名称:Textcube,代码行数:16,代码来源:Textcube.Data.ServiceSetting.php

示例7: open

 function open($name = '', $fields = '*', $sort = 'name')
 {
     global $database;
     if (!empty($name)) {
         $name = 'AND name = \'' . $name . '\'';
     }
     if (!empty($sort)) {
         $sort = 'ORDER BY ' . $sort;
     }
     $this->close();
     $this->_result = POD::query("SELECT {$fields} FROM {$database['prefix']}Plugins WHERE blogid = " . getBlogId() . " {$name} {$sort}");
     if ($this->_result) {
         $this->_count = POD::num_rows($this->_result);
     }
     return $this->shift();
 }
开发者ID:Avantians,项目名称:Textcube,代码行数:16,代码来源:Textcube.Data.PluginSetting.php

示例8: open

 function open($filter = '', $fields = '*', $sort = 'id')
 {
     global $database;
     if (is_numeric($filter)) {
         $filter = 'AND id = ' . $filter;
     } else {
         if (!empty($filter)) {
             $filter = 'AND ' . $filter;
         }
     }
     if (!empty($sort)) {
         $sort = 'ORDER BY ' . $sort;
     }
     $this->close();
     $this->_result = POD::query("SELECT {$fields} FROM {$database['prefix']}LinkCategories WHERE blogid = " . getBlogId() . " {$filter} {$sort}");
     if ($this->_result) {
         $this->_count = POD::num_rows($this->_result);
     }
     return $this->shift();
 }
开发者ID:ragi79,项目名称:Textcube,代码行数:20,代码来源:Textcube.Data.LinkCategories.php

示例9: 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>&nbsp;' . _t("Related entries") . '&nbsp;</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:&nbsp;{$comments}&nbsp;|&nbsp;Trackbacks:&nbsp;{$trackbacks}&nbsp;|&nbsp;{$created}</span></li>";
            }
        } else {
            $html .= "<li>" . _t("No related entries.") . "</li>";
        }
        $html .= <<<EOF
\t\t</ul>
\t</div>
EOF;
    }
    return $target . $html;
}
开发者ID:hinablue,项目名称:TextCube,代码行数:41,代码来源:index.php

示例10: open

 function open($filter = 'True', $fields = '*', $sort = 'id')
 {
     global $database;
     if (is_numeric($filter)) {
         $filter = 'id = ' . $filter;
     }
     if (!empty($sort)) {
         $sort = 'ORDER BY ' . $sort;
     }
     $this->close();
     $this->_result = POD::query("SELECT {$fields} FROM {$database['prefix']}CommentsNotifiedSiteInfo WHERE {$filter} {$sort}");
     if ($this->_result) {
         if ($this->_count = POD::num_rows($this->_result)) {
             return $this->shift();
         } else {
             POD::free($this->_result);
         }
     }
     unset($this->_result);
     return false;
 }
开发者ID:ragi79,项目名称:Textcube,代码行数:21,代码来源:Textcube.Data.CommentNotifiedSiteInfo.php

示例11: open

 function open($filter = '', $fields = '*', $sort = 'published DESC')
 {
     global $database;
     $this->close();
     $this->init();
     if (is_numeric($filter)) {
         $filter = 'AND id = ' . $filter;
     } else {
         if (!empty($filter)) {
             $filter = 'AND ' . $filter;
         }
     }
     if (!empty($sort)) {
         $sort = 'ORDER BY ' . $sort;
     }
     $this->_result = POD::query("SELECT {$fields} FROM {$database['prefix']}Entries WHERE blogid = {$this->blogid} AND draft = 0 AND category >= 0 {$filter} {$sort}");
     if ($this->_result) {
         $this->_count = POD::num_rows($this->_result);
     }
     return $this->shift();
 }
开发者ID:ragi79,项目名称:Textcube,代码行数:21,代码来源:Textcube.Data.Post.php

示例12: open

 function open($filter = '', $fields = '*', $sort = 'attached')
 {
     global $database;
     $blogid = getBlogId();
     if (!empty($filter)) {
         $filter = 'AND ' . $filter;
     }
     if (!empty($sort)) {
         $sort = 'ORDER BY ' . $sort;
     }
     $this->close();
     $this->_result = POD::query("SELECT {$fields} FROM {$database['prefix']}Attachments WHERE blogid = {$blogid} {$filter} {$sort}");
     if ($this->_result) {
         if ($this->_count = POD::num_rows($this->_result)) {
             return $this->shift();
         } else {
             POD::free($this->_result);
         }
     }
     unset($this->_result);
     return false;
 }
开发者ID:ragi79,项目名称:Textcube,代码行数:22,代码来源:Textcube.Data.Attachment.php

示例13: open

 function open($filter = '', $fields = 'i.*', $sort = 'id')
 {
     global $database;
     if (is_numeric($filter)) {
         $filter = 'AND id = ' . $filter;
     } else {
         if (!empty($filter)) {
             $filter = 'AND ' . $filter;
         }
     }
     if (!empty($sort)) {
         $sort = 'ORDER BY ' . $sort;
     }
     $this->close();
     $this->_result = POD::query("SELECT {$fields}\n\t\t\t\tFROM {$database['prefix']}FeedItems i \n\t\t\t\tJOIN {$database['prefix']}FeedGroupRelations g ON i.feed = g.feed \n\t\t\t\tWHERE g.blogid = {$blogid} {$filter} {$sort}");
     if ($this->_result) {
         if ($this->_count = POD::num_rows($this->_result)) {
             return $this->shift();
         } else {
             POD::free($this->_result);
         }
     }
     unset($this->_result);
     return false;
 }
开发者ID:ni5am,项目名称:Textcube,代码行数:25,代码来源:Textcube.Data.Feed.php

示例14: remove

 function remove($id)
 {
     global $database;
     $this->init();
     if (is_numeric($id)) {
         return false;
     }
     $result = POD::query("DELETE FROM {$database['prefix']}Entries WHERE blogid = " . getBlogId() . " AND category = -2 AND id = {$id}");
     if ($result && ($this->_count = POD::num_rows($result))) {
         return true;
     }
     return false;
 }
开发者ID:Avantians,项目名称:Textcube,代码行数:13,代码来源:Textcube.Data.Notice.php

示例15: mailNotifyComment

function mailNotifyComment($target, $mother)
{
    global $blogid, $hostURL, $blogURL, $database, $service, $configVal, $serviceURL, $pluginURL;
    requireComponent('TextCube.Function.misc');
    include_once ROOT . "/library/contrib/phpmailer/class.phpmailer.php";
    $mail = new PHPMailer();
    $data = misc::fetchConfigVal($configVal);
    $type = 1;
    // comment
    if ($mother['entry'] == 0) {
        $type = 3;
    }
    // guestbook
    $notifyType = isset($data['notifysetting']) && (int) $data['notifysetting'] === 1 ? true : false;
    $notifyGuestbook = isset($data['notifyguestbook']) && (int) $data['notifyguestbook'] === 1 ? true : false;
    $userid = getUserId();
    if ($userid === 0) {
        $userid = POD::queryCell("SELECT `userid` FROM `{$database['prefix']}Privileges` WHERE `acl`='16' AND `blogid`='{$blogid}' LIMIT 1");
    }
    $mailselfcheck = $mother['replier'] === $userid ? true : false;
    $mailercheck = false;
    if (1 === $type || 3 === $type && $notifyGuestbook) {
        if ($notifyType === true) {
            if ($mailselfcheck === false) {
                $email = isset($data['mail']) && !empty($data['mail']) ? $data['mail'] : POD::queryCell("SELECT `loginid` FROM `{$database['prefix']}Users` WHERE `userid`='{$userid}' LIMIT 1");
                $name = POD::queryCell("SELECT `name` FROM `{$database['prefix']}Users` WHERE `userid`={$userid} LIMIT 1");
                $mail->AddAddress($email, $name);
                $mailercheck = true;
            }
        } else {
            $result = POD::query("SELECT `u`.`userid`, `u`.`loginid` AS email, `u`.`name` FROM `{$database['prefix']}Users` AS u\r\n                LEFT JOIN `{$database['prefix']}Privileges` AS p ON `p`.`userid` = `u`.`userid` WHERE `p`.`blogid`='{$blogid}'");
            if (POD::num_rows($result) > 0) {
                while ($row = POD::fetch($result, 'array')) {
                    if ($row['userid'] === $userid || $row['userid'] === $mother['replier']) {
                        $mail->AddAddress($row['email'], $row['name']);
                    } else {
                        $mail->AddCC($row['email'], $row['name']);
                    }
                    $mailercheck = true;
                }
            }
        }
    }
    if ($mailercheck === true) {
        $link = $type === 1 ? "{$hostURL}{$blogURL}/{$mother['entry']}" : (!is_null($mother['parent']) && $mother['parent'] > 0 ? "{$hostURL}{$blogURL}/guestbook/" . $mother['parent'] . "#guestbook" . $mother['entry'] : "{$hostURL}{$blogURL}/guestbook/" . $mother['entry']);
        $message = "<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n</head>\r\n<body>\r\n<div style=\"text-align:left;\">\r\n<table style=\"width:100%;border:1px solid #000;\">\r\n<tr><th colspan=\"2\"> " . _f('You have a new %1 %2.', $mother['secret'] === true ? _t('secret') : '', $type === 1 ? _t('comment.') : _t('message.')) . " </th></tr>\r\n<tr><td style=\"width:150px;\">" . _t('link') . "</td><td><a href=\"" . $link . "\">" . _t('link') . "</a></td></tr>\r\n<tr><td style=\"width:150px;\">" . _t('nickname') . "</td><td>" . $mother['name'] . "</td></tr>\r\n<tr><td colspan=\"2\">" . _t('content') . "</td></tr>\r\n<tr><td colspan=\"2\">" . nl2br($mother['comment']) . "<br /><br />via IP:" . $mother['ip'] . "</td></tr>\r\n</table>\r\n</div>\r\n<p style=\"text-align:center;color:#999999;font-size: 0.75em;\">MailNotification By TextCube.</p>\r\n</body>\r\n</html>";
        ob_start();
        $mail->SetLanguage('en', ROOT . "/library/contrib/phpmailer/language/");
        $mail->IsHTML(true);
        $mail->CharSet = 'utf-8';
        $mail->From = "noreply@" . $service['domain'];
        $mail->FromName = "TextCube Mail Notification";
        $mail->Subject = !isset($data['emailsubject']) || empty($data['emailsubject']) ? _t("[TextCube] New message notification.") : $data['emailsubject'];
        $mail->Body = $message;
        $mail->AltBody = 'To view this email message, open the email with html enabled mailer.';
        if (!getServiceSetting('useCustomSMTP', 0)) {
            $mail->IsMail();
        } else {
            $mail->IsSMTP();
            $mail->Host = getServiceSetting('smtpHost', '127.0.0.1');
            $mail->Port = getServiceSetting('smtpPort', 25);
        }
        $mail->Send();
        $mail->ClearAddresses();
        $mail->ClearCCs();
        ob_end_clean();
    }
    return $target;
}
开发者ID:hinablue,项目名称:TextCube,代码行数:69,代码来源:index.php


注:本文中的POD::num_rows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。