Example #1
0
                        $inquery = "UPDATE `#@__member` SET money=money-{$needMoney} WHERE mid='" . $cfg_ml->M_ID . "'";
                        if (!$dsql->ExecuteNoneQuery($inquery)) {
                            showmsg('购买失败, 请返回', -1);
                            exit;
                        }
                        #api{{
                        if (defined('UC_APPID')) {
                            include_once DEDEROOT . '/api/uc.func.php';
                            $row = $dsql->GetOne("SELECT `scores`,`userid` FROM `#@__member` WHERE `mid`='" . $cfg_ml->M_ID . "'");
                            uc_credit_note($row['userid'], -$needMoney, 'money');
                        }
                        #/aip}}
                        showmsg('购买成功,购买扣点不会重扣金币,谢谢!', '/plus/view.php?aid=' . $aid);
                        exit;
                    } else {
                        showmsg('购买失败, 请返回', -1);
                        exit;
                    }
                }
                $msgtitle = "扣金币购买阅读!";
                $moremsg = "阅读该文档内容需要付费!<br>这篇文档需要 <font color='red'>" . $needMoney . " 金币</font> 才能访问,你目前拥有金币 <font color='red'>" . $cfg_ml->M_Money . " </font>个!<br>确认阅读请点 [<a href='/plus/view.php?aid=" . $aid . "&dopost=buy' target='_blank'>确认付点阅读</a>]";
                include_once $cfg_basedir . $cfg_templets_dir . "/plus/view_msg.htm";
                $arc->Close();
                exit;
            }
        }
    }
    //金币处理付处理
}
$arc->Display();