$user_info array and updating an extra collumn on new topic and reply

Started by alchemyx, January 23, 2006, 12:06:43 AM

Previous topic - Next topic

alchemyx

ok, I want to add a money system to my board, and my site, on the site, you get "Ice Chips" for posting resources and adding your game for download, and in turn, you can trade them in for things like, extra space on the projecthoster, or special features for your developer log.

I'm not really sure how to add the ability to get "Ice Chips" from the posts... only when posting new posts, either topics or replies...

I looked through sources/Post.php and sources/Subs-Post.php and finally found one area that I'm looking for.

Quote// Are you the one that happened to create this post?
      if ($ID_MEMBER == $posterOptions['id'])
         $user_info['posts']++;
      updateMemberData($posterOptions['id'], array('posts' => '+'));

and I updated it to do this...
Quote// Are you the one that happened to create this post?
      if ($ID_MEMBER == $posterOptions['id'])
         $user_info['posts']++;
         $user_info['money'] = ($user_info['money'] + (strlen($_REQUEST['msg']) / 200));
      updateMemberData($posterOptions['id'], array('posts' => '+'));

so that you get .02 ice chips for each letter...

But of course, that won't work by itself... I need to add to "updateMemberData($posterOptions['id'], array('posts' => '+'));" and find where SMF puts the SQL query into the $user_info array.

Any help would be appreciated. :)

Advertisement: