Well, I managed to put together an SQL-query which gives me what I want.
PHP Code:
select l.link_id, l.title, u.username from idx_link l, idx_paid_listing p, idx_users u, idx_link_user lu where l.link_id = p.link_id and p.link_id = lu.link_id and u.username = lu.username and p.sponsored = 1
But how do I convert that to some sort of variable similar to <%if $login_status_logged_in%> to be able to check wheter true or false in a custom page? Where is this variable <%if $login_status_logged_in%> declared?