The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Show page numbers

Page 2 of 2 Previous  1, 2

View previous topic View next topic Go down

Solved Show page numbers

Post by FIB on March 10th 2015, 11:47 am

First topic message reminder :

Is it possible to show page numbers ?


HERE...



phpbb2


Last edited by FIB on March 15th 2015, 4:09 pm; edited 1 time in total

FIB
Forumember

Male Posts : 482
Reputation : 2
Language : English
Location : UK

http://ourbulgariaforum.freeforums.eu/

Back to top Go down


Solved Re: Show page numbers

Post by FIB on March 13th 2015, 12:08 am

@JScript wrote:
@FIB wrote:One more question... How is the text size changed? only asking just in case it needs to be bigger with the numbers.
I do not quite understand your question, but you want to change the font size?

JS


@JScript Yes that is correct

FIB
Forumember

Male Posts : 482
Reputation : 2
Language : English
Location : UK

http://ourbulgariaforum.freeforums.eu/

Back to top Go down

Solved Re: Show page numbers

Post by JScript on March 13th 2015, 12:27 am

@FIB

Okay, so in this case, use the code below:
Code:

/***
 * Application: showPages.js
 * Description:
 * Version: 0.03122015-jq1.9.1
 *         RC1 (Release candidate 1!)
 * Author: JScript - 2015/03/12
 * Copyright (c) 2015 JScript <jscriptbrasil at live dot com>
 * This work is free. You can redistribute it and/or modify it
 * under the terms of the WTFPL, Version 2
 */
var showPages = {
   autor: "JScript",
   Application: "showPages.js",
   version: "0.03122015-jq1.9.1",
   codename: "FIB",

   goToPage: "Go to page",
   postsPerPage: 10,

   temp: '',
   phpBB2: '',
   phpBB3: '',
   punbb: '',
   invision: '',

   initialize: function() {
      jQuery(function() {
         showPages.add();
      });
   },

   add: function() {
      var oTarget = $('.last-post-icon'),
         aFound, oAppend,
         phpBB2 = '<span class="gensmall showpages" style="float: right;">[ <img title="' + showPages.goToPage + '" alt="' + showPages.goToPage + '" src="http://illiweb.com/fa/empty.gif" class="sprite-icon_minipost">' + showPages.goToPage + ': ';

      for (var i = 0, len = oTarget.length; i < len; i++) {
         aFound = /(\/t[0-9]+)p([0-9]+)-/.exec(oTarget[i]);
         if (aFound) {
            oAppend = $(oTarget[i]).closest('tr').find('td:eq(1)');
            showPages.temp = phpBB2 + '<a href="' + aFound[1] + '-">1</a>, ';
            var jlen = aFound[2] / showPages.postsPerPage;

            if (jlen > 3) {
               showPages.temp += '<a href="' + aFound[1] + 'p' + showPages.postsPerPage + '-">2</a>, ... ' +
                  '<a href="' + aFound[1] + 'p' + (aFound[2] - showPages.postsPerPage) + '-">' + jlen + '</a>, ' +
                  '<a href="' + aFound[1] + 'p' + aFound[2] + '-">' + (jlen + 1) + '</a>, ';
            } else {
               for (var j = 0; j < jlen; j++) {
                  showPages.temp += '<a href="' + aFound[1] + 'p' + ((j + 1) * showPages.postsPerPage) + '-">' + (j + 2) + '</a>, ';
               }
            }
            showPages.temp = showPages.temp.slice(0, -2) + ' ]</span>';
            oAppend.append(showPages.temp);
         }
      };
   }
};

showPages.initialize();

And here's an example of CSS for font size:
Code:

.gensmall.showpages {
  font-size: 12px;
}

So long,

JS

JScript
Forumember

Male Posts : 741
Reputation : 167
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: Show page numbers

Post by FIB on March 13th 2015, 12:37 am

@JScript Is this to replace the existing code or add to it?

FIB
Forumember

Male Posts : 482
Reputation : 2
Language : English
Location : UK

http://ourbulgariaforum.freeforums.eu/

Back to top Go down

Solved Re: Show page numbers

Post by JScript on March 13th 2015, 12:40 am

Replace, sure!

JS

JScript
Forumember

Male Posts : 741
Reputation : 167
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: Show page numbers

Post by FIB on March 13th 2015, 12:47 am

@JScript Do I also need to add this



Code:

.gensmall.showpages {
  font-size: 12px;
}

FIB
Forumember

Male Posts : 482
Reputation : 2
Language : English
Location : UK

http://ourbulgariaforum.freeforums.eu/

Back to top Go down

Solved Re: Show page numbers

Post by FIB on March 15th 2015, 4:08 pm

All sorted thank you for all you help @JScript

FIB
Forumember

Male Posts : 482
Reputation : 2
Language : English
Location : UK

http://ourbulgariaforum.freeforums.eu/

Back to top Go down

Solved Re: Show page numbers

Post by SLGray on March 15th 2015, 5:52 pm

Topic solved and archived


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35622
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Page 2 of 2 Previous  1, 2

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum