From 693b6d0fd4e2c1d30d0951f436566ecc54fd65c2 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 15 Oct 2013 00:43:11 +0200 Subject: [PATCH 1/7] Infinite scroll: At the end of the network page new content is loaded automatically --- index.php | 79 ++++++++++++++++++++++++++++- mod/settings.php | 23 +++++---- view/templates/settings_display.tpl | 1 + 3 files changed, 93 insertions(+), 10 deletions(-) diff --git a/index.php b/index.php index 8784b5d0eb..39b4337f3c 100644 --- a/index.php +++ b/index.php @@ -108,6 +108,7 @@ if((x($_GET,'zrl')) && (!$install && !$maintenance)) { * * What we really need to do is output the raw headers ourselves so we can keep them separate. * + */ // header('Link: <' . $a->get_baseurl() . '/amcd>; rel="acct-mgmt";'); @@ -118,7 +119,6 @@ if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module == if(! x($_SESSION,'authenticated')) header('X-Account-Management-Status: none'); - /* set up page['htmlhead'] and page['end'] for the modules to use */ $a->page['htmlhead'] = ''; $a->page['end'] = ''; @@ -428,6 +428,83 @@ else $a->page['htmlhead'] = str_replace('{{$stylesheet}}',$stylesheet,$a->page['htmlhead']); //$a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array('$stylesheet' => $stylesheet)); +if ($_GET["mode"] == "raw") { + $doc = new DOMDocument(); + + $target = new DOMDocument(); + $target->loadXML(""); + + $content = mb_convert_encoding($a->page["content"], 'HTML-ENTITIES', "UTF-8"); + + @$doc->loadHTML($content); + + $xpath = new DomXPath($doc); + + $list = $xpath->query("//*[contains(@id,'tread-wrapper-')]"); /* */ + + foreach ($list as $item) { + + $item = $target->importNode($item, true); + + // And then append it to the target + $target->documentElement->appendChild($item); + } + + header("Content-type: text/html; charset=utf-8"); + + echo substr($target->saveHTML(), 6, -8); + + session_write_close(); + exit; + +} elseif (get_pconfig(local_user(),'system','infinite_scroll') AND ($_GET["q"] == "network")) { + if (is_string($_GET["page"])) + $pageno = $_GET["page"]; + else + $pageno = 1; + + $reload_uri = ""; + + foreach ($_GET AS $param => $value) + if (($param != "page") AND ($param != "q")) + $reload_uri .= "&".$param."=".$value; + +$a->page['htmlhead'] .= <<< EOT + + +EOT; + +} + $page = $a->page; $profile = $a->profile; diff --git a/mod/settings.php b/mod/settings.php index 12f7910cce..a75230f339 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -259,7 +259,8 @@ function settings_post(&$a) { $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : $a->user['theme']); $mobile_theme = ((x($_POST,'mobile_theme')) ? notags(trim($_POST['mobile_theme'])) : ''); - $nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0); + $nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0); + $infinite_scroll = ((x($_POST,'infinite_scroll')) ? intval($_POST['infinite_scroll']) : 0); $browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0); $browser_update = $browser_update * 1000; if($browser_update < 10000) @@ -281,6 +282,7 @@ function settings_post(&$a) { set_pconfig(local_user(),'system','itemspage_network', $itemspage_network); set_pconfig(local_user(),'system','itemspage_mobile_network', $itemspage_mobile_network); set_pconfig(local_user(),'system','no_smilies',$nosmile); + set_pconfig(local_user(),'system','infinite_scroll',$infinite_scroll); if ($theme == $a->user['theme']){ @@ -816,7 +818,7 @@ function settings_content(&$a) { } $theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']); $mobile_theme_selected = (!x($_SESSION,'mobile-theme')? $default_mobile_theme : $_SESSION['mobile-theme']); - + $browser_update = intval(get_pconfig(local_user(), 'system','update_interval')); $browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds @@ -824,17 +826,19 @@ function settings_content(&$a) { $itemspage_network = (($itemspage_network > 0 && $itemspage_network < 101) ? $itemspage_network : 40); // default if not set: 40 items $itemspage_mobile_network = intval(get_pconfig(local_user(), 'system','itemspage_mobile_network')); $itemspage_mobile_network = (($itemspage_mobile_network > 0 && $itemspage_mobile_network < 101) ? $itemspage_mobile_network : 20); // default if not set: 20 items - + $nosmile = get_pconfig(local_user(),'system','no_smilies'); $nosmile = (($nosmile===false)? '0': $nosmile); // default if not set: 0 + $infinite_scroll = get_pconfig(local_user(),'system','infinite_scroll'); + $infinite_scroll = (($infinite_scroll===false)? '0': $infinite_scroll); // default if not set: 0 $theme_config = ""; if( ($themeconfigfile = get_theme_config_file($theme_selected)) != null){ require_once($themeconfigfile); $theme_config = theme_content($a); } - + $tpl = get_markup_template("settings_display.tpl"); $o = replace_macros($tpl, array( '$ptitle' => t('Display Settings'), @@ -842,17 +846,18 @@ function settings_content(&$a) { '$submit' => t('Submit'), '$baseurl' => $a->get_baseurl(true), '$uid' => local_user(), - + '$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes, true), '$mobile_theme' => array('mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false), '$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')), '$itemspage_network' => array('itemspage_network', t("Number of items to display per page:"), $itemspage_network, t('Maximum of 100 items')), '$itemspage_mobile_network' => array('itemspage_mobile_network', t("Number of items to display per page when viewed from mobile device:"), $itemspage_mobile_network, t('Maximum of 100 items')), '$nosmile' => array('nosmile', t("Don't show emoticons"), $nosmile, ''), - + '$infinite_scroll' => array('infinite_scroll', t("Infinite scroll"), $infinite_scroll, ''), + '$theme_config' => $theme_config, )); - + $tpl = get_markup_template("settings_display_end.tpl"); $a->page['end'] .= replace_macros($tpl, array( '$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes) @@ -860,8 +865,8 @@ function settings_content(&$a) { return $o; } - - + + /* * ACCOUNT SETTINGS */ diff --git a/view/templates/settings_display.tpl b/view/templates/settings_display.tpl index 9107512965..5da575049f 100644 --- a/view/templates/settings_display.tpl +++ b/view/templates/settings_display.tpl @@ -14,6 +14,7 @@ {{include file="field_input.tpl" field=$itemspage_mobile_network}} {{include file="field_input.tpl" field=$ajaxint}} {{include file="field_checkbox.tpl" field=$nosmile}} +{{include file="field_checkbox.tpl" field=$infinite_scroll}}
From 680524f446ac356fe3742466378bce024959f8a2 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 15 Oct 2013 00:44:46 +0200 Subject: [PATCH 2/7] Detecting twitter profiles. This is added for the twitter import --- include/html2plain.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/html2plain.php b/include/html2plain.php index 07de829656..3e4c0e8db0 100644 --- a/include/html2plain.php +++ b/include/html2plain.php @@ -84,11 +84,14 @@ function collecturls($message) { foreach ($result as $treffer) { // A list of some links that should be ignored $list = array("/user/", "/tag/", "/group/", "/profile/", "/search?search=", "/search?tag=", "mailto:", "/u/", "/node/", - "//facebook.com/profile.php?id=", "//plus.google.com/"); + "//facebook.com/profile.php?id=", "//plus.google.com/", "//twitter.com/"); foreach ($list as $listitem) if (strpos($treffer[1], $listitem) !== false) $ignore = true; + if ((strpos($treffer[1], "//twitter.com/") !== false) and (strpos($treffer[1], "/status/") !== false)) + $ignore = false; + if ((strpos($treffer[1], "//plus.google.com/") !== false) and (strpos($treffer[1], "/posts") !== false)) $ignore = false; From 1b0b686116eb049fb6c5f43b2f06c0c7f5b91d37 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 15 Oct 2013 00:49:13 +0200 Subject: [PATCH 3/7] Speeding up the search for tags. --- mod/network.php | 35 ++++++++++++++++++++--------------- mod/search.php | 7 +++++-- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/mod/network.php b/mod/network.php index 7195092ea1..371b4ee684 100644 --- a/mod/network.php +++ b/mod/network.php @@ -174,8 +174,6 @@ function network_init(&$a) { ); } - - // search terms header if(x($_GET,'search')) { $a->page['content'] .= '

' . t('Search Results For:') . ' ' . $search . '

'; @@ -225,9 +223,9 @@ function saved_searches($search) { 'selected' => ($search==$rr['term']), ); } - } + } + - $tpl = get_markup_template("saved_searches_aside.tpl"); $o = replace_macros($tpl, array( '$title' => t('Saved Searches'), @@ -235,7 +233,7 @@ function saved_searches($search) { '$searchbox' => search($search,'netsearch-box',$srchurl,true), '$saved' => $saved, )); - + return $o; } @@ -270,15 +268,15 @@ function network_query_get_sel_tab($a) { || ($a->argc > 2 && $a->argv[2] === 'new')) { $new_active = 'active'; } - + if(x($_GET,'search')) { $search_active = 'active'; } - + if(x($_GET,'star')) { $starred_active = 'active'; } - + if(x($_GET,'bmark')) { $bookmarked_active = 'active'; } @@ -291,8 +289,8 @@ function network_query_get_sel_tab($a) { $spam_active = 'active'; } - - + + if (($new_active == '') && ($starred_active == '') && ($bookmarked_active == '') @@ -308,7 +306,7 @@ function network_query_get_sel_tab($a) { case 'comment' : $all_active = 'active'; $no_active=''; break; } } - + return array($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active); } @@ -571,7 +569,6 @@ function network_content(&$a, $update = 0) { // that belongs to you, hence you can see all of it. We will filter by group if // desired. - $sql_options = (($star) ? " and starred = 1 " : ''); $sql_options .= (($bmark) ? " and bookmark = 1 " : ''); @@ -641,6 +638,7 @@ function network_content(&$a, $update = 0) { $sql_extra2 = (($nouveau) ? '' : " AND `item`.`parent` = `item`.`id` "); $sql_extra3 = (($nouveau) ? '' : $sql_extra3); + $sql_order = "`item`.`received`"; $sql_table = "`item`"; if(x($_GET,'search')) { @@ -675,11 +673,15 @@ function network_content(&$a, $update = 0) { $sql_extra = sprintf(" AND `term`.`term` = '%s' AND `term`.`otype` = %d AND `term`.`type` = %d ", dbesc(protect_sprintf($search)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG)); $sql_table = "`term` LEFT JOIN `item` ON `item`.`id` = `term`.`oid` AND `item`.`uid` = `term`.`uid` "; + + $sql_order = "`term`.`tid`"; } else { if (get_config('system','use_fulltext_engine')) $sql_extra = sprintf(" AND MATCH (`item`.`body`, `item`.`title`) AGAINST ('%s' in boolean mode) ", dbesc(protect_sprintf($search))); else $sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search)))); + + $sql_order = "`item`.`received`"; } } if(strlen($file)) { @@ -767,7 +769,7 @@ function network_content(&$a, $update = 0) { $simple_update AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 $sql_extra $sql_nets - ORDER BY `item`.`received` DESC $pager_sql ", + ORDER BY $sql_order DESC $pager_sql ", intval($_SESSION['uid']) ); @@ -783,6 +785,9 @@ function network_content(&$a, $update = 0) { else $ordering = "`commented`"; + if ($sql_order == "") + $sql_order = "`item`.$ordering"; + // Fetch a page full of parent items for this page if($update) { @@ -803,7 +808,7 @@ function network_content(&$a, $update = 0) { AND `item`.`moderated` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `item`.`parent` = `item`.`id` $sql_extra3 $sql_extra $sql_nets - ORDER BY `item`.$ordering DESC $pager_sql ", + ORDER BY $sql_order DESC $pager_sql ", intval(local_user()) ); } @@ -874,7 +879,7 @@ function network_content(&$a, $update = 0) { $o .= conversation($a,$items,$mode,$update); - if(! $update) { + if(!$update) { if( get_config('alt_pager', 'global') || get_pconfig(local_user(),'system','alt_pager') ) { $o .= alt_pager($a,count($items)); } diff --git a/mod/search.php b/mod/search.php index ebb7dc70d2..2a6308632f 100644 --- a/mod/search.php +++ b/mod/search.php @@ -144,6 +144,8 @@ function search_content(&$a) { $sql_extra = sprintf(" AND `term`.`term` = '%s' AND `term`.`otype` = %d AND `term`.`type` = %d group by `item`.`uri` ", dbesc(protect_sprintf($search)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG)); $sql_table = "`term` LEFT JOIN `item` ON `item`.`id` = `term`.`oid` AND `item`.`uid` = `term`.`uid` "; + $sql_order = "`term`.`tid`"; + //$sql_order = "`item`.`received`"; //$sql_extra = sprintf(" AND EXISTS (SELECT * FROM `term` WHERE `item`.`id` = `term`.`oid` AND `item`.`uid` = `term`.`uid` AND `term`.`term` = '%s' AND `term`.`otype` = %d AND `term`.`type` = %d) GROUP BY `item`.`uri` ", // dbesc(protect_sprintf($search)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG)); @@ -155,6 +157,7 @@ function search_content(&$a) { $sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search)))); } $sql_table = "`item`"; + $sql_order = "`item`.`received`"; } // Here is the way permissions work in the search module... @@ -195,7 +198,7 @@ function search_content(&$a) { OR ( `item`.`uid` = %d )) AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 $sql_extra - ORDER BY `received` DESC LIMIT %d , %d ", + ORDER BY $sql_order DESC LIMIT %d , %d ", intval(local_user()), intval($a->pager['start']), intval($a->pager['itemspage']) @@ -209,7 +212,7 @@ function search_content(&$a) { } - if($tag) + if($tag) $o .= '

Items tagged with: ' . $search . '

'; else $o .= '

Search results for: ' . $search . '

'; From e70b110984868c90d9fe416bf8666384ee662d43 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 15 Oct 2013 00:49:49 +0200 Subject: [PATCH 4/7] Switching from "new share" to "old share" --- htconfig.php | 4 ++-- include/api.php | 2 +- include/diaspora.php | 2 +- include/items.php | 2 +- mod/admin.php | 6 +++--- mod/share.php | 2 +- view/templates/admin_site.tpl | 2 +- view/theme/decaf-mobile/templates/admin_site.tpl | 2 +- view/theme/frost-mobile/templates/admin_site.tpl | 2 +- view/theme/frost/templates/admin_site.tpl | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htconfig.php b/htconfig.php index e8aec10909..a5f5574eea 100644 --- a/htconfig.php +++ b/htconfig.php @@ -92,5 +92,5 @@ $a->config['system']['lockpath'] = ""; // If enabled, the MyBB fulltext engine is used // $a->config['system']['use_fulltext_engine'] = true; -// Use the new "share" element -// $a->config['system']['new_share'] = true; +// Use the old style "share" +// $a->config['system']['old_share'] = false; diff --git a/include/api.php b/include/api.php index cfbf7a7e5c..292d87f0f2 100644 --- a/include/api.php +++ b/include/api.php @@ -984,7 +984,7 @@ ); if ($r[0]['body'] != "") { - if (intval(get_config('system','new_share'))) { + if (!intval(get_config('system','old_share'))) { $post = "[share author='".str_replace("'", "'", $r[0]['reply_author']). "' profile='".$r[0]['reply_url']. "' avatar='".$r[0]['reply_photo']. diff --git a/include/diaspora.php b/include/diaspora.php index f4ce6cb760..0deb3cc2bb 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -1040,7 +1040,7 @@ function diaspora_reshare($importer,$xml,$msg) { $datarray['owner-name'] = $contact['name']; $datarray['owner-link'] = $contact['url']; $datarray['owner-avatar'] = ((x($contact,'thumb')) ? $contact['thumb'] : $contact['photo']); - if (intval(get_config('system','new_share'))) { + if (!intval(get_config('system','wall-to-wall_share'))) { $prefix = "[share author='".str_replace("'", "'",$person['name']). "' profile='".$person['url']. "' avatar='".((x($person,'thumb')) ? $person['thumb'] : $person['photo']). diff --git a/include/items.php b/include/items.php index f4f972e72d..fb7f488f4d 100755 --- a/include/items.php +++ b/include/items.php @@ -811,7 +811,7 @@ function get_atom_elements($feed,$item) { if (($name != "") and ($uri != "") and ($avatar != "") and ($message != "")) { logger('get_atom_elements: fixing sender of repeated message.'); - if (intval(get_config('system','new_share'))) { + if (!intval(get_config('system','wall-to-wall_share'))) { $prefix = "[share author='".str_replace("'", "'",$name). "' profile='".$uri. "' avatar='".$avatar. diff --git a/mod/admin.php b/mod/admin.php index f1f895dbcc..3a3fe6632a 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -282,7 +282,7 @@ function admin_page_site_post(&$a){ $ostatus_poll_interval = ((x($_POST,'ostatus_poll_interval')) ? intval(trim($_POST['ostatus_poll_interval'])) : 0); $diaspora_enabled = ((x($_POST,'diaspora_enabled')) ? True : False); $ssl_policy = ((x($_POST,'ssl_policy')) ? intval($_POST['ssl_policy']) : 0); - $new_share = ((x($_POST,'new_share')) ? True : False); + $old_share = ((x($_POST,'old_share')) ? True : False); $hide_help = ((x($_POST,'hide_help')) ? True : False); $use_fulltext_engine = ((x($_POST,'use_fulltext_engine')) ? True : False); $itemcache = ((x($_POST,'itemcache')) ? notags(trim($_POST['itemcache'])) : ''); @@ -398,7 +398,7 @@ function admin_page_site_post(&$a){ set_config('system','diaspora_enabled', $diaspora_enabled); set_config('config','private_addons', $private_addons); - set_config('system','new_share', $new_share); + set_config('system','old_share', $old_share); set_config('system','hide_help', $hide_help); set_config('system','use_fulltext_engine', $use_fulltext_engine); set_config('system','itemcache', $itemcache); @@ -508,7 +508,7 @@ function admin_page_site(&$a) { '$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - change theme settings"), $theme_choices), '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile-theme'), t("Theme for mobile devices"), $theme_choices_mobile), '$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(get_config('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices), - '$new_share' => array('new_share', t("'Share' element"), get_config('system','new_share'), t("Activates the bbcode element 'share' for repeating items.")), + '$old_share' => array('old_share', t("Old style 'Share'"), get_config('system','old_share'), t("Deactivates the bbcode element 'share' for repeating items.")), '$hide_help' => array('hide_help', t("Hide help entry from navigation menu"), get_config('system','hide_help'), t("Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.")), '$singleuser' => array('singleuser', t("Single user instance"), get_config('system','singleuser'), t("Make this instance multi-user or single-user for the named user"), $user_names), '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), diff --git a/mod/share.php b/mod/share.php index 8358f67169..66d07db3ce 100644 --- a/mod/share.php +++ b/mod/share.php @@ -18,7 +18,7 @@ function share_init(&$a) { if(! count($r) || ($r[0]['private'] == 1)) killme(); - if (intval(get_config('system','new_share'))) { + if (!intval(get_config('system','old_share'))) { if (strpos($r[0]['body'], "[/share]") !== false) { $pos = strpos($r[0]['body'], "[share"); $o = substr($r[0]['body'], $pos); diff --git a/view/templates/admin_site.tpl b/view/templates/admin_site.tpl index c33897c368..bc7ed79377 100644 --- a/view/templates/admin_site.tpl +++ b/view/templates/admin_site.tpl @@ -55,7 +55,7 @@ {{include file="field_select.tpl" field=$theme}} {{include file="field_select.tpl" field=$theme_mobile}} {{include file="field_select.tpl" field=$ssl_policy}} - {{include file="field_checkbox.tpl" field=$new_share}} + {{include file="field_checkbox.tpl" field=$old_share}} {{include file="field_checkbox.tpl" field=$hide_help}} {{include file="field_select.tpl" field=$singleuser}} diff --git a/view/theme/decaf-mobile/templates/admin_site.tpl b/view/theme/decaf-mobile/templates/admin_site.tpl index 035024e689..4f7ca2c15f 100644 --- a/view/theme/decaf-mobile/templates/admin_site.tpl +++ b/view/theme/decaf-mobile/templates/admin_site.tpl @@ -16,7 +16,7 @@ {{include file="field_select.tpl" field=$theme}} {{include file="field_select.tpl" field=$theme_mobile}} {{include file="field_select.tpl" field=$ssl_policy}} - {{include file="field_checkbox.tpl" field=$new_share}} + {{include file="field_checkbox.tpl" field=$old_share}} {{include file="field_checkbox.tpl" field=$hide_help}} {{include file="field_select.tpl" field=$singleuser}} diff --git a/view/theme/frost-mobile/templates/admin_site.tpl b/view/theme/frost-mobile/templates/admin_site.tpl index 035024e689..4f7ca2c15f 100644 --- a/view/theme/frost-mobile/templates/admin_site.tpl +++ b/view/theme/frost-mobile/templates/admin_site.tpl @@ -16,7 +16,7 @@ {{include file="field_select.tpl" field=$theme}} {{include file="field_select.tpl" field=$theme_mobile}} {{include file="field_select.tpl" field=$ssl_policy}} - {{include file="field_checkbox.tpl" field=$new_share}} + {{include file="field_checkbox.tpl" field=$old_share}} {{include file="field_checkbox.tpl" field=$hide_help}} {{include file="field_select.tpl" field=$singleuser}} diff --git a/view/theme/frost/templates/admin_site.tpl b/view/theme/frost/templates/admin_site.tpl index af0eebacc6..2f5bf8b81a 100644 --- a/view/theme/frost/templates/admin_site.tpl +++ b/view/theme/frost/templates/admin_site.tpl @@ -16,7 +16,7 @@ {{include file="field_select.tpl" field=$theme}} {{include file="field_select.tpl" field=$theme_mobile}} {{include file="field_select.tpl" field=$ssl_policy}} - {{include file="field_checkbox.tpl" field=$new_share}} + {{include file="field_checkbox.tpl" field=$old_share}} {{include file="field_checkbox.tpl" field=$hide_help}} {{include file="field_select.tpl" field=$singleuser}} From 028dc3c3b4dc9eb04166743dac4de14c2d763a2c Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 15 Oct 2013 01:11:01 +0200 Subject: [PATCH 5/7] Switching the user agent because CloudFlare has blocked the old one --- mod/parse_url.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/parse_url.php b/mod/parse_url.php index c8670d4d96..e7481a252a 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -59,7 +59,7 @@ function parseurl_getsiteinfo($url) { curl_setopt($ch, CURLOPT_TIMEOUT, 3); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); - curl_setopt($ch,CURLOPT_USERAGENT,'Opera/9.64(Windows NT 5.1; U; de) Presto/2.1.1'); + curl_setopt($ch,CURLOPT_USERAGENT,' Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0'); $header = curl_exec($ch); $curl_info = @curl_getinfo($ch); From f1154cfdd5d99cf306efa748a9849c807e7aceb5 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 19 Oct 2013 07:11:50 +0200 Subject: [PATCH 6/7] Bugfix: Links were ignored sometimes. (Due to a missing default value) --- include/html2plain.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/html2plain.php b/include/html2plain.php index 3e4c0e8db0..dfb577abe1 100644 --- a/include/html2plain.php +++ b/include/html2plain.php @@ -82,6 +82,9 @@ function collecturls($message) { $urls = array(); foreach ($result as $treffer) { + + $ignore = false; + // A list of some links that should be ignored $list = array("/user/", "/tag/", "/group/", "/profile/", "/search?search=", "/search?tag=", "mailto:", "/u/", "/node/", "//facebook.com/profile.php?id=", "//plus.google.com/", "//twitter.com/"); From 661664550d7cf3cece7f9fa1ab2f2e065280e07f Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 20 Oct 2013 12:26:27 +0200 Subject: [PATCH 7/7] Repeated items that are transmitted to text based networks now contain the address and name of the original poater. --- include/bbcode.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index f74c86b50a..ee251f1f1e 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -343,15 +343,15 @@ function bb_ShareAttributesSimple2($match) { function GetProfileUsername($profile, $username) { $friendica = preg_replace("=https?://(.*)/profile/(.*)=ism", "$2@$1", $profile); if ($friendica != $profile) - return($friendica); + return($friendica." (".$username.")"); $diaspora = preg_replace("=https?://(.*)/u/(.*)=ism", "$2@$1", $profile); if ($diaspora != $profile) - return($diaspora); + return($diaspora." (".$username.")"); $twitter = preg_replace("=https?://twitter.com/(.*)=ism", "$1@twitter.com", $profile); if ($twitter != $profile) - return($twitter); + return($twitter." (".$username.")"); $StatusnetHost = preg_replace("=https?://(.*)/user/(.*)=ism", "$1", $profile); if ($StatusnetHost != $profile) { @@ -360,7 +360,7 @@ function GetProfileUsername($profile, $username) { $UserData = fetch_url("http://".$StatusnetHost."/api/users/show.json?user_id=".$StatusnetUser); $user = json_decode($UserData); if ($user) - return($user->screen_name."@".$StatusnetHost); + return($user->screen_name."@".$StatusnetHost." (".$username.")"); } }