Display php/mysql on custom page

First Id like to start off by saying, I have searched the webs and read a couple threads on this site that show 'how' to display custom php data on a page in xenforo. I dont know if I am just dense or what, but its just not coming to me. I am able to write a full system from scratch to read information from a database on a page, show user stats, etc... but I reallllly want to learn how to do this from within xenforo. If anyone would have time to help me I would super appreciate it.

My overall objective is to basically have a complete 'statistics' pages on a website for a game. I want to list all games we record stats for, show leader boards for each game, and show each individual user profile and all of his/her collective stats on a page. I do not need help with the actual php sense of the project, I can manage that. I need help with making it in xenforo. Thanks in advance!