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?
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.
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.