<?php
/*
Simple:Press Forum
Admin integration Update Global Options Support Functions
$LastChangedDate: 2009-10-08 04:41:16 +0100 (Thu, 08 Oct 2009) $
$Rev: 2792 $
*/

if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF']))
{
	die('Access Denied');
}

function sfa_get_integration_page_data()
{
	global $wpdb;

	$sfoptions = array();

	$sfoptions['sfslug'] = sf_get_option('sfslug');
	$sfoptions['sfpage'] = sf_get_option('sfpage');
	$sfoptions['sfpermalink']=sf_get_option('sfpermalink');

	if(!empty($sfoptions['sfslug']))
	{
		$pageslug = explode("/", $sfoptions['sfslug']);
		$thisslug = $pageslug[count($pageslug)-1];
		$pageid = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '".$thisslug."'");
		if (!$pageid)
		{
			$sfoptions['sfpage'] = 0;
			$sfoptions['sfslug'] = '';
		}
	} else {
		$sfoptions['sfpage'] = 0;
		$sfoptions['sfslug'] = '';
	}

	return $sfoptions;
}

?>