hehe tùi ngồi chance nó wa dùng cho shop bank rùi tùi chưa test thử nữa chỉ chance lại thui bác làm test hộ tui cái coi có work ko
1 / Chạy query sau :
CODE
INSERT INTO `ibf_conf_settings` ( `conf_id` , `conf_title` , `conf_description` , `conf_group` , `conf_type` , `conf_key` , `conf_value` , `conf_default` , `conf_extra` , `conf_evalphp` , `conf_protected` , `conf_position` , `conf_start_group` , `conf_end_group` , `conf_help_key` , `conf_add_cache` )
VALUES
(
'', 'Ccash for Uploads', '', '5', 'input', 'cash_upload', '', '3', '', '', '1', '36', '', '0', '0', '1'
),
(
'', 'Cost of Download', '', '5', 'input', 'cash_download', '', '3', '', '', '1', '37', '', '1', '0', '1')
Mở ACP lên, vào Maintenance, chọn Cache Control
Nhìn xuống cái settings , bên phải , nhấn vào nút Update
2 / Mở sources/admin/ad_member.php
CODE
$ibforums->html .= $ibforums->adskin->add_td_row( array( "<b>Post Count</b>" ,
$ibforums->adskin->form_input("posts", $mem['posts'])
) );
Chèn phía dưới:
CODE
$ibforums->html .= $ibforums->adskin->add_td_row( array( "<b>Credits</b>" ,
$ibforums->adskin->form_input("cash", $mem['cash'])
) );
Tìm tiếp tục :
CODE
'org_perm_id' => $permid,
Chèn phía dưới:
CODE
'cash' => $ibforums->input['cash'],
4/ Mở sources/post.php
Tìm
CODE
else
{
$DB->simple_construct( array( 'update' => 'attachments', 'set' => "attach_pid={$pid}", 'where' => "attach_post_key='{$post_key}'" ) );
$DB->simple_exec();
$DB->simple_construct( array( 'update' => 'topics', 'set' => "topic_hasattach=topic_hasattach+{$cnt['cnt']}", 'where' => "tid={$tid}" ) );
$DB->simple_exec();
}
Chèn phía dưới
CODE
$DB->simple_construct( array( "select" => 'count(*) as nimg', 'from' => 'attachments', 'where' => "attach_post_key='{$post_key}' AND attach_is_image <> 1") );
$DB->simple_exec();
$tm = $DB->fetch_row();
$total_upload = $tm['nimg']*$ibforums->vars['cash_upload'];
$DB->simple_construct( array( 'update' => 'members', 'set' => "cash=cash+{$total_upload}", 'where' => "id='{$ibforums->member['id']}'" ) );
$DB->simple_exec();
5/ Mở sources/misc/attach.php
CODE
if ( file_exists( $file ) and ( $ibforums->cache['attachtypes'][ $attach['attach_ext'] ]['atype_mimetype'] != "" ) )
{
Chèn phía dưới
CODE
if ($ibforums->member['cash'] < $ibforums->vars['cash_download'])
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'cash_error' ) );
}
$DB->simple_construct( array( 'update' => 'members', 'set' => "cash=cash-{$ibforums->vars['cash_download']}", 'where' => "id='{$ibforums->member['id']}'" ) );
$DB->simple_exec();
6/ Mở lang/en/lang_error.php
CODE
$lang = array (
Chèn phía dưới
CODE
'cash_error' => "You haven't enough cash for download",
Vào ACP, mở Skin Manager , chọn lần lượt các skin ( phải làm cho tất cả các skin bạn có ) , chọn Edit Root Skin Template HTML , chọn Topic View
Chọn Show_attachments
Tìm
CODE
{ipb.lang['attach_hits']}: {$data['hits']}
Chèn bên cạnh
CODE
, <font color="red">It needs {ipb.vars['cash_download']} Cash</font>
bước này thì thích thì làm vô ko thì thôi vì cái này trong shop bank cũng có chức năng mass send money này rùi
Mở sources/admin/ad_index.php
Tìm
CODE
//-----------------------------------------
// continue...
//-----------------------------------------
Chèn phía dưới
CODE
if ($ibforums->input['code'] == 'cash')
{
$this->raise_all_cash(intval($ibforums->input['amount']));
}
Tìm tiếp
CODE
function phplookup() {
if (document.forms[1].phpfunc.value == \"\") {
alert(\"You must enter a PHP function!\");
} else {
window.parent.body.location = 'http://www.php.net/' + escape(document.forms[1].phpfunc.value);
}
}
Chèn phía dưới
CODE
function cash_rall() {
if (document.forms[1].cash_all.value == \"\") {
alert(\"You must enter an amount!\");
} else {
window.parent.body.location = '{$ibforums->adskin->base_url}' + '&act=index&code=cash&amount=' + escape(document.forms[1].cash_all.value);
}
}
Tìm tiếp
CODE
$ibforums->html .= $ibforums->adskin->add_td_row( array( "Add New Forum:",
"<input type='text' style='width:100%' name='forum_name' class='textinput' value='Forum title here' onfocus='this.value=\"\"'>",
"<input type='button' value='Add Forum' id='button' onClick='new_forum()'>"
) );
Chèn phía dưới
CODE
$ibforums->html .= $ibforums->adskin->add_td_row( array( "Raise up all members cash:",
"<input type='text' style='width:100%' name='cash_all' class='textinput' value='Amount here' onfocus='this.value=\"\"'>",
"<input type='button' value='Raise up' id='button' onClick='cash_rall()'>"
) );
Tìm tiếp
CODE
}
?>
Chèn phía trên
CODE
function raise_all_cash($amount=0)
{
global $DB,$ibforums;
$DB->simple_construct( array( 'update' => 'members', 'set' => "cash=cash+{$amount}", 'where' => "id>'0'" ) );
$DB->simple_exec();
$ibforums->admin->save_log("Raise up {$amount} cash to all members");
$ibforums->admin->done_screen("Raise up {$amount} cash to all members", "Raise up cash", "act=index", "redirect" );
}
check hộ mình nha coi có bị gì ko