No announcement yet.

numbernav_pages being processed differently by different areas

  • Filter
  • Time
  • Show
Clear All
new posts

  • numbernav_pages being processed differently by different areas

    This one is driving me insane...

    numbernav_pages is responsible for displaying the individual page numbers at the bottom of thread listings and threads themselves.

    When displaying a thread listing, it will produce (for example page 2):
    <a href="forumdisplay.php?s=&forumid=15&daysprune=30&sortorder=&sortfield=lastpost&perpage=25&pagenumber=2">2</a>
    Yet, it decides to act differently without any way to stop it doing so, when it does the same thing for a thread itself:
    <a href="showthread.php?s=&threadid=7800&perpage=15&pagenumber=2" class="thtcolor"><font size="1" face="Verdana, Arial" color="#FFFFC0">2</font></a>
    Why is it doing this? This is now a class on the URL, and there's a font tag - these are NOT in the template and are only appearing when vBulletin is generating a thread view.

    VERY confused... this and numpages are causing me causing me grief. Awesome work on the rest of the template system though, it's been an absolute piece of cake to completely change the way the forums look.

    Thanks guys,

  • #2
    If you look in the template, you'll see all the tags are generated by the code itself.


    • #3
      What I saw is that it has been hardcoded for vBulletin's default layout, which is displaying that information within a table bar. Put it somewhere else, and vBulletin's hardcoding works against you - ie it uses the "table bar text colour", which is only useful if used on top of the "table bar background colour".

      Thus to overcome this I've had to go through and hardcode the heading colour on every other template, and then change the table bar text colour to suit NOT being on top of the table bar background. How stupid is that - just to fix the hardcoded styling of the page numbers on thread views, when that same template works fine on thread listings! Even then, the actual "layout" of the page numbering is now against the styling of my site because the numpages template which doesn't work is being deleted rather than fixed, so I've had to put it outside my layout to make it work.

      Still have the quirk of the class causing the links to not behave correctly, but I'll have to live with that.



      • #4
        You can edit the code in showthread.php to remove the class...

        PHP Code:
          while (
        $curpage++<$totalpages) {
            if ((
        $curpage>$pagenumber-$pagenavpages and $curpage<$pagenumber+$pagenavpages) or $pagenavpages==0) {
              if (
        $curpage==$pagenumber) {
        $endpagetag '';
        "\$pagenumbers .= \"".gettemplate("numbernav_pages")."\";");
              } else {
        $numbernav_atag="<a href=\"$shorturl&pagenumber=$curpage\" class=\"thtcolor\"><smallfont color=\"{tableheadtextcolor}\">";
        $endpagetag '</smallfont></a>';
        "\$pagenumbers .= \"".gettemplate("numbernav_pages")."\";");
        "\$pagenav = \"".gettemplate("numbernav")."\";"); 
        I know it is a pain and a hassle, however the navigation items will most likely be improved in future releases. Several other features could be made more dynamic and most likely will in upcoming versions.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API - Full / Mobile
        Vote for your favorite feature requests and the bugs you want to see fixed.


        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.