vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Major Additions - vBCredits - Ultimate Points System (https://vborg.vbsupport.ru/showthread.php?t=151924)

DeMiNe0 07-15-2007 05:23 PM

Well i'm more or less trying to figure out a way to give points to a user without actually having to reward a post. I have users who don't post on the site, but do alot of other really helpful things for us, that i would like to give points to. Then they can buy items that represent actual items in a game through the shop.

DeMiNe0 07-15-2007 05:33 PM

BTW, You could try using this code in place of your current PM code. I replaced it in my credits.php and it seems to notify me now.

PHP Code:

            $dsender $db->query_first("SELECT userid, username FROM " TABLE_PREFIX "user WHERE userid = " $vbulletin->options['credits_pmid']);
            
$pmdm =& datamanager_init('PM'$vbulletinERRTYPE_ARRAY);         
            
$pmdm->set('fromuserid'$dsender['userid']);
            
$pmdm->set('fromusername'$dsender['username']);
            
$pmdm->set_info('receipt'false);
            
$pmdm->set_info('savecopy'false);
            
$pmdm->overridequota true;                   // Force pm send even if recipient's mailbox is full
            
$pmdm->set('title'$vbphrase['credits_pm_post_subject']);
            
$pmdm->set('message'construct_phrase($vbphrase['credits_pm_post_body'], $userinfo['username'], vb_number_format(( $vbulletin->GPC['dir'] == 'pos' : -) * $vbulletin->GPC['amount'], $vbulletin->options['credits_decimals']), $vbphrase['credits'], ( $vbulletin->GPC['anonymous'] ? $vbphrase['anonymous'] : $vbulletin->userinfo['username'] ), fetch_censored_text($vbulletin->GPC['reason']), $vbphrase['credits_log']));
            
$pmdm->set('dateline'TIMENOW);
            
$pmdm->set('allowsmilie'true);            
            
$pmdm->set_recipients($userinfo['username'], $permissions);
            
$pmdm->save(); 


Darkwaltz4 07-15-2007 06:01 PM

Well what you basically did was stick in quotaoverride, which indicates the reason you didnt get any PMs -- the userid you specified to send the alert PMs must have run out of room. I wanted to kind of obey that but I guess it wouldnt hurt to change it to that.

Also, in the usercp you can edit user credits directly in the user editor.

You might have some trouble with adding it to the profile because the control for it is tied to the posts. Like I said I will look into it for the next release.

DeMiNe0 07-15-2007 06:04 PM

Problem is, i have moderators who can't access that, that i would like to be able to be able to have them give points to users who don't post often.

Darkwaltz4 07-15-2007 06:06 PM

For the time being you could grant your moderators large amounts of credits which they could then go and donate to the other users?

cheat-master30 07-15-2007 06:17 PM

For some reason, the donate part does not work. The gaining of credits via posts, activity, etc works fine though. Any fix to that?

cheat-master30 07-15-2007 06:18 PM

Fixed when I uploaded the new version of the donating page...

Darkwaltz4 07-15-2007 06:20 PM

:D glad to help!

DeMiNe0 07-15-2007 06:20 PM

Then the problem is, they can't take credits away :P Thats a really important part of this addon im trying to develop.

Let me give you a better image of what im doing. I run a 300 person World of Warcraft Guild. Instead of using a convential DKP(A type of points system many games use). I'm trying to make my own Point system.

Users are rewarded for signing up on the website, referring other members, posting ect. But points are also given and taken based on what these players do in game. For example, if they do something helpful, a moderator will give them points. If the member does somthing bad (like harrass a member, or miss an event) they take points away. I'm the only person who has admincp access, and too many point edits need to be made when I am not on.

I'm basicly trying to make credits.php?p=POSTID work like credits.php?u=USERID. I made a new if statement to add the ?u in. Doesn't need any ajax or anything. I've allready started working on it, but i've ran into a few problems, with points not being updated, and ID variables not being passed.

sunrise2006 07-15-2007 07:21 PM

Wow, Thanks for this update, it's very good, peradventure when I browse this mod to offer some possibilities such as "earn per character" and "PM alert when received point from anyone" that I see the new version is released and I very happed.
I will go to translate it to Persian and update on my board.

Milad 07-15-2007 07:22 PM

If I install it, will it calculate the credits based on previous posts threads etc?

Darkwaltz4 07-15-2007 07:23 PM

Yes, use the tool at the bottom of the update counters screen.

cheat-master30 07-15-2007 07:24 PM

Quote:

Originally Posted by Milad (Post 1292077)
If I install it, will it calculate the credits based on previous posts threads etc?

You can update it to do that in the Admin CP I think. Otherwise my credits total on my forum without enhancement would not currently be 186,971 when I just implemented it today.

moonray 07-16-2007 12:01 AM

Hi,
Everything is working great and I love this hack. I have even disabled the built in reputation system in favor of this.

However, after upgrading to v1.2, I get this error when I delete a thread:
Code:

Database error in vBulletin 3.6.7:

Invalid SQL:

                              UPDATE vb_user SET
                                        credits = CASE  WHEN userid IN (0,1) THEN credits + -2.285
, posts = CASE  WHEN userid IN (0,1) AND posts > 1 THEN posts - 1
 ELSE 0 END
                              WHERE userid IN (0,1);

MySQL Error  : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' posts = CASE  WHEN userid IN (0,1) AND posts > 1 THEN posts - 1
 ELSE 0 END
                      ' at line 3
Error Number : 1064

I have only changed the credits awarded for each action (+2 for thread, +0.03 per character of post and - for thread deletion). Even with the default credits value, when a thread is deleted, the author gets to keep the 'credits per character', or am I mistaken?

That may be reason for this, but I appreciate any help with this.

Thank you!

Darkwaltz4 07-16-2007 12:03 AM

no, credits per character is also taken into account, but i will check whats up with that error :)

yingzhou 07-16-2007 12:09 AM

I have this error when I delete a thread:

Database error in vBulletin 3.6.7:

Invalid SQL:

UPDATE user SET
credits = CASE WHEN userid IN (0,1) THEN credits + -6.8
WHEN userid IN (0,3) THEN credits + -16.5
, posts = CASE WHEN userid IN (0,1,3) AND posts > 1 THEN posts - 1
ELSE 0 END
WHERE userid IN (0,1,3);

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' posts = CASE WHEN userid IN (0,1,3) AND posts > 1 THEN posts - 1
ELSE 0 END
' at line 4
Error Number : 1064
Date : Sunday, July 15th 2007 @ 06:07:37 PM
Script : http://pltho.net/forum/inlinemod.php...46,47,43,45,44
Referrer : http://pltho.net/forum/inlinemod.php?forumid=31
IP Address : 61.163.92.190
Username : yingzhou
Classname : vb_database

Darkwaltz4 07-16-2007 12:27 AM

Everyone using 1.2, please make this set of edits:

in functions_databuild.php, find all of the following (appears three times):

//obsolete

This will fix the deletion queries, sorry about that.
Updated the first post and the download.

Also, yes when posts/threads get deleted it detracts the character credit as well as applying the Deletion Post/Thread credit (typically negative). Also, when undeleting the perchar credit is returned and the posting credit is applied again.

aycan555 07-16-2007 02:00 AM

Thank you verry verry much for this mod i was realy need this mod :)
Please could you integrate this with the vissionscripts hidemod? when users recieve thanks gets credits? also can you do it like this:
[credit=20]hiden content here [/credit]
to view the content users need to pay 20 credit? to pay the credit there will be link like thank you buttons says: Sen 20 credit to user...

Can we do like this?

Thank you verrry much... I was really looking this mod for months...

Darkwaltz4 07-16-2007 02:05 AM

glad you like it :)

good news:
version 1.3 is under way, and with it - plugin hooks :)

whats that mean? addons for this and other hacks, such as infusing credits with scripts that dont normally use credits, such as the hidemod above.

if you are just getting here and you have NOT patched your 1.2, please do the edit on this post. Please note that if you just downloaded the hack within 2 hours ago, you dont need to patch anything, its already been fixed.

EDIT:
I have created a new converter for vbbux to vbcredits! It is located in the complementary/converters/ folder. Upload vbbuxplaza_to_vbcredits.php to your admincp and run it. It requires the newest versions of both hacks and allows the option to use both the onhand and bank credits.

I am looking at converters for other points systems as well as integratable hacks (I am looking at the arcade systems right now) which should be out before 1.3

yingzhou 07-16-2007 10:56 AM

Thank you for the fix. My forum is on the way. Thanks.

I think we should have some option in the ACP like: Admin donate to someone, Reset all the credit, the Bank ...

moonray 07-16-2007 12:20 PM

Quote:

Originally Posted by Darkwaltz4 (Post 1292308)
no, credits per character is also taken into account, but i will check whats up with that error :)

Thank you Darkwaltz, I appreciate your support on this. I have made the modification suggested and all looks fine now :)

jasculs 07-16-2007 03:21 PM

The points per character has already been an awesome idea. I am running a contest that is based on points and they can only get points by posting a thread or by how many characters they post. It actually helps them to make better quality posts because usually the more someone writes the more thought they put into it.

Thanks

I nominated this for mod of the month

alessai 07-16-2007 11:04 PM

Quote:

[credit=20]hiden content here [/credit]
to view the content users need to pay 20 credit? to pay the credit there will be link like thank you buttons says: Sen 20 credit to user...
great idea

AzzidReign 07-17-2007 12:12 AM

Maybe a way to integrate the points in with this as well:
https://vborg.vbsupport.ru/showthread.php?t=150751

Everytime someone "diggs" your topic, you get so many points.

Same goes for the Thanks hack. Receiving thanks = getting points and maybe even giving x number of thanks you get so many points...yes, it can be abused I guess, but I'm trying to encourage my users to start thanking...so idk.

Mum 07-17-2007 01:08 AM

Quote:

Originally Posted by kylek (Post 1288686)
It would be great if it could be tied into ibproarcade for game play costs, jackpot, etc.

I am looking forward to it for this, and will keep an eye out for when it's done. Looks great!

AzzidReign 07-17-2007 02:01 AM

I hate to say this but, I couldn't get this to show up in the postbit. All other spots show up. Yes, I have the proper hook in the postbit...the posbit is pretty much the default postbit with very little code change to it.

Even the default skin doesn't have the credits showing up in the postbit. Here's a link to a thread on the default skin:
Here

Darkwaltz4 07-17-2007 02:09 AM

My guess is you have some overlapping plugins going on.

If this is the case, I can help configure them so everyone plays nice :-p

DS MrSinister 07-17-2007 02:11 AM

Quote:

Originally Posted by AzzidReign (Post 1293308)
I hate to say this but, I couldn't get this to show up in the postbit. All other spots show up. Yes, I have the proper hook in the postbit...the posbit is pretty much the default postbit with very little code change to it.

Even the default skin doesn't have the credits showing up in the postbit. Here's a link to a thread on the default skin:
Here

Its the thank you hack Template Hook Fix for vb 3.6.7.. if you disable it will show up.. Something i just figure out my self.. Not sure how to fix it so i can have both running..

Darkwaltz4 07-17-2007 02:14 AM

the postbit plugin uses the template hook variable -- the only one which doesnt reset when it moves to the next postbit, so it stacks............


let me try something, be right back with a fix for both of you.

AzzidReign 07-17-2007 02:17 AM

Thanks Darkwalktz4!

Atwal 07-17-2007 02:50 AM

this hack is great u should try to get a feature added to it

the thank you hack would be fantastic with this like u get a certain amount of credits for each thank you button instead of the reputation thing that it currently has

AzzidReign 07-17-2007 02:54 AM

Couldn't get it to work Dark :( You can view that link again to see it doesn't work on default.

Darkwaltz4 07-17-2007 04:55 AM

Okay, I downloaded and installed the Thank You Hack. The problem is the patch, which unfortunately will be there until 3.6.8, so, to fix (this is confirmed to work :))

//obsolete

v1.3 will have this update in it. also, this will work on boards without the thankyou hack, and without the thankyou hack's patch either (so it can only be a positive fix) will also work when vb upgrades, but will probably get all the extra ceaning code out

rainyleaves 07-17-2007 06:15 AM

Awesome mod!!!
Thanks :)

carlt 07-17-2007 09:02 AM

Dark,
Thanks for the mod. I know it will be a big help on my forum.

I had a few minor issues after the install and was hoping for some help:)

Just to give you an idea on a 1-10 scale my coding is at about 2 and one of the points might be because I am grading myself:D

The questions I have:

Where do I go to change the credit settings?
How can I get the credits to show in the postbit(I noticed the post but not sure how/where to insert just want it below the post count)?
Not able to sort by credits in memberlist, how can I fix that?


Again thanks for the mod and any help you can give on it.

DeMiNe0 07-17-2007 12:26 PM

Is 1.3 going to have the ability to reward points via profile? (Or atleast another way to award points other then posts and admincp?) The guys who actually pay for the board are making me install the broken vbplaza because there moderators can't give and take points to users who dont post. Help me!! I don't wanna switch lol! :P

I've been trying to figure out how to copy the entire block of code that controls the giving/taking a points based on the user who owns the postid that is passed in the URL, so that it uses a userid that is passed in the URL instead, but i've failed so far.

All i really need to do is be able to use something like credits.php?u=USERID to reward points.

AzzidReign 07-17-2007 03:36 PM

Quote:

Originally Posted by Darkwaltz4 (Post 1293399)
Okay, I downloaded and installed the Thank You Hack. The problem is the patch, which unfortunately will be there until 3.6.8, so, to fix (this is confirmed to work :))

Edit the "Display Credits in Postbit" plugin
Change Hook Location to: postbit_display_start
Change execution order to: 100

Change code to this:
Code:

if ($this->registry->options['credits_public'])
{
 $credits_this = array($post['postid'], $post['userid'], vb_number_format($post['credits'], $this->registry->options['credits_decimals']));
 //clear out postbit if it contains this again. other hacks can take care of their own stuff themselves.
 $template_hook['postbit_userinfo_right'] = str_replace('<div><a href="credits.php?u=' . $GLOBALS['credits_last'][1] . '">' . $vbphrase['credits'] . '</a>: <span id="cdt_' . $GLOBALS['credits_last'][0] . '_' . $GLOBALS['credits_last'][1] . '">' . $GLOBALS['credits_last'][2] . '</span></div>', '', $template_hook['postbit_userinfo_right']) . '<div><a href="credits.php?u=' . $credits_this[1] . '">' . $vbphrase['credits'] . '</a>: <span id="cdt_' . $credits_this[0] . '_' . $credits_this[1] . '">' . $credits_this[2] . '</span></div>';
 $GLOBALS['credits_last'] = $credits_this;
}

v1.3 will have this update in it. also, this will work on boards without the thankyou hack, and without the thankyou hack's patch either (so it can only be a positive fix) will also work when vb upgrades, but will probably get all the extra ceaning code out

Works great! Thanks!

Darkwaltz4 07-17-2007 04:08 PM

Quote:

Originally Posted by carlt (Post 1293501)
Dark,
Thanks for the mod. I know it will be a big help on my forum.

I had a few minor issues after the install and was hoping for some help:)

Just to give you an idea on a 1-10 scale my coding is at about 2 and one of the points might be because I am grading myself:D

The questions I have:

Where do I go to change the credit settings?
How can I get the credits to show in the postbit(I noticed the post but not sure how/where to insert just want it below the post count)?
Not able to sort by credits in memberlist, how can I fix that?


Again thanks for the mod and any help you can give on it.

In the usergroup editor.
If they are not showing up in the postbit, first follow the footnote directions in the Instructions.txt file, and then the patch I just posted.
Do they appear in the memberlist, but not sort by them? Did you edit the memberlist file per the instructions?

Quote:

Originally Posted by DeMiNe0 (Post 1293595)
Is 1.3 going to have the ability to reward points via profile? (Or atleast another way to award points other then posts and admincp?) The guys who actually pay for the board are making me install the broken vbplaza because there moderators can't give and take points to users who dont post. Help me!! I don't wanna switch lol! :P

I've been trying to figure out how to copy the entire block of code that controls the giving/taking a points based on the user who owns the postid that is passed in the URL, so that it uses a userid that is passed in the URL instead, but i've failed so far.

All i really need to do is be able to use something like credits.php?u=USERID to reward points.

I will see what I can get you patchwise, check back soon. You really dont want vbplaza (at least in the current state it is in). I have it installed for testing purposes, and it doesnt use the vb cleaning methods, which is why it was removed for XSS vulnerability

Quote:

Originally Posted by AzzidReign (Post 1293728)
Works great! Thanks!

:D what about you, DS MrSinister?


Also, now that I have the Thank You Hack installed, I went ahead and made a Thank You Hack addon. Will post it in a bit along with other things.

Darkwaltz4 07-17-2007 06:24 PM

Here I have a converter for Nexia Points, and an addon for the Post Thank You Hack!

To use, upload the nexia_to_vbcredits.php to the admincp folder and run it

and import the product product-credits_post_thanks.php, and youre done!

this post will be deleted in v1.3, and these files will be located in their respective folders in the main file. (just wanted to get these out before 1.3)

look for more addons soon. still working on the arcades. btw, i have like 3 different points systems and two arcades running :-p kinda funny.

//note, files removed and placed into main download
5, 8

cheat-master30 07-17-2007 06:30 PM

When you mean the arcades, does that mean basically integration with IB Pro Arcade and credits for high scores/tournament winning/etc? Because if so I certainly want that feature.


All times are GMT. The time now is 07:43 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.01810 seconds
  • Memory Usage 1,867KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (9)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
  • (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