Topic: Donate.php | Lottery.php | Bank.php ~ all Blank pages ?|

Ok I succesfully installed the cash mod.

And I got it show up in the header. But like whenever I got to 24-7GT.com/forums/bank.php or donate.php or lottery.php it shows a white page.. smile


here's my codes:


Donate.php:


<?PHP

define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/cash.php';

if ($pun_user['g_read_board'] == '0')
    message($lang_common['No view']);

$page_title = pun_htmlspecialchars($pun_config['o_board_title'].' - '.$lang_common['Donate']);
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';

if (isset($_POST['submit'])) {
    $amount = intval($_POST['amount']);
    $query = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE username=\''.pun_htmlspecialchars($_POST['username']).'\' LIMIT 1');
    if (!$db->num_rows($query))
        message($lang_cash['User_not_exist']);

    $user = $db->fetch_assoc($query);
    if ($pun_user['cm_cash'] < $amount || $amount < 0)
        message($lang_cash['Not_enough'].' '.$pun_config['cm_cur_name'].'.');
    $db->query('UPDATE '.$db->prefix.'users SET cm_cash=cm_cash+'.$amount.' WHERE id='.$user['id'].' LIMIT 1');
    $db->query('UPDATE '.$db->prefix.'users SET cm_cash=cm_cash-'.$amount.' WHERE id='.$pun_user['id'].' LIMIT 1');
echo '    <div id="bank" class="blockform">
        <h2 class="block2"><span>'.$lang_common['Donate'].'</span></h2>
        <div class="box">
            <form id="bank" method="post" action="donate.php">
                <div class="inform">
                    <fieldset>
                        <legend>'.$lang_cash['Donations'].'</legend>
                        <div class="infldset">
                            <div>'.$lang_cash['Donation_sent_to'].' '.$user['username'].' '.$lang_cash['with_amount_of'].' '.number_format($amount).' '.$pun_config['cm_cur_name'].'.</div>
                            <div><a href="bank.php">'.$lang_common['Go back'].'</a>.</div>
                        </div>
                    </fieldset>
                </div>
            </form>
        </div>
    </div>';

} else {
    if (isset($_GET['userid'])) {
        $userid = intval($_GET['userid']);
        $query = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE id='.$userid.' LIMIT 1');
        if (!$db->num_rows($query))
            $userid = 0;
        else
            $user = $db->fetch_assoc($query);
    } else
        $userid = 0;
echo '    <div id="bank" class="blockform">
        <h2 class="block2"><span>Donate</span></h2>
        <div class="box">
            <form id="bank" method="post" action="donate.php">
                <div class="inform">
                    <fieldset>
                        <legend>'.$lang_cash['Select_user_amount'].'</legend>
                        <div class="infldset">';

    if ($userid == 0) {
echo '                            <div>'.$lang_common['Username'].': <input type="input" name="username" value="" tabindex="2" /></div>';
    } else {
echo '                            <div>'.$lang_common['Username'].': <input type="input" name="username" value="'.$user['username'].'" tabindex="2" /></div>';
    }
echo '                            <div>'.$lang_cash['Amount'].': <input type="input" name="amount" value="0" tabindex="2" /></div>
                            <div><br /><input type="submit" name="submit" value="'.$lang_common['Donate'].'" tabindex="2" /></div>
                        </div>
                    </fieldset>
                </div>
            </form>
        </div>
    </div>';



}

require PUN_ROOT.'footer.php';

Lottery.php:


<?PHP

define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/cash.php';
if (!function_exists('generate_config_cache')) // If the file include/cache.php wasn't already included, include it now
    require PUN_ROOT.'include/cache.php';

if ($pun_user['g_read_board'] == '0')
    message($lang_common['No view']);

$page_title = pun_htmlspecialchars($pun_config['o_board_title'].' - '.$lang_common['Lottery']);
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';

if ($pun_config['cm_lottery'] == 0)
    message($lang_cash['Bank_disabled']);

if (isset($_POST['submit'])) {
    if ($pun_user['cm_cash'] < $pun_config['cm_lottery_cost'])
        message($lang_cash['Not_enough'].' '.$pun_config['cm_cur_name'].' '.$lang_cash['To_buy_ticket'].'.');
    if (rand(1, 100) < $pun_config['cm_lottery_chance']) {
        // They win!
        $db->query('UPDATE '.$db->prefix.'users SET cm_cash=cm_cash+('.$pun_config['cm_lottery_pot'].'-'.$pun_config['cm_lottery_cost'].') WHERE id='.$pun_user['id'].' LIMIT 1');
        $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$pun_config['cm_lottery_cost'].' WHERE conf_name=\'cm_lottery_pot\' LIMIT 1');
        $db->query('UPDATE '.$db->prefix.'config SET conf_value=\''.$pun_user['username'].' '.$lang_cash['Last_winner_received'].' '.$pun_config['cm_lottery_pot'].' '.$pun_config['cm_cur_name'].'.\' WHERE conf_name=\'cm_lottery_pot\' LIMIT 1');
echo '
    <div id="bank" class="blockform">
        <h2 class="block2"><span>'.$lang_cash['Welcome_lottery'].'</span></h2>
        <div class="box">
            <form id="bank" method="post" action="lottery.php">
                <div class="inform">
                    <fieldset>
                        <legend>'.$lang_cash['You_won'].'</legend>
                        <div class="infldset">
                            <div>'.$lang_cash['You_won_you_received'].' '.number_format($pun_config['cm_lottery_pot']).' '.$pun_config['cm_cur_name'].'.</div>
                            <div><br /><input type="submit" name="submit" value="'.$lang_cash['Try_again'].'" tabindex="2" /></div>
                            <div><br /><a href="lottery.php">'.$lang_common['Go back'].'</a>.</div>
                        </div>
                    </fieldset>
                </div>
            </form>
        </div>
    </div>
';
        generate_config_cache();

    } else {
        // This things a scam...
        $db->query('UPDATE '.$db->prefix.'users SET cm_cash=cm_cash-'.$pun_config['cm_lottery_cost'].' WHERE id='.$pun_user['id'].' LIMIT 1');
        $db->query('UPDATE '.$db->prefix.'config SET conf_value=conf_value+'.$pun_config['cm_lottery_cost'].' WHERE conf_name=\'cm_lottery_pot\' LIMIT 1');
echo '
    <div id="bank" class="blockform">
        <h2 class="block2"><span>'.$lang_cash['Welcome_lottery'].'</span></h2>
        <div class="box">
            <form id="bank" method="post" action="lottery.php">
                <div class="inform">
                    <fieldset>
                        <legend>'.$lang_cash['You_lost'].'</legend>
                        <div class="infldset">
                            <div>'.$lang_cash['You_lost_you_received'].'</div>';
if ($pun_config['cm_last_win'] == 1)
echo '                            <div><br />'.$pun_config['cm_lottery_lastwon'].'</div>';
echo '
                            <div>Current Pot: '.number_format($pun_config['cm_lottery_pot']).'</div>
                            <div><br /><input type="submit" name="submit" value="'.$lang_cash['Try_again'].'" tabindex="2" /></div>
                            <div><br /><a href="lottery.php">'.$lang_common['Go back'].'</a>.</div>
                        </div>
                    </fieldset>
                </div>
            </form>
        </div>
    </div>
';
        generate_config_cache();
    
    }

} else {
echo '
    <div id="bank" class="blockform">
        <h2 class="block2"><span>'.$lang_cash['Welcome_lottery'].'</span></h2>
        <div class="box">
            <form id="bank" method="post" action="lottery.php">
                <div class="inform">
                    <fieldset>
                        <legend>'.$lang_cash['Buy_ticket'].'</legend>
                        <div class="infldset">
                            <div>'.ucwords($pun_config['cm_cur_name']).': '.number_format($pun_user['cm_cash']).'</div>
                            <div>'.ucwords($pun_config['cm_cur_name']).' '.$lang_cash['Needed'].': '.$pun_config['cm_lottery_cost'].'</div>
                            <div><a href="bank.php">'.$lang_common['Bank'].'</a>: '.number_format($pun_user['cm_bank']).'</div>
                            <div>Current pot: '.number_format($pun_config['cm_lottery_pot']).'</div>
                            <div><br /><input type="submit" name="submit" value="'.$lang_cash['Buy'].'" tabindex="2" /></div>
                        </div>
                    </fieldset>
                </div>
            </form>
        </div>
    </div>
';



}

require PUN_ROOT.'footer.php';

Bank.php:


<?PHP

define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/cash.php';

if ($pun_user['g_read_board'] == '0')
    message($lang_common['No view']);

$page_title = pun_htmlspecialchars($pun_config['o_board_title'].' - '.$lang_common['Bank']);
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
$now = time();

if ($pun_config['cm_bank'] == 0)
    message($lang_cash['Bank_disabled']);

if (isset($_POST['withdraw'])) {
    $amount = intval($_POST['amount']);
    if ($amount <= 0)
        message($lang_cash['Invalid_amount']);
    if ($amount > $pun_user['cm_bank'])
        message($lang_cash['Not_enough'].' '.$pun_config['cm_cur_name'].' '.$lang_cash['In_bank'].'.');
    if ($pun_config['cm_intereste'] == 1)
        $db->query('UPDATE '.$db->prefix.'users SET cm_bank=(cm_bank+cm_bank*((('.$now.'-cm_interest)/86400)*'.$pun_config['cm_interest'].'/100))-'.$amount.', cm_cash=cm_cash+'.$amount.', cm_interest='.$now.' WHERE id='.$pun_user['id'].' LIMIT 1');
    else
        $db->query('UPDATE '.$db->prefix.'users SET cm_bank=cm_bank-'.$amount.', cm_cash=cm_cash+'.$amount.' WHERE id='.$pun_user['id'].' LIMIT 1');
echo '    <div id="bank" class="blockform">
        <h2 class="block2"><span>'.$lang_cash['Welcome_bank'].'</span></h2>
        <div class="box">
            <form id="bank" method="post" action="bank.php">
                <div class="inform">
                    <fieldset>
                        <legend>'.$lang_cash['Withdrawing'].'</legend>
                        <div class="infldset">
                            <div>'.$lang_cash['Withdrew_success'].' '.$amount.' '.$pun_config['cm_cur_name'].'.</div>
                            <div><a href="bank.php">'.$lang_common['Go back'].'</a></div>
                        </div>
                    </fieldset>
                </div>
            </form>
        </div>
    </div>';

} elseif (isset($_POST['deposit'])) {
    $amount = intval($_POST['amount']);
    if ($amount <= 0)
        message($lang_cash['Invalid_amount']);
    if ($amount > $pun_user['cm_cash'])
        message($lang_cash['Not_enough'].' '.$pun_config['cm_cur_name'].'.');
    if ($pun_config['cm_intereste'] == 1)
        $db->query('UPDATE '.$db->prefix.'users SET cm_bank=(cm_bank+cm_bank*((('.$now.'-cm_interest)/86400)*'.$pun_config['cm_interest'].'/100))+'.$amount.', cm_cash=cm_cash-'.$amount.', cm_interest='.$now.' WHERE id='.$pun_user['id'].' LIMIT 1');
    else
        $db->query('UPDATE '.$db->prefix.'users SET cm_bank=cm_bank+'.$amount.', cm_cash=cm_cash-'.$amount.' WHERE id='.$pun_user['id'].' LIMIT 1');
echo '    <div id="bank" class="blockform">
        <h2 class="block2"><span>'.$lang_cash['Welcome_bank'].'</span></h2>
        <div class="box">
            <form id="bank" method="post" action="bank.php">
                <div class="inform">
                    <fieldset>
                        <legend>'.$lang_cash['Depositing'].'</legend>
                        <div class="infldset">
                            <div>'.$lang_cash['Deposit_succes'].' '.$amount.' '.$pun_config['cm_cur_name'].'.</div>
                            <div><a href="bank.php">'.$lang_common['Go back'].'</a></div>
                        </div>
                    </fieldset>
                </div>
            </form>
        </div>
    </div>';


} else {
if ($pun_config['cm_intereste'] == 1)
    $amount = $pun_user['cm_bank'] * ((($now - $pun_user['cm_interest']) / 86400) * $pun_config['cm_interest'] / 100);

echo '    <div id="bank" class="blockform">
        <h2 class="block2"><span>'.$lang_cash['Welcome_bank'].'</span></h2>
        <div class="box">
            <form id="bank" method="post" action="bank.php">
                <div class="inform">
                    <fieldset>
                        <legend>'.$lang_cash['Deposit_or_Withdraw'].'</legend>
                        <div class="infldset">
                            <div>'.ucwords($pun_config['cm_cur_name']).': '.number_format($pun_user['cm_cash']).'</div>';
if ($pun_config['cm_intereste'] == 1)
echo '                            <div>'.$lang_common['Bank'].': '.number_format($pun_user['cm_bank'] + $amount).' </div>';
else
echo '                            <div>'.$lang_common['Bank'].': '.number_format($pun_user['cm_bank']).'</div>';

echo '                            <div>'.$lang_cash['Amount'].': <input type="text" name="amount" size="10" tabindex="1" /> <input type="submit" name="deposit" value="'.$lang_cash['Deposit'].'" tabindex="2" /> <input type="submit" name="withdraw" value="'.$lang_cash['Withdraw'].'" tabindex="2" /></div>
                        </div>
                    </fieldset>
                </div>
            </form>
        </div>
    </div>';


}


require PUN_ROOT.'footer.php';

Thanks!

2

Re: Donate.php | Lottery.php | Bank.php ~ all Blank pages ?|

Moved.

3

Re: Donate.php | Lottery.php | Bank.php ~ all Blank pages ?|

Check your server logs.

4 (edited by NiCk Newman 2008-03-23 21:00)

Re: Donate.php | Lottery.php | Bank.php ~ all Blank pages ?|

Lol, were?

Hmm, If i get ftp working will u guys connect and try to help? tongue
EDIT: Rofl better then me sittin here trying to know what to do @@

5 (edited by MattF 2008-03-23 21:56)

Re: Donate.php | Lottery.php | Bank.php ~ all Blank pages ?|

NiCk Newman wrote:

Lol, were?

Where, not were. Whichever file your httpd server logs to.

NiCk Newman wrote:

Hmm, If i get ftp working will u guys connect and try to help?

Myself personally, no.

Re: Donate.php | Lottery.php | Bank.php ~ all Blank pages ?|

why would u need my server logs when i just installed this mod and didn't do any changes? lol

7

Re: Donate.php | Lottery.php | Bank.php ~ all Blank pages ?|

NiCk Newman wrote:

why would u need my server logs when i just installed this mod and didn't do any changes? lol

Each question is going to take a long time to get anywhere if you're going to argue the toss over the responses.

Plus, by virtue of the fact that you installed a mod, you made a lot of changes.

Again, check your logs. I don't want your logs. I merely told you to check them. That's what logs are for.

Re: Donate.php | Lottery.php | Bank.php ~ all Blank pages ?|

Sir.. I know what i did . i just change my viewtopic files in the README..

i didn't edit anything else, so it's not my fault it's mods fault. and that needs to be looked over man

9

Re: Donate.php | Lottery.php | Bank.php ~ all Blank pages ?|

Fine. If you're not willing to do as asked and supply the most basic of relevant information, feel free to trace the problem yourself. You obviously know more than I what the problem is.

Re: Donate.php | Lottery.php | Bank.php ~ all Blank pages ?|

lol nah man u know way more,
i just seem confused on what to do bro

11

Re: Donate.php | Lottery.php | Bank.php ~ all Blank pages ?|

Find the lines that say something along the lines of PHP Error or PHP Notice in your httpd logs and post a sample.

Re: Donate.php | Lottery.php | Bank.php ~ all Blank pages ?|

MattF wrote:

Find the lines that say something along the lines of PHP Error or PHP Notice in your httpd logs and post a sample.

http://24-7gt.com:2082/getaccesslog/acc … 24_2008.gz