vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   User Points System (https://vborg.vbsupport.ru/showthread.php?t=32060)

GuruXL 04-10-2002 07:42 PM

Quote:

Originally posted by mas404
Hi

How can i but the points $post[field6] on the welcome text
so the user can see his point on the formhome page.

yep i need to do the same thing, but i can't get it to work

Vivi Ornitier 04-10-2002 08:04 PM

I went into phpMyAdmin and changed the userfield used for the points to an int instead of char.

Edit: Guru and mas - just changed it to $bbuserinfo[field6] and that should fix it.

GuruXL 04-11-2002 01:48 AM

Quote:

Originally posted by Vivi Ornitier
I went into phpMyAdmin and changed the userfield used for the points to an int instead of char.

that didn't work for me :(

Vivi Ornitier 04-11-2002 07:19 PM

Well, I'm not sure. I played around for a while but couldn't get it working.

Anyway, here is an addition to the automatic points for posting:
PHP Code:

      $newpts=$bbuserinfo[posts]/10 ;
      
$newptsround($newpts) ; 
      
$newpts=$newpts+;
      
$DB_site->query("UPDATE userfield SET
          fieldX=fieldX+
$newpts WHERE userid='$bbuserinfo[userid]'"); 

This will make it so the user will get 1 point if he/she has 10 posts, 10 for 100, etc. If you already have the auto-point added, just replace it with this and change the proper X's.
If not, find this in newreply.php and newthread.php:
PHP Code:

          $DB_site->query("UPDATE user SET
          "
.iif ($foruminfo[countposts],"posts=posts+1,","")."
          
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");
      } 

And place my code underneath that.

Palmer ofShinra 04-17-2002 09:02 PM

Quote:

Originally posted by heretic
I'm curious, can this hack be modified to show commas? the users on my site earn up in the hundred thousands, and was wondering how it can be more readable, so instead of 1234567 it'd be 1,234,567
echo number_format($points);

heretic 04-17-2002 10:44 PM

where? in points.php?

Palmer ofShinra 04-18-2002 12:53 AM

Use it in whatever file is appropriate...

If it's for displaying next to posts... just add $points=number_format($points) into the getpostbit part of functions.php

For display on the forum main page, edit index.php

And so forth.

heretic 04-18-2002 01:09 AM

since I want it to show in the postbit, I put it in functions.php in the buildpostbit function, the echo statement you have doesn't do anything, and hte example from the post above gives me a parse error...should I put it in global.php instead?

heretic 04-18-2002 01:11 AM

meh, I forgot the ;

heretic 04-18-2002 01:20 AM

nope, no matter where I put that, it doesn't work


All times are GMT. The time now is 04:26 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.01245 seconds
  • Memory Usage 1,743KB
  • 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
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete