Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Topic started by: houtsma on August 21, 2004, 01:22:04 PM

Title: Pages: << [1] 2 3 ... 45 >>
Post by: houtsma on August 21, 2004, 01:22:04 PM
I would like to see two extra buttons (<< and >>) to move to the previous or following
subpage in a topic. The current Next and Previous buttons move to the corresponding
Topics instead, which is something i am not used to.

Thanks,
Jan
Title: Re: Pages: << [1] 2 3 ... 45 >>
Post by: [Unknown] on August 21, 2004, 04:13:52 PM
Actually, those are in a completely different part of the screen, to signify that they are not related to the page listing.

Have you tried changing your contiguous pages settings?

-[Unknown]
Title: Re: Pages: << [1] 2 3 ... 45 >>
Post by: houtsma on August 22, 2004, 04:48:49 AM
Yes i know it's a different part of the screen and i don't argue them. Just that
they are more or less "near" the pages buttons (on a small screen the difference
is small). But having "<<' and ">>" buttons would even take that doubt away.

In the contiguous page settings i can switch it on, off or select a different
layout (1 ... 4 [5] 6 ... 9 or 1 ... 3 4 [5] 6 7 ... 9) but none of them will allow
me to press some "next sub-page" button, like the "next-topic" button.

Look for example at phpbb or other boards. Not that smf should try to duplicate
the other boards but this is one feature iwhich in my opinion is really handy!

Talking about another phpbb feature i miss, see:
     http://www.simplemachines.org/community/index.php?topic=15617.0

Thanks. smf is great software though!

jan
Title: Re: Pages: << [1] 2 3 ... 45 >>
Post by: admactanium on November 18, 2004, 03:32:19 AM
new here so sorry to bring up an old topic. but i agree with the original poster here. i would like to see either "<<" and ">>" or "previous" & "next" or image buttons surrounding the contiguous pages. it's easier to hit a bigger target than to hit a single digit. also, it tends to make the designer want to make the page numbers really large to make the target easier to hit (which seems a bit too big).

great stuff here. love the board but that's the one small but significant thing i'd like to see added.
Title: Re: Pages: << [1] 2 3 ... 45 >>
Post by: A.M.A on November 18, 2004, 04:08:48 AM
That method is already used for wireless browsing .. if you need it just add/replace
this:
' . (!empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . '">First</a> <a href="' . $context['links']['prev'] . '">previous</a> ' : '') . '(' . $context['page_info']['current_page'] . '/' . $context['page_info']['num_pages'] . ')' . (!empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . '">next</a> <a href="' . $context['links']['last'] . '">Last</a> ' : '') . '
or this:
' . (!empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . '">&lt;&lt;</a> <a href="' . $context['links']['prev'] . '">&lt;</a> ' : '') . '(' . $context['page_info']['current_page'] . '/' . $context['page_info']['num_pages'] . ')' . (!empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . '">&gt;</a> <a href="' . $context['links']['last'] . '">&gt;&gt;</a> ' : '') . '

to/with Display.template.php
', $context['page_index'];
two times.
Title: Re: Pages: << [1] 2 3 ... 45 >>
Post by: admactanium on November 20, 2004, 08:34:10 PM
sorry to be dense ama, but how exactly do i do this? i didn't understand your post.

open display.template.php

and find this:
', $context['page_index'];

and put this below it:
' . (!empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . '">First</a> <a href="' . $context['links']['prev'] . '">previous</a> ' : '') . '(' . $context['page_info']['current_page'] . '/' . $context['page_info']['num_pages'] . ')' . (!empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . '">next</a> <a href="' . $context['links']['last'] . '">Last</a> ' : '') . '

?

what is the "two times." referring to?

thanks.
Title: Re: Pages: << [1] 2 3 ... 45 >>
Post by: [Unknown] on November 21, 2004, 01:33:58 AM
He wants you to find some block of code, which will appear in two places of Themes/yourtheme/Display.template.php, and both times you find it replace it with another block of code.

-[Unknown]
Title: Re: Pages: << [1] 2 3 ... 45 >>
Post by: admactanium on November 21, 2004, 10:53:14 PM
thank you unknown. i will attempt that change.
Title: Re: Pages: << [1] 2 3 ... 45 >>
Post by: admactanium on November 22, 2004, 05:35:39 AM
hmm. so i copied the first line exactly into line 170 of the display.template.php file in my theme. i replaced the line:

', $context['page_index'];

with this line:

' . (!empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . '">First</a> <a href="' . $context['links']['prev'] . '">previous</a> ' : '') . '(' . $context['page_info']['current_page'] . '/' . $context['page_info']['num_pages'] . ')' . (!empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . '">next</a> <a href="' . $context['links']['last'] . '">Last</a> ' : '') . '

and my browser returned this error:

QuoteParse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/jeffnee/public_html/scar/forum/Themes/scarface/Display.template.php on line 170

i tried to find out where the missing "," or ";" should go but i'm just guessing.
Title: Re: Pages: << [1] 2 3 ... 45 >>
Post by: Grudge on November 22, 2004, 05:39:06 AM
That line should be:
' . (!empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . '">First</a> <a href="' . $context['links']['prev'] . '">previous</a> ' : '') . '(' . $context['page_info']['current_page'] . '/' . $context['page_info']['num_pages'] . ')' . (!empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . '">next</a> <a href="' . $context['links']['last'] . '">Last</a> ' : '');

When used in the place that you mentioned
Title: Re: Pages: << [1] 2 3 ... 45 >>
Post by: V@no on March 24, 2005, 12:27:05 AM
Thanks guys for the code!
Works great.

And here is exactly what hautsma wanted:' . (!empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . '">&lt;&lt;</a> <a href="' . $context['links']['prev'] . '">&lt;</a> ' : '') . $context['page_index'] . (!empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . '">&gt;</a> <a href="' . $context['links']['last'] . '">&gt;&gt;</a> ' : '');
Title: Re: Pages: << [1] 2 3 ... 45 >>
Post by: V@no on October 18, 2009, 09:27:18 PM
I know it's very old topic, but since then came up a better solution that is theme-independent.

In Sources/Subs.php find:
return $pageindex;

Insert above:
// First/Prev
if ($start != 0)
$pageindex = sprintf($base_link, 0, '&#171;&#171;') . ((empty($modSettings['compactTopicPagesEnable'])) ? "" : " " . sprintf($base_link, $start - $num_per_page, '&#171;')) . $pageindex;

// Next/Last
$tmpMaxPages = (int) (($max_value - 1) / $num_per_page) * $num_per_page;
if ($tmpMaxPages >= $start + $num_per_page)
$pageindex .= ((empty($modSettings['compactTopicPagesEnable'])) ? "" : sprintf($base_link, (($start + $num_per_page) > $max_value ? $max_value : ($start + $num_per_page)), '&#187;') . " ") . sprintf($base_link, $tmpMaxPages, '&#187;&#187;');