User Award System Infusion for PHP-Fusion v7
What it does:

This is a complete Awards infusion to add/delete awards, add/delete awards given to users, and let users show their awards on their profile and forum posts.


Installation:
  1. Upload the contents in the 'files' folder to your base directory so all other folders inside of it match.
  2. Go to Admin Panel - System Admin - Infusions.
  3. In the dropdown menu, choose Award System and Infuse.
  4. You can now either do 2 things. Show the awards on the users profile, or/and for better view add it on the forum as well..
  5. For userfield go to Admin Panel - User Admin - User Fields
  6. Enable User Awards in Statistics sectoion. For the forum section read the Configuration section.
  7. To add the public Awards page of all the current awards for your members to see add the following link to the navigation
  8. http://domain.tld/infusions/award_system/awards.php
  9. See Configuration below on how to edit core files.

Core File Modification:

  1. /forum/viewthread.php (optional configuration below)
CONFIGURATION:
  1. Open forum/viewthread.php in the forum directory of php-fusion.
  2. Search for include LOCALE.LOCALESET."forum/main.php";
    -Should be the first include, after the 3 require_once functions.
  1. Under that line add this function:
  2. function grabaward($awards_id){
    $result = dbquery("SELECT * FROM ".DB_PREFIX."award_system"." WHERE awards_id = '".$awards_id."' LIMIT 1");
    $sdata = dbarray($result);
    echo "<img src=\"".IMAGES."awards/".$sdata['awards_imageurl']."\" alt=\"".$sdata['awards_title']."\" title=\"".$sdata['awards_title']."\">";
    }
  3. Next find:
  4. echo "</span><br /><br />\n";
  5. Replace with
  6. 		echo "</span>\n";
    echo "<span style=\"white-space: normal;\" class='small'>";
    $resulta = dbquery("SELECT * FROM ".DB_PREFIX."award_users"." WHERE user_id = '".$data['user_id']."' ORDER BY award_time");
    while ($dataa = dbarray($resulta)) {
    grabaward($dataa['awards_id']);
    }
    echo "</span><br /><br />\n";
  7. Save and close out, you have now installed the infusion. To uninstall replace the new function with the old function above and then defuse the infusion from the admin panel.

AUTOMATIC AWARDS:
Once installing is done you will notice awards for submitting Weblinks and News content. If you are familuar with enough PHP to add functions in their right section you can add the below function in maincore.php, and then use it in places to have awards automatically given out.


  	  //Add Award Function
      function add_award($user_id, $admin_id, $awards_id, $award_time){
      //$admin_id for this should be 1, unless you create a user called "Automation" or such, and use that ID. So you know any ID that was automatic, exc.
      //Awards Time, like any time should just be time() function.
      $resultawards = dbquery("INSERT INTO ".DB_PREFIX."award_system (`increment_id`, `user_id`, `admin_id`, `awards_id`, `award_time`) VALUES (NULL, '".$user_id."', '".$awards_id."', '".$admin_id."', '".$award_time."')");
      }
original readme design by pmm
Web: www.php-fusion.co.uk or www.ugleh.com Version:2.0