BrainCMS VIP Not Working

Lopez89

New Member
Jan 4, 2019
24
0
Hi guys, I'm using the last version of BrainCms; when I go to the Buy Vip page, and buy it, it says ''You successfully bought VIP'', but then I don't actually have it! It doesn't even take the diamonds

I'm using Arcturus Emu.
 

Lopez89

New Member
Jan 4, 2019
24
0
This is the buyvip.php

PHP:
<?php
    if(!defined('BRAIN_CMS'))
    {
        die('Sorry but you cannot access this file!');
    }
    function buyvip()
    {
        global $dbh,$config,$lang;
        if (isset($_POST['getvip']))
        {
            if (User::userData('vip_points') >= $config['vipCost'])
            {
                if (User::userData('online') == 1)
                {
                    return html::error($lang["Vonline"]);
                }
                else
                {
                    if (User::userData('rank_vip') == $config['vipRankToGet'])
                    {
                        return html::error($lang["Valreadyvip"]);
                    }
                    else
                    {
                        $removeDiamonds = $dbh->prepare("
                        UPDATE users SET
                        vip_points=vip_points - :cost
                        WHERE
                        id=:id
                        ");
                        $removeDiamonds->bindParam(':id', $_SESSION['id']);
                        $removeDiamonds->bindParam(':cost', $config['vipCost']);
                        $removeDiamonds->execute();
                        $giveVipRank = $dbh->prepare("
                        UPDATE users SET
                        rank_vip = :viprank
                        WHERE
                        id=:id
                        ");
                        $giveVipRank->bindParam(':id', $_SESSION['id']);
                        $giveVipRank->bindParam(':viprank', $config['vipRankToGet']);
                        $giveVipRank->execute();
                        $giveVipBadge = $dbh->prepare("
                        INSERT INTO
                        user_badges
                        (user_id, badge_id, badge_slot)
                        VALUES
                        (
                        :id,
                        :badgeid,
                        0
                        )");
                        $giveVipBadge->bindParam(':id', $_SESSION['id']);
                        $giveVipBadge->bindParam(':badgeid', $config['vipBadge']);
                        $giveVipBadge->execute();
                        return html::errorSucces($lang["VbuySucces"]);
                    }
                }
            }
            else
            {
                return html::error($lang["VnoDimonds"]);
            }
        }
    }

And this is the page where you buy the VIP

PHP:
<?php
    include_once 'includes/header.php';
?>
<title><?= $config['hotelName'] ?>: <?= $lang["Ccommunity"] ?></title>
<div class="center">
<?php
        include_once 'includes/alerts.php';
    ?>
    <div class="columleft">
        <div class="box">
            <div class="title">
                <?= $lang["Vvipheader"] ?>
            </div>
            <div class="mainBox" style="float;left">
                <div class="boxHeader"></div>
                <?php echo'<img src="templates\brain\style\images\vip\vip_image.gif" align="right">  '?>
                <?= $lang["Vvipwhatsin"] ?>
                <?php echo'<img src="templates\brain\style\images\vip\vipbadge.gif" align="left">  '?>
            </div>
        </div>
    </div>
    <div class="columright">
       
        <div class="box">
            <div class="title green">
                <?= $lang["VvipBuyHeader"] ?>
            </div>
            <?php buyvip(); ?>
            <?= $lang["VvipBuyslogan"] ?>
            <form method="post">
                <input type="submit" class="submit" value="<?= $lang["VvipBuyButton"] ?>" name="getvip" style="margin-top: 10px;">
            </form>
        </div>
    </div>
    <?php
        include_once 'includes/footer.php';
    ?>
</div>
</div>
</body>
</html>

What else do you need?
 

Lopez89

New Member
Jan 4, 2019
24
0
@Sentinel It has nothing to do with the client:
1) It says ''You successfully bought VIP'' but does not change the rank of the user
2) Does not take diamonds
3) You can buy it as many times as you want

@Hypothesis Here it is-->

This is the User table structure -->
This is the Rank table structure -->
This is the Permissions table structure -->
 
Last edited:

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
You don't have an error returning box. I would bet on the fact that its returning an error, and you aren't see it because you don't have a callback.

Before you ask, I don't use braincms and I have no idea what the function is to get the error to display
 

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
Try to run each query individually. Remove the other 2 queries, and check the diamond one... My guess is one might be throwing an error (could even be the diamond one since the other 2 aren't executing either) so check each one individually to see if any of them execute.
 

Vngi

New Member
Aug 3, 2017
14
3
Okay, here's the problem after editing a bunch of pages, BrainCMS, whilst it does come /w Arcturus Database, although I am using slightly different tables. ( but keep in mind, Arcturus has different than Plus ) which could be why it's like this.

- VIP Page, does not link to the correct database column / tables, this goes for a few pages: Example Home, Badges will not link to the correct badge table.

Again, I have slightly modified version of Arcturus tables based on my catalog, but if you quickly take a screenshot of your DB Tables, Ill be more than happy to tell you if that's your issue :)


Example:
KZy8Q3p.png
 
Last edited:

Users who are viewing this thread

Top