View Single Post
  #3  
Old 11-02-2005, 04:55 AM
TJFweb TJFweb is offline
 
Join Date: Dec 2001
Posts: 191
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome, I got it working using the $post[points] variable.

I just had to hook the plugin to postbit_display_complete as it must have been executing before the uCash hook was (which is also in postbit_display_complete).

I hacked the uCash global file to not insert commas and now everything displays very nicely alongside my activity stats. COOL

I renamed the variables and added it as its own plugin. It looks like this (I take it that I can remove the // and anything that comes after it in each line?):
Code:
//Separate out cashcount
    $icon_cashcount=$post[points];
    if($icon_cashcount<1){
      $icon_cashd=array(1=>'s',2=>'s',3=>'s',4=>'s',5=>'s',6=>'s',7=>'s',8=>'s',9=>'0');
    }else{//($icon_cashcount<1)
      for($i=9;$i>0;$i--){
        $icon_cashdigit=$icon_cashcount%10;
        $icon_cashcount=floor($icon_cashcount/10);
        if(($icon_cashdigit==0)&&($icon_cashcount==0)){
          $icon_cashd[$i]='s';
        }else{//(($icon_cashdigit==0)&&($icon_cashcount==0))
          $icon_cashd[$i]=$icon_cashdigit;
        }//endif(($icon_cashdigit==0)&&($icon_cashcount==0))
      }//endfor($i=9;$i>0;$i++)
    }//endif($icon_cashcount<1)
Could I ask one last favor? If it doesn't require a heap of extra work, is it possible to insert a line or two of code so that a $ sign gif (given by element 'ds') can appear just before a non zero element (in place of the first 's' element) in the array (i.e. $icon_cashd[xxx]='ds')? My digits show perfectly, but it would be nice to have a preceding dollar sign too.

Thanks a lot, WetWired. You've been a great help.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01409 seconds
  • Memory Usage 1,764KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete