Variable scope in plugin outside loop [closed]

OK FIXED using

define('WP_USE_THEMES', false);
require_once(APP_PATH.BLOG_FOLDER.'wp-blog-header.php');

instead of wp-load.php