Fix more notices, one of which was actually caused by a bug
parent
ba549ca6ef
commit
8469014d18
13
fof-db.php
13
fof-db.php
|
@ -482,12 +482,12 @@ function fof_db_get_subscription_to_tags()
|
||||||
{
|
{
|
||||||
$prefs = unserialize($row['subscription_prefs']);
|
$prefs = unserialize($row['subscription_prefs']);
|
||||||
$tags = $prefs['tags'];
|
$tags = $prefs['tags'];
|
||||||
if(!is_array($r[$row['feed_id']]))
|
if (!isset($r[$row['feed_id']]))
|
||||||
$r[$row['feed_id']] = array();
|
$r[$row['feed_id']] = array();
|
||||||
$r[$row['feed_id']][$row['user_id']] = $tags;
|
$r[$row['feed_id']][$row['user_id']] = $tags;
|
||||||
if ($prefs['filter'])
|
if (!empty($prefs['filter']))
|
||||||
{
|
{
|
||||||
if(!is_array($r['filter'][$row['feed_id']]))
|
if (!isset($r['filter'][$row['feed_id']]))
|
||||||
$r['filter'][$row['feed_id']] = array();
|
$r['filter'][$row['feed_id']] = array();
|
||||||
$r['filter'][$row['feed_id']][$row['user_id']] = $prefs['filter'];
|
$r['filter'][$row['feed_id']][$row['user_id']] = $prefs['filter'];
|
||||||
}
|
}
|
||||||
|
@ -768,10 +768,11 @@ function fof_db_get_users()
|
||||||
|
|
||||||
$result = fof_safe_query("select user_name, user_id, user_prefs from $FOF_USER_TABLE");
|
$result = fof_safe_query("select user_name, user_id, user_prefs from $FOF_USER_TABLE");
|
||||||
|
|
||||||
while($row = fof_db_get_row($result))
|
$users = array();
|
||||||
|
while ($row = fof_db_get_row($result))
|
||||||
{
|
{
|
||||||
$users[$row['user_id']['user_name']] = $row['user_name'];
|
$users[$row['user_id']]['user_name'] = $row['user_name'];
|
||||||
$users[$row['user_id']['user_prefs']] = unserialize($row['user_prefs']);
|
$users[$row['user_id']]['user_prefs'] = unserialize($row['user_prefs']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
fof-main.php
14
fof-main.php
|
@ -686,9 +686,12 @@ function fof_apply_tags($item)
|
||||||
$filtered[$user_id] = true;
|
$filtered[$user_id] = true;
|
||||||
|
|
||||||
// regexp filter items
|
// regexp filter items
|
||||||
foreach((array)$fof_subscription_to_tags['filter'][$item['feed_id']] as $user_id => $filter)
|
if (isset($fof_subscription_to_tags['filter'][$item['feed_id']]))
|
||||||
if ($filter && (preg_match($filter, $title) || preg_match($filter, $content)))
|
{
|
||||||
$filtered[$user_id] = true;
|
foreach ((array)$fof_subscription_to_tags['filter'][$item['feed_id']] as $user_id => $filter)
|
||||||
|
if ($filter && (preg_match($filter, $title) || preg_match($filter, $content)))
|
||||||
|
$filtered[$user_id] = true;
|
||||||
|
}
|
||||||
|
|
||||||
// mark item as unread for some users
|
// mark item as unread for some users
|
||||||
fof_db_mark_item_unread($item['item_id'], array_keys($filtered));
|
fof_db_mark_item_unread($item['item_id'], array_keys($filtered));
|
||||||
|
@ -749,7 +752,7 @@ function fof_update_feed($id, $as_user = NULL)
|
||||||
$feed_id = $feed['feed_id'];
|
$feed_id = $feed['feed_id'];
|
||||||
$n = 0;
|
$n = 0;
|
||||||
|
|
||||||
if ($feed['feed_filter'])
|
if (!empty($feed['feed_filter']))
|
||||||
{
|
{
|
||||||
$filter = @unserialize($feed['feed_filter']);
|
$filter = @unserialize($feed['feed_filter']);
|
||||||
if (!$filter || !$filter['re'] || !$filter['tags'])
|
if (!$filter || !$filter['re'] || !$filter['tags'])
|
||||||
|
@ -827,7 +830,8 @@ function fof_update_feed($id, $as_user = NULL)
|
||||||
$p = FoF_Prefs::instance();
|
$p = FoF_Prefs::instance();
|
||||||
$admin_prefs = $p->admin_prefs;
|
$admin_prefs = $p->admin_prefs;
|
||||||
|
|
||||||
if($admin_prefs['purge'] != "")
|
$ndelete = 0;
|
||||||
|
if ($admin_prefs['purge'] != "")
|
||||||
{
|
{
|
||||||
fof_log('purge is ' . $admin_prefs['purge']);
|
fof_log('purge is ' . $admin_prefs['purge']);
|
||||||
$count = count($ids);
|
$count = count($ids);
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
fof_add_item_prefilter('fof_enclosures');
|
fof_add_item_prefilter('fof_enclosures');
|
||||||
|
|
||||||
function fof_enclosures($item, $link, $title, $content)
|
function fof_enclosures($item, $link, $title, $content)
|
||||||
{
|
{
|
||||||
|
$html = '';
|
||||||
if ($enclosure = $item->get_enclosure(0))
|
if ($enclosure = $item->get_enclosure(0))
|
||||||
{
|
{
|
||||||
$html = '<br><br><a href="#" onclick="show_enclosure(event); return false;">show enclosure</a><div style="display: none" align="center" width="auto">';
|
$html = '<br><br><a href="#" onclick="show_enclosure(event); return false;">show enclosure</a><div style="display: none" align="center" width="auto">';
|
||||||
|
@ -13,17 +14,14 @@ function fof_enclosures($item, $link, $title, $content)
|
||||||
'mediaplayer' => 'plugins/mediaplayer.swf',
|
'mediaplayer' => 'plugins/mediaplayer.swf',
|
||||||
'alt' => '<img src="plugins/mini_podcast.png" class="download" border="0" title="Download the Podcast (' . $enclosure->get_extension() . '; ' . $enclosure->get_size() . ' MB)" />',
|
'alt' => '<img src="plugins/mini_podcast.png" class="download" border="0" title="Download the Podcast (' . $enclosure->get_extension() . '; ' . $enclosure->get_size() . ' MB)" />',
|
||||||
'altclass' => 'download'
|
'altclass' => 'download'
|
||||||
)) . '</p>';
|
)) . '</p>';
|
||||||
$html .= '<i align="center">(' . $enclosure->get_type();
|
$html .= '<i align="center">(' . $enclosure->get_type();
|
||||||
if ($enclosure->get_size())
|
if ($enclosure->get_size())
|
||||||
{
|
{
|
||||||
$html .= '; ' . $enclosure->get_size() . ' MB';
|
$html .= '; ' . $enclosure->get_size() . ' MB';
|
||||||
|
}
|
||||||
}
|
$html .= ')</i>';
|
||||||
$html .= ')</i>';
|
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
}
|
}
|
||||||
|
return array($link, $title, $content . $html);
|
||||||
return array($link, $title, $content . $html);
|
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
|
@ -1987,7 +1987,9 @@ class SimplePie
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$file = new $this->file_class($favicon, $this->timeout / 10, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen);
|
$file = new $this->file_class($favicon, $this->timeout / 10, 5,
|
||||||
|
isset($_SERVER['REMOTE_ADDR']) ? array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']) : array(),
|
||||||
|
$this->useragent, $this->force_fsockopen);
|
||||||
|
|
||||||
if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)) && strlen($file->body) > 0)
|
if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)) && strlen($file->body) > 0)
|
||||||
{
|
{
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue