inherit
152392
0
Dec 29, 2015 15:47:36 GMT -8
umtaut
56
March 2010
taut
|
Post by umtaut on Apr 5, 2015 3:54:45 GMT -8
Forum URL: taut.proboards.comHello, I am trying to create a custom post count to display on the main page. I do not wish to replace the 'Total posts' count but merely add a div somewhere that counts the posts made after a specific total, for instance 59 posts, on the main page. I figured it was sufficient to make a template mod. I tried doing something like this: $[total_posts] - 59 but without any success. I also tried creating a small script, but I am unable to access the total posts number in this way. Can I load it via proboards.data or is there another way of accessing the number? I know board stats are not possible to access globally (like number of users i a certain croup, etc.), but seeing as this number is available for everyone on the main page I figured it should be possible.
|
|
Kami
Forum Cat
Posts: 40,199
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,199
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Apr 5, 2015 13:16:32 GMT -8
Forum URL: taut.proboards.comHello, I am trying to create a custom post count to display on the main page. I do not wish to replace the 'Total posts' count but merely add a div somewhere that counts the posts made after a specific total, for instance 59 posts, on the main page. I figured it was sufficient to make a template mod. I tried doing something like this: $[total_posts] - 59 but without any success. I also tried creating a small script, but I am unable to access the total posts number in this way. Can I load it via proboards.data or is there another way of accessing the number? I know board stats are not possible to access globally (like number of users i a certain croup, etc.), but seeing as this number is available for everyone on the main page I figured it should be possible. I have to admit, I'm not really sure what you're trying to accomplish? What do you expect to happen with this modification?
|
|
inherit
152392
0
Dec 29, 2015 15:47:36 GMT -8
umtaut
56
March 2010
taut
|
Post by umtaut on Apr 6, 2015 1:43:26 GMT -8
Kami: with 59 being the number of total posts right now I was hoping to adjust the info center total to 0. If it worked as intended it would then go to 1 when $[total_posts] go to 60. The reason for having it is so to have an interactive post counter so all members of the site can see how far along we are with reaching our goal of posts that day. I didn't this was relevant for my thread. So far I have this script: <script type="text/javascript"> /* Post Count */ var postCount = total_posts; var postStart= 59 ; document.getElementById("thePostCount").innerHTML = postCount-postStart + "/200"; </script> My problem is accessing total_posts. This should allow me to put the counter anywhere on the page with: <div id="thePostCount"></div>
|
|
Kami
Forum Cat
Posts: 40,199
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,199
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Apr 6, 2015 3:18:29 GMT -8
Kami: with 59 being the number of total posts right now I was hoping to adjust the info center total to 0. If it worked as intended it would then go to 1 when $[total_posts] go to 60. The reason for having it is so to have an interactive post counter so all members of the site can see how far along we are with reaching our goal of posts that day. I didn't this was relevant for my thread. So far I have this script: <script type="text/javascript"> /* Post Count */ var postCount = total_posts; var postStart= 59 ; document.getElementById("thePostCount").innerHTML = postCount-postStart + "/200"; </script> My problem is accessing total_posts. This should allow me to put the counter anywhere on the page with: <div id="thePostCount"></div> I am not too familiar with javascript but I think part of the problem is that your syntax is wrong. var postStart= 59 ; should be var postStart = 59;. Note the space between "postStart" and the "=" and the lack of space between "59" and ";" in my correction. The part where I think is the bigger problem is the line defining postCount as equalling total_posts. That's the variable in the template, but I'm not entirely sure if that's what you should be targeting with the JS. There also could be a problem with that line since total_posts is being used before it's defined in the script buuuuuut I'm not sure if that's entirely the case if you're targeting the specific variable. All that said I am not entirely you can target the variable this way, so I'm going to tag a few people who might be more knowledgeable -- Todge, Craig, or maybe Chris
|
|
#eb7100
1480
0
1
Nov 21, 2024 14:52:33 GMT -8
Craig
209,196
September 2001
cmdynasty
|
Post by Craig on Apr 6, 2015 4:37:45 GMT -8
You can only grab the total posts of the forum as a whole on the home template. I am assuming postStart is a variable you are going to have to change everyday?
I am not sure if a plugin would be a better way to go as it may be able to store the post count, and perhaps even auto update the postStart automatically each day for you. I would make a post in the plugin request board.
|
|
inherit
152392
0
Dec 29, 2015 15:47:36 GMT -8
umtaut
56
March 2010
taut
|
Post by umtaut on Apr 6, 2015 5:06:42 GMT -8
Hello CraigI only need the counter one or two times so updating it will not be a nuiscance. But I will try my luck and request a plugin Thank you.
|
|
#eb7100
1480
0
1
Nov 21, 2024 14:52:33 GMT -8
Craig
209,196
September 2001
cmdynasty
|
Post by Craig on Apr 6, 2015 5:43:09 GMT -8
Good luck with it
|
|