![]() |
How to calculate?
I basically want under my postbit template to say
Posts: X Raffle Tickets: X (number) But in order to get that number, I want it to calculate Raffle Tickets by posts / 20 How would I go about doing this? Sorry, I'm a programmer and this seems really easy to make in C++ or Java but not sure with php and html. Thanks |
What are Raffle Tickets? They are not a default vbulltin thing. You should ask this question in the modification thread where you downloaded the modification.
|
Its not a modification. Every 20 posts a member makes creates 1 raffle ticket SO,
the equation is: Raffle = Posts / 20 (truncate decimal) EXAMPLE: Raffle = 40 / 20 Raffle= 2. Display: Posts: 40 Raffles: 2 |
Do raffle tickets go away at any point?
|
That doesn't make sense. Let's say we have 3 users. A, B, and C. A has 20 posts and thus one raffle ticket. B has 10 posts and no raffle tickets. C has 15 posts and no raffle tickets.
Total posts = 45 Total raffle tickets = 1 if (totalPosts%20 > 9) (posts/20) - 1 = 2 (rounded) else posts/20 = 2 (rounded) ^Still inaccurate according to my above example. 2 != 1 Also, go into your statistics template and get the variable. ($totalposts) |
Quote:
Code:
<if condition="$post['tickets'] = (int)($post['posts'] / 20)"></if> |
Can you use (int) in a template like that?
|
Quote:
|
Do you mean parenthesis? I use those in conditional for wrapping some conditions and they seem to work fine. Unless I got your meaning wrong.
They use the math in the style vars, though. Not that that would mean anything. How's this for some screwed up code? Code:
if ((int)round(abs($postdays)) > 1) |
Quote:
|
All times are GMT. The time now is 02:49 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:
|