News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Pages: << [1] 2 3 ... 45 >>

Started by houtsma, August 21, 2004, 01:22:04 PM

Previous topic - Next topic

houtsma

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

[Unknown]

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]

houtsma

#2
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

admactanium

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.

A.M.A

#4
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.
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

admactanium

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.

[Unknown]

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]

admactanium

thank you unknown. i will attempt that change.

admactanium

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.

Grudge

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
I'm only a half geek really...

V@no

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> ' : '');

V@no

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;');

Advertisement: