<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="modx.prosilver.en.xsl"?>
<!--NOTICE: Please open this file in your web browser. If presented with a security warning, you may safely tell it to allow the blocked content.-->
<!--For security purposes, please check: http://www.phpbb.com/mods/ for the latest version of this MOD.\nAlthough MODs are checked before being allowed in the MODs Database there is no guarantee that there are no security problems within the MOD.\nNo support will be given for MODs not found within the MODs Database which can be found at http://www.phpbb.com/mods/-->
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
	<header>
		<meta name="generator" content="MODX file generated with PP MODX Creator by tumba25 (online version)"/>
		<license><![CDATA[http://opensource.org/licenses/gpl-license.php GNU General Public License v2]]></license>
		<title lang="en"><![CDATA[bbDKP 1.2.5 to 1.2.6-PL5]]></title>
		<description lang="en"><![CDATA[Update script 1.2.5 to 1.2.6-PL5]]></description>
		<description lang="fr"><![CDATA[mise à jour 1.2.5 vers 1.2.6-PL5]]></description>
		<description lang="de"><![CDATA[Aktualisierung 1.2.5 bis 1.2.6-PL5]]></description>
		<author-notes lang="en"><![CDATA[Requires bbdkp 1.2.5, Please read docs/INSTALL.html before beginning]]></author-notes>
		<author-notes lang="fr"><![CDATA[Requiert bbdkp 1.2.5, Veuillez lire docs/INSTALL.html avant de commencer.]]></author-notes>
		<author-notes lang="de"><![CDATA[benötigt bbdkp 1.2.5, Bitte lesen sie docs/INSTALL.html bevor.]]></author-notes>
		<author-group>
			<author>
				<realname><![CDATA[Andy Vandenberghe]]></realname>
				<username><![CDATA[Sajaki]]></username>
				<homepage><![CDATA[http://www.bbdkp.com]]></homepage>
				<email><![CDATA[sajaki9@gmail.com]]></email>
				<contributions-group>
					<contributions status="current" from="2008-04-04" position="Developer"/>
				</contributions-group>
			</author>
			<author>
				<realname><![CDATA[Steffen]]></realname>
				<username><![CDATA[Blazeflack]]></username>
				<homepage><![CDATA[http://aegis.dk]]></homepage>
				<email><![CDATA[blazeflack@gmail.com]]></email>
				<contributions-group>
					<contributions status="current" from="2010-06-01" position="Supporter"/>
				</contributions-group>
			</author>
			<author>
				<realname><![CDATA[Kevin Rushin]]></realname>
				<username><![CDATA[Malfate / Medraut]]></username>
				<homepage><![CDATA[http://www.bbdkp.com]]></homepage>
				<email><![CDATA[cs.krushin@gmail.com]]></email>
				<contributions-group>
					<contributions status="past" from="2007-12-27" to="2009-01-01" position="Former Leader, bbDKP Supporter"/>
				</contributions-group>
			</author>
			<author>
				<realname><![CDATA[Morten Boegeskov]]></realname>
				<username><![CDATA[Hroar]]></username>
				<homepage><![CDATA[http://www.bbdkp.com]]></homepage>
				<email><![CDATA[morten.boegeskov@gmail.com]]></email>
				<contributions-group>
					<contributions status="past" from="2009-05-01" to="2009-09-04" position="Developer"/>
				</contributions-group>
			</author>
			<author>
				<username><![CDATA[Kapli]]></username>
				<contributions-group>
					<contributions status="past" from="2008-08-01" to="2009-04-01" position="Developer"/>
				</contributions-group>
			</author>
			<author>
				<realname><![CDATA[Teksonic]]></realname>
				<username><![CDATA[Teksonic]]></username>
				<contributions-group>
					<contributions status="past" from="2008-04-06" to="2008-06-01" position="Support Manager/ Previous Developer"/>
				</contributions-group>
			</author>
			<author>
				<realname><![CDATA[Ippeh]]></realname>
				<username><![CDATA[Ippeh]]></username>
				<homepage><![CDATA[http://www.explodinglabrats.com/]]></homepage>
				<email><![CDATA[ippe.he@gmail.com]]></email>
				<contributions-group>
					<contributions status="past" from="2007-12-24" to="2008-10-01" position="bbDKP Project Founder, Previous Developer"/>
				</contributions-group>
			</author>
		</author-group>
		<mod-version>1.2.6-PL5</mod-version>
		<installation>
			<level>easy</level>
			<time>600</time>
			<target-version>3.0.10</target-version>
		</installation>
		<link-group>
			<link type="parent" href="../install.xml" lang="de">Frisch-Installations-Anleitung</link>
			<link type="parent" href="../install.xml" lang="en">Clean-Installation Manual</link>
			<link type="parent" href="../install.xml" lang="fr">Manuel de première installation</link>
		</link-group>
	</header>
	<action-group>
		<delete>
			<!-- delete old files -->
			<file name="styles/prosilver/template/dkp/jquery-1.6.2.min.js"/>			
		</delete>
		<copy>
			<!-- replace/add modified/new files -->
			<file from="root/aboutbbdkp.php" to="aboutbbdkp.php"/>
			<file from="root/portal.php" to="portal.php"/>
			<file from="root/adm/style/dkp/*.*" to="adm/style/dkp/*.*"/>
			<file from="root/includes/acp/*.*" to="includes/acp/*.*"/>
			<file from="root/includes/bbdkp/*.*" to="includes/bbdkp/*.*"/>
			<file from="root/includes/ucp/*.*" to="includes/ucp/*.*"/>			
			<file from="root/install/*.*" to="install/*.*"/>
			<file from="root/language/en/mods/*.*" to="language/en/mods/*.*"/>
			<file from="root/styles/prosilver/template/dkp/*.*" to="styles/prosilver/template/dkp/*.*"/>
			<file from="root/styles/prosilver/theme/bbdkp.css" to="styles/prosilver/theme/bbdkp.css"/>
			<file from="root/umil/*.*" to="umil/*.*"/>
		</copy>
		<open src="includes/functions.php">
			<edit>
				<comment lang="en"><![CDATA[new language link in functions]]></comment>
				<find><![CDATA[		'L_DKPPAGE'		=> $user->lang['DKP'],
]]></find>
				<action type="after-add"><![CDATA[		'L_BBDKP'		=> $user->lang['FOOTERBBDKP'],
]]></action>
			</edit>
			<edit>
				<comment lang="en"><![CDATA[adding cronjobs in footer function]]></comment>
				<comment lang="en"><![CDATA[ajouter cronjobs dans la fonction footer]]></comment>
				<comment lang="en"><![CDATA[zufügen Cronjobs in die footer Funktion]]></comment>
				<find><![CDATA[			$cron_type = 'tidy_sessions';
		}]]></find>
				<action type="after-add"><![CDATA[			// bbDKP cron job
		else if ($time_now - $config['bbdkp_crontime']*3600 > $config['bbdkp_lastcron'])
		{
			$cron_type = 'pointdecay';
		}
]]></action>
			</edit>
			
		</open>

		<open src="cron.php">
			<edit>
				<comment lang="en"><![CDATA[adding cronjobs]]></comment>
				<comment lang="fr"><![CDATA[ajouter cronjobs]]></comment>
				<comment lang="de"><![CDATA[zufügen cronjobs]]></comment>								
				<find><![CDATA[						auto_prune($row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']);
			}
		}

		break;
]]></find>
		<action type="after-add"><![CDATA[	case 'pointdecay':
	
		if ($config['bbdkp_decaycron'] == 1 && (time() - $config['bbdkp_crontime'] * 3600 <= $config['bbdkp_lastcron']))
		{
			break;
		}

		if ( !class_exists('acp_dkp_raid')) 
		{
			require($phpbb_root_path . 'includes/acp/acp_dkp_raid.' . $phpEx); 
		}
		$acp_dkp_raid = new acp_dkp_raid;
		$acp_dkp_raid->sync_decay($config['bbdkp_decay']);
		set_config('bbdkp_lastcron', time(), true);
		break;]]></action>
		</edit>
		</open>	

		<open src="viewtopic.php">
			<edit>
				<find><![CDATA[	'S_VIEWTOPIC'			=> true,]]></find>
				<action type="after-add"><![CDATA[	// BBDKP
	'S_BBDKP_TOPIC'       => true,
	// BBDKP END]]></action>
			</edit>

			<edit>
			<find><![CDATA[			'SELECT'	=> 'u.*, z.friend, z.foe, p.*',]]></find>
				<action type="replace-with"><![CDATA[	'SELECT'	=> 'u.*, z.friend, z.foe, p.*, 
		bm.member_id, bm.member_level, bm.member_name, bm.member_gender_id, bl.name as class_name, bc.colorcode, bc.imagename, bl1.name as race_name,  br.image_female_small, br.image_male_small ',  
]]></action>
			</edit>
			
			<edit>
			<find><![CDATA[						'ON'	=> 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id']]></find>
				<action type="after-add"><![CDATA[		), 
		array(
			'FROM'	=> array(MEMBER_LIST_TABLE => 'bm'),
			'ON'	=> 'p.poster_id = bm.phpbb_user_id AND bm.member_rank_id !=90'
			), 
		array(
			'FROM'  => array(CLASS_TABLE => 'bc'),
			'ON'    => "bc.class_id = bm.member_class_id AND bc.game_id = bm.game_id "
			),
			
		array(
			'FROM'  => array(RACE_TABLE => 'br'),
			'ON'    => "br.race_id = bm.member_race_id AND br.game_id = bm.game_id "
			),

		array(
			'FROM'  => array(BB_LANGUAGE => 'bl'),
			'ON'    => "bl.attribute_id = bc.class_id AND bl.language= '" . $config['bbdkp_lang'] . "' AND bl.attribute = 'class'  and bl.game_id = bc.game_id "
			), 
						
		array(
			'FROM'  => array(BB_LANGUAGE => 'bl1'),
			'ON'    => "bl1.attribute_id = br.race_id AND bl1.language= '" . $config['bbdkp_lang'] . "' AND bl1.attribute = 'race'  and bl1.game_id = br.game_id "
]]></action>
			</edit>



			<edit>
			<find><![CDATA[$now = phpbb_gmgetdate(time() + $user->timezone + $user->dst);]]></find>
				<action type="after-add"><![CDATA[//BBDKP
$bbchar = get_bbchar($result);
$db->sql_rowseek(0, $result);
//BBDKP]]></action>
			</edit>


			<edit>
			<find><![CDATA[				'warnings'			=> 0,]]></find>
				<action type="after-add"><![CDATA[				// BBDKP START
				'bbchar'			=> '',
				// BBDKP END]]></action>
			</edit>
			
			<edit>
			<find><![CDATA[				'posts'			=> $row['user_posts'],]]></find>
				<action type="after-add"><![CDATA[				// BBDKP START
				'bbchar'		=> $bbchar[$poster_id],
				// BBDKP END]]></action>
			</edit>
			
			<edit>
				<find><![CDATA[	$template->assign_block_vars('postrow', $postrow);]]></find>
				<action type="after-add"><![CDATA[
	// BBDKP START
	if (!empty($user_cache[$poster_id]['bbchar']))
	{
		foreach ($user_cache[$poster_id]['bbchar'] as $memberid => $memberdata)
		{
			$template->assign_block_vars('postrow.bbchar', array(
				'BBMEMBERNAME'	=> $memberdata['bbmembername'],
				'BBCOLORCODE'	=> $memberdata['bbcolorcode'],
				'BBRACE'		=> $memberdata['bbrace'],
				'BBRACEIMG'		=> $memberdata['bbraceimg'],
				'BBCLASS'		=> $memberdata['bbclass'],
				'BBCLASSIMG'	=> $memberdata['bbclassimg'],
				'BBLEVEL'		=> $memberdata['bblevel'],
				'U_VIEW_BBMEMBER' => append_sid ( "{$phpbb_root_path}dkp.$phpEx", 'page=viewmember' . '&amp;' . URI_NAMEID . '=' .  $memberid ),
		
			));
		}
	}
	// BBDKP END
]]></action>
			</edit>

			<edit>
				<find><![CDATA[page_footer();]]></find>
				<action type="after-add"><![CDATA[/**
 * retrieves bbDKP character info from sql result.
 * 
 * @param object $result
 * @return array $bbchar
 */
function get_bbchar($bbresult)
{
	global $phpbb_root_path, $db;
	$bbchar= array();
	while ($row = $db->sql_fetchrow($bbresult))
	{
		$poster_id = (int) $row['poster_id'];
		
		if ($poster_id != ANONYMOUS)
		{
			$bb_race_image = (string) (($row['member_gender_id']== 0) ? $row['image_male_small'] : $row['image_female_small']);
			$bb_race_image = (strlen($bb_race_image) > 1) ? $phpbb_root_path . "images/race_images/" . $bb_race_image . ".png" : '';
			$bb_class_image = (strlen($row['imagename']) > 1) ? $phpbb_root_path . "images/class_images/" . $row['imagename'] . ".png" : '';
		
			$bbchar[$poster_id][$row['member_id']]['bbmemberid'] = $row['member_id'];
			$bbchar[$poster_id][$row['member_id']]['bbmembername'] = $row['member_name'];
			$bbchar[$poster_id][$row['member_id']]['bbcolorcode'] = $row['colorcode'];
			$bbchar[$poster_id][$row['member_id']]['bbrace'] = $row['race_name'];
			$bbchar[$poster_id][$row['member_id']]['bbraceimg'] = $bb_race_image;
			$bbchar[$poster_id][$row['member_id']]['bbclass'] = $row['class_name'];
			$bbchar[$poster_id][$row['member_id']]['bbclassimg'] = $bb_class_image;
			$bbchar[$poster_id][$row['member_id']]['bblevel'] = $row['member_level'];
		
		}
		
	}
	//do not free result just yet
	return $bbchar;
	
}]]></action>
			</edit>
		</open>


		<open src="styles/prosilver/template/viewtopic_body.html">
			<edit>
				<find><![CDATA[			</dd>
		<!-- ENDIF -->
		<!-- ENDIF -->
]]></find>
				<action type="after-add"><![CDATA[		
		<!-- BBDKP START -->
		<dd>&nbsp;</dd>
		<dd>&nbsp;</dd>
		<dd>
			<!-- BEGIN bbchar -->
			<ul style="list-style: none;">
				<li>
				<!-- IF postrow.bbchar.BBRACEIMG --><img src="{postrow.bbchar.BBRACEIMG}" alt="{postrow.bbchar.RACE}" /> <!-- ENDIF -->
				<!-- IF postrow.bbchar.BBCLASSIMG --><img src="{postrow.bbchar.BBCLASSIMG}" alt="{postrow.bbchar.CLASS}" /> <!-- ENDIF -->
				<a href="{postrow.bbchar.U_VIEW_BBMEMBER}"><span style="white-space: nowrap; color:{postrow.bbchar.BBCOLORCODE}">{postrow.bbchar.BBMEMBERNAME}</span> </a> 
				<strong><!-- IF postrow.bbchar.BBLEVEL -->{postrow.bbchar.BBLEVEL}<!-- ENDIF --></strong>
				</li>
			</ul>
			<!-- END bbchar -->
		</dd>
		<!-- BBDKP END -->
]]></action>
			</edit>
		</open>	
		
		<open src="/styles/prosilver/template/overall_footer.html">
			<edit>
				<comment lang="en"><![CDATA[updating footer]]></comment>
				<comment lang="fr"><![CDATA[mise à jour overall_footer]]></comment>
				<comment lang="de"><![CDATA[änderung in overall_footer]]></comment>			
				<find><![CDATA[function pop_search()]]></find>
				<action type="replace-with"><![CDATA[function pop_aboutbbdkp()]]></action>
			</edit>
			<edit>
				<comment lang="en"><![CDATA[updating footer]]></comment>
				<comment lang="fr"><![CDATA[mise à jour overall_footer]]></comment>
				<comment lang="de"><![CDATA[änderung in overall_footer]]></comment>			
				<find><![CDATA[<a class="bbdkpcredits" onclick="javascript:pop_search();" style="cursor:pointer;" onmouseover="style.textDecoration='underline';" onmouseout="style.textDecoration='none';">powered by bbDKP</a><br />]]></find>
				<action type="replace-with"><![CDATA[<a class="bbdkpcredits" onclick="javascript:pop_aboutbbdkp();" style="cursor:pointer;" onmouseover="style.textDecoration='underline';" onmouseout="style.textDecoration='none';">{L_BBDKP}</a><br />]]></action>
			</edit>
		</open>

		<php-installer><![CDATA[install/index.php]]></php-installer>
		<diy-instructions lang="en"><![CDATA[Please see the full installation and upgrade instructions here : /docs/install.html
What has changed ? see here : /docs/changelog.html

Post-install instructions : 
1) Run bbDKP 1.2.6 database update : install/index.php 
2) delete the install folder. 
		Enjoy ;)]]></diy-instructions>
		<diy-instructions lang="fr"><![CDATA[le guide de mise à jour : /docs/install.html
Liste des changements : /docs/changelog.html

1) lancer la mise à jour : install/index.php 
2) Supprimer le repertoire /install pour réactiver le forum.]]></diy-instructions>
		<diy-instructions lang="de"><![CDATA[Installations und Upgradeanweisungen : /docs/install.html
Liste der änderungen : /docs/changelog.html

1) Datenbank aktualisierung : install/index.php 
2) lösche das Installations-Verzeichnis „install"]]></diy-instructions>
	</action-group>
</mod>
