Fix some more notices
parent
83c00eddc8
commit
4a68c2889f
20
add.php
20
add.php
|
@ -16,13 +16,13 @@
|
||||||
|
|
||||||
include("header.php");
|
include("header.php");
|
||||||
|
|
||||||
$url = $_REQUEST['rss_url'];
|
$url = @$_REQUEST['rss_url'];
|
||||||
$new_tags = $_REQUEST['new_tags'];
|
$new_tags = @$_REQUEST['new_tags'];
|
||||||
$login = $_REQUEST['basic_login'];
|
$login = @$_REQUEST['basic_login'];
|
||||||
$password = $_REQUEST['basic_password'];
|
$password = @$_REQUEST['basic_password'];
|
||||||
$opml = $_REQUEST['opml_url'];
|
$opml = @$_REQUEST['opml_url'];
|
||||||
$file = $_POST['opml_file'];
|
$file = @$_POST['opml_file'];
|
||||||
$unread = $_REQUEST['unread'];
|
$unread = @$_REQUEST['unread'];
|
||||||
|
|
||||||
if ($url && !preg_match('!^[a-z0-9_]+://!is', $url))
|
if ($url && !preg_match('!^[a-z0-9_]+://!is', $url))
|
||||||
$url = "http://$url";
|
$url = "http://$url";
|
||||||
|
@ -32,7 +32,7 @@ if ($login == '%user%')
|
||||||
|
|
||||||
$feeds = array();
|
$feeds = array();
|
||||||
|
|
||||||
if ($_REQUEST['do'])
|
if (!empty($_REQUEST['do']))
|
||||||
{
|
{
|
||||||
if ($opml)
|
if ($opml)
|
||||||
{
|
{
|
||||||
|
@ -55,7 +55,7 @@ if ($_REQUEST['do'])
|
||||||
|
|
||||||
$url = preg_replace('!^([a-z0-9_]+)://([^/]*:[^/]*@)?!is', '\1://', $url);
|
$url = preg_replace('!^([a-z0-9_]+)://([^/]*:[^/]*@)?!is', '\1://', $url);
|
||||||
|
|
||||||
if ($_FILES['opml_file']['tmp_name'])
|
if (!empty($_FILES['opml_file']['tmp_name']))
|
||||||
{
|
{
|
||||||
if(!$content_array = file($_FILES['opml_file']['tmp_name']))
|
if(!$content_array = file($_FILES['opml_file']['tmp_name']))
|
||||||
{
|
{
|
||||||
|
@ -69,7 +69,7 @@ if ($_FILES['opml_file']['tmp_name'])
|
||||||
}
|
}
|
||||||
|
|
||||||
$add_feed_url = "http";
|
$add_feed_url = "http";
|
||||||
if($_SERVER["HTTPS"] == "on")
|
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
|
||||||
$add_feed_url = "https";
|
$add_feed_url = "https";
|
||||||
$add_feed_url .= "://" . $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"];
|
$add_feed_url .= "://" . $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"];
|
||||||
?>
|
?>
|
||||||
|
|
16
fof-db.php
16
fof-db.php
|
@ -441,19 +441,25 @@ function fof_db_get_items($user_id = 1, $feed = NULL, $what = "unread",
|
||||||
|
|
||||||
function fof_db_get_item($user_id, $item_id)
|
function fof_db_get_item($user_id, $item_id)
|
||||||
{
|
{
|
||||||
global $FOF_SUBSCRIPTION_TABLE, $FOF_FEED_TABLE, $FOF_ITEM_TABLE, $FOF_ITEM_TAG_TABLE, $FOF_TAG_TABLE;
|
global $FOF_FEED_TABLE, $FOF_ITEM_TABLE, $FOF_ITEM_TAG_TABLE, $FOF_TAG_TABLE;
|
||||||
|
|
||||||
$query = "select $FOF_FEED_TABLE.feed_image as feed_image, $FOF_FEED_TABLE.feed_title as feed_title, $FOF_FEED_TABLE.feed_link as feed_link, $FOF_FEED_TABLE.feed_description as feed_description, $FOF_ITEM_TABLE.item_id as item_id, $FOF_ITEM_TABLE.item_link as item_link, $FOF_ITEM_TABLE.item_title as item_title, $FOF_ITEM_TABLE.item_cached, $FOF_ITEM_TABLE.item_published, $FOF_ITEM_TABLE.item_updated, $FOF_ITEM_TABLE.item_content as item_content from $FOF_FEED_TABLE, $FOF_ITEM_TABLE where $FOF_ITEM_TABLE.feed_id=$FOF_FEED_TABLE.feed_id and $FOF_ITEM_TABLE.item_id = %d";
|
$query = "select f.feed_image, f.feed_title, f.feed_link, f.feed_description, i.*".
|
||||||
|
" from $FOF_FEED_TABLE f, $FOF_ITEM_TABLE i where i.feed_id=f.feed_id and i.item_id = %d";
|
||||||
|
|
||||||
$result = fof_safe_query($query, $item_id);
|
$result = fof_safe_query($query, $item_id);
|
||||||
|
|
||||||
$item = mysql_fetch_assoc($result);
|
$item = mysql_fetch_assoc($result);
|
||||||
$item['tags'] = array();
|
$item['tags'] = array();
|
||||||
if($user_id)
|
if ($user_id)
|
||||||
{
|
{
|
||||||
$result = fof_safe_query("select $FOF_TAG_TABLE.tag_name from $FOF_TAG_TABLE, $FOF_ITEM_TAG_TABLE where $FOF_TAG_TABLE.tag_id = $FOF_ITEM_TAG_TABLE.tag_id and $FOF_ITEM_TAG_TABLE.item_id = %d and $FOF_ITEM_TAG_TABLE.user_id = %d", $item_id, $user_id);
|
$result = fof_safe_query(
|
||||||
while($row = fof_db_get_row($result))
|
"select t.tag_name from $FOF_TAG_TABLE t, $FOF_ITEM_TAG_TABLE it".
|
||||||
|
" where t.tag_id = it.tag_id and it.item_id = %d and it.user_id = %d", $item_id, $user_id
|
||||||
|
);
|
||||||
|
while ($row = fof_db_get_row($result))
|
||||||
|
{
|
||||||
$item['tags'][] = $row['tag_name'];
|
$item['tags'][] = $row['tag_name'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $item;
|
return $item;
|
||||||
|
|
16
fof-main.php
16
fof-main.php
|
@ -380,20 +380,24 @@ function fof_get_feeds($user_id, $order = 'feed_title', $direction = 'asc')
|
||||||
|
|
||||||
function fof_feed_title($feed, $prefs = NULL)
|
function fof_feed_title($feed, $prefs = NULL)
|
||||||
{
|
{
|
||||||
if (!$prefs)
|
if (!$prefs && !empty($feed['prefs']))
|
||||||
|
{
|
||||||
$prefs = $feed['prefs'];
|
$prefs = $feed['prefs'];
|
||||||
|
}
|
||||||
if (!$prefs)
|
if (!$prefs)
|
||||||
|
{
|
||||||
$prefs = fof_db_get_subscription_prefs(fof_current_user(), $feed['feed_id']);
|
$prefs = fof_db_get_subscription_prefs(fof_current_user(), $feed['feed_id']);
|
||||||
|
}
|
||||||
$t = !empty($prefs['feed_title']) ? $prefs['feed_title'] : $feed['feed_title'];
|
$t = !empty($prefs['feed_title']) ? $prefs['feed_title'] : $feed['feed_title'];
|
||||||
return $t;
|
return $t;
|
||||||
}
|
}
|
||||||
|
|
||||||
function fof_view_title($feed=NULL, $what="new", $when=NULL, $start=NULL, $limit=NULL, $search=NULL)
|
function fof_view_title($feed = NULL, $what = "new", $when = NULL, $start = NULL, $limit = NULL, $search = NULL)
|
||||||
{
|
{
|
||||||
$prefs = fof_prefs();
|
$prefs = fof_prefs();
|
||||||
$title = "feed on feeds";
|
$title = "feed on feeds";
|
||||||
|
|
||||||
if(!is_null($when) && $when != "")
|
if (!is_null($when) && $when != "")
|
||||||
{
|
{
|
||||||
$title .= ' - ' . $when;
|
$title .= ' - ' . $when;
|
||||||
}
|
}
|
||||||
|
@ -991,10 +995,12 @@ function fof_get_widgets($item)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($fof_item_widgets as $widget)
|
$widgets = array();
|
||||||
|
foreach ($fof_item_widgets as $widget)
|
||||||
{
|
{
|
||||||
$w = $widget($item);
|
$w = $widget($item);
|
||||||
if($w) $widgets[] = $w;
|
if ($w)
|
||||||
|
$widgets[] = $w;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $widgets;
|
return $widgets;
|
||||||
|
|
7
item.php
7
item.php
|
@ -17,8 +17,11 @@ include_once("fof-render.php");
|
||||||
|
|
||||||
fof_set_content_type();
|
fof_set_content_type();
|
||||||
|
|
||||||
|
if (empty($_GET['id']))
|
||||||
|
{
|
||||||
|
die("No post ID");
|
||||||
|
}
|
||||||
|
|
||||||
$row = fof_get_item(fof_current_user(), $_GET['id']);
|
$row = fof_get_item(fof_current_user(), $_GET['id']);
|
||||||
|
|
||||||
fof_render_item($row);
|
fof_render_item($row);
|
||||||
|
|
||||||
?>
|
|
Loading…
Reference in New Issue