RevCms me.php

R3aper

New Member
Jan 7, 2017
9
2
I use revCMS habbo theme. On me.php it says how much coin you have, but as soon as I buy something or give me some coins in the database is not updated on the website. So I have to log out and log in to it to be updated on the website. How do I fix this?
 

Kak

Posting Freak
Apr 21, 2017
951
165
i think it is possible although im not sure what the query is. I think it would be something like updating users credits stats. If you have a stats page like showing users with the most respects, etc you could take a look at the file and see what the code is that makes the stats page update to give you an idea.
@JayCustom @Damien may know. You may have to give them your class.template file or something to better help you.
 

Moron

wes#5860
Mar 25, 2014
61
36
You need to make sure you don't cache the page, I believe.

If you cache the page, then new data isn't requested each time from the database.

Someone correct me if I'm wrong!
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
In RevCMS your credits are stored in your Session based on your login...

$_SESSION['user']['credits']; -> Thats how you access it. You can change it to do something like this:


Code:
<?php
 $getCredits = mysql_fetch_assoc(mysql_query("SELECT `credits` FROM ``users` WHERE `username` = '".$_SESSION['user']['username']."' LIMIT 1"));

echo $getCredits["credits"];
?>
 
Let me rephrase:

If you feel like doing this the seriously correct way, I would make a class in php that has functions that can retrieve the users information you want updated before they logout and login. This would include getCurrentLook, getCurrentCredits, getCurrentDiamonds, getCurrentPixels, getCurrentRank...

Then I would use AngularJS and Javascript to update all the labels on the page every 30 or so seconds with java script grabbing the results from the function.

That would make your page very dynamic and functional.
 

Users who are viewing this thread

Top