// 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;
);
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'].
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) {
$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.")");
}
}
$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']).
$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/");
+ "//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;
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.
*
* 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";');
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'] = '';
$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("<root></root>");
+
+ $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
+<script type="text/javascript">
+
+$(document).ready(function() {
+ num = $pageno;
+});
+
+function loadcontent() {
+ //$("div.loader").show();
+
+ num+=1;
+
+ console.log('Loading page ' + num);
+
+ $.get('/network?mode=raw$reload_uri&page=' + num, function(data) {
+ $(data).insertBefore('#conversation-end');
+ });
+
+ //$("div.loader").fadeOut('normal');
+}
+
+var num = $pageno;
+
+$(window).scroll(function(e){
+
+ //if ($(window).scrollTop() == $(document).height() - $(window).height()){
+ if ($(window).scrollTop() > $("section").height() - $(window).height()){
+ loadcontent();
+ }
+});
+</script>
+
+EOT;
+
+}
+
$page = $a->page;
$profile = $a->profile;
$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'])) : '');
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);
'$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $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.")),
);
}
-
-
// search terms header
if(x($_GET,'search')) {
$a->page['content'] .= '<h2>' . t('Search Results For:') . ' ' . $search . '</h2>';
'selected' => ($search==$rr['term']),
);
}
- }
+ }
+
-
$tpl = get_markup_template("saved_searches_aside.tpl");
$o = replace_macros($tpl, array(
'$title' => t('Saved Searches'),
'$searchbox' => search($search,'netsearch-box',$srchurl,true),
'$saved' => $saved,
));
-
+
return $o;
}
|| ($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';
}
$spam_active = 'active';
}
-
-
+
+
if (($new_active == '')
&& ($starred_active == '')
&& ($bookmarked_active == '')
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);
}
// 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 " : '');
$sql_extra2 = (($nouveau) ? '' : " AND `item`.`parent` = `item`.`id` ");
$sql_extra3 = (($nouveau) ? '' : $sql_extra3);
+ $sql_order = "`item`.`received`";
$sql_table = "`item`";
if(x($_GET,'search')) {
$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)) {
$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'])
);
else
$ordering = "`commented`";
+ if ($sql_order == "")
+ $sql_order = "`item`.$ordering";
+
// Fetch a page full of parent items for this page
if($update) {
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())
);
}
$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));
}
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);
$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));
$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...
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'])
}
- if($tag)
+ if($tag)
$o .= '<h2>Items tagged with: ' . $search . '</h2>';
else
$o .= '<h2>Search results for: ' . $search . '</h2>';
$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)
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']){
}
$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
$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'),
'$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)
return $o;
}
-
-
+
+
/*
* ACCOUNT SETTINGS
*/
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);
{{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}}
{{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}}
<div class="settings-submit-wrapper" >
{{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}}
{{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}}
{{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}}