Donation Bar on Portal

Download and support for PhpBB3 Simple Portal
Locked
User avatar
Stoker
Site Admin
Site Admin
Posts: 3540
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Donation Bar on Portal

Post by Stoker »

Donation Bar on Portal
Written by Stoker

With a few code changes we can put the Donation bar on the Portal page.
There is no ACP Control for this.

Open portal.php
Find:

Code: Select all

//END Welcome Mod
After add:

Code: Select all

if (!empty($config['donation_index_enable']))
{
$user->add_lang('mods/donate');
$template->assign_vars(array(	
	'DONATION_ACHIEVEMENT_ENABLE'		=> (isset($config['donation_achievement_enable'])) ? $config['donation_achievement_enable']:false,
	'DONATION_ACHIEVEMENT'				=> (isset($config['donation_achievement'])) ? $config['donation_achievement']:false,
	'DONATION_INDEX_ENABLE'				=> (isset($config['donation_index_enable'])) ? $config['donation_index_enable']:false,
	'DONATION_INDEX_TOP'				=> (isset($config['donation_index_top'])) ? $config['donation_index_top']:false,
	'DONATION_INDEX_BOTTOM'				=> (isset($config['donation_index_bottom'])) ? $config['donation_index_bottom']:false,
	'DONATION_GOAL_ENABLE'				=> (isset($config['donation_goal_enable'])) ? $config['donation_goal_enable']:false,
	'DONATION_GOAL'						=> (isset($config['donation_goal'])) ? $config['donation_goal']:false,
	'DONATION_GOAL_CURRENCY_ENABLE'		=> (isset($config['donation_goal_currency_enable'])) ? $config['donation_goal_currency_enable']:false,
	'DONATION_GOAL_CURRENCY'			=> (isset($config['donation_goal_currency'])) ? $config['donation_goal_currency']:false,
));
}
if (!empty($config['donation_goal_enable']) &&  $config['donation_goal'] > 0)
{
$donation_goal_number = ($config['donation_achievement'] * 100) / $config['donation_goal'];
$template->assign_vars(array(
   'DONATION_GOAL_NUMBER'            => $donation_goal_number,
));
}
Open styles/prosilver/template/simpleportal_body.html
Find:

Code: Select all

<hr />
Before add:

Code: Select all

<!-- IF S_DONATE_ENABLED and (DONATION_ACHIEVEMENT_ENABLE or DONATION_GOAL_ENABLE) -->
				<h3><a href="{U_DONATE}">{L_DONATIONS_INDEX}</a></h3>
				<!-- IF DONATION_GOAL_ENABLE and DONATION_ACHIEVEMENT_ENABLE and DONATION_GOAL > 0 -->
				<div style="background:url('{ROOT_PATH}images/prog_grey_index.png') repeat-x; background-color: #cccccc; border: 1px solid black; width:100%; margin-top: 2px;"><div style="background:url('{ROOT_PATH}images/prog_<!-- IF DONATION_GOAL_NUMBER < 33 -->red<!-- ELSEIF DONATION_GOAL_NUMBER < 67 -->yellow<!-- ELSE -->green<!-- ENDIF -->_index.png') repeat-x;background-color: #008040; color: white; font-weight:bold; max-width:100%;<!-- IF DONATION_GOAL_NUMBER < 100 --> border-right: 1px solid black;<!-- ENDIF -->  width:{DONATION_GOAL_NUMBER}%; height:16px;"><span style="padding-left:25px; font-size:12px; line-height:16px;">{DONATION_GOAL_NUMBER}%</span></div></div>
				<!-- ENDIF -->
				<p style="text-align:center; font-size:14px;"><!-- IF DONATION_ACHIEVEMENT_ENABLE -->{L_WE_HAVE_ACHIEVED} <strong><!-- IF DONATION_ACHIEVEMENT > 0 -->{DONATION_ACHIEVEMENT}<!-- ELSE -->{DONATION_GOAL_NUMBER}<!-- ENDIF --></strong><!-- IF DONATION_GOAL_CURRENCY_ENABLE --> {DONATION_GOAL_CURRENCY}<!-- ENDIF --> {L_WE_HAVE_ACHIEVED_IN}<!-- ENDIF --><!-- IF DONATION_GOAL_ENABLE and DONATION_GOAL > 0 --> {L_OUR_DONATION_GOAL} <strong>{DONATION_GOAL}</strong><!-- IF DONATION_GOAL_CURRENCY_ENABLE --> {DONATION_GOAL_CURRENCY}<!-- ENDIF -->.<!-- ENDIF --></p>
			<!-- ENDIF -->
Board rules! No PM support
Locked