Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
BrainCMS VIP Not Working
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Lopez89" data-source="post: 442670" data-attributes="member: 83835"><p>This is the buyvip.php</p><p></p><p>[php]</p><p><?php</p><p> if(!defined('BRAIN_CMS'))</p><p> {</p><p> die('Sorry but you cannot access this file!');</p><p> }</p><p> function buyvip()</p><p> {</p><p> global $dbh,$config,$lang;</p><p> if (isset($_POST['getvip']))</p><p> {</p><p> if (User::userData('vip_points') >= $config['vipCost'])</p><p> {</p><p> if (User::userData('online') == 1)</p><p> {</p><p> return html::error($lang["Vonline"]);</p><p> }</p><p> else</p><p> {</p><p> if (User::userData('rank_vip') == $config['vipRankToGet'])</p><p> {</p><p> return html::error($lang["Valreadyvip"]);</p><p> }</p><p> else</p><p> {</p><p> $removeDiamonds = $dbh->prepare("</p><p> UPDATE users SET</p><p> vip_points=vip_points - :cost</p><p> WHERE</p><p> id=:id</p><p> ");</p><p> $removeDiamonds->bindParam(':id', $_SESSION['id']);</p><p> $removeDiamonds->bindParam(':cost', $config['vipCost']);</p><p> $removeDiamonds->execute();</p><p> $giveVipRank = $dbh->prepare("</p><p> UPDATE users SET</p><p> rank_vip = :viprank</p><p> WHERE</p><p> id=:id</p><p> ");</p><p> $giveVipRank->bindParam(':id', $_SESSION['id']);</p><p> $giveVipRank->bindParam(':viprank', $config['vipRankToGet']);</p><p> $giveVipRank->execute();</p><p> $giveVipBadge = $dbh->prepare("</p><p> INSERT INTO</p><p> user_badges</p><p> (user_id, badge_id, badge_slot)</p><p> VALUES</p><p> (</p><p> :id,</p><p> :badgeid,</p><p> 0</p><p> )");</p><p> $giveVipBadge->bindParam(':id', $_SESSION['id']);</p><p> $giveVipBadge->bindParam(':badgeid', $config['vipBadge']);</p><p> $giveVipBadge->execute();</p><p> return html::errorSucces($lang["VbuySucces"]);</p><p> }</p><p> }</p><p> }</p><p> else</p><p> {</p><p> return html::error($lang["VnoDimonds"]);</p><p> }</p><p> }</p><p> }</p><p>[/php]</p><p></p><p>And this is the page where you buy the VIP</p><p></p><p>[php]</p><p><?php</p><p> include_once 'includes/header.php';</p><p>?></p><p><title><?= $config['hotelName'] ?>: <?= $lang["Ccommunity"] ?></title></p><p><div class="center"></p><p><?php</p><p> include_once 'includes/alerts.php';</p><p> ?></p><p> <div class="columleft"></p><p> <div class="box"></p><p> <div class="title"></p><p> <?= $lang["Vvipheader"] ?></p><p> </div></p><p> <div class="mainBox" style="float;left"></p><p> <div class="boxHeader"></div></p><p> <?php echo'<img src="templates\brain\style\images\vip\vip_image.gif" align="right"> '?></p><p> <?= $lang["Vvipwhatsin"] ?></p><p> <?php echo'<img src="templates\brain\style\images\vip\vipbadge.gif" align="left"> '?></p><p> </div></p><p> </div></p><p> </div></p><p> <div class="columright"></p><p> </p><p> <div class="box"></p><p> <div class="title green"></p><p> <?= $lang["VvipBuyHeader"] ?></p><p> </div></p><p> <?php buyvip(); ?></p><p> <?= $lang["VvipBuyslogan"] ?></p><p> <form method="post"></p><p> <input type="submit" class="submit" value="<?= $lang["VvipBuyButton"] ?>" name="getvip" style="margin-top: 10px;"></p><p> </form></p><p> </div></p><p> </div></p><p> <?php</p><p> include_once 'includes/footer.php';</p><p> ?></p><p></div></p><p></div></p><p></body></p><p></html> </p><p>[/php]</p><p></p><p>What else do you need?</p></blockquote><p></p>
[QUOTE="Lopez89, post: 442670, member: 83835"] 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"]); } } } [/php] 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> [/php] What else do you need? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
BrainCMS VIP Not Working
Top