Ok... I'm a little confused... I've written a plugin that I'm trying to update it on my site. Whent he page is called on its own, then it works, but if I add directories to the URL it craps out on me.
for example:
http://URL/photos/
get_query_var('pagename') will = "photos"
but
http://URL/photos/photo/234243
get_query_var('pagename') will = "" when it should equal "photos", am I wrong?