vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Confused, request your help! (https://vborg.vbsupport.ru/showthread.php?t=52094)

Sylvus 04-25-2003 12:06 AM

Confused, request your help!
 
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

PHP Code:


$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?


All times are GMT. The time now is 08:22 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01355 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete