inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Aug 18, 2013 12:42:31 GMT -8
Was wondering if there was a way for a plugin to work out the average posts a day overall.
So say like the average posts a day if the total posts is 2500 and the sites been open 2 months or similar. Preferably this should be something you could set up a div with a class to write to it ((As I do not use 'standard' infocenters)).
Of course if this could be done by a template even better!
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Aug 18, 2013 16:43:32 GMT -8
<tr><td>Total Threads: $[total_threads] Total Posts: $[total_posts] Averaging: <script type="text/javascript"> var dt=new Date(2012,8,1); var td=new Date(); var span=td-dt; var totalDays=parseInt(span/(1000*60*60*24)); document.write(parseInt(($[total_posts]/totalDays)*10)/10 + ' Posts per day');</script></td></tr>
replace with that line
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Aug 18, 2013 21:30:25 GMT -8
Thank you Wormo!
Edit: forgot to specify I meant it from site starting (This is why I don't make requests at stupid o' clock
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Aug 18, 2013 22:37:57 GMT -8
of course. the there isnt a variable that shows the site start. you can look at the registered date of the admin and get it though.
var dt=new Date(2012,8,1);
year, month-1, day
months in javascript go from 0 to 11. so subtract 1.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Aug 18, 2013 22:54:04 GMT -8
Okay that works thank you ^_^ Sorry about that I was 90% asleep
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Aug 21, 2013 0:58:20 GMT -8
WormopolisWhile debugging the monetary system, I noticed the JS error coming from the script. It seems as if total_posts doesn't exist? shieldrp.com/thread/606/day-diner-open?page=1&scrollTo=2594SyntaxError: unmatched ) in regular expression [Break On This Error]
...000*60*60*24)); document.write(parseInt((/totalDays)*10)/10 + ' Posts per day') On Average we post <script type="text/javascript"> var dt=new Date(2013,5,15); var td=new Date(); var span=td-dt; var totalDays=parseInt(span/(1000*60*60*24)); document.write(parseInt((/totalDays)*10)/10 + ' Posts per day');</script>
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Aug 21, 2013 1:01:40 GMT -8
that is different then what I have above. for some reason it stripped out the template variable
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Aug 21, 2013 1:40:42 GMT -8
WormopolisThat was in the source, so no template vars would get shown, hence why it's stripped out.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Aug 21, 2013 1:44:13 GMT -8
It's also on an area it wouldn't be shown - to stop there been blank spaces I hide and show divs on different areas so with that being on a thread the infocenter part wouldn't show if that makes sense XD
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Aug 21, 2013 3:37:02 GMT -8
if the template variable doesnt exist in that area, then there isnt a way to get total forum posts. you would need to either request to have that data added to proboards.data, or request that template variable be added into more sections then just "home"
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Aug 21, 2013 3:55:53 GMT -8
That's what I'm saying though - because the data doesn't exist it sits in a hidden div, on the thread view itself and on the board display part it doesn't actually show that at all, the div its in is hidden through javascript
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Aug 21, 2013 4:52:07 GMT -8
The point I was trying to make is that your forum shows an error. I know the tpl var is empty in some areas, I was just pointing it out that there was an error. I would store $[total_posts] in a var... var total_posts = "$[total_posts]" || 0;
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Aug 21, 2013 5:21:23 GMT -8
Where would I put this xD I have no idea where I'd need to actually put this - and the other thing I was thinking of suggesting would it still work okay if I included the script within the if statement that controls what shows on the main page?
|
|