[FAQ] Creating a new element

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [FAQ] Creating a new element

    Hi @Yaro2709, I want to create a new element in newstar, for example, there is dark matter, I have a name called coin or money, it doesn't matter, I want to make a cost like dark matter, how can I do it?

    I will make an element except these
  • step 1: add new column to users table

    ALTER TABLE uni1_users ADD COLUMN `coin` double(50,0) NOT NULL DEFAULT '0';

    run this code on your database under user table,

    step 2 : if you need to update it and save while you are refreshing the page you need to add this column on class.PlanetRessUpdate.php

    If you do so, you can increase and decrease it with $USER['coin'] -= 5000; ( for example )

    step 3: if you skip and dont update PlanetRessUpdate.php then you need to update $USER['coin'] with database query as follows,

    when coin decreased,

    $sql = "UPDATE %%USERS%% SET coin = coin - :newCoin WHERE id = :userId;";

    $db->update($sql,array(
    ':newCoin' => $USER['coin'] - 5000
    ));
    ogniter.net

    for a slightly better version of steemnova

    github.com/koraykarakus/steemnova-1.8-x