Author Topic: Help with Themes, etc. (Read 350 times)
« Reply #1 on: July 28, 2009, 05:09:01 PM »
Hi Ya
It Applies to posts in a topic - from what I can see there is no function for doing Prev / Next in a Board with a large number of topics
So at a guess it is what you are after - try it and if it is not what you want then over write the file with the backup you will make before you start
If that makes sense
Shortie
Thank You, "Guest" For Reading My Post.
« Reply #2 on: July 28, 2009, 05:49:03 PM »
Backups?? Backups are for amatuers! LOL
« Reply #3 on: July 28, 2009, 05:52:44 PM »
LoL
May have to remind you of that one day
Thank You, "Guest" For Reading My Post.
« Reply #4 on: July 29, 2009, 02:30:14 PM »
LoL
May have to remind you of that one day
Yah, eating crow sux
The edit worked fine. Don't want to be a nit but can the prev/next be moved between the pages and the go up/down instead of on the extreme left?
Thx, +EV
« Reply #5 on: July 29, 2009, 03:03:29 PM »
Thank You, "Guest" For Reading My Post.
« Reply #6 on: July 29, 2009, 04:19:31 PM »
Okay here we are
First edit circa line 130
// Show the page index... "Pages: [1]".
echo '
', $txt['pages'], ': ', $context['page_index'], ' ', $context['previous_next'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '
' . $txt['go_down'] . ' ' : '', '
', template_button_strip($normal_buttons, 'bottom'), '
';
Second edit circa line 520
echo '
', $txt['pages'], ': ', $context['page_index'],' ', $context['previous_next'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '
' . $txt['go_up'] . ' ' : '', '
', template_button_strip($normal_buttons, 'top'), '
';
Shortie
Thank You, "Guest" For Reading My Post.
« Reply #7 on: July 29, 2009, 04:44:31 PM »
Okay here we are
First edit circa line 130
// Show the page index... "Pages: [1]".
echo '
', $txt['pages'], ': ', $context['page_index'], ' ', $context['previous_next'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '
' . $txt['go_down'] . ' ' : '', '
', template_button_strip($normal_buttons, 'bottom'), '
';
Second edit circa line 520
echo '
', $txt['pages'], ': ', $context['page_index'],' ', $context['previous_next'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '
' . $txt['go_up'] . ' ' : '', '
', template_button_strip($normal_buttons, 'top'), '
';
Shortie
[ ERROR: SPECIFIED ATTACHMENT MISSING ]
The position moved fine but the prev/next is now rotating thru the topics not the posts??
« Reply #8 on: July 29, 2009, 04:57:13 PM »
Opss
It has done that since day one - I should test more but have been flat out recently
Will see what I can do but can't promise at the moment - maybe SoLo or someone could jump in
Shortie
Thank You, "Guest" For Reading My Post.
« Reply #9 on: July 29, 2009, 10:15:32 PM »
Sure, would love to Jump In, just attach all files related to what you are doing there plusev, k? And file edits that you have done, please point me to the LINE #'s. That way I don't have to waste time finding it myself and can focus primarily on what you want accomplished.
Thanks
« Reply #10 on: July 29, 2009, 10:47:23 PM »
The exact code is above as supplied by Shortie. Did the edits and it's functioning fine. Currently the Prev/Next text links browse the topics. What I was looking for was for the Prev/Next links to browse the pages within a topic.
« Reply #11 on: July 30, 2009, 12:46:58 AM »
Ok, gotcha, so you want the Prev Next links to browse through the current topic pages, instead of going to the next topic in that board. So, if there are no more pages, than I suppose the Next link should be just text, not a link. And if you are already on page 1, the Prev link should be text and not a link also. And if there is only 1 page for that topic, both Prev & Next links should only be text, not links. Will work an edit out for this, be back shortly.
« Reply #12 on: July 30, 2009, 01:21:07 AM »
Hi All
At a guess the best bet would be to find the existing code and just mod it for posts instead of topics
But you are the PHP Perfectionist so do what is best
As for page one and the last page could just turn the link off may be easier
Shortie
Thank You, "Guest" For Reading My Post.
« Reply #13 on: July 30, 2009, 02:08:15 AM »
Yep, has to be modded, and code has to be changed in Display.php and Display.template.php files. Working on it right now, but don't know if I'll get the chance to finish since I'm currently a bit busy around the house...
We'll see...
« Reply #14 on: July 30, 2009, 02:55:12 AM »
FOR SMF 2.0.x Versions:
Ok, in ./Sources/Display.php @ around LINE #549...
FIND:
// Construct the page index, allowing for the .START method...
$context['page_index'] = constructPageIndex($scripturl . '?topic=' . $topic . '.%d', $_REQUEST['start'], $context['total_visible_posts'], $context['messages_per_page'], true);
$context['start'] = $_REQUEST['start'];
AFTER, ADD:
if (empty($context['start']))
$context['prev_topic_page'] = '<< Previous';
else
$context['prev_topic_page'] = '<< Previous ';
if ($context['total_visible_posts'] <= ($context['start'] + $context['messages_per_page']))
$context['next_topic_page'] = ' Next>>';
else
$context['next_topic_page'] = ' Next >> ';
Now in ./Themes/default/Display.template.php
FIND @ around LINE 131 (or whereever you have it defined, since I believe you changed this already):
', $context['previous_next'], '
REPLACE WITH:
', $context['prev_topic_page'], $context['next_topic_page'], '
There ya go, 2 Edits. Anyways, never even changed the $context['previous_next'] variable. So, if you want you can still use this variable wherever.
« Last Edit: July 30, 2009, 03:07:13 AM by SoLoGHoST »