Merge branch 'master' into tres

Conflicts:
	include/Contact.php
	include/ItemObject.php
	include/api.php
	include/attach.php
	include/diaspora.php
	include/dir_fns.php
	include/enotify.php
	include/event.php
	include/expire.php
	include/items.php
	include/notifier.php
	include/notify.php
	include/photos.php
	include/taxonomy.php
	include/text.php
	include/widgets.php
	include/zot.php
	mod/admin.php
	mod/channel.php
	mod/dirsearch.php
	mod/display.php
	mod/editwebpage.php
	mod/events.php
	mod/home.php
	mod/item.php
	mod/manage.php
	mod/mood.php
	mod/network.php
	mod/page.php
	mod/photos.php
	mod/ping.php
	mod/post.php
	mod/thing.php
	mod/viewsrc.php
	view/css/mod_events.css
This commit is contained in:
friendica
2015-04-23 19:49:41 -07:00
1727 changed files with 56838 additions and 208980 deletions

View File

@@ -36,6 +36,11 @@ function channel_init(&$a) {
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/feed/' . $which .'" />' . "\r\n" ;
// Not yet ready for prime time
// $a->page['htmlhead'] .= '<link rel="openid.server" href="' . $a->get_baseurl() . '/id/' . $which .'?f=" />' . "\r\n" ;
// $a->page['htmlhead'] .= '<link rel="openid.delegate" href="' . $a->get_baseurl() . '/channel/' . $which .'" />' . "\r\n" ;
// Run profile_load() here to make sure the theme is set before
// we start loading content
@@ -45,6 +50,11 @@ function channel_init(&$a) {
function channel_content(&$a, $update = 0, $load = false) {
if($load)
$_SESSION['loadtime'] = datetime_convert();
$category = $datequery = $datequery2 = '';
$mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : '');
@@ -144,16 +154,25 @@ function channel_content(&$a, $update = 0, $load = false) {
$page_mode = 'client';
$abook_uids = " and abook.abook_channel = " . intval($a->profile['profile_uid']) . " ";
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
if($update && $_SESSION['loadtime'])
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
if($load)
$simple_update = '';
if(($update) && (! $load)) {
if ($mid) {
$r = q("SELECT parent AS item_id from item where mid = '%s' and uid = %d AND item_restrict = 0
$r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d AND item_restrict = 0
AND item_wall = 1 AND item_unseen = 1 $sql_extra limit 1",
dbesc($mid),
dbesc($mid . '%'),
intval($a->profile['profile_uid'])
);
} else {
$r = q("SELECT distinct parent AS `item_id`, created from item
left join abook on item.author_xchan = abook.abook_xchan
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
WHERE uid = %d AND item_restrict = 0
AND item_wall = 1 AND item_unseen = 1
AND ((abook.abook_flags & %d) = 0 or abook.abook_flags is null)
@@ -162,6 +181,7 @@ function channel_content(&$a, $update = 0, $load = false) {
intval($a->profile['profile_uid']),
intval(ABOOK_FLAG_BLOCKED)
);
$_SESSION['loadtime'] = datetime_convert();
}
}
@@ -242,6 +262,9 @@ function channel_content(&$a, $update = 0, $load = false) {
}
if((! $update) && (! $load)) {
// This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
@@ -322,8 +345,11 @@ function channel_content(&$a, $update = 0, $load = false) {
$o .= conversation($a,$items,'channel',$update,'traditional');
}
if((! $update) || ($_COOKIE['jsAvailable'] != 1))
if((! $update) || ($_COOKIE['jsAvailable'] != 1)) {
$o .= alt_pager($a,count($items));
if ($mid && $items[0]['title'])
$a->page['title'] = $items[0]['title'] . " - " . $a->page['title'];
}
if($mid)
$o .= '<div id="content-complete"></div>';