def post_add(db, usernick, message):
    """Add a new post to the database.
    The date of the post will be the current time and date.

    Return a the id of the newly created post or None if there was a problem"""

    if(len(message) < 551): # 551 words limits
        cur = db.cursor()
        cur.execute("INSERT INTO posts (usernick, content) VALUES(?,?)", (usernick, message,)) # add stuffs into the database
        db.commit()
        row = list(cur.execute("SELECT id, timestamp, usernick, content, users.avatar FROM posts, users WHERE users.nick = posts.usernick ORDER BY timestamp DESC"))
        return row[0][0] # retrieve the id of the post
    else:
        return None