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


PHP rss_fetch_row函数代码示例

本文整理汇总了PHP中rss_fetch_row函数的典型用法代码示例。如果您正苦于以下问题:PHP rss_fetch_row函数的具体用法?PHP rss_fetch_row怎么用?PHP rss_fetch_row使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: checkSchema

/**
 * Checks the db schema for the for all required tables, adds those which are missing.
 * Returns the number of added tables;
 */
function checkSchema()
{
    $missing_tables = array();
    $actual_tables = array();
    $expected_tables = getExpectedTables();
    $rs = rss_query("show tables", true, true);
    while (list($tbl) = rss_fetch_row($rs)) {
        $actual_tables[] = $tbl;
    }
    foreach ($expected_tables as $base => $tbl) {
        $exists = array_search($tbl, $actual_tables);
        if ($exists === FALSE || $exists === NULL) {
            $missing_tables[] = $base;
        }
    }
    $updated = 0;
    if (count($missing_tables) > 0) {
        $msg = (count($actual_tables) ? "Updating" : "Creating") . ' your database schema! This should be a one-time operation,' . ' if you see this message over and over again please import your database schema' . ' manually.';
        rss_error($msg, RSS_ERROR_WARNING);
        foreach ($missing_tables as $table) {
            $updated += call_user_func("_init_{$table}");
        }
        if ($updated == count($missing_tables)) {
            rss_error(__("Successfully created {$updated} of {$updated} database tables!"), RSS_ERROR_NOTICE);
        } else {
            rss_error(count($missing_tables) - $updated . " out of " . count($missing_tables) . " tables could not be created!", RSS_ERROR_ERROR);
        }
    }
    if ($updated) {
        rss_invalidate_cache();
    }
    return $updated;
}
开发者ID:nerdling,项目名称:gregarius,代码行数:37,代码来源:schema.php

示例2: relatedTags

function relatedTags($tags)
{
    /* related tags */
    $twhere = "";
    foreach ($tags as $tag) {
        $tag = rss_real_escape_string($tag);
        $twhere .= "t.tag='{$tag}' or ";
    }
    $twhere .= "1=0";
    $sql = "select fid,tid,m.tdate from " . getTable('metatag') . " m " . "inner join " . getTable('tag') . " t on t.id = m.tid  where m.ttype = 'item'" . " and ({$twhere})";
    //echo $sql;
    $res = rss_query($sql);
    $fids = array();
    $ctid = -1;
    while (list($fid, $tid) = rss_fetch_row($res)) {
        $fids[] = $fid;
        $tids[] = $tid;
    }
    $fids = array_unique($fids);
    $tids = array_unique($tids);
    $rtags = array();
    if (count($fids)) {
        $sql = "select t.tag, count(*) as cnt from " . getTable('metatag') . " m left join " . getTable('item') . " i on (m.fid=i.id) " . " inner join " . getTable('tag') . " t on (t.id = m.tid) " . " where m.fid in (" . implode(",", $fids) . ")" . " and t.id not in (" . implode(",", $tids) . ")";
        if (hidePrivate()) {
            $sql .= " and not(i.unread & " . RSS_MODE_PRIVATE_STATE . ") ";
        }
        $sql .= " group by t.tag order by cnt desc";
        //echo $sql;
        $res = rss_query($sql);
        while (list($rtag, $cnt) = rss_fetch_row($res)) {
            $rtags[$rtag] = $cnt;
        }
    }
    return $rtags;
}
开发者ID:abdallahchamas,项目名称:haiti_tracker,代码行数:35,代码来源:tags.php

示例3: rss_toolkit_channels_combo

function rss_toolkit_channels_combo($id, $all_channels_id = ALL_CHANNELS_ID, $selected = 0, $showDeprecated = false)
{
    $ret = "\t\t<select name=\"{$id}\" id=\"{$id}\">\n" . "\t\t\t<option value=\"" . $all_channels_id . "\"" . (0 == $selected ? " selected=\"selected\"" : "") . ">" . __('All') . "</option>\n";
    $sql = "select " . " c.id, c.title, f.name, f.id  " . " from " . getTable("channels") . " c " . " inner join " . getTable("folders") . " f " . "   on f.id = c.parent ";
    if (hidePrivate()) {
        $sql .= " and not(c.mode & " . RSS_MODE_PRIVATE_STATE . ") ";
    }
    if (false == $showDeprecated) {
        $sql .= " and not(c.mode & " . RSS_MODE_DELETED_STATE . ") ";
    }
    $sql .= " order by " . (getConfig('rss.config.absoluteordering') ? "f.position asc, c.position asc" : "f.name asc, c.title asc");
    $res = rss_query($sql);
    $prev_parent = -1;
    while (list($id_, $title_, $parent_, $parent_id_) = rss_fetch_row($res)) {
        if ($prev_parent != $parent_id_) {
            if ($prev_parent > -1) {
                $ret .= "\t\t\t</optgroup>\n";
            }
            if ($parent_ == "") {
                $parent_ = __('Root');
            }
            $ret .= "\t\t\t<optgroup label=\"{$parent_} /\">\n";
            $prev_parent = $parent_id_;
        }
        if (strlen($title_) > 25) {
            $title_ = substr($title_, 0, 22) . "...";
        }
        $ret .= "\t\t\t\t<option value=\"{$id_}\"" . ($selected == $id_ ? " selected=\"selected\"" : "") . ">{$title_}</option>\n";
    }
    if ($prev_parent != 0) {
        $ret .= "\t\t\t</optgroup>\n";
    }
    $ret .= "\t\t</select>\n";
    return $ret;
}
开发者ID:jphpsf,项目名称:gregarius,代码行数:35,代码来源:toolkit.php

示例4: checkETag

function checkETag($withDB = true, $keyPrefix = "", $cacheValidity = 0)
{
    $key = $keyPrefix . '$Revision$' . $_SERVER["REQUEST_URI"];
    if ($withDB) {
        list($dt) = rss_fetch_row(rss_query('select timestamp from ' . getTable('cache') . " where cachekey='data_ts'"));
        $key .= $dt;
    }
    if (array_key_exists(RSS_USER_COOKIE, $_REQUEST)) {
        $key .= $_REQUEST[RSS_USER_COOKIE];
    }
    $key = md5($key);
    if (array_key_exists('HTTP_IF_NONE_MATCH', $_SERVER) && $_SERVER['HTTP_IF_NONE_MATCH'] == $key) {
        header("HTTP/1.1 304 Not Modified");
        header("X-RSS-CACHE-STATUS: HIT");
        header("ETag: {$key}");
        flush();
        exit;
    } else {
        header("ETag: {$key}");
        header("X-RSS-CACHE-STATUS: MISS");
        if ($cacheValidity) {
            header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $cacheValidity * 3600) . 'GMT');
        }
    }
}
开发者ID:jphpsf,项目名称:gregarius,代码行数:25,代码来源:core.php

示例5: render

 function render()
 {
     $res = rss_query("select url from " . getTable("channels") . " where id = " . $this->fid);
     if (!defined('MAGPIE_DEBUG') || !MAGPIE_DEBUG) {
         define('MAGPIE_DEBUG', true);
     }
     list($url) = rss_fetch_row($res);
     define('MAGPIE_CACHE_ON', false);
     $rss = fetch_rss($url);
     echo "<pre>\n";
     echo htmlentities(print_r($rss, 1));
     echo "</pre>\n";
 }
开发者ID:jphpsf,项目名称:gregarius,代码行数:13,代码来源:debugfeed.php

示例6: __exp__getFromDelicious

function __exp__getFromDelicious($id)
{
    list($url) = rss_fetch_row(rss_query('select url from ' . getTable('item') . " where id={$id}"));
    $ret = array();
    $durl = "http://del.icio.us/url/" . md5($url) . "?settagview=list";
    $bfr = getUrl($durl, 3000);
    if ($bfr) {
        define('DLSRX', '|<a href="/tag/([^"]+)".*>\\1</a>|U');
        if ($bfr && preg_match_all(DLSRX, $bfr, $hits, PREG_SET_ORDER)) {
            $hits = array_slice($hits, 0, MAX_TAGS_PER_ITEM);
            foreach ($hits as $hit) {
                $ret[] = $hit[1];
            }
        }
    }
    return "{$id}," . implode(" ", $ret);
}
开发者ID:jphpsf,项目名称:gregarius,代码行数:17,代码来源:delicious.php

示例7: set_admin_pass

function set_admin_pass($uname = null, $pass = null)
{
    $sql = "select count(*) from " . getTable('users') . " where password != '' and ulevel >=99";
    list($adminexists) = rss_fetch_row(rss_query($sql));
    if ($adminexists) {
        die('Oops. Admin already exists!');
    }
    if ($uname && $pass) {
        rss_query("update " . getTable('users') . " set uname='{$uname}', " . "password='" . md5(md5($pass)) . "' where ulevel=99");
        rss_invalidate_cache();
        rss_redirect('admin/');
        exit;
    }
    admin_header();
    ?>
	<script type="text/javascript">
	<!--
		function on_submit_password_match() {
			pass=document.getElementById('password').value;
			pass2=document.getElementById('password2').value;
			if(pass !== pass2){
				msg = '<?php 
    echo __('Passwords do not match!');
    ?>
';
				document.getElementById('admin_match_result').innerHTML = msg;
				document.getElementById('password').value = '';
				document.getElementById('password2').value = '';
				return false;
			}else{
				document.getElementById('password2').value = '';
				return loginHandler();
			}
		}	
	-->
	</script>
	
	<?php 
    echo "\n<div id=\"channel_admin\" class=\"frame\">";
    echo "<h2></h2>\n" . __('<p>No Administrator has been specified yet!</p><p>Please provide an Administrator username and password now!</p>');
    echo "<form action=\"" . $_SERVER['PHP_SELF'] . "\" onsubmit=\"return on_submit_password_match();\" method=\"post\">\n" . "<fieldset style=\"width:400px;\">" . "<p><label style=\"display:block\" for=\"username\">" . __('Username') . ":</label>\n" . "<input type=\"text\" id=\"username\" name=\"username\" /></p>\n" . "<p><label style=\"display:block\" for=\"password\">" . __('Password') . ":</label>\n" . "<input type=\"password\" id=\"password\" name=\"password\" /></p>\n" . "<p><label style=\"display:block\" for=\"password2\">" . __('Password (again)') . ":</label>\n" . "<input type=\"password\" id=\"password2\" name=\"password2\" /></p>\n" . "<p><input type=\"submit\" value=\"" . __('OK') . "\" /></p>\n" . "<div style=\"display:inline;\" id=\"admin_match_result\"></div>\n" . "</fieldset>\n" . "</form>\n";
    echo "</div>\n";
    admin_footer();
    exit;
}
开发者ID:jphpsf,项目名称:gregarius,代码行数:45,代码来源:users.php

示例8: blOPML

function blOPML()
{
    // Unread count
    $ucres = rss_query("select cid, count(*) from " . getTable("item") . " where unread & " . RSS_MODE_UNREAD_STATE . " and not(unread & " . RSS_MODE_DELETED_STATE . ") group by cid");
    $uc = array();
    while (list($uccid, $ucuc) = rss_fetch_row($ucres)) {
        $uc[$uccid] = $ucuc;
    }
    $sql = "select " . " c.id, c.title, c.url, c.siteurl, f.name " . " from " . getTable("channels") . " c " . " inner join " . getTable("folders") . " f " . "  on f.id = c.parent";
    if (hidePrivate()) {
        $sql .= " and not(c.mode & " . RSS_MODE_PRIVATE_STATE . ") ";
    }
    $sql .= " and not(c.mode & " . RSS_MODE_DELETED_STATE . ") ";
    if (getConfig('rss.config.absoluteordering')) {
        $sql .= " order by f.position asc, c.position asc";
    } else {
        $sql .= " order by f.name, c.title asc";
    }
    $folders = array();
    $res = rss_query($sql);
    while (list($cid, $title, $xmlUrl, $siteUrl, $folder) = rss_fetch_row($res)) {
        if (!isset($folders[$folder])) {
            $folders[$folder] = array();
        }
        $folders[$folder][] = array('title' => htmlspecialchars($title), 'htmlUrl' => htmlspecialchars($siteUrl), 'xmlUrl' => htmlspecialchars($xmlUrl), 'BloglinesUnread' => isset($uc[$cid]) ? $uc[$cid] : 0, 'BloglinesSubId' => $cid);
    }
    header('Content-Type: text/xml; charset=utf-8');
    echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
    echo "<opml version=\"1.0\">\n" . "<head>\n" . "\t<title>Gregarius Subscriptions</title>\n" . "\t<dateCreated>" . date('D, j M Y H:i:s \\G\\M\\T') . "</dateCreated>\n" . "\t<ownerName></ownerName>\n" . "</head>\n" . "<body>\n";
    foreach ($folders as $fname => $folder) {
        echo "\t<outline title=\"{$fname}\">\n";
        foreach ($folder as $feed) {
            echo "\t\t<outline type=\"rss\"";
            foreach ($feed as $key => $value) {
                echo " {$key}=\"{$value}\"";
            }
            echo " />\n";
        }
        echo "\t</outline>\n";
    }
    echo "</body>\n" . "</opml>\n";
}
开发者ID:jphpsf,项目名称:gregarius,代码行数:42,代码来源:api.php

示例9: dashboard

function dashboard()
{
    $idtoken = _VERSION_ . "-" . md5($_SERVER["HTTP_HOST"]);
    $magpieCacheAge = 60 * 60 * 24;
    if (function_exists('apache_request_headers')) {
        $hdrs = apache_request_headers();
        if (isset($hdrs['Pragma']) && $hdrs['Pragma'] == 'no-cache' || isset($hdrs['Cache-Control']) && $hdrs['Cache-Control'] == 'no-cache') {
            $magpieCacheAge = 0;
        }
    }
    define('MAGPIE_FETCH_TIME_OUT', 2);
    define('MAGPIE_CACHE_AGE', $magpieCacheAge);
    $rs = rss_query("select id, title, position, url, obj, unix_timestamp(daterefreshed), itemcount " . " from " . getTable('dashboard') . " order by position asc");
    $rss = array();
    while (list($id, $title, $pos, $url, $obj, $ts, $cnt) = rss_fetch_row($rs)) {
        if ($obj && time() - $ts < $magpieCacheAge) {
            $rss[$title] = unserialize($obj);
        } else {
            $old_level = error_reporting(E_ERROR);
            $rss[$title] = fetch_rss($url . $idtoken);
            error_reporting($old_level);
            if ($rss[$title] && is_object($rss[$title])) {
                $rss[$title]->items = array_slice($rss[$title]->items, 0, $cnt);
                rss_query('update ' . getTable('dashboard') . " set obj='" . rss_real_escape_string(serialize($rss[$title])) . "', " . " daterefreshed=now()\twhere id={$id}");
            }
        }
        if ($rss[$title] && is_object($rss[$title])) {
            if ($pos == 0) {
                echo "\n\t\t\t\t\t\t\t<h2 style=\"margin-bottom: 0.5em\">{$title}</h2>\n\t\t\t\t\t\t\t<div id=\"db_main\">\n\t\t\t\t\t\t\t<ul>";
                foreach ($rss[$title]->items as $item) {
                    echo "<li class=\"item unread\">\n" . "<h4><a href=\"" . $item['link'] . "\">" . $item['title'] . "</a></h4>\n" . "<h5>Posted: " . time_since(strtotime($item['pubdate'])) . " ago </h5>\n" . "<div class=\"content\">" . $item['content']['encoded'] . "</div>\n</li>\n";
                }
                echo "</ul></div>\n";
            } else {
                echo "<div class=\"frame db_side\">\n";
                db_side($title, $rss[$title]);
                echo "</div>";
            }
        }
    }
}
开发者ID:jphpsf,项目名称:gregarius,代码行数:41,代码来源:dashboard.php

示例10: populate

 function populate($updatePrivateAlso = false, $cid)
 {
     $cid = (int) $cid;
     $sql = "select c.id, c.url, c.title from " . getTable("channels") . " c " . " inner join " . getTable('folders') . " f on f.id = c.parent " . " where not(c.mode & " . RSS_MODE_DELETED_STATE . ") ";
     if (hidePrivate() && !$updatePrivateAlso) {
         $sql .= " and not(mode & " . RSS_MODE_PRIVATE_STATE . ") ";
     }
     if (DEFAULT_CID != $cid) {
         $sql .= " and c.id = " . $cid . " ";
     } else {
         if (getConfig('rss.config.absoluteordering')) {
             $sql .= " order by f.position asc, c.position asc";
         } else {
             $sql .= " order by f.name, c.title asc";
         }
     }
     $res = rss_query($sql);
     while (list($cid, $url, $title) = rss_fetch_row($res)) {
         $this->chans[] = array($cid, $url, $title);
     }
 }
开发者ID:nerdling,项目名称:gregarius,代码行数:21,代码来源:update.php

示例11: define

define('CST_ADMIN_DOMAIN_CONFIG', 'config');
define('CST_ADMIN_DOMAIN_OPML', 'opml');
define('CST_ADMIN_DOMAIN_PLUGINS', 'plugins');
define('CST_ADMIN_DOMAIN_PLUGIN_OPTIONS', 'plugin_options');
define('CST_ADMIN_DOMAIN_THEMES', 'themes');
define('CST_ADMIN_DOMAIN_THEME_OPTIONS', 'theme_options');
define('CST_ADMIN_DOMAIN_TAGS', 'tags');
// OPML import target
define('CST_ADMIN_OPML_IMPORT_WIPE', 1);
define('CST_ADMIN_OPML_IMPORT_FOLDER', 2);
define('CST_ADMIN_OPML_IMPORT_MERGE', 3);
$auth = rss_user_check_user_level(RSS_USER_LEVEL_ADMIN);
if (!$auth) {
    // check whether the admin password has been set.
    $sql = "select uname,password from " . getTable('users') . " where ulevel=99";
    list($dummy, $__pw__) = rss_fetch_row(rss_query($sql));
    if ($__pw__ == '') {
        $admin_uname = null;
        $admin_pass = null;
        if (isset($_POST['username']) && isset($_POST['password'])) {
            $admin_uname = $_POST['username'];
            $admin_pass = $_POST['password'];
        }
        set_admin_pass($admin_uname, $admin_pass);
    } else {
        rss_login_form();
        exit;
    }
}
admin_header();
admin_main($auth);
开发者ID:jphpsf,项目名称:gregarius,代码行数:31,代码来源:index.php

示例12: __exp__rateItem

function __exp__rateItem($iid, $rt)
{
    $iid = sanitize($iid, RSS_SANITIZER_NUMERIC);
    $rt = sanitize($rt, RSS_SANITIZER_NUMERIC);
    list($rrt) = rss_fetch_row(rss_query("select rating from " . getTable('rating') . " where iid = {$iid}"));
    rss_query('delete from ' . getTable('rating') . ' where iid = ' . $iid);
    if ($rt == $rrt) {
        return "{$iid}|0";
    }
    rss_query('insert into ' . getTable('rating') . "(iid,rating) values ({$iid},{$rt})");
    if (rss_is_sql_error(RSS_SQL_ERROR_NO_ERROR)) {
        return "{$iid}|{$rt}";
    }
}
开发者ID:nerdling,项目名称:gregarius,代码行数:14,代码来源:ajax.php

示例13: populate

 function populate()
 {
     ////// actual feeds ///////
     $this->folders = array();
     _pf('CatList->populate() ...');
     $sql = "select " . " c.id, c.title, c.url, c.siteurl, t.tag, c.parent, c.icon, c.descr, c.mode, t.id " . " from " . getTable('channels') . " c " . " inner join " . getTable('metatag') . " m on m.fid = c.id " . " inner join " . getTable('tag') . " t on t.id = m.tid " . " where m.ttype = 'channel' ";
     if (hidePrivate()) {
         $sql .= " and not(c.mode & " . RSS_MODE_PRIVATE_STATE . ") ";
     }
     $sql .= " and not(c.mode & " . RSS_MODE_DELETED_STATE . ") ";
     $sql .= " order by t.tag asc";
     if (!getConfig("rss.config.absoluteordering")) {
         $sql .= ", c.title asc";
     }
     $res = rss_query($sql);
     $this->taggedFeedCnt = rss_num_rows($res);
     // get # of unread items for each feed
     $ucres = rss_query("select cid, count(*) from " . getTable("item") . " where unread & " . RSS_MODE_UNREAD_STATE . " and not(unread & " . RSS_MODE_DELETED_STATE . ") group by cid");
     $uc = array();
     while (list($uccid, $ucuc) = rss_fetch_row($ucres)) {
         $uc[$uccid] = $ucuc;
     }
     while (list($cid, $ctitle, $curl, $csiteurl, $fname, $cparent, $cico, $cdescr, $cmode, $tid) = rss_fetch_row($res)) {
         $unread = 0;
         if (isset($uc[$cid])) {
             $unread = $uc[$cid];
         }
         $f = new FeedListItem($cid, $ctitle, $curl, $csiteurl, $fname, $cparent, $cico, $cdescr, $cmode, $unread);
         if (!array_key_exists($tid, $this->folders)) {
             $this->folders[$tid] = new CatFolder($fname, $tid, $this);
             $this->tagCnt++;
         }
         $this->folders[$tid]->feeds[] = $f;
         $this->folders[$tid]->isCollapsed = in_array($tid, $this->collapsed_ids) && $tid > 0;
         _pf('done');
     }
 }
开发者ID:jphpsf,项目名称:gregarius,代码行数:37,代码来源:categories.php

示例14: item_admin

/**
 * performs pruning action
 */
function item_admin()
{
    $ret__ = CST_ADMIN_DOMAIN_NONE;
    switch ($_REQUEST['action']) {
        case __('Delete'):
            $req = rss_query('select count(*) as cnt from ' . getTable('item') . " where not(unread & " . RSS_MODE_DELETED_STATE . ")");
            list($cnt) = rss_fetch_row($req);
            $prune_older = sanitize($_REQUEST['prune_older'], RSS_SANITIZER_NUMERIC);
            if (array_key_exists('prune_older', $_REQUEST) && strlen($_REQUEST['prune_older']) && is_numeric($_REQUEST['prune_older'])) {
                switch ($_REQUEST['prune_period']) {
                    case __('days'):
                        $period = 'day';
                        break;
                    case __('months'):
                        $period = 'month';
                        break;
                    case __('years'):
                        $period = 'year';
                        break;
                    default:
                        rss_error(__('Invalid pruning period'), RSS_ERROR_ERROR, true);
                        return CST_ADMIN_DOMAIN_ITEM;
                        break;
                }
                $sql = " from " . getTable('item') . " i inner join " . getTable('channels') . " c on c.id=i.cid " . " where 1=1 ";
                if (array_key_exists('prune_channel', $_REQUEST)) {
                    if (ALL_CHANNELS_ID != $_REQUEST['prune_channel']) {
                        $sql .= " and c.id = " . $_REQUEST['prune_channel'] . "";
                    }
                }
                if ($prune_older > 0) {
                    $prune_older_date = date("Y-m-d H:i:s", strtotime("-{$prune_older} {$period}"));
                    $sql .= " and ifnull(i.pubdate, i.added) <  '{$prune_older_date}'";
                }
                if (!array_key_exists('prune_include_sticky', $_REQUEST) || $_REQUEST['prune_include_sticky'] != '1') {
                    $sql .= " and not(unread & " . RSS_MODE_STICKY_STATE . ") ";
                }
                if (!array_key_exists('prune_include_flag', $_REQUEST) || $_REQUEST['prune_include_flag'] != '1') {
                    $sql .= " and not(unread & " . RSS_MODE_FLAG_STATE . ") ";
                }
                if (!array_key_exists('prune_include_unread', $_REQUEST) || $_REQUEST['prune_include_unread'] != '1') {
                    $sql .= " and not(unread & " . RSS_MODE_UNREAD_STATE . ") ";
                }
                if (array_key_exists('prune_exclude_tags', $_REQUEST) && trim($_REQUEST['prune_exclude_tags'])) {
                    if (trim($_REQUEST['prune_exclude_tags']) == '*') {
                        $tsql = " select distinct fid from " . getTable('metatag');
                    } else {
                        $exclude_tags = explode(" ", $_REQUEST['prune_exclude_tags']);
                        $trimmed_exclude_tags = array();
                        foreach ($exclude_tags as $etag) {
                            if ($tetag = rss_real_escape_string(trim($etag))) {
                                $trimmed_exclude_tags[] = $tetag;
                            }
                        }
                        $tsql = " select distinct fid from " . getTable('metatag') . " m " . " inner join " . getTable('tag') . " t" . "   on t.id = m.tid " . " where t.tag in ('" . implode("', '", $trimmed_exclude_tags) . "')";
                    }
                    $tres = rss_query($tsql);
                    $fids = array();
                    while (list($fid) = rss_fetch_row($tres)) {
                        $fids[] = $fid;
                    }
                    if (count($fids)) {
                        $sql .= " and i.id not in (" . implode(",", $fids) . ") ";
                    }
                }
                if (array_key_exists(CST_ADMIN_CONFIRMED, $_REQUEST)) {
                    // Possible fix for #207: max out execution time
                    // to avoid timeouts
                    @set_time_limit(0);
                    @ini_set('max_execution_time', 60 * 10);
                    //echo "<pre>\n";
                    //delete the tags for these items
                    $sqlids = "select distinct i.id,i.cid " . $sql . " order by i.cid, i.id desc";
                    $rs = rss_query($sqlids);
                    $ids = array();
                    $cids = array();
                    //echo "to be deleted\n";
                    while (list($id, $cid) = rss_fetch_row($rs)) {
                        $cids[$cid][] = $id;
                        //echo "cid=$cid, $id\n";
                    }
                    //echo "\n\n";
                    if (count($cids)) {
                        // Righto. Lets check which of these ids still is in cache:
                        $cacheIds = array();
                        // now, sort the ids to be deleted into two lists: in cache / to trash
                        $in_cache = array();
                        $to_trash = array();
                        foreach ($cids as $cid => $ids) {
                            $rsCache = rss_query("select itemsincache from " . getTable('channels') . " where id={$cid}");
                            list($idString) = rss_fetch_row($rsCache);
                            if ($idString) {
                                $cacheIds = unserialize($idString);
                            } else {
                                $cacheIds = array();
                            }
                            foreach ($ids as $iid) {
//.........这里部分代码省略.........
开发者ID:jphpsf,项目名称:gregarius,代码行数:101,代码来源:items.php

示例15: populate

 function populate($sqlWhere, $sqlOrder = "", $startItem = 0, $itemCount = -1, $hint = ITEM_SORT_HINT_MIXED, $includeDeprecated = false)
 {
     $si = $this->page * $this->itemsPerPage;
     parent::populate($sqlWhere, $sqlOrder, $si, $itemCount > 0 ? $this->itemsPerPage : $itemCount, $hint, $includeDeprecated);
     $sql = "select count(*) as cnt " . " from " . $this->_sqlActualFrom . " where " . $this->_sqlActualWhere;
     list($this->numItems) = rss_fetch_row(rss_query($sql));
     if ($this->itemsPerPage && $this->numItems > $this->itemsPerPage) {
         $this->navigation = new ItemListNavigation($this);
     }
 }
开发者ID:abdallahchamas,项目名称:haiti_tracker,代码行数:10,代码来源:items.php


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