updates
This commit is contained in:
parent
a20a637727
commit
03209d2d0d
@ -280,6 +280,31 @@ function paginate(&$a) {
|
|||||||
return $o;
|
return $o;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
if(! function_exists('alt_pager')) {
|
||||||
|
function alt_pager(&$a, $i) {
|
||||||
|
$o = '';
|
||||||
|
$stripped = preg_replace('/(&page=[0-9]*)/','',$a->query_string);
|
||||||
|
$stripped = str_replace('q=','',$stripped);
|
||||||
|
$stripped = trim($stripped,'/');
|
||||||
|
$pagenum = $a->pager['page'];
|
||||||
|
$url = $a->get_baseurl() . '/' . $stripped;
|
||||||
|
|
||||||
|
$o .= '<div class="pager">';
|
||||||
|
|
||||||
|
if($a->pager['page']>1)
|
||||||
|
$o .= "<a href=\"$url"."&page=".($a->pager['page'] - 1).'">' . t('newer') . '</a>';
|
||||||
|
if($i>0) {
|
||||||
|
if($a->pager['page']>1)
|
||||||
|
$o .= " - ";
|
||||||
|
$o .= "<a href=\"$url"."&page=".($a->pager['page'] + 1).'">' . t('older') . '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$o .= '</div>'."\r\n";
|
||||||
|
|
||||||
|
return $o;
|
||||||
|
}}
|
||||||
|
|
||||||
// Turn user/group ACLs stored as angle bracketed text into arrays
|
// Turn user/group ACLs stored as angle bracketed text into arrays
|
||||||
|
|
||||||
if(! function_exists('expand_acl')) {
|
if(! function_exists('expand_acl')) {
|
||||||
|
@ -357,9 +357,9 @@
|
|||||||
function dolike(ident,verb) {
|
function dolike(ident,verb) {
|
||||||
unpause();
|
unpause();
|
||||||
$('#like-rotator-' + ident.toString()).show();
|
$('#like-rotator-' + ident.toString()).show();
|
||||||
$.get('like/' + ident.toString() + '?verb=' + verb );
|
$.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate );
|
||||||
if(timer) clearTimeout(timer);
|
// if(timer) clearTimeout(timer);
|
||||||
timer = setTimeout(NavUpdate,3000);
|
// timer = setTimeout(NavUpdate,3000);
|
||||||
liking = 1;
|
liking = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,14 +44,14 @@ function community_content(&$a, $update = 0) {
|
|||||||
// Only public posts can be shown
|
// Only public posts can be shown
|
||||||
// OR your own posts if you are a logged in member
|
// OR your own posts if you are a logged in member
|
||||||
|
|
||||||
|
if(! get_pconfig(local_user(),'system','alt_pager')) {
|
||||||
$r = q("SELECT distinct(`item`.`uri`) AS `total`
|
$r = q("SELECT COUNT(distinct(`item`.`uri`)) AS `total`
|
||||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
|
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
|
||||||
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
|
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
|
||||||
AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = ''
|
AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = ''
|
||||||
AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = ''
|
AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = ''
|
||||||
AND `item`.`private` = 0 AND `item`.`wall` = 1 AND `user`.`hidewall` = 0
|
AND `item`.`private` = 0 AND `item`.`wall` = 1 AND `user`.`hidewall` = 0
|
||||||
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 group by `item`.`uri` "
|
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0"
|
||||||
);
|
);
|
||||||
|
|
||||||
if(count($r))
|
if(count($r))
|
||||||
@ -62,6 +62,8 @@ function community_content(&$a, $update = 0) {
|
|||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$r = q("SELECT distinct(`item`.`uri`), `item`.*, `item`.`id` AS `item_id`,
|
$r = q("SELECT distinct(`item`.`uri`), `item`.*, `item`.`id` AS `item_id`,
|
||||||
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`,
|
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`,
|
||||||
`contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
|
`contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
|
||||||
@ -80,11 +82,21 @@ function community_content(&$a, $update = 0) {
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if(! count($r)) {
|
||||||
|
info( t('No results.') . EOL);
|
||||||
|
return $o;
|
||||||
|
}
|
||||||
|
|
||||||
// we behave the same in message lists as the search module
|
// we behave the same in message lists as the search module
|
||||||
|
|
||||||
$o .= conversation($a,$r,'community',$update);
|
$o .= conversation($a,$r,'community',$update);
|
||||||
|
|
||||||
|
if(! get_pconfig(local_user(),'system','alt_pager')) {
|
||||||
$o .= paginate($a);
|
$o .= paginate($a);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$o .= alt_pager($a,count($r));
|
||||||
|
}
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ function like_content(&$a) {
|
|||||||
$like_item = $r[0];
|
$like_item = $r[0];
|
||||||
|
|
||||||
// Already voted, undo it
|
// Already voted, undo it
|
||||||
$r = q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1",
|
$r = q("UPDATE `item` SET `deleted` = 1, `unseen` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1",
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
intval($like_item['id'])
|
intval($like_item['id'])
|
||||||
);
|
);
|
||||||
|
@ -560,6 +560,7 @@ function network_content(&$a, $update = 0) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if(! get_pconfig(local_user(),'system','alt_pager')) {
|
||||||
$r = q("SELECT COUNT(*) AS `total`
|
$r = q("SELECT COUNT(*) AS `total`
|
||||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||||
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
||||||
@ -571,9 +572,10 @@ function network_content(&$a, $update = 0) {
|
|||||||
|
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$a->set_pager_total($r[0]['total']);
|
$a->set_pager_total($r[0]['total']);
|
||||||
|
}
|
||||||
|
}
|
||||||
$itemspage_network = get_pconfig(local_user(),'system','itemspage_network');
|
$itemspage_network = get_pconfig(local_user(),'system','itemspage_network');
|
||||||
$a->set_pager_itemspage(((intval($itemspage_network)) ? $itemspage_network : 40));
|
$a->set_pager_itemspage(((intval($itemspage_network)) ? $itemspage_network : 40));
|
||||||
}
|
|
||||||
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
|
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -613,7 +615,8 @@ function network_content(&$a, $update = 0) {
|
|||||||
if($update) {
|
if($update) {
|
||||||
$r = q("SELECT `parent` AS `item_id`, `contact`.`uid` AS `contact_uid`
|
$r = q("SELECT `parent` AS `item_id`, `contact`.`uid` AS `contact_uid`
|
||||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||||
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND
|
||||||
|
(`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE ."' OR item.verb = '" . ACTIVITY_DISLIKE . "')
|
||||||
and `item`.`moderated` = 0 and `item`.`unseen` = 1
|
and `item`.`moderated` = 0 and `item`.`unseen` = 1
|
||||||
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
||||||
$sql_extra3 $sql_extra $sql_nets ",
|
$sql_extra3 $sql_extra $sql_nets ",
|
||||||
@ -687,8 +690,13 @@ function network_content(&$a, $update = 0) {
|
|||||||
$o .= conversation($a,$items,$mode,$update);
|
$o .= conversation($a,$items,$mode,$update);
|
||||||
|
|
||||||
if(! $update) {
|
if(! $update) {
|
||||||
|
if(! get_pconfig(local_user(),'system','alt_pager')) {
|
||||||
$o .= paginate($a);
|
$o .= paginate($a);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$o .= alt_pager($a,count($items));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,8 @@ function profile_content(&$a, $update = 0) {
|
|||||||
|
|
||||||
$r = q("SELECT distinct(parent) AS `item_id`, `contact`.`uid` AS `contact-uid`
|
$r = q("SELECT distinct(parent) AS `item_id`, `contact`.`uid` AS `contact-uid`
|
||||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||||
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND
|
||||||
|
(`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE ."' OR item.verb = '" . ACTIVITY_DISLIKE . "')
|
||||||
and `item`.`moderated` = 0 and `item`.`unseen` = 1
|
and `item`.`moderated` = 0 and `item`.`unseen` = 1
|
||||||
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
||||||
AND `item`.`wall` = 1
|
AND `item`.`wall` = 1
|
||||||
@ -227,7 +228,7 @@ function profile_content(&$a, $update = 0) {
|
|||||||
$sql_extra2 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2))));
|
$sql_extra2 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(! get_pconfig($a->profile['profile_uid'],'system','alt_pager')) {
|
||||||
$r = q("SELECT COUNT(*) AS `total`
|
$r = q("SELECT COUNT(*) AS `total`
|
||||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||||
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
||||||
@ -239,8 +240,9 @@ function profile_content(&$a, $update = 0) {
|
|||||||
|
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$a->set_pager_total($r[0]['total']);
|
$a->set_pager_total($r[0]['total']);
|
||||||
$a->set_pager_itemspage(40);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
$a->set_pager_itemspage(40);
|
||||||
|
|
||||||
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
|
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
|
||||||
|
|
||||||
@ -324,8 +326,13 @@ function profile_content(&$a, $update = 0) {
|
|||||||
$o .= conversation($a,$items,'profile',$update);
|
$o .= conversation($a,$items,'profile',$update);
|
||||||
|
|
||||||
if(! $update) {
|
if(! $update) {
|
||||||
|
if(! get_pconfig($a->profile['profile_uid'],'system','alt_pager')) {
|
||||||
$o .= paginate($a);
|
$o .= paginate($a);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$o .= alt_pager($a,count($items));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
@ -130,6 +130,7 @@ function search_content(&$a) {
|
|||||||
// OR your own posts if you are a logged in member
|
// OR your own posts if you are a logged in member
|
||||||
// No items will be shown if the member has a blocked profile wall.
|
// No items will be shown if the member has a blocked profile wall.
|
||||||
|
|
||||||
|
if(! get_pconfig(local_user(),'system','alt_pager')) {
|
||||||
$r = q("SELECT distinct(`item`.`uri`) as `total`
|
$r = q("SELECT distinct(`item`.`uri`) as `total`
|
||||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
|
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
|
||||||
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
|
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
|
||||||
@ -142,10 +143,12 @@ function search_content(&$a) {
|
|||||||
|
|
||||||
if(count($r))
|
if(count($r))
|
||||||
$a->set_pager_total(count($r));
|
$a->set_pager_total(count($r));
|
||||||
|
|
||||||
if(! count($r)) {
|
if(! count($r)) {
|
||||||
info( t('No results.') . EOL);
|
info( t('No results.') . EOL);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$r = q("SELECT distinct(`item`.`uri`), `item`.*, `item`.`id` AS `item_id`,
|
$r = q("SELECT distinct(`item`.`uri`), `item`.*, `item`.`id` AS `item_id`,
|
||||||
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`,
|
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`,
|
||||||
@ -170,6 +173,12 @@ function search_content(&$a) {
|
|||||||
|
|
||||||
$a = fetch_post_tags($a);
|
$a = fetch_post_tags($a);
|
||||||
|
|
||||||
|
if(! count($r)) {
|
||||||
|
info( t('No results.') . EOL);
|
||||||
|
return $o;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if($tag)
|
if($tag)
|
||||||
$o .= '<h2>Items tagged with: ' . htmlspecialchars($search) . '</h2>';
|
$o .= '<h2>Items tagged with: ' . htmlspecialchars($search) . '</h2>';
|
||||||
else
|
else
|
||||||
@ -177,7 +186,12 @@ function search_content(&$a) {
|
|||||||
|
|
||||||
$o .= conversation($a,$r,'search',false);
|
$o .= conversation($a,$r,'search',false);
|
||||||
|
|
||||||
|
if(! get_pconfig(local_user(),'system','alt_pager')) {
|
||||||
$o .= paginate($a);
|
$o .= paginate($a);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$o .= alt_pager($a,count($r));
|
||||||
|
}
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
2012-07-12.13
|
2012-07-14.15
|
||||||
|
Reference in New Issue
Block a user