Yet Another Award System 1.0.1  by HacNho  
Copyright (C) 2005 by HacNho, All rights reserved.

Hack Version: 1.0.1b.050329
Compatible vB version: 3.0.7. It should be compatible with all vB 3.x version, but not tested.


Version 1.0.1 - New features:
- Display awards in postbit (showthread, showpost, announcement, private)

Version 1.0.1b:
- Display awards in postbit (showthread, showpost, announcement, private) for hybrid and threaded mode


UPGRADE INSTRUCTION FILES
UPGRADE1.txt: From version 1.0.0 to version 1.0.1
UPGRADE2.txt: From version 1.0.1 to version 1.0.1b


UPGRADE INSTRUCTION

<edit file>
showthread.php
</edit file>

<search for>
	// re-initialise the $postarray variable
	$postarray = array();
	while ($post = $DB_site->fetch_array($cacheposts))
	{
</search for>

<replace>
// [START HACK='Yet Another Award System' AUTHOR='HacNho']
		// Obtain list of awards for current user
			$alluserawards =  $DB_site->query("
				SELECT a.*, au.*, post.userid, post.postid 
				FROM " . TABLE_PREFIX . "post, " . TABLE_PREFIX . "award_user au, " . TABLE_PREFIX . "award a 
				WHERE post.postid IN (" . $cache_postids . ") AND au.userid=post.userid AND a.award_id=au.award_id
				GROUP BY au.issue_id
			");
			if ($DB_site->num_rows($alluserawards))
			{
				while ($award = $DB_site->fetch_array($alluserawards))
				{	
					eval('$userawards["award_$award[userid]"] .= "' . fetch_template('awards_bit') . '";');
				}
				$DB_site->free_result($alluserawards);
			}
// [END HACK='Yet Another Award System' AUTHOR='HacNho']

	// re-initialise the $postarray variable
	$postarray = array();
	while ($post = $DB_site->fetch_array($cacheposts))
	{

// [START HACK='Yet Another Award System' AUTHOR='HacNho']
		$post['showuserawards'] = false;
		if(!empty($userawards["award_$post[userid]"]))
		{
			$post['showuserawards'] = true;
			$post['userawards'] = $userawards["award_$post[userid]"];
		}
// [END HACK='Yet Another Award System' AUTHOR='HacNho']
</replace>
