[ticket/224] Add possibility to append username to donation
B3P-224
This commit is contained in:
@@ -61,4 +61,5 @@ $lang = array_merge($lang, array(
|
|||||||
'ACP_PORTAL_PAYPAL_SETTINGS_EXP' => 'Hier kannst du die Paypal Einstellungen ändern.',
|
'ACP_PORTAL_PAYPAL_SETTINGS_EXP' => 'Hier kannst du die Paypal Einstellungen ändern.',
|
||||||
'PORTAL_PAY_ACC' => 'Paypal Account',
|
'PORTAL_PAY_ACC' => 'Paypal Account',
|
||||||
'PORTAL_PAY_ACC_EXP' => 'Gib deine e-mail-Adresse an, die du bei Paypal benutzt, z.B. xxx@xxx.com',
|
'PORTAL_PAY_ACC_EXP' => 'Gib deine e-mail-Adresse an, die du bei Paypal benutzt, z.B. xxx@xxx.com',
|
||||||
|
'PORTAL_PAY_CUSTOM' => 'Benutzername an die Paypal Zahlung anhängen',
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -61,4 +61,5 @@ $lang = array_merge($lang, array(
|
|||||||
'ACP_PORTAL_PAYPAL_SETTINGS_EXP' => 'This is where you customize the Paypal block.',
|
'ACP_PORTAL_PAYPAL_SETTINGS_EXP' => 'This is where you customize the Paypal block.',
|
||||||
'PORTAL_PAY_ACC' => 'Paypal account to use',
|
'PORTAL_PAY_ACC' => 'Paypal account to use',
|
||||||
'PORTAL_PAY_ACC_EXP' => 'Enter your Paypal e-mail address eg. xxx@xxx.com',
|
'PORTAL_PAY_ACC_EXP' => 'Enter your Paypal e-mail address eg. xxx@xxx.com',
|
||||||
|
'PORTAL_PAY_CUSTOM' => 'Append username to Paypal donation',
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -49,18 +49,24 @@ class portal_donation_module
|
|||||||
|
|
||||||
public function get_template_center($module_id)
|
public function get_template_center($module_id)
|
||||||
{
|
{
|
||||||
global $config, $template;
|
global $config, $template, $user;
|
||||||
|
|
||||||
$template->assign_var('PAY_ACC_CENTER', $config['board3_pay_acc_' . $module_id]);
|
$template->assign_vars(array(
|
||||||
|
'PAY_ACC_CENTER' => $config['board3_pay_acc_' . $module_id],
|
||||||
|
'PAY_CUSTOM_CENTER' => (!empty($config['board3_pay_custom_' . $module_id])) ? $user->data['username_clean'] : false,
|
||||||
|
));
|
||||||
|
|
||||||
return 'donation_center.html';
|
return 'donation_center.html';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_template_side($module_id)
|
public function get_template_side($module_id)
|
||||||
{
|
{
|
||||||
global $config, $template;
|
global $config, $template, $user;
|
||||||
|
|
||||||
$template->assign_var('PAY_ACC_SIDE', $config['board3_pay_acc_' . $module_id]);
|
$template->assign_vars(array(
|
||||||
|
'PAY_ACC_SIDE' => $config['board3_pay_acc_' . $module_id],
|
||||||
|
'PAY_CUSTOM_SIDE' => (!empty($config['board3_pay_custom_' . $module_id])) ? $user->data['username_clean'] : false,
|
||||||
|
));
|
||||||
|
|
||||||
return 'donation_side.html';
|
return 'donation_side.html';
|
||||||
}
|
}
|
||||||
@@ -71,7 +77,8 @@ class portal_donation_module
|
|||||||
'title' => 'ACP_PORTAL_PAYPAL_SETTINGS',
|
'title' => 'ACP_PORTAL_PAYPAL_SETTINGS',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'ACP_PORTAL_PAYPAL_SETTINGS',
|
'legend1' => 'ACP_PORTAL_PAYPAL_SETTINGS',
|
||||||
'board3_pay_acc_' . $module_id => array('lang' => 'PORTAL_PAY_ACC' , 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true),
|
'board3_pay_acc_' . $module_id => array('lang' => 'PORTAL_PAY_ACC', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true),
|
||||||
|
'board3_pay_custom_' . $module_id => array('lang' => 'PORTAL_PAY_CUSTOM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -82,6 +89,7 @@ class portal_donation_module
|
|||||||
public function install($module_id)
|
public function install($module_id)
|
||||||
{
|
{
|
||||||
set_config('board3_pay_acc_' . $module_id, 'your@paypal.com');
|
set_config('board3_pay_acc_' . $module_id, 'your@paypal.com');
|
||||||
|
set_config('board3_pay_custom_' . $module_id, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,6 +99,7 @@ class portal_donation_module
|
|||||||
|
|
||||||
$del_config = array(
|
$del_config = array(
|
||||||
'board3_pay_acc_' . $module_id,
|
'board3_pay_acc_' . $module_id,
|
||||||
|
'board3_pay_custom_' . $module_id,
|
||||||
);
|
);
|
||||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
|
|||||||
@@ -3,45 +3,48 @@
|
|||||||
<li><dl>
|
<li><dl>
|
||||||
<dd style="border-left: 0px">
|
<dd style="border-left: 0px">
|
||||||
<div style="text-align: left; margin: 5px 5px 5px 5px">
|
<div style="text-align: left; margin: 5px 5px 5px 5px">
|
||||||
<strong>{SITENAME}</strong> {L_DONATION_TEXT}
|
<strong>{SITENAME}</strong> {L_DONATION_TEXT}
|
||||||
<br />
|
<br />
|
||||||
<div style="float: left; padding: 5px 5px 5px 5px"><img src="{T_THEME_PATH}/images/portal/paypal.gif" alt="" /></div>
|
<div style="float: left; padding: 5px 5px 5px 5px"><img src="{T_THEME_PATH}/images/portal/paypal.gif" alt="" /></div>
|
||||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="padding-top:15px">
|
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="padding-top:15px">
|
||||||
<div>
|
<div>
|
||||||
<input type="hidden" name="cmd" value="_xclick" />
|
<input type="hidden" name="cmd" value="_xclick" />
|
||||||
<input type="hidden" name="business" value="{PAY_ACC_CENTER}" />
|
<input type="hidden" name="business" value="{PAY_ACC_CENTER}" />
|
||||||
<input type="hidden" name="item_name" value="{L_PAY_ITEM}" />
|
<input type="hidden" name="item_name" value="{L_PAY_ITEM}" />
|
||||||
<input type="hidden" name="no_note" value="1" />
|
<input type="hidden" name="no_note" value="1" />
|
||||||
<input type="hidden" name="no_shipping" value="2" />
|
<input type="hidden" name="no_shipping" value="2" />
|
||||||
<input type="hidden" name="bn" value="PP-DonationsBF" />
|
<input type="hidden" name="bn" value="PP-DonationsBF" />
|
||||||
<input type="hidden" name="tax" value="0" />
|
<input type="hidden" name="tax" value="0" />
|
||||||
<input type="text" tabindex="11" name="amount" size="10" maxlength="6" value="" class="inputbox autowidth" title="{L_PAY_MSG}" />
|
<!-- IF PAY_CUSTOM_CENTER -->
|
||||||
<select name="currency_code" class="autowidth">
|
<input type="hidden" name="custom" value="{PAY_CUSTOM_CENTER}">
|
||||||
<option value="USD">{L_USD}</option>
|
<!-- ENDIF -->
|
||||||
<option value="AUD">{L_AUD}</option>
|
<input type="text" tabindex="11" name="amount" size="10" maxlength="6" value="" class="inputbox autowidth" title="{L_PAY_MSG}" />
|
||||||
<option value="CAD">{L_CAD}</option>
|
<select name="currency_code" class="autowidth">
|
||||||
<option value="CZK">{L_CZK}</option>
|
<option value="USD">{L_USD}</option>
|
||||||
<option value="DKK">{L_DKK}</option>
|
<option value="AUD">{L_AUD}</option>
|
||||||
<option value="EUR" selected="selected">{L_EUR}</option>
|
<option value="CAD">{L_CAD}</option>
|
||||||
<option value="HKD">{L_HKD}</option>
|
<option value="CZK">{L_CZK}</option>
|
||||||
<option value="HUF">{L_HUF}</option>
|
<option value="DKK">{L_DKK}</option>
|
||||||
<option value="NZD">{L_NZD}</option>
|
<option value="EUR" selected="selected">{L_EUR}</option>
|
||||||
<option value="NOK">{L_NOK}</option>
|
<option value="HKD">{L_HKD}</option>
|
||||||
<option value="PLN">{L_PLN}</option>
|
<option value="HUF">{L_HUF}</option>
|
||||||
<option value="GBP">{L_GBP}</option>
|
<option value="NZD">{L_NZD}</option>
|
||||||
<option value="SGD">{L_SGD}</option>
|
<option value="NOK">{L_NOK}</option>
|
||||||
<option value="SEK">{L_SEK}</option>
|
<option value="PLN">{L_PLN}</option>
|
||||||
<option value="CHF">{L_CHF}</option>
|
<option value="GBP">{L_GBP}</option>
|
||||||
<option value="JPY">{L_JPY}</option>
|
<option value="SGD">{L_SGD}</option>
|
||||||
<option value="MXN">{L_MXN}</option>
|
<option value="SEK">{L_SEK}</option>
|
||||||
<option value="ILS">{L_ILS}</option>
|
<option value="CHF">{L_CHF}</option>
|
||||||
</select>
|
<option value="JPY">{L_JPY}</option>
|
||||||
<input type="submit" name="submit" value="{L_DONATION}" class="button1" />
|
<option value="MXN">{L_MXN}</option>
|
||||||
</div>
|
<option value="ILS">{L_ILS}</option>
|
||||||
</form>
|
</select>
|
||||||
<br />
|
<input type="submit" name="submit" value="{L_DONATION}" class="button1" />
|
||||||
<strong>{L_PAY_MSG}</strong>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
|
<br />
|
||||||
|
<strong>{L_PAY_MSG}</strong>
|
||||||
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
</dl></li>
|
</dl></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
<input type="hidden" name="no_shipping" value="2" />
|
<input type="hidden" name="no_shipping" value="2" />
|
||||||
<input type="hidden" name="bn" value="PP-DonationsBF" />
|
<input type="hidden" name="bn" value="PP-DonationsBF" />
|
||||||
<input type="hidden" name="tax" value="0" />
|
<input type="hidden" name="tax" value="0" />
|
||||||
|
<!-- IF PAY_CUSTOM_SIDE -->
|
||||||
|
<input type="hidden" name="custom" value="{PAY_CUSTOM_SIDE}">
|
||||||
|
<!-- ENDIF -->
|
||||||
<input type="text" tabindex="10" name="amount" size="10" maxlength="6" value="" class="inputbox autowidth" title="{L_PAY_MSG}" />
|
<input type="text" tabindex="10" name="amount" size="10" maxlength="6" value="" class="inputbox autowidth" title="{L_PAY_MSG}" />
|
||||||
<select name="currency_code" class="autowidth">
|
<select name="currency_code" class="autowidth">
|
||||||
<option value="USD">USD</option>
|
<option value="USD">USD</option>
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
<input type="hidden" name="no_shipping" value="2" />
|
<input type="hidden" name="no_shipping" value="2" />
|
||||||
<input type="hidden" name="bn" value="PP-DonationsBF" />
|
<input type="hidden" name="bn" value="PP-DonationsBF" />
|
||||||
<input type="hidden" name="tax" value="0" />
|
<input type="hidden" name="tax" value="0" />
|
||||||
|
<!-- IF PAY_CUSTOM_CENTER -->
|
||||||
|
<input type="hidden" name="custom" value="{PAY_CUSTOM_CENTER}">
|
||||||
|
<!-- ENDIF -->
|
||||||
<input type="text" tabindex="11" name="amount" size="10" maxlength="6" value="" class="inputbox autowidth" title="{L_PAY_MSG}" />
|
<input type="text" tabindex="11" name="amount" size="10" maxlength="6" value="" class="inputbox autowidth" title="{L_PAY_MSG}" />
|
||||||
<select name="currency_code" class="autowidth">
|
<select name="currency_code" class="autowidth">
|
||||||
<option value="USD">{L_USD}</option>
|
<option value="USD">{L_USD}</option>
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
<input type="hidden" name="no_shipping" value="2" />
|
<input type="hidden" name="no_shipping" value="2" />
|
||||||
<input type="hidden" name="bn" value="PP-DonationsBF" />
|
<input type="hidden" name="bn" value="PP-DonationsBF" />
|
||||||
<input type="hidden" name="tax" value="0" />
|
<input type="hidden" name="tax" value="0" />
|
||||||
|
<!-- IF PAY_CUSTOM_SIDE -->
|
||||||
|
<input type="hidden" name="custom" value="{PAY_CUSTOM_SIDE}">
|
||||||
|
<!-- ENDIF -->
|
||||||
<input type="text" tabindex="10" name="amount" size="10" maxlength="6" value="" class="inputbox autowidth" title="{L_PAY_MSG}" />
|
<input type="text" tabindex="10" name="amount" size="10" maxlength="6" value="" class="inputbox autowidth" title="{L_PAY_MSG}" />
|
||||||
<select name="currency_code" class="autowidth">
|
<select name="currency_code" class="autowidth">
|
||||||
<option value="USD">USD</option>
|
<option value="USD">USD</option>
|
||||||
|
|||||||
Reference in New Issue
Block a user