vb.org Archive

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

imported_silkroad 06-10-2009 01:23 PM

Hi Dark!

Is it possible to add the winning lottery number to prior drawings? Our users buy tickets and then after no one wins, they have no way to check what the winning number was! The current system does not

Thanks!!

http://www.unix.com/credits.php?do=banking

Darkwaltz4 06-10-2009 01:45 PM

Quote:

Originally Posted by imported_silkroad (Post 1826952)
Hi Dark!

Is it possible to add the winning lottery number to prior drawings? Our users buy tickets and then after no one wins, they have no way to check what the winning number was! The current system does not

Thanks!!

http://www.unix.com/credits.php?do=banking

Well, the winner gets the winning number listed in their transaction log, but otherwise it isnt stored after it has been drawn.

Quote:

Originally Posted by tscargo (Post 1826866)
Is this product still developed/maintained ? I believe it has been RC for quite a long time. When is the final release expected ?

This product is still being maintained, but development on the 1.x branch is stopped, and wont be continued at vbulletin.org. I am still giving support for it here, but on my site is where you will find a lot of addons and where vbcredits 2.0 will be released.

imported_silkroad 06-10-2009 03:46 PM

Quote:

Originally Posted by Darkwaltz4 (Post 1826962)
Well, the winner gets the winning number listed in their transaction log, but otherwise it isnt stored after it has been drawn.

OK, thanks. I'll mod the database and code to store the result of the drawings.

Cheers and thanks again for a great core product.:D

Bro_Joey_Gowdy 06-11-2009 12:21 AM

Is this compatible with the Living Avatar system?

Darkwaltz4 06-11-2009 03:01 PM

Quote:

Originally Posted by Bro_Joey_Gowdy (Post 1827345)
Is this compatible with the Living Avatar system?

yes, i have a couple free options available for this but all at vbcredits.com

if you are using living avatars 1.*, i have integration instructions (2.* has built in integration with vbcredits)

or, you can use vBCommerce and the Living Avatars itemtype to sell living avatars items directly through your shop.

Bro_Joey_Gowdy 06-12-2009 04:22 AM

Thanks, I'll look into that later... downloaded and marked as installed.

GeekStep 06-12-2009 05:13 PM

Hi,
Thanks for the great product!
I have few issues though. I am unable to find the original code in navbar to replace with your code.

I searched the whole code by keywords "pmwarning", "pmpercent" but there is nothing with these keywords in my navbar file. The closest code I found (with if condition and with "PM") is this:

<if condition="$show['pmmainlink']"><tr><td class="vbmenu_option"><a href="private.php$session[sessionurl_q]" rel="nofollow">$vbphrase[private_messages]</a></td></tr></if>

Is this the one to be replaced with your code?
It still looks different as does not have inboxfull or other variables in the one you mentioned.

Darkwaltz4 06-12-2009 07:26 PM

Quote:

Originally Posted by GeekStep (Post 1828410)
Hi,
Thanks for the great product!
I have few issues though. I am unable to find the original code in navbar to replace with your code.


I searched the whole code by keywords "pmwarning", "pmpercent" but there is nothing with these keywords in my navbar file. The closest code I found (with if condition and with "PM") is this:


<if condition="$show['pmmainlink']"><tr><td class="vbmenu_option"><a href="private.php$session[sessionurl_q]" rel="nofollow">$vbphrase[private_messages]</a></td></tr></if>

Is this the one to be replaced with your code?
It still looks different as does not have inboxfull or other variables in the one you mentioned.

that looks pretty good but your style has been heavily changed from the default so you might have to get creative. you can always move around the stuff that you add until it appears in a place that looks right.

kawe 06-15-2009 10:14 AM

why my credits not align left ?
how to fix it
im already revert all template
and setup follow the instruction :(

imported_silkroad 06-15-2009 02:13 PM

FWIW, Added new field winnumber to MySQL table credits_lottery to record winning number after each lottery. Code mod below:

Code:

# diff credits_daily.php credits_daily.php.back2
183c183
<                      $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "credits_lottery SET active = 0, winner = '" . $vbulletin->db->escape_string(serialize($winners)) . "', winnumber = $winnumber WHERE lotteryid = " . $lottery['lotteryid']);
---
>                      $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "credits_lottery SET active = 0, winner = '" . $vbulletin->db->escape_string(serialize($winners)) . "' WHERE lotteryid = " . $lottery['lotteryid']);

If it works (hope so!), will mod template to show winning number in last lottery, which is missing now.

50calray 06-15-2009 05:25 PM

Quote:

Originally Posted by Darkwaltz4 (Post 1816416)
Couple ways to do it:

You can use the mass credit updater again (select all groups DONT select any awards, base 0, let it process)

I just did this and my website freaked out on me?

I get some type of warning and the forum skin turned white minus the banner.

Quote:

Warning: Division by zero in [path]/includes/functions_credits.php on line 28
http://www.semiautorifles.com/forums...911-a-967.html

50calray 06-15-2009 06:02 PM

edited: my IT guy rebooted it.

Darkwaltz4 06-17-2009 01:21 PM

Quote:

Originally Posted by kawe (Post 1829982)
why my credits not align left ?
how to fix it
im already revert all template
and setup follow the instruction :(

look at the other lines in the navbar area - do they have classes on them that need to also be applied to the new line you added for vbcredits? your style's css might not be expecting to style that line, so the default is making it center.

Quote:

Originally Posted by imported_silkroad (Post 1830084)
FWIW, Added new field winnumber to MySQL table credits_lottery to record winning number after each lottery. Code mod below:

Code:

# diff credits_daily.php credits_daily.php.back2
183c183
<                      $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "credits_lottery SET active = 0, winner = '" . $vbulletin->db->escape_string(serialize($winners)) . "', winnumber = $winnumber WHERE lotteryid = " . $lottery['lotteryid']);
---
>                      $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "credits_lottery SET active = 0, winner = '" . $vbulletin->db->escape_string(serialize($winners)) . "' WHERE lotteryid = " . $lottery['lotteryid']);

If it works (hope so!), will mod template to show winning number in last lottery, which is missing now.

that looks like it should work, and easy to pull out when listing finished drawings :)

Quote:

Originally Posted by 50calray (Post 1830217)
Warning: Division by zero in [path]/includes/functions_credits.php on line 28

You put 0 for the number of referrals per referral point. it needs to be 1 or higher - it is NOT the same as the referral award (it has to do with the additive referral bonus). once you fix that the error will go away and your style will fix itself.

imported_silkroad 06-17-2009 03:29 PM

Quote:

Originally Posted by Darkwaltz4 (Post 1831275)
that looks like it should work, and easy to pull out when listing finished drawings :)

Thanks!

I'll check the database when the current drawing happens the end of this week. If it works, I'll finish add to the lottery output.

Cheers.

ArnyVee 06-20-2009 06:19 PM

Quote:

Originally Posted by imported_silkroad (Post 1830084)
FWIW, Added new field winnumber to MySQL table credits_lottery to record winning number after each lottery. Code mod below:

Code:

# diff credits_daily.php credits_daily.php.back2
183c183
<                      $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "credits_lottery SET active = 0, winner = '" . $vbulletin->db->escape_string(serialize($winners)) . "', winnumber = $winnumber WHERE lotteryid = " . $lottery['lotteryid']);
---
>                      $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "credits_lottery SET active = 0, winner = '" . $vbulletin->db->escape_string(serialize($winners)) . "' WHERE lotteryid = " . $lottery['lotteryid']);

If it works (hope so!), will mod template to show winning number in last lottery, which is missing now.

Quote:

Originally Posted by Darkwaltz4 (Post 1831275)
that looks like it should work, and easy to pull out when listing finished drawings :)

Wow, if this works, please share! :D

imported_silkroad 06-21-2009 07:03 PM

Hi Dark!

We need to stop giving credits to users without activity for the past two years. Where would we add some PHP code like this:

Code:

//    60 * 60 * 24 * 365 * 2 = 63072000
$twoyearsago = time() - 63072000;

if ($userinfo[lastactivity] < $twoyearsago )
{
    exit;
}

Or the same code in the template somewhere?

Code:

<if condition="$userinfo[lastactivity] < (TIMENOW - 63072000)">
    User has not logged in for 30 days exit or something
</if>

Where should we do it?

Thanks!!

imported_silkroad 06-21-2009 07:05 PM

Quote:

Originally Posted by ArnyVee (Post 1833493)
Wow, if this works, please share! :D

OK, if we get it working, will let you know. Right now, we have a bug in the lottery code, but it was from another change we made, so we should know if this is working next weekend.

If it works, just follow the instructions in post 890 above.

Cheers.

Darkwaltz4 06-22-2009 08:55 PM

Quote:

Originally Posted by imported_silkroad (Post 1834265)
Hi Dark!

We need to stop giving credits to users without activity for the past two years. Where would we add some PHP code like this:

Code:

//    60 * 60 * 24 * 365 * 2 = 63072000
$twoyearsago = time() - 63072000;
 
if ($userinfo[lastactivity] < $twoyearsago )
{
    exit;
}

Or the same code in the template somewhere?

Code:

<if condition="$userinfo[lastactivity] < (TIMENOW - 63072000)">
    User has not logged in for 30 days exit or something
</if>

Where should we do it?

Thanks!!

the easy way is to move those users into a usergroup that doesnt earn credits for anything

or you can add that check to the includes/functions_credits.php award_credits function, and then the includes/cron/credits_daily.php file to change this query

PHP Code:

$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "user SET credits = credits + CASE$pcsql ELSE 0 END WHERE credits_canearn = 1"); 

to include the date range

imported_silkroad 06-23-2009 08:25 AM

Quote:

Originally Posted by Darkwaltz4 (Post 1835113)
the easy way is to move those users into a usergroup that doesnt earn credits for anything

or you can add that check to the includes/functions_credits.php award_credits function, and then the includes/cron/credits_daily.php file to change this query

PHP Code:

$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "user SET credits = credits + CASE$pcsql ELSE 0 END WHERE credits_canearn = 1"); 

to include the date range

Thanks Dark!

I don't think we will move the users to another usergroup, because if they become active again, which they often do, then we have to move them back. That that would not work for us.

So, I think I'll add the check to credits_daily.php as you suggested. I might add a new vB Option in the AdminCP for this instead of hardcoding our two year rule.

Thanks again.

imported_silkroad 06-23-2009 09:00 AM

Hi Dark,

I looked at that line in credits_daily.php. Perhaps my post was not clear, or I am missing something, or simply am making a mistake.

I want users who have been inactive for two years to receive no credit for anything (especially credit for having their old posts viewed, since we get a lot of traffic).

Does this one line in credits_daily.php "do it all", in other words, it is the one line that adds user credits for post views, posts, etc.?

Code:

$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits = credits + CASE$pcsql ELSE 0 END WHERE credits_canearn = 1")
How about the query_write above that one?

Code:

  $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits = credits + CASE$cdtsql ELSE 0 END, credits_numrefs = credits_numrefs + CASE$refsql ELSE 0 END WHERE credits_canearn = 1 AND usergroupid IN (" . implode(', ', $goodug) . ")")
;

Thanks!

imported_silkroad 06-23-2009 12:55 PM

Hi Dark!

Maybe this is better, just add this to credits_daily.php ?

$twoyearsago = time() - 63072000;
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits = 0 WHERE lastactivity < $twoyearsago");

and also, this:

$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits_canearn = 0 WHERE lastactivity < $twoyearsago");

So, the first query zeros out all the old credits of users inactive for more than two years, the second query turns off all credit earnings for the same group.

However, I need to turn credits_canearn back on when a user become active again, something like:

$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits_canearn = 1 WHERE lastactivity > $twoyearsago");

Thoughts?

imported_silkroad 06-24-2009 11:33 AM

Update; I ended up with a simple vB cron file that does this once a day:

Quote:

$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits = 0 WHERE lastactivity < (UNIX_TIMESTAMP() - (60 * 60 * 24 * 365 * 2))");

$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits_canearn = 0 WHERE lastactivity < (UNIX_TIMESTAMP() - (60 * 60 * 24 * 365 * 2))");

$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits_canearn = 1 WHERE lastactivity > (UNIX_TIMESTAMP() - (60 * 60 * 24 * 365 *2))

Darkwaltz4 06-24-2009 03:11 PM

to simplify, you could add just this one query to the bottom of credits_daily

PHP Code:

$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "user SET credits_canearn = (lastactivity > " . (TIMENOW 63072000) . "), credits = credits * credits_canearn"); 


imported_silkroad 06-24-2009 04:03 PM

Great idea, thanks!

Quote:

$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits_canearn = (lastactivity > " . (TIMENOW - 63072000) . "), credits = credits * credits_canearn")
;

But I don't understand it, ROTFL :D

Darkwaltz4 06-24-2009 04:12 PM

:p well its a combination of a couple sql tricks. the first sets the canearn flag to 1 or 0 (true or false, but it gets typecasted to int because thats the column type) based on the activity date.

the second multiplies your credits against that flag... if you can earn credits, then its 1 * your credits = your credits stay the same. if you cant earn credits, then its 0 = your credits are now 0.

imported_silkroad 06-24-2009 04:34 PM

Oh, so the () around the lastactivity condition makes it boolean?

Wow! I would call you Master, and me Grasshopper, but I don't want to end up in the closet of a hotel room in Bangkok with ropes "everywhere" :D

Darkwaltz4 06-24-2009 04:53 PM

in response to the... first part

the > makes it boolean, but the column (credits_canearn) is int, so boolean true becomes int 1 and boolean false becomes int 0. the parens are just for clarification

imported_silkroad 06-25-2009 05:22 PM

Quote:

Originally Posted by Darkwaltz4 (Post 1836512)
in response to the... first part

the > makes it boolean, but the column (credits_canearn) is int, so boolean true becomes int 1 and boolean false becomes int 0. the parens are just for clarification

Clever. Thanks!

animcentral 06-25-2009 05:46 PM

is this support point per forum?
i need a points system that support Point Per forum to set point per forums

Darkwaltz4 06-26-2009 01:56 AM

yep, it has forum overrides

yeshoward 07-07-2009 12:10 PM

Hi
we have a ads board and we want members need to "spend" X points per classified ads they post there, possible for your module? so posting is actually deducting points instead of earning

imported_silkroad 07-07-2009 12:51 PM

Yes, it certainly possible (anything is possible!)

If you want to see this in action, visit this link and try to post a "New Thread" as a registered user.

imported_silkroad 07-07-2009 12:56 PM

Hi Dark,

Any idea why this vbcredits query appears so many times in the mysql-slow.log (low query log)? This vbcredits query dominates our slow queries log (slow query time is a big 10 sec). Not sure why.

Stats from the last hour or so:

Quote:

Count: 10456 Time=0.00s (40s) Lock=0.00s (1s) Rows=0.0 (31),
SELECT award.*, award.fromuserid AS userid, user.* FROM credits_transactions AS award LEFT JOIN post AS post ON (award.postid = post.postid) LEFT JOIN user AS user ON (award.fromuserid = user.userid) LEFT JOIN thread AS thread ON (post.threadid = thread.threadid) WHERE award.action = 'S' AND award.completed = N AND thread.threadid = N ORDER BY award.postid ASC, award.timestamp DESC
Thanks.

imported_silkroad 07-07-2009 01:10 PM

Hi (again) Dark,

Nevermind, sorry. I see the issue. We have this set:

--log-queries-not-using-indexes

Command Line Format --log-queries-not-using-indexes Config File Format log-queries-not-using-indexes Option Sets Variable Yes, log_queries_not_using_indexes Variable Name log_queries_not_using_indexes Variable Scope Global Dynamic Variable Yes Deprecated 5.1.29, by slow-query-log Value Set Type boolean


If you are using this option with the slow query log enabled, queries that are expected to retrieve all rows are logged. See Section 5.2.4, “The Slow Query Log”. This option does not necessarily mean that no index is used. For example, a query that uses a full index scan uses an index but would be logged because the index would not limit the number of rows.

sebil 07-07-2009 06:53 PM

hello..

i just installed this one ye.. and got this error.. with 3.7

Quote:

1||1246996131||92.25.91.29||do=options&dogroup=cre dits_global_settings||http://www.malludreams.com/forum/adm...v||Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.33 Safari/530.5Access Denied, you have been logged.
and with 3.6:-
iam getting this errror..

Quote:

A conflict was detected in the bitfields. You cannot continue with the installation of this product until this has been fixed. The conflicts found were:
Bitfield Collision: credits_cantearn = prefixrequired
please helpp

lafsunlmtd 07-08-2009 02:43 PM

I've got a very large forum that runs on a cluster of multiple servers.. How does vbCredits run in a multiple server environment with over 425,000 members? Will we run into any problems using this system, or should everything work out alright?

Darkwaltz4 07-08-2009 05:27 PM

Quote:

Originally Posted by yeshoward (Post 1844459)
Hi
we have a ads board and we want members need to "spend" X points per classified ads they post there, possible for your module? so posting is actually deducting points instead of earning

you can set negative awards even per forum with the forum overrides system, but to make it require a positive number of credits to complete the action, youll need this addon:
http://www.vbcredits.com/forum/showthread.php?t=945

Quote:

Originally Posted by imported_silkroad (Post 1844477)
Hi (again) Dark,

Nevermind, sorry. I see the issue. We have this set:

--log-queries-not-using-indexes

Command Line Format --log-queries-not-using-indexes Config File Format log-queries-not-using-indexes Option Sets Variable Yes, log_queries_not_using_indexes Variable Name log_queries_not_using_indexes Variable Scope Global Dynamic Variable Yes Deprecated 5.1.29, by slow-query-log Value Set Type boolean


If you are using this option with the slow query log enabled, queries that are expected to retrieve all rows are logged. See Section 5.2.4, ?The Slow Query Log?. This option does not necessarily mean that no index is used. For example, a query that uses a full index scan uses an index but would be logged because the index would not limit the number of rows.

admittedly, i need to learn optimal table indexing :(

Quote:

Originally Posted by sebil (Post 1844690)
hello..

i just installed this one ye.. and got this error.. with 3.7

and with 3.6:-
iam getting this errror..

please helpp

vbcredits isnt compatible with vbfirewall
to install on vb3.6, install the vb3.6 version of vbcredits instead

Quote:

Originally Posted by lafsunlmtd (Post 1845138)
I've got a very large forum that runs on a cluster of multiple servers.. How does vbCredits run in a multiple server environment with over 425,000 members? Will we run into any problems using this system, or should everything work out alright?

well, ive had several big board users with vbcredits tell me it works alright, in fact you can ask imported_silkroad about his experiences with it and im pretty sure hes got even more members :p

lafsunlmtd 07-08-2009 06:32 PM

hmmm.... it won't install on my master/slave server environ as is. it keeps trying to write to my slaves. I will try some other stuff and let you know if anything works.

Saviour 07-08-2009 07:17 PM

Not sure if this has been covered before...too many posts to search.

Anyway...

When purchasing raffle tickets, I noticed that you will receive an error if you hit the Enter key instead of clicking on Purchase. It causes a database error with the below message:

Code:

Database error in vBulletin 3.8.3:

Invalid SQL:
SELECT * FROM vb_credits_lottery WHERE lotteryid =;

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 '' at line 1
Error Number : 1064
Request Date : Wednesday, July 8th 2009 @ 02:43:33 PM
Error Date : Wednesday, July 8th 2009 @ 02:43:34 PM
Script : http://xxxxxxxx.com/forums/credits.php?do=lottery
Referrer : http://xxxxxxxx.com/forums/credits.php?do=manage
IP Address : [removed]
Username : xxxxxx
Classname : vB_Database
MySQL Version : 5.0.67-log

Is this a bug? Is there a fix?

bluecamosis 07-12-2009 11:36 AM

Hi, I have a question about this hack. I've successfully installed it on my forums and it's working perfectly fine. But I have a query.

Is there a way to calculate the total amount of credits for a particular user group? I have 4 different "teams" in my forum, and I'm thinking of displaying the total amount of credits each group has accumulated, but I'm not sure how to do that. Help will be greatly appreciated thanks! =)


All times are GMT. The time now is 03:42 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.02336 seconds
  • Memory Usage 1,905KB
  • 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
  • (10)bbcode_code_printable
  • (3)bbcode_php_printable
  • (26)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