The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
$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 |
#2
|
|||
|
|||
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).
|
#3
|
|||
|
|||
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! |
#4
|
||||
|
||||
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. |
#5
|
||||
|
||||
$totalposts is formatted, so use this instead of Kirk's code.
PHP Code:
|
#6
|
||||
|
||||
I almost just disputed that str_replace saying you didn't define anything. I'm retarded.
|
#7
|
|||
|
|||
..also the seperator might not be a comma. It will depend on how your numbers are formatted.
|
#8
|
||||
|
||||
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 |
#9
|
|||
|
|||
http://members.vbulletin.com/api/vBu..._number_format
So something like: PHP Code:
|
#10
|
||||
|
||||
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.... |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|