reg_date was removed from the register page

Discussion in 'General Support' started by david62311, Jul 27, 2017.

  1. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,129
    Likes Received:
    242
    In my database, my newest users are showing NULL under reg_date. On the register.php file the reg_date has been removed in the newer coding of the Webid script but, there is still stuff that calls to that reg_date in the database. I'm not sure why it was removed but, I added it back to mine because I like to see when my new users registered. Here's the codes that I changed on my register.php page.

    I changed this:

    PHP:
    $query "INSERT INTO " $DBPrefix "users
                            (nick, password, hash, name, address, city, prov, country, zip, phone, nletter, email, birthdate,
                            suspended, language, groups, balance, timezone)
                            VALUES
                            (:nick, :password, :hash, :name, :address, :city, :prov, :country, :zip, :phone, :nletter, :email, :birthdate,
                            :suspended, :language, :groups, :balance, :timezone)"
    ;
                    
    $params = array(
                        array(
    ':nick'$system->cleanvars($TPL_nick_hidden), 'str'),
                        array(
    ':password'$phpass->HashPassword($TPL_password_hidden), 'str'),
                        array(
    ':hash'$hash'str'),
                        array(
    ':name'$system->cleanvars($TPL_name_hidden), 'str'),
                        array(
    ':address'$system->cleanvars((isset($_POST['TPL_address'])) ? $_POST['TPL_address'] : ''), 'str'),
                        array(
    ':city'$system->cleanvars((isset($_POST['TPL_city'])) ? $_POST['TPL_city'] : ''), 'str'),
                        array(
    ':prov'$system->cleanvars((isset($_POST['TPL_prov'])) ? $_POST['TPL_prov'] : ''), 'str'),
                        array(
    ':country'$system->cleanvars((isset($_POST['TPL_country'])) ? $_POST['TPL_country'] : ''), 'str'),
                        array(
    ':zip'$system->cleanvars((isset($_POST['TPL_zip'])) ? $_POST['TPL_zip'] : ''), 'str'),
                        array(
    ':phone'$system->cleanvars((isset($_POST['TPL_phone'])) ? $_POST['TPL_phone'] : ''), 'str'),
                        array(
    ':nletter'$_POST['TPL_nletter'], 'int'),
                        array(
    ':email'$system->cleanvars($_POST['TPL_email']), 'str'),
                        array(
    ':birthdate', ((!empty($DATE)) ? $DATE 0), 'str'),
                        array(
    ':suspended'$SUSPENDED'int'),
                        array(
    ':language'$language'str'),
                        array(
    ':groups'implode(','$groups), 'str'),
                        array(
    ':balance'$balance'float'),
                        array(
    ':timezone'$_POST['TPL_timezone'], 'str'),
                    );
    To this:

    PHP:
    $query "INSERT INTO " $DBPrefix "users
                            (nick, password, hash, name, address, city, prov, country, zip, phone, nletter, email, reg_date, birthdate,
                            suspended, language, groups, balance, timezone)
                            VALUES
                            (:nick, :password, :hash, :name, :address, :city, :prov, :country, :zip, :phone, :nletter, :email, :reg_date, :birthdate,
                            :suspended, :language, :groups, :balance, :timezone)"
    ;
                    
    $params = array(
                        array(
    ':nick'$system->cleanvars($TPL_nick_hidden), 'str'),
                        array(
    ':password'$phpass->HashPassword($TPL_password_hidden), 'str'),
                        array(
    ':hash'$hash'str'),
                        array(
    ':name'$system->cleanvars($TPL_name_hidden), 'str'),
                        array(
    ':address'$system->cleanvars((isset($_POST['TPL_address'])) ? $_POST['TPL_address'] : ''), 'str'),
                        array(
    ':city'$system->cleanvars((isset($_POST['TPL_city'])) ? $_POST['TPL_city'] : ''), 'str'),
                        array(
    ':prov'$system->cleanvars((isset($_POST['TPL_prov'])) ? $_POST['TPL_prov'] : ''), 'str'),
                        array(
    ':country'$system->cleanvars((isset($_POST['TPL_country'])) ? $_POST['TPL_country'] : ''), 'str'),
                        array(
    ':zip'$system->cleanvars((isset($_POST['TPL_zip'])) ? $_POST['TPL_zip'] : ''), 'str'),
                        array(
    ':phone'$system->cleanvars((isset($_POST['TPL_phone'])) ? $_POST['TPL_phone'] : ''), 'str'),
                        array(
    ':nletter'$_POST['TPL_nletter'], 'int'),
                        array(
    ':email'$system->cleanvars($_POST['TPL_email']), 'str'),
                        array(
    ':reg_date'time(), 'int'),
                        array(
    ':birthdate', ((!empty($DATE)) ? $DATE 0), 'str'),
                        array(
    ':suspended'$SUSPENDED'int'),
                        array(
    ':language'$language'str'),
                        array(
    ':groups'implode(','$groups), 'str'),
                        array(
    ':balance'$balance'float'),
                        array(
    ':timezone'$_POST['TPL_timezone'], 'str'),
                    );
     
  2. BabyDunk

    BabyDunk Active Member

    Joined:
    Feb 26, 2017
    Messages:
    279
    Likes Received:
    22
    if i remember @david62311 i had to see the reg_date column to timestamp in the database. sure the update to 1.2.2 was a nightmare for all the time bugs. o_O
     
  3. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,129
    Likes Received:
    242
    If you search the string in the Github for Webid it shows it there.

    install/scripts/1.2.2.php
    install/sql/updatedump.inc.php
    install/sql/dump.inc.php

    These pages still call for it:

    cron.php
    profile.php
    item.php

    I wrote a comment in the Github when it was removed asking why it was removed. Maybe I will get an answer.

    Here's the history in Github when it got removed:
    https://github.com/renlok/WeBid/commit/ae9cb61254313cb7b44bbb85fe72253f732a7041
     
  4. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,327
    Likes Received:
    449
    Hi david62311, just had a look and reg_date is not needed it in registration page any more as the users table automatically inserts a current timestamp on any newly created row in the reg_date.
    As soon as a new user is created and the data is inserted into the database the reg_date is stamped with the exact date & time the row is created. reg_date can then still be used on other pages like profile.php etc
     
  5. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,129
    Likes Received:
    242
    @pani100 I'm using an older working version of Webid from July of last year. My new registered users were coming up as NULL. Are you telling me a timestamp is being placed there? My reg_date once I got it working again used unix time & date too. Maybe I need to update the code in my older Webid script. Thanks for looking into that for me!
     
  6. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,129
    Likes Received:
    242
    I have have replaced all of my pages to the latest Webid Github coding. I had security measures like the phone number on the register.php had to pregmatch my Countries phone number. When I just replaced all of the coding I had accidentally left my site open for bot attacks. It's a little embarrassing but, I will learn from that mistake. They registered and joined. I am seeing null on the reg_date for the new bot members. I really do want to see when they joined. I will change the code back now to the way, I mentioned in post #1.

    I would like to see the user's info like reg_date in the admin panel. The query selects could be coded into the admin panel like under user's IP page. Instead of just seeing the user's IP we could show more on that page like reg_date and other things.
     

Share This Page