Current time: 02-10-2012, 06:24 AM Hello There, Guest! (LoginRegister)




MySubscriptions, Donation Bar, MyDownloads, MyAchievements and support for our free and paid plugins. All that for $7!

Advertise Here!
Are you looking to advertise on this forum? Please read this announcement thread.


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
External point scoring...
07-15-2010, 12:55 AM
Post: #1
Lightbulb External point scoring...
Hi, I'm new to MyBB and NewPoints plugins. I wanted to know if it's possible to allow forum users to score points outside of the forum.

I'm currently using the MyBB login system for my entire website (http://www.ww-c.netii.net), and I want to be able to award points to users for completing different actions throughout the site.
Find all posts by this user
Quote this message in a reply

07-15-2010, 01:16 AM
Post: #2
RE: External point scoring...
Did you look at the development.html file? It contains almost all functions provided by NewPoints, you may want to take a look at it since it explains what each function does.

If you have any question about any function, feel free to ask Smile

[Image: s.png]
Find all posts by this user
Quote this message in a reply
07-15-2010, 01:57 AM (This post was last modified: 07-15-2010 02:03 AM by whiz.)
Post: #3
RE: External point scoring...
Okay, a couple of questions.
1) Would I need to make a plugin, or is there a PHP file I can include on pages that would award points?
2) I see that I'll need to use the newpoints_addpoints() function, but what are the forum/group income rate parameters for?
Find all posts by this user
Quote this message in a reply
07-15-2010, 02:10 AM
Post: #4
RE: External point scoring...
Forum rules and Group rules are two features that come with NewPoints.
You can find the Forum rules in the NewPoints ACP page as well as the Group rules.

The parameter forum income rate should be set to 0 since it should be used only when you're doing something inside a certain forum. (e.g. you want people to receive 2x more when they post in a news forum or you want people to receive no points when they post in the chat forum)

The parameter group income rate should be set the to the group income rate - which is set in the NewPoints -> Group Rules Admin CP page.

Example:
PHP Code:
// check group rules - primary group check
$grouprules newpoints_getrules('group'$mybb->user['usergroup']);
if (!
$grouprules)
    
$grouprules['rate'] = 1// no rule set so default income rate is 1

// give points to the user
newpoints_addpoints($mybb->user['uid'], 1000$grouprules['rate']); 

The rate will be multiplied by the amount of points which is 100 in this case.

Anymore questions? By the way, you do not need a plugin to this, but you must make sure the NewPoints plugin is running.

[Image: s.png]
Find all posts by this user
Quote this message in a reply

07-15-2010, 05:29 AM (This post was last modified: 07-15-2010 05:48 AM by whiz.)
Post: #5
RE: External point scoring...
Okay, I've got it to work on a page, with it adding/removing points as required.

What I'd like to know now is if it's possible to add extra information to the NewPoints home page (<forum>/newpoints.php), so that I can detail how I'm going to award points for other things throughout my site.

Is there some kind of template system, like in MyBB, for editing certain aspects?

Edit (1): I've found the templates in the Global section, and after looking in the newpoints_home template, it seems that the one I need to edit is newpoints_home_desc. But that's under $lang - where do I find that?
Edit (2): found it! Should be alright now. Wink
Find all posts by this user
Quote this message in a reply
07-15-2010, 09:54 PM
Post: #6
RE: External point scoring...
I'm glad you got it working Smile

[Image: s.png]
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)