Add a new user point group.



Hire Us!Download Video(1)Comments

This tutorial has been requested by some of the members to the site. It will show you how to add your own group to gain points such as when a user sign up or when a user views a certain link. You will need phpmyadmin for this. If you are having problems installing it, you can hire us to to it.

Files to edit:
admin/modules/groups.php
admin/language/lang-english.php

Steps :
The first thing we need to do is add a new row in the database to store our new points group. In phpmyadmin click on your nuke database then click on nuke_groups_points. If you click browse you will notice that there are 21 entries. This could be less or more depending on the version of nuke that you are using. Look for the id of the last entry, in my case it is 21. Since all those numbers are taken, our new group will have to use the number 22 or higher.
Click Insert and in the first id field type 22 and leave the value at 0 for the points field. Click Go and the new row will be added to the table.

Now that we have our row, we need to make edits to the admin/modules/groups.php file to make sure you can add and delete points for your new group. Find the following codes( This may not be the same code but it should be similar).

Under that paste the following. If you compare both codes you will notice what I did. I just add 1 to all the numbers.

If you visit http://www.yoursite.com/admin.php?op=Groups you should see your new points group at the bottom of the page. You will also notice that something is off. That would be the languages. Open admin/language/lang-english.php and just before the closing php tag "?> " paste the following codes.

You can now visit the Groups admin page and assign points. The last thing is to place update_points(22); where ever you want a user to get points. Notice the 22 in the brackets, that is the same number used for the id.

Here is an example of how you would use that funtion. Let's say that you wanted to give users 5 points when they sign up. You will need to place update_points(22); in the function that adds nuke users to the database. Open modules/Your_Account/index.php and find the following function.

Inside that function find:

Under that paste update_points(22); so it will now look like the following:

That's it! Simple uh? Now your new users will get 5 points or the amount you set in the Groups admin page. Visit our forums for more help.



Hire Us!Download Video(1)Comments