inherit
203774
0
Mar 15, 2021 14:31:18 GMT -8
bearsmummy
23
January 2014
bearsmummy
|
Post by bearsmummy on Aug 22, 2017 5:08:25 GMT -8
Forum URL: copingwithlife.proboards.comI do not know where to post this; so please, bear with me. I recall on the older versions of proboards, in the info center, besides the number of threads and total posts, it showed how many boards there were. Is it possible to be able to add how many boards in the info center on the new versions of proboards? If so, could you explain to me how to do it? Many thanks.
|
|
inherit
140147
0
Nov 19, 2024 5:07:22 GMT -8
Nscalerr
Throw me to the wolves and I'll return leading the pack!
3,043
May 2009
nscalerr
|
Post by Nscalerr on Aug 22, 2017 5:35:01 GMT -8
Hi bearsmummyAdding this script to your Main Footer will have the desired effect. <script type="text/javascript"> /* Adds number of boards to info center. */ var boardNum = $(".board-link").length; $("#boardNum").text(boardNum); </script> Then add the following to your Home template where you want the number of boards to show. Boards: <span id="boardNum"></span>
|
|
inherit
203774
0
Mar 15, 2021 14:31:18 GMT -8
bearsmummy
23
January 2014
bearsmummy
|
Post by bearsmummy on Aug 22, 2017 14:22:33 GMT -8
Thank you so much! So I need to add this to ALL of my themes templates, correct? Will that also work for sub-boards or is there an additional code for that?
Where on the Home Template do I add this code? I placed it at the bottom and I have the board number sitting below the box to the left.
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Aug 22, 2017 14:34:59 GMT -8
If you want it on each theme you'll need to make the change on all of them.
The code relies on the .board-link class which the boards on the index page have but their sub-boards do not, so this code will not include sub-boards in the count unless you modify the selector that determines which links it targets. That's done by changing this line: To this:
|
|
inherit
203774
0
Mar 15, 2021 14:31:18 GMT -8
bearsmummy
23
January 2014
bearsmummy
|
Post by bearsmummy on Aug 22, 2017 14:54:47 GMT -8
Hi Brian, Okay, now I am officially lost. Please bear with me. I haven't been on proboards for a few years and I hate to admit that facebook dulls the mind. You are directing me to where in the forum? I am to look in Structure, Themes, ? I know that once I grasp it, I won't forget it. I need to go back to school.
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Aug 22, 2017 15:01:46 GMT -8
The script that was first given to you goes in the footer section of Structure > Headers & Footers > Main Header & Footer. If you want it to include the sub-board count you can make the change I specified.
This second part has to be added to Themes > Layout Templates > Home on each of your themes:
This will produce the number of boards on your forum. If you want it to show alongside the total threads and posts you can find this line: And change it to this:
|
|
inherit
203774
0
Mar 15, 2021 14:31:18 GMT -8
bearsmummy
23
January 2014
bearsmummy
|
Post by bearsmummy on Aug 22, 2017 15:47:48 GMT -8
Thank you Brian! As usual, you rock! I could always rely upon you to guide me through everything. :-)
|
|
inherit
203774
0
Mar 15, 2021 14:31:18 GMT -8
bearsmummy
23
January 2014
bearsmummy
|
Post by bearsmummy on Aug 22, 2017 16:14:57 GMT -8
Sorry to bug. I think I did everything right; but, the number of boards and subboards are not showing up. Any suggestions?
|
|
inherit
140147
0
Nov 19, 2024 5:07:22 GMT -8
Nscalerr
Throw me to the wolves and I'll return leading the pack!
3,043
May 2009
nscalerr
|
Post by Nscalerr on Aug 22, 2017 18:34:39 GMT -8
For the sub-boards on my forum I added the following script to the same place as the other script. <script type="text/javascript"> /* Adds number of sub-boards to info center. */ var subBoardNum = $(".sub-boards a").length $("#subBoardNum").text(subBoardNum); </script> and added the following to the home template. Sub-Boards: <span id="subBoardNum"></span> I have the following in my forums home template for displaying the boards and sub-boards. <tr><td>Threads: $[total_threads] — Posts: $[total_posts] — Categories: $[category.length] — Boards: <span id="boardNum"></span> — Sub-Boards: <span id="subBoardNum"></span></td></tr>
Brian changing the line of code to include sub-boards didn't actually work as intended in the test I ran. Yes it did show a number, but not boards and sub-boards seperately.
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Aug 23, 2017 8:00:50 GMT -8
Sorry to bug. I think I did everything right; but, the number of boards and subboards are not showing up. Any suggestions? Did you modify the Home template of the theme? On your default theme I don't see any edits to the section where the board count is meant to show. Brian changing the line of code to include sub-boards didn't actually work as intended in the test I ran. Yes it did show a number, but not boards and sub-boards seperately. My modification to the code was never meant to show them separately. Sub-boards are still boards, so my goal was to combine their counts.
|
|
inherit
203774
0
Mar 15, 2021 14:31:18 GMT -8
bearsmummy
23
January 2014
bearsmummy
|
Post by bearsmummy on Aug 23, 2017 12:57:38 GMT -8
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Aug 23, 2017 13:15:40 GMT -8
It looks like the number isn't appearing because this line in your main footer is typed incorrectly. You've added an extra instance of var boardNum = when there should only be one.
Eliminate the part colored red from that line so that it looks like this:
It should work after that.
|
|
inherit
203774
0
Mar 15, 2021 14:31:18 GMT -8
bearsmummy
23
January 2014
bearsmummy
|
Post by bearsmummy on Aug 25, 2017 2:55:39 GMT -8
Thank you Brain. I don't know how I did that. I appreciate all that you have done for me. Have a great weekend.
|
|