Merge pull request #1375 from annando/1502-altpager-default

"altpager" is now the standard value and can be disabled.
This commit is contained in:
Tobias Diekershoff 2015-02-08 13:37:26 +01:00
commit 7d2da9be02
6 changed files with 18 additions and 17 deletions

View file

@ -372,6 +372,8 @@ function admin_page_site_post(&$a){
$basepath = ((x($_POST,'basepath')) ? notags(trim($_POST['basepath'])) : ''); $basepath = ((x($_POST,'basepath')) ? notags(trim($_POST['basepath'])) : '');
$singleuser = ((x($_POST,'singleuser')) ? notags(trim($_POST['singleuser'])) : ''); $singleuser = ((x($_POST,'singleuser')) ? notags(trim($_POST['singleuser'])) : '');
$proxy_disabled = ((x($_POST,'proxy_disabled')) ? True : False); $proxy_disabled = ((x($_POST,'proxy_disabled')) ? True : False);
$old_pager = ((x($_POST,'old_pager')) ? True : False);
if($ssl_policy != intval(get_config('system','ssl_policy'))) { if($ssl_policy != intval(get_config('system','ssl_policy'))) {
if($ssl_policy == SSL_POLICY_FULL) { if($ssl_policy == SSL_POLICY_FULL) {
q("update `contact` set q("update `contact` set
@ -499,6 +501,7 @@ function admin_page_site_post(&$a){
set_config('system','temppath', $temppath); set_config('system','temppath', $temppath);
set_config('system','basepath', $basepath); set_config('system','basepath', $basepath);
set_config('system','proxy_disabled', $proxy_disabled); set_config('system','proxy_disabled', $proxy_disabled);
set_config('system','old_pager', $old_pager);
info( t('Site settings updated.') . EOL); info( t('Site settings updated.') . EOL);
goaway($a->get_baseurl(true) . '/admin/site' ); goaway($a->get_baseurl(true) . '/admin/site' );
@ -664,6 +667,7 @@ function admin_page_site(&$a) {
'$temppath' => array('temppath', t("Temp path"), get_config('system','temppath'), "If you have a restricted system where the webserver can't access the system temp path, enter another path here."), '$temppath' => array('temppath', t("Temp path"), get_config('system','temppath'), "If you have a restricted system where the webserver can't access the system temp path, enter another path here."),
'$basepath' => array('basepath', t("Base path to installation"), get_config('system','basepath'), "If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."), '$basepath' => array('basepath', t("Base path to installation"), get_config('system','basepath'), "If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."),
'$proxy_disabled' => array('proxy_disabled', t("Disable picture proxy"), get_config('system','proxy_disabled'), t("The picture proxy increases performance and privacy. It shouldn't be used on systems with very low bandwith.")), '$proxy_disabled' => array('proxy_disabled', t("Disable picture proxy"), get_config('system','proxy_disabled'), t("The picture proxy increases performance and privacy. It shouldn't be used on systems with very low bandwith.")),
'$old_pager' => array('old_pager', t("Enable old style pager"), get_config('system','old_pager'), t("The old style pager has page numbers but slows down massively the page speed.")),
'$relocate_url' => array('relocate_url', t("New base url"), $a->get_baseurl(), "Change base url for this server. Sends relocate message to all DFRN contacts of all users."), '$relocate_url' => array('relocate_url', t("New base url"), $a->get_baseurl(), "Change base url for this server. Sends relocate message to all DFRN contacts of all users."),
'$form_security_token' => get_form_security_token("admin_site") '$form_security_token' => get_form_security_token("admin_site")

View file

@ -44,7 +44,7 @@ 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_config('alt_pager', 'global')) && (! get_pconfig(local_user(),'system','alt_pager')) ) { if(get_config('system', 'old_pager')) {
$r = q("SELECT COUNT(distinct(`item`.`uri`)) AS `total` $r = q("SELECT COUNT(distinct(`item`.`uri`)) AS `total`
FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
@ -103,10 +103,9 @@ function community_content(&$a, $update = 0) {
$o .= conversation($a,$s,'community',$update); $o .= conversation($a,$s,'community',$update);
if(get_config('alt_pager', 'global') || get_pconfig(local_user(),'system','alt_pager') ) { if(!get_config('system', 'old_pager')) {
$o .= alt_pager($a,count($r)); $o .= alt_pager($a,count($r));
} } else {
else {
$o .= paginate($a); $o .= paginate($a);
} }

View file

@ -627,7 +627,7 @@ die("ss");
} }
else { else {
if( (! get_config('alt_pager', 'global')) && (! get_pconfig(local_user(),'system','alt_pager')) ) { if(get_config('system', 'old_pager')) {
$r = q("SELECT COUNT(*) AS `total` $r = q("SELECT COUNT(*) AS `total`
FROM $sql_table $sql_post_table INNER JOIN `contact` ON `contact`.`id` = $sql_table.`contact-id` FROM $sql_table $sql_post_table INNER JOIN `contact` ON `contact`.`id` = $sql_table.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
@ -815,10 +815,9 @@ die("ss");
$o .= conversation($a,$items,$mode,$update); $o .= conversation($a,$items,$mode,$update);
if(!$update) { if(!$update) {
if( get_config('alt_pager', 'global') || get_pconfig(local_user(),'system','alt_pager') ) { if(!get_config('system', 'old_pager')) {
$o .= alt_pager($a,count($items)); $o .= alt_pager($a,count($items));
} } else {
else {
$o .= paginate($a); $o .= paginate($a);
} }
} }

View file

@ -246,7 +246,7 @@ function profile_content(&$a, $update = 0) {
$sql_extra2 .= protect_sprintf(sprintf(" AND `thread`.`created` >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2)))); $sql_extra2 .= protect_sprintf(sprintf(" AND `thread`.`created` >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2))));
} }
if( (! get_config('alt_pager', 'global')) && (! get_pconfig($a->profile['profile_uid'],'system','alt_pager')) ) { if(get_config('system', 'old_pager')) {
$r = q("SELECT COUNT(*) AS `total` $r = q("SELECT COUNT(*) AS `total`
FROM `thread` INNER JOIN `item` ON `item`.`id` = `thread`.`iid` FROM `thread` INNER JOIN `item` ON `item`.`id` = `thread`.`iid`
$sql_post_table INNER JOIN `contact` ON `contact`.`id` = `thread`.`contact-id` $sql_post_table INNER JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`
@ -340,10 +340,9 @@ function profile_content(&$a, $update = 0) {
$o .= conversation($a,$items,'profile',$update); $o .= conversation($a,$items,'profile',$update);
if(! $update) { if(! $update) {
if( get_config('alt_pager', 'global') || get_pconfig($a->profile['profile_uid'],'system','alt_pager') ) { if(!get_config('system', 'old_pager')) {
$o .= alt_pager($a,count($items)); $o .= alt_pager($a,count($items));
} } else {
else {
$o .= paginate($a); $o .= paginate($a);
} }
} }

View file

@ -150,7 +150,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_config('alt_pager', 'global')) && (! get_pconfig(local_user(),'system','alt_pager')) ) { if(get_config('system', 'old_pager')) {
$r = q("SELECT distinct(`item`.`uri`) as `total` $r = q("SELECT distinct(`item`.`uri`) as `total`
FROM $sql_table INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` FROM $sql_table INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
@ -205,10 +205,9 @@ function search_content(&$a) {
$o .= conversation($a,$r,'search',false); $o .= conversation($a,$r,'search',false);
if( get_config('alt_pager', 'global') || get_pconfig(local_user(),'system','alt_pager') ) { if(!get_config('system', 'old_pager')) {
$o .= alt_pager($a,count($r)); $o .= alt_pager($a,count($r));
} } else {
else {
$o .= paginate($a); $o .= paginate($a);
} }

View file

@ -116,6 +116,7 @@
{{include file="field_input.tpl" field=$itemcache_duration}} {{include file="field_input.tpl" field=$itemcache_duration}}
{{include file="field_input.tpl" field=$max_comments}} {{include file="field_input.tpl" field=$max_comments}}
{{include file="field_checkbox.tpl" field=$proxy_disabled}} {{include file="field_checkbox.tpl" field=$proxy_disabled}}
{{include file="field_checkbox.tpl" field=$old_pager}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div> <div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>
</form> </form>