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

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
wakewatcher
Forum Members
Forum Members
Posts: 149
Joined: Fri Dec 28, 2007 12:33 am

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

Post 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?
Post Reply

Return to “CMSMS Core”