Combine phpnuke points to cash mod user_points

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Combine phpnuke points to cash mod user_points
craigmack
CZ Active Member
 Codezwiz Site Donator
craigmack has been a member for over 19 year's 19 Year Member
usa.gif michigan.gif
Age: 46
Gender: Male
Fav. Sports Team: Pistons
Status: Offline
Joined: Feb 15, 2005
0.02 posts per day
Posts: 147
Points: 6,072
   
I am currently running phpnuke 7.7 with cash mod 221 what my question is how do i combine the tables points and user points?

I have searched across several forums trying to figure this out the code i got from this forum is

mainfile.php

$db->sql_query("UPDATE ".$user_prefix."_users SET user_points=user_points+$row[points] WHERE username='$username'");


But for whatever reason this does not combine the tables together it only displays the user_points table

Thanks in advance for help.


Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
What do you mean combine together? You mean you want the total points from each field added up? Best bet would be to edit that line in your mainfile and just drop the points field altogether. If you want to add up the totals first let me know and I try to write you a little query to do it.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: Combine phpnuke points to cash mod user_points
craigmack
CZ Active Member
 Codezwiz Site Donator
craigmack has been a member for over 19 year's 19 Year Member
usa.gif michigan.gif
Age: 46
Gender: Male
Fav. Sports Team: Pistons
Status: Offline
Joined: Feb 15, 2005
0.02 posts per day
Posts: 147
Points: 6,072
   
basically php nuke gives points for forum posts, news post .....etc
i added this code to my mainfile.php

$db->sql_query("UPDATE ".$user_prefix."_users SET user_points=user_points+$row[points] WHERE username='$username'");


And phpnuke still adds the the points earned in the points table.
What i am trying to do is have phpnuke insert the points earned from posting in the forums and submitting news into the user_points table.

So to answer your question i guess i would want the totals, for example in the CZ user-info V5 the value for $sitepoints can be points or user_points.

Sorry if i dont make much sense i know what im trying to do just having a problem explaining it.

Thanks an Go Pistons!


Back to top Reply with quote
#4   re: Combine phpnuke points to cash mod user_points
MrFraud
CZ Newbie
MrFraud has been a member for over 19 year's 19 Year Member
philippines.gif
Gender: Male
Status: Offline
Joined: Oct 21, 2005
0.00 posts per day
Posts: 5
Points: 704
   
In combining the features of both all you need to do is to edit some simple figures at the database, this means that you have to have an access at your database you are using, phpyMyadmin would be our case whatsoever in this module.

First, thing you need to install the CashMod module also you have to have a Nuke Points installed, then after installation pre-define your currencies, any currency will do all you need to have is one entry at the moment.

Second, access your database through your cPanel, you have an access if you are the owner of such webhosting account, then look to these database table named "nuke_bbcash", if you have a different prefix then "something_bbcash". Click the browse button to view this table and you will see something like "user_points", "user_cash", "user_what-so-ever-u-named-it" then edit this entry and rename it to "points",

Third, now it would seems that you have two entries in this matter, the pre-defined "points field" for nuke points and the "user_points" from Cash mod, you then have to delete the "points", and renaming the "user_points" or simply you could delete the latter fi you don't know how to edit the field to be have a decimal point, then its all set and you can test it out.

I found this out when editing most script files and noticed that most script files used the default "points" as their points_name so why not do the other way around and edit cashmod instead.

Regardless, I am having bugs in this CashMod whether its caused by these edits or whatsoever. I am running a Nuke 7.8.31 and a phpBB 2.0.17 version
with a ported CashMod 2.2.2 version and seems that when you look into the Memberlist through the forums, the points don't show up and instead leaving a clean columns after "Post".


PS :edited:
It works at exchange points what-so-ever, and that was fun. but if you want to show the decimal value to the "CZ member block"?? if you have your points entry at cash mod with a decimal value most commonly the members block shows this as a whole number, it shows but doesnt change the original value. which in this case there is a code
$userpoints = number_format($userinfo[$sitepoints]);
all you need to do here is remove the number_format and the parenthesis to show your true points value with decimal points


Back to top Reply with quote
#5   re: Combine phpnuke points to cash mod user_points
MrFraud
CZ Newbie
MrFraud has been a member for over 19 year's 19 Year Member
philippines.gif
Gender: Male
Status: Offline
Joined: Oct 21, 2005
0.00 posts per day
Posts: 5
Points: 704
   
Since I don't know much about php and database other than mysql, since im just a newbie in this line of knowledge, I can't be able to do much help from this. Here is a 3-line simple sql queries to do the things mentioned above much easier. You can make a blank sql file and paste this code below then upload it your sql database from your phpMyAdmin, i dont know much about other database if this lines would be valid.
UPDATE `nuke_bbcash` SET `cash_dbfield` = 'points' WHERE `cash_id` =1 LIMIT 1 ;
ALTER TABLE `nuke_users` CHANGE `points` `points` DECIMAL( 11, 2 ) NOT NULL DEFAULT '0.00';
ALTER TABLE `nuke_users` DROP `user_points`;


Nuke Points and CashMod must be already installed before doing this queries. and you have already made your first currency to be altered. Name the first currency "user_points" for the above sql query to work. Also, you can delete or ignore the 2nd line if you need not to have decimal points in your member's points value. From here all points that have been acquired by your phpnuke members would not be reset and instead merge it to a newly installed CashMod.

Or if the other way around, you cannot simply run or upload an automated sql query, since cash id from the nuke_bbcash increments on each entry you had before even if you have deleted those entries in CashMod Admin Settings, the late incremented id's would not be used again. you'll be needing much more technical help on editing the database manually through instructions and directions.


Back to top Reply with quote
#6   re: Combine phpnuke points to cash mod user_points
craigmack
CZ Active Member
 Codezwiz Site Donator
craigmack has been a member for over 19 year's 19 Year Member
usa.gif michigan.gif
Age: 46
Gender: Male
Fav. Sports Team: Pistons
Status: Offline
Joined: Feb 15, 2005
0.02 posts per day
Posts: 147
Points: 6,072
   
I was working on this for a new site and what i did was go into phpmyadmin and change the table to points instead of user_points which the cash mod expects you to use and so far its working. Is it that easy or will i come up with some problems?



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum