##############################################################
## MOD Title: Annual Stars
## MOD Author: evil3 < evil@phpbbmodders.net > (Igor Wiedler) http://phpbbmodders.net
## MOD Description: Users get a star for each year of their membership.
## MOD Version: 1.0.1a
##
## Installation Level: Easy
## Installation Time: 3 Minutes
## Files To Edit:
##		memberlist.php
##		viewtopic.php
##		includes/acp/acp_styles.php
##		language/en/common.php
##		styles/prosilver/imageset/imageset.cfg
##		styles/prosilver/template/memberlist_view.html
##		styles/prosilver/template/viewtopic_body.html
##
## Included Files:
##		root/styles/prosilver/imageset/icon_annual_star.gif
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## This MOD was originally a phpBB 2.0 MOD by drathbun. It can
## be found here: http://www.phpbb.com/community/viewtopic.php?t=384941
##
## The star image is also taken from that MOD. It was created
## by Dave Rathbun.
##
## I recreated it for phpBB 3.0, as i needed if for my board.
##
## Don't forget to refresh your imagesets after installation.
##
##############################################################
## MOD History:
##
##   2007-11-11 - Version 1.0.0
##      - Initial release
##
##   2008-04-25 - Version 1.0.1
##      - Fixed ammount of years
##
##   2008-05-04 - Version 1.0.1a
##      - Added changes to the xml
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ COPY ]------------------------------------------
#
copy root/styles/prosilver/imageset/icon_annual_star.gif to styles/prosilver/imageset/icon_annual_star.gif
#
#-----[ OPEN ]------------------------------------------
#
memberlist.php
#
#-----[ FIND ]------------------------------------------
#
	// Dump it out to the template
	return array(
#
#-----[ BEFORE, ADD ]------------------------------------------
#
	// annual stars
	$reg_stars = '';
	if ($reg_years = (int) ((time() - (int) $data['user_regdate']) / 31536000))
	{
		$reg_stars = str_repeat($user->img('icon_annual_star', 'YEARS_OF_MEMBERSHIP'), $reg_years);
	}
#
#-----[ FIND ]------------------------------------------
#
		'WARNINGS'		=> isset($data['user_warnings']) ? $data['user_warnings'] : 0,
#
#-----[ AFTER, ADD ]------------------------------------------
#
		// annual stars
		'MEMBERSHIP_STARS'	=> $reg_stars,
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
				'allow_pm'			=> 0,
			);
#
#-----[ AFTER, ADD ]------------------------------------------
#
			// annual stars
			$user_cache[$poster_id]['reg_stars'] = '';
#
#-----[ FIND ]------------------------------------------
#
				'search'		=> ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", 'search_author=' . urlencode($row['username']) .'&amp;showresults=posts') : '',
			);
#
#-----[ AFTER, ADD ]------------------------------------------
#
			// annual stars
			$user_cache[$poster_id]['reg_stars'] = '';
			if ($reg_years = (int) ((time() - (int) $row['user_regdate']) / 31536000))
			{
				$user_cache[$poster_id]['reg_stars'] = str_repeat($user->img('icon_annual_star', 'YEARS_OF_MEMBERSHIP'), $reg_years);
			}
#
#-----[ FIND ]------------------------------------------
#
		'POSTER_AGE'		=> $user_cache[$poster_id]['age'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
		// annual stars
		'MEMBERSHIP_STARS'	=> $user_cache[$poster_id]['reg_stars'],
#
#-----[ OPEN ]------------------------------------------
#
includes/acp/acp_styles.php
#
#-----[ FIND ]------------------------------------------
#
		// Execute overall actions
		switch ($action)
#
#-----[ BEFORE, ADD ]------------------------------------------
#
		// annual stars
		$this->imageset_keys['icons'][] = 'icon_annual_star';
#
#-----[ OPEN ]------------------------------------------
#
language/en/common.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// annual stars
$lang['YEARS_OF_MEMBERSHIP'] = 'Years of membership';
#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/imageset/imageset.cfg
#
#-----[ FIND ]------------------------------------------
#
img_icon_user_warn = icon_user_warn.gif*20*20
#
#-----[ AFTER, ADD ]------------------------------------------
#
img_icon_annual_star = icon_annual_star.gif
#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/template/memberlist_view.html
#
#-----[ FIND ]------------------------------------------
#
			<dt>{L_JOINED}:</dt> <dd>{JOINED}</dd>
#
#-----[ AFTER, ADD ]------------------------------------------
#
			<!-- IF MEMBERSHIP_STARS -->
				<dt>{L_YEARS_OF_MEMBERSHIP}:</dt> <dd>{MEMBERSHIP_STARS}</dd>
			<!-- ENDIF -->
#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/template/viewtopic_body.html
#
#-----[ FIND ]------------------------------------------
#
		<dd>&nbsp;</dd>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
			<!-- IF postrow.MEMBERSHIP_STARS -->
				<dd>&nbsp;</dd>
				<dd>{postrow.MEMBERSHIP_STARS}</dd>
			<!-- ENDIF -->
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM