From 59828593c14a64cecf7ee5c077da9f918062ed60 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 13 Feb 2015 14:25:04 -0800 Subject: some ratings fixes --- include/dir_fns.php | 2 +- include/socgraph.php | 23 ----------------------- 2 files changed, 1 insertion(+), 24 deletions(-) (limited to 'include') diff --git a/include/dir_fns.php b/include/dir_fns.php index 8c0161ff1..5ed626b8a 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -247,7 +247,7 @@ function sync_directories($dirmode) { logger('rating updated'); } else { - $z = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_sig, xlink_updated, xlink_static ) values( '%s', '%s', %d, '%s', '%s', 1 ) ", + $z = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_sig, xlink_updated, xlink_static ) values( '%s', '%s', %d, '%s', '%s', '%s', 1 ) ", dbesc($rr['channel']), dbesc($rr['target']), intval($rr['rating']), diff --git a/include/socgraph.php b/include/socgraph.php index 13957e814..59830ef1b 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -185,29 +185,6 @@ function poco_load($xchan = '',$url = null) { $total ++; - - $r = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 0 limit 1", - dbesc($xchan), - dbesc($hash) - ); - - if(! $r) { - q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_updated, xlink_static ) values ( '%s', '%s', %d, '%s', '%s', 0 ) ", - dbesc($xchan), - dbesc($hash), - intval($rating), - dbesc($rating_text), - dbesc(datetime_convert()) - ); - } - else { - q("update xlink set xlink_updated = '%s', xlink_rating = %d, xlink_rating_text = '%s' where xlink_id = %d", - dbesc(datetime_convert()), - intval($rating), - dbesc($rating_text), - intval($r[0]['xlink_id']) - ); - } } logger("poco_load: loaded $total entries",LOGGER_DEBUG); -- cgit v1.2.3 From a5f7df46675e94471cd4128504eb17d8e5a0e9b1 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 15 Feb 2015 19:15:55 -0800 Subject: issue #860, replace br html element with linefeed between table rows --- include/bbcode.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/bbcode.php b/include/bbcode.php index 8f2b5bd38..749bc2334 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -625,6 +625,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { $Text = preg_replace("/\[table border=1\](.*?)\[\/table\]/sm", '$1
' ,$Text); $Text = preg_replace("/\[table border=0\](.*?)\[\/table\]/sm", '$1
' ,$Text); } + $Text = str_replace('
',"\n",$Text); $Text = str_replace('[hr]','
', $Text); // This is actually executed in prepare_body() -- cgit v1.2.3 From 1c4b9199809581504ee66212f3bb434fd9773aff Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 15 Feb 2015 23:45:22 -0800 Subject: force site_url to be lowercase when stored. Otherwise rating hubs on postgres could get real messy. --- include/zot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index da6ca16c3..926764635 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2442,7 +2442,7 @@ function import_site($arr,$pubkey) { } $directory_url = htmlspecialchars($arr['directory_url'],ENT_COMPAT,'UTF-8',false); - $url = htmlspecialchars($arr['url'],ENT_COMPAT,'UTF-8',false); + $url = htmlspecialchars(strtolower($arr['url']),ENT_COMPAT,'UTF-8',false); $sellpage = htmlspecialchars($arr['sellpage'],ENT_COMPAT,'UTF-8',false); $site_location = htmlspecialchars($arr['location'],ENT_COMPAT,'UTF-8',false); $site_realm = htmlspecialchars($arr['realm'],ENT_COMPAT,'UTF-8',false); -- cgit v1.2.3 From b4f639239fb0d6d5ed58fb7139bb7f88f1b77150 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 16 Feb 2015 11:09:12 -0800 Subject: mopping up the public site ratings --- include/widgets.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/widgets.php b/include/widgets.php index d457db07d..fbbc74224 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -962,4 +962,11 @@ function widget_rating($arr) { return $o; +} + +// used by site ratings pages to provide a return link +function widget_pubsites() { + if(get_app()->poi) + return; + return ''; } \ No newline at end of file -- cgit v1.2.3