def leaderboardhub(gamename): scoretypes = hub.query_db( 'SELECT leaderboard.name FROM leaderboard WHERE leaderboard.gamename = ?', [gamename]) if len(scoretypes) > 1: return render_template('leaderboardgame.html', entries=scoretypes) else: return redirect('/leaderboards/' + gamename + '/' + scoretypes[0][0])
def blog_route(): entries = hub.query_db( "SELECT * FROM article ORDER BY postDate DESC LIMIT 3") return render_template('bloghub.html', entries=entries)
def spesific_article(article_id): article = hub.query_db("SELECT * FROM article WHERE id = ?", [article_id], one=True) print(article) return render_template("article.html", entries={'article': article})
def leaderboards(): games = hub.query_db('SELECT * FROM lb_game') return render_template('leaderboards.html', entries=games)
def leaderboard(gamename, scoretype): scores = hub.query_db( 'SELECT time_submitted, username, value FROM score WHERE score.typename = ? AND score.gamename = ?', [scoretype, gamename]) return render_template('leaderboard.html', entries=scores)
def leaderboardhub(gamename): scoretypes = hub.query_db('SELECT leaderboard.name FROM leaderboard WHERE leaderboard.gamename = ?', [gamename]) if len(scoretypes) > 1: return render_template('leaderboardgame.html', entries=scoretypes) else: return redirect('/leaderboards/' + gamename + '/' + scoretypes[0][0])
def blog_route(): entries = hub.query_db("SELECT * FROM article ORDER BY postDate DESC LIMIT 3") return render_template('bloghub.html', entries=entries)