![]() |
$totalposts coding!
Hi All
Dont know if anyone can help me what PHP code would i use to say countdown to x amount of posts say you are reaching 1 million posts you want to subtract this figure to $totalposts any idea how one would code this?!?!? Thanks |
I'm a bit confused... Are you trying to make a variable that shows the total amount of forum posts on the forumhome? If so, search these forums for global variables (i remember finding one by Ziki).
|
Nah Basically trying to do a countdown
our forum is approaching 2million posts so on forum home i want to write text like "Number of posts till 2 million - (shows the figure here) so im thinking along the lines of $totalposts which is the variable for showing how many posts a forum has at the moment and get the figure and subtract it by 2million :) hoep tha tmakes sense! |
Create a new plugin at hook location "forumhome_complete" with the following:
Code:
$remaining = 2000000 - $totalposts; ie: There are $remaining posts remaining to our goal of 2,000,000. |
$totalposts is formatted, so use this instead of Kirk's code.
PHP Code:
|
Quote:
|
..also the seperator might not be a comma. It will depend on how your numbers are formatted.
|
With this, is there a way to put the comma back in?? (using Dismounted method)
My numbers are being outputted as 100000 vice 100,000 |
http://members.vbulletin.com/api/vBu..._number_format
So something like: PHP Code:
|
But how would that format the output of
Code:
$remaining = 2000000 - str_replace(',', '', $totalposts); ok I got it.. I just had to add another line.. So I used two $remaining1 and remaining.... |
All times are GMT. The time now is 01:12 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|