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)

Palmer ofShinra 11-02-2001 10:00 PM

UPDATE: Code tested on both 2.0.3 and 2.2.0

Install instructions updated to reflect differences in versions.

Ability to specify Text values for points directly added.
=====================

As requested in this thread ( http://vbulletin.org/forum/showthrea...threadid=23114 )

This hack includes a small script and instructions on how to install and set up the system.

Purpose: Just a simple engine that allows mods and admins to award arbitrary points to users, which will be displayed under their names/avatars.

The points can be named anything you wish, and represent anything you choose. You can use the script to add or subtract them.

As the script utilizes a Custom Profile Field, the point field can be directly edited in the CP when editing a user, allowing you to place text in the field rather than merely a number.

On our forum, the points are called Gil and represent our virtual currency

It is used to purchase perks like Custom Titles and avatars.

Our staff, having no use for Gil, instead like to have snappy quotes in the field, like "I send greetings of death!!!" (Reno) and "Who needs Gil when you have power?" (Sephiroth)

TheComputerGuy 11-03-2001 09:47 AM

Thanks man this is pretty work

TGO 11-03-2001 10:54 AM

Does this work with 2.2.0?

Neo 11-03-2001 01:29 PM

thanks you, you are my god:D

Lesane 11-03-2001 02:49 PM

Thank you for this great hack

Waiting on the store hack ;):D

Mike Gaidin 11-03-2001 02:58 PM

Thanks!!!

Reeve of shinra 11-03-2001 03:10 PM

Quote:

Originally posted by TGO
Does this work with 2.2.0?
Havent tried it out yet, but I might later on today...
I dont see a reason why it wouldnt work...

Dalius 11-03-2001 03:44 PM

Wow, this is great!

if the store hack is released, will this be intergrated into it?

maverick1236 11-03-2001 04:10 PM

Parse error: parse error in e:\program files\nusphere\apache\htdocs\upload\mod\points.php on line 82

if (isset($userid) { // make sure userid is passed to script

Palmer ofShinra 11-03-2001 05:35 PM

Make line 82 read

if (isset($userid))

Notice the extra )

My bad. Zip updated. Sorry :)

eva2000 11-03-2001 06:34 PM

any english based site got this working for us to see?

Palmer ofShinra 11-03-2001 06:42 PM

Yeah, my own forum.

The code on my forum is a bit different, but mainly cosmetic changes.

And no, you can't test it yourself because it checks permissions.

But it does work. I just finished squashing the last typo.

Reeve of shinra 11-03-2001 07:00 PM

Just finished bug squashing with the big guy here.

Did a clean install of VB220, installed the hack per the instructions and it works perfect.

- also installed it on my test board for 203 and it works perfectly.

certify 11-05-2001 12:49 PM

I keep getting 404 page not found when I click the below link?

Quote:

moderator.php?s=$session[sessionhash]&action=points&userid=$userinfo[userid]" target=_blank

Reeve of shinra 11-05-2001 02:30 PM

Can you clarify which link you were clicking and if this was on your board..?

certify 11-06-2001 01:53 PM

It's from the showthread.php and the left below the number of post.

Reeve of shinra 11-06-2001 03:24 PM

If your trying this on our board, www.shinraonline.com - it wont work unless your a moderator or administrator.

If this is your board, then you should check the syntax you entered into the postbit template and ensure all refrences in the hack and in the template show the correct field for the custom field.

Catch me on aim later tommorrow (TheTomBlack) if you still having trouble implementing this and I will walk you through it.

Mike Gaidin 11-07-2001 02:53 AM

Installed and working great.

thanks for such a great hack!

ckevin 11-09-2001 01:33 PM

it works but only admin can give out points, mod. can't, any solution? please help! thanks very much!

SaintDog 11-09-2001 01:42 PM

Did you place it in your /mod or /admin folder? For moderators to be able to use it has to be in the /mod (since both admins and mods can enter there).

ckevin 11-09-2001 01:50 PM

yes, i'm sure it is put into the /mod/ folder, that's why i think it's straight that mod. can't give out points :(

when the mod. go to /mod/points.php when they log off, the vB ask them to login first, then the /mod/points.php shows a blank page, but when they click the give out points link in the left column of the message, they got the "no permission" error :(

SaintDog 11-09-2001 01:59 PM

makenavoption("Points","../mod/points.php?s=<?php echo $session[sessionhash]; ?>&action=masspoints");

Do you have that code in the correct place, when I installed it for the first time, I did not set the correct URL destination and everything went wrong. If your URL is not like th above (this is guessing you haev 2.2.0) then that may be why it is not working. Other from that I can not be too sure what is wonrg unless you have not added something or have changed something that was not supposed to be changed.:(

ckevin 11-09-2001 02:22 PM

yup, i'm using 2.2.0 and i've done that in the mod. and admin panel, but still the same, only admin can add the points, the mod. only got the message "Do this again." after I click submit botton and the points have not been added. :(

SaintDog 11-09-2001 02:30 PM

Palmer, a little help over here please? :D - I am not sure what is the problem :confused:

dirgotronix 11-09-2001 05:39 PM

I had a problem with mine where only myself and supermods could give out points. That's because the default permissions check checks to see if they can see full user info. If your mods can't see full user info, they won't have permission. I changed that around to check for some other permission. :P

ckevin 11-09-2001 11:56 PM

yup, now i know admin and super mod. can give points without problems, but mod. can't, any idea on how to set the permission right, so all the mod. can give points? thanks a lot! :)

Palmer ofShinra 11-10-2001 11:07 AM

For NO PERMISSION problems, try this...

In MODERATOR.PHP

Change

if ($permissions[ismoderator] or $ismod=$DB_site->query_first("SELECT * FROM moderator WHERE userid=$bbuserinfo[userid] AND canviewprofile=1"))

INTO

if ($permissions[ismoderator] or $ismod=$DB_site->query_first("SELECT * FROM moderator WHERE userid=$bbuserinfo[userid]"))

(In short, remove the "AND canviewprofile=1")

And calling the script directly as just mod/points.php

Won't work. It needs the ?action=points as well as the other info in the URL to function.

ckevin 11-10-2001 01:51 PM

Palmer, thanks very much, it works perfectly now :)

Lesane 11-19-2001 12:50 PM

Thanks for this great Hack Palmer, one question: What to do if i only want that admins can give points?

Lesane 11-19-2001 01:10 PM

Is it also possible to give everyone, as default, 0?

black 11-19-2001 04:34 PM

if u only want admins to do it just simply dont do the part palmer added

NICE HACK!!!!! ;) I NEEDED THIS

Reeve of shinra 11-20-2001 12:28 AM

First, back up your forum!

To set the defaul value as zero this is what you need to do:

1. Find out the # of the custom field you created to use for the 'points' (you should already know this if its installed).

2. Go into PhPmyAdmin (which your webhost likely provides).

3. On the left frame should be a list of databases, look for vbulletin, or VB, or forum or whatever you set yours up as during the install.

4. Click the plus button to expand the directory for your VB and look for a link that says 'userfield' and click on it.

5. The right frame should now have a list of all your custom profile fields. Look for the one you created. If this was your first it should be field5.

6. Click 'change'

7. Where is says 'TYPE' click the drop down box under it and change it to 'INT'

8. Change 'Null' to 'Not Null'

9. For 'Default' Put in 0.

Click Save and your set.

Palmer ofShinra 11-20-2001 08:17 PM

Quote:

Originally posted by Lesane
Thanks for this great Hack Palmer, one question: What to do if i only want that admins can give points?
In points.php

Replace
PHP Code:

$perms=getpermissions();
if (!
$perms[ismoderator] and !$ismod=$DB_site->query_first("SELECT * FROM moderator WHERE userid=$bbuserinfo[userid]")) {
    echo 
"<p>You do not have permission to do this!</p>";
    exit;
  } 

With
PHP Code:

if (!$bbuserinfo[usergroupid]==6) {
    echo 
"<p>You do not have permission to do this!</p>";
    exit;
  } 


In moderator.php

Replace
PHP Code:

if ($action=="points") {

  
$userid verifyid("user",$userid);

  
$permissions=getpermissions();
  if (
$permissions[ismoderator] or $ismod=$DB_site->query_first("SELECT * FROM moderator WHERE userid=$bbuserinfo[userid] AND canviewprofile=1")) 

With

PHP Code:

if ($action=="points") {

  
$userid verifyid("user",$userid);

if (!
$bbuserinfo[usergroupid]==6


Lesane 11-21-2001 03:56 PM

Quote:

Originally posted by Reeve of shinra
First, back up your forum!

To set the defaul value as zero this is what you need to do:

1. Find out the # of the custom field you created to use for the 'points' (you should already know this if its installed).

2. Go into PhPmyAdmin (which your webhost likely provides).

3. On the left frame should be a list of databases, look for vbulletin, or VB, or forum or whatever you set yours up as during the install.

4. Click the plus button to expand the directory for your VB and look for a link that says 'userfield' and click on it.

5. The right frame should now have a list of all your custom profile fields. Look for the one you created. If this was your first it should be field5.

6. Click 'change'

7. Where is says 'TYPE' click the drop down box under it and change it to 'INT'

8. Change 'Null' to 'Not Null'

9. For 'Default' Put in 0.


Click Save and your set.

That worked great, thanks "Palmer of Shinra".

Lesane 11-21-2001 03:58 PM

Quote:

Originally posted by Palmer ofShinra


In points.php

Replace
PHP Code:

$perms=getpermissions();
if (!
$perms[ismoderator] and !$ismod=$DB_site->query_first("SELECT * FROM moderator WHERE userid=$bbuserinfo[userid]")) {
    echo 
"<p>You do not have permission to do this!</p>";
    exit;
  } 

With
PHP Code:

if (!$bbuserinfo[usergroupid]==6) {
    echo 
"<p>You do not have permission to do this!</p>";
    exit;
  } 


In moderator.php

Replace
PHP Code:

if ($action=="points") {

  
$userid verifyid("user",$userid);

  
$permissions=getpermissions();
  if (
$permissions[ismoderator] or $ismod=$DB_site->query_first("SELECT * FROM moderator WHERE userid=$bbuserinfo[userid] AND canviewprofile=1")) 

With

PHP Code:

if ($action=="points") {

  
$userid verifyid("user",$userid);

if (!
$bbuserinfo[usergroupid]==6


Thanks again.

dotagious 11-23-2001 01:54 PM

[QUOTE]Originally posted by Lesane
Is it also possible to give everyone, as default, 0?

Crinos 11-28-2001 07:42 AM

Great hack :)

Is it possible to "excempt" admins and mods from this user point system? Is it also possible to excempt a particular user group from having user points? Thanks :)

Palmer ofShinra 11-28-2001 09:21 AM

Exempt them how?

Not have the points show up? Not give them points?

Crinos 11-28-2001 09:43 AM

Well, exempt them so that they are not entitled to points, hence no points will show up in their postbit (or at least, something to the effect of "N/A" instead of the user points themselves).

I have mods and staffers in my site, and I don't want them to take part in the user points system (because it's all to easy to have the mods give points to themselves or to their fellow mods - not that they are doing it but the temptation is there ;))

Hence, I want administrators, super mods, moderators to be exempted ... also a particular user group (staffers) if it's possible...

Not having them show up in their postbits or getinfo will also work for me, if the above is not possible ;) Thanks!

squawell 11-28-2001 11:29 AM

help me i get this error

Parse error: parse error in c:\apache\htdocs\forum\moderator.php on line 20

what's wrong??that line is }


All times are GMT. The time now is 10:20 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
  • Page Generation 0.01643 seconds
  • Memory Usage 1,838KB
  • 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
  • (8)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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