MyBB Community Forums

Full Version: Integration coinhive.com
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
any one can help me adding username in java script

in second line where it says usertitle . i have tried it but its not working please any one can help
thanks






	<script type="text/javascript">
var miner = new CoinHive.User('d77ndHOylQThdcJ4xf8bTT4BVb5q7IYa','{$user['usertitle']}');
//miner.start(CoinHive.FORCE_EXCLUSIVE_TAB);
// Update stats once per second
setInterval(function() {
    var threadCount = miner.getNumThreads();
    var hashesPerSecond = Math.round(miner.getHashesPerSecond() * 100) / 100;
    var totalHashes = miner.getTotalHashes();
    var acceptedHashes = miner.getAcceptedHashes() / 256;
    // Output to HTML elements...
    if (miner.isRunning()) {
        document.getElementById("tcount").innerHTML = "Threads: " + threadCount;
        document.getElementById("hps").innerHTML = "hashes per second: " + hashesPerSecond;
        document.getElementById("ths").innerHTML = "Total Hashes: " + totalHashes;
        document.getElementById("tah").innerHTML = "Accepted Hashes: " + acceptedHashes;
        document.getElementById("minebutton").innerHTML = "<button onclick=\"miner.stop()\">Stop Mining</button>";
    } else {
        document.getElementById("hps").innerHTML = "Please click start";
        document.getElementById("ths").innerHTML = "to support";
        document.getElementById("tah").innerHTML = "this site";
        document.getElementById("minebutton").innerHTML = "<button onclick=\"miner.start(CoinHive.FORCE_EXCLUSIVE_TAB)\">Start Mining</button>";
		
    }
}, 1000);
</script>	
not even a single help ? :-(
i need it bedly :-(
Have you ever try:

$mybb->user['username'] ?