Page 1 of 1

user defined taq question (don't load subsequent content)

Posted: Sun Apr 04, 2010 5:44 am
by wakewatcher
Is it possible to have a UDF which looks at a flag and based on the flag can inhibit outputting the remaining content on a page?
I'm making some progress on loosely integrating smf with cmsms to insure that some pages are blocked unless the user is signed in to smf. (Since I don't know how to bridge sign-ins http://forum.cmsmadesimple.org/index.php/topic,42977.0.html.) The problem (one of them) is along with the sign-in form it also shows the content I want to hide.

I tried this as the UDF:

Code: Select all

require_once('./smf/SSI.php');
$Referrer = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$_SESSION['login_url'] = $Referrer;
$_SESSION['logout_url'] = $Referrer;
echo "$Referrer";
if ($context['user']['is_guest'])
{
  ssi_login(); 
  exit;
}

but the exit (of course) stops all output passed that point from being displayed.  I guess I'm looking instead of the 'exit' to set a variable and then somehoe check that variable before displaying the content.  If not logged in then don't display. Suggestions?