SMF Development > Bug Reports

The "pagelinks" class is missing from "Core" theme files

(1/1)

rickmastfan67:
I was just building a template based off the "Core" template released in 2.0 and noticed that the class "pagelinks" wasn't included in the files that came with the theme.  However, the "pagelinks" info (line 3369) is in the "index.css" file that comes with the theme.  So, since none of the files for the theme have it, it's useless forcing people to have to manually add back in that class into the files and possibly not knowing where it goes unless they have some basic PHP editing skills to get that class to work correctly.

Below, I've listed the files that are in the Core template that are lacking this class to make it work correctly.

Core/Display.template.php:

--- Code: (line 157) --- <div class="margintop middletext floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>
--- End code ---
should be:

--- Code: --- <div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>
--- End code ---
-

--- Code: (line 612) --- <div class="middletext floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
--- End code ---
should be:

--- Code: --- <div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
--- End code ---

Core/Memberlist.template.php:

--- Code: (line 27) --- <div class="floatleft middletext">
--- End code ---
should be:

--- Code: --- <div class="pagelinks floatleft">
--- End code ---
-

--- Code: (line 137/138) --- <div class="middletext clearfix">
<div class="floatleft">', $txt['pages'], ': ', $context['page_index'], '</div>';

--- End code ---
should be:

--- Code: --- <div class="clearfix">
<div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], '</div>';

--- End code ---

Core/MessageIndex.template.php:

--- Code: (line 149) --- <div class="floatleft middletext">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>

--- End code ---
should be:

--- Code: --- <div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>

--- End code ---
-

--- Code: (line 379) --- <div class="floatleft middletext">' . $txt['pages'] . ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
--- End code ---
should be:

--- Code: --- <div class="pagelinks floatleft">' . $txt['pages'] . ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
--- End code ---

Just thought I would bring this to your attention guys.

Also, there seems to be a few other pages that the pagelinks class might need to be added to in the Core template as any page in the Admin area &
Moderation Center that has page numbers doesn't have it's color for the page links changed.  Same with "Recent Unread Topics"/"Updated Topics".  If I find any other pages that this isn't working with, I'll add them to this thread later.

EDIT: It seems that some more minor tweaking will be needed to get the 1st of each of those to work just right on MessageIndex.template.php and MessageIndex.template.php.  With my "fix" above, it seems to make the buttons on the right side of the screen (New Topic, New Poll, ect) to no longer be flush with the bar underneath them.  Don't know why that's happening.  Yet when you're viewing a post, that doesn't happen.

emanuele:
Hello rickmastfan67,

thank you for the report and for the fix :D

rickmastfan67:
No problem emanuele.  Just thought people would like to be able to change those the basic page numbers with ease if they were editing the "core" theme. :)


--- Quote from: rickmastfan67 on May 15, 2012, 06:28:35 AM ---EDIT: It seems that some more minor tweaking will be needed to get the 1st of each of those to work just right on MessageIndex.template.php and MessageIndex.template.php.  With my "fix" above, it seems to make the buttons on the right side of the screen (New Topic, New Poll, ect) to no longer be flush with the bar underneath them.  Don't know why that's happening.  Yet when you're viewing a post, that doesn't happen.

--- End quote ---

Ok, I've figured out how to fix this.  The padding for the .pagelinks class needed to be adjusted from 0.5em to 0.3em.  That fixed the buttons on the right of the screen having a big gap.  Also, it wouldn't hurt to add in the following lines for the .pagelinks class in the CSS to make it a tad easier for people to change the color of the basic ones.  It will also allow the .pagesection class color that is found in the Admin areas to be colored as well allowing novices to do a quick change if they can't see the page numbers because of their background being almost the same color.

Original code in "\Themes\core\css\index.css":

--- Code: ---/* the page navigation area */
.pagesection
{
font-size: 0.85em;
padding: 0.5em 0.2em;
overflow: hidden;
}
.pagesection .pagelinks
{
padding: 0.5em 0;
}

--- End code ---

Replace with:

--- Code: ---/* the page navigation area */
.pagesection
{
font-size: 0.9em;
font-family: verdana, sans-serif;
padding: 0.5em 0.2em;
overflow: hidden;
color: black;
}
.pagelinks
{
font-size: 0.9em;
font-family: verdana, sans-serif;
padding: 0.3em 0;
color: black;
}

--- End code ---

You can change the "color" tags to whatever color you want them to be for the fix.

Also, I've also updated the main post for the "Core/Memberlist.template.php" file since I noticed that one of Page number sets was still too small (the bottom one on that page).  Had to take out the extra "middletext" class that was making that text smaller than the top one.

And for that ".pagesection .pagelinks" that I removed.  I honestly didn't see any problems with removing it, but if there is, please let me know and obviously don't take it out of the official release if it's really needed.

Hopefully with the fixes I've done here don't cause any weird effects. lol.  They don't on my end at least.  And those fixes in my custom theme I'm making are working perfectly.

Navigation

[0] Message Index

Go to full version