Sylvus
04-25-2003, 01:06 AM
I'm using a hack that tells the user how many days they've been registered. Then, with this information I give each member 10 posts per day they've been registered for.
Everything works fine, EXCEPT for the $postgroup which I use in the postbit template.
$regdays is OK in the postbit.
$bonusxp is OK in the postbit.
$totalxp is OK in the postbit.
$postgroup is coming out incorrectly. Anyone know why?
Here's the code used in functions.php
$regdays = round((time() - $post[joindate]) / 86400); // Days Joined
if ($regdays < 1) { // Must be registered Today
$regdays = "1";
$daytext = "Day";
}
if ($regdays == 1) {
$daytext = "Day";
} else {
$daytext = "Days";
}
// Add bonus posts to users.
$bonusxp=$regdays;
$bonusxp=$bonusxp*10;
$totalxp=$bonusxp+$post[posts];
// Change postbit based on $totalxp
if ($totalxp >= 1) { $postgroup = "Grunt<br>Level: 1"; }
else if($totalxp >= 100) { $postgroup = "Wanderer<br>Level: 2<P>"; }
else if($totalxp >= 300) { $postgroup = "Explorer<br>Level: 3<P>"; }
else if($totalxp >= 600) { $postgroup = "Survivor<br>Level: 4<P>"; }
// END
The $postgroup within the postbit template always "Grun Level: 1" even though $totalxp in the postbit template is well over that.
What have I done wrong?
Everything works fine, EXCEPT for the $postgroup which I use in the postbit template.
$regdays is OK in the postbit.
$bonusxp is OK in the postbit.
$totalxp is OK in the postbit.
$postgroup is coming out incorrectly. Anyone know why?
Here's the code used in functions.php
$regdays = round((time() - $post[joindate]) / 86400); // Days Joined
if ($regdays < 1) { // Must be registered Today
$regdays = "1";
$daytext = "Day";
}
if ($regdays == 1) {
$daytext = "Day";
} else {
$daytext = "Days";
}
// Add bonus posts to users.
$bonusxp=$regdays;
$bonusxp=$bonusxp*10;
$totalxp=$bonusxp+$post[posts];
// Change postbit based on $totalxp
if ($totalxp >= 1) { $postgroup = "Grunt<br>Level: 1"; }
else if($totalxp >= 100) { $postgroup = "Wanderer<br>Level: 2<P>"; }
else if($totalxp >= 300) { $postgroup = "Explorer<br>Level: 3<P>"; }
else if($totalxp >= 600) { $postgroup = "Survivor<br>Level: 4<P>"; }
// END
The $postgroup within the postbit template always "Grun Level: 1" even though $totalxp in the postbit template is well over that.
What have I done wrong?