Location: PHPKode > projects > Enigma > Enigma2/Enigma2_Install/Blocks/Block_registrations.php
<?php
/*
*****************************************************************

 Block_Registrations.php
 
*****************************************************************
LSP: Lunabyte Systems Portal
Open-Source Project Inspired by Zef Hemel (hide@address.com)
*****************************************************************
Software Version:                  LSP 2.0 "Enigma 2"
Software by:                         Lunabyte Systems (http://www.lunabyte.net)
Copyright 2002-2005 by:       Lunabyte Systems (http://www.lunabyte.net)
Support, News, Updates at:    http://www.lunabyte.net
*****************************************************************
This program is free software; you may redistribute it and/or modify it 
under the terms of the provided license as published by Lunabyte Systems.

This program is distributed in the hope that it is and will be useful,                  
but WITHOUT ANY WARRANTIES; without even any implied warranty of           
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                        

See the "LSP_license.txt" file for details of the LSP license.
The latest version can always be found at http://www.lunabyte.net.
*****************************************************************
*/

if (!defined('ENIGMA'))
	die('<b>Access Violation</b><br />Direct Access to this location is not allowed.');

function Block_registrations()
{
	global $db_prefix, $context, $scripturl, $modSettings, $settings, $txt;

	if (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2)
	{

		$request = db_query("
			SELECT COUNT(ID_MEMBER)
			FROM {$db_prefix}members
			WHERE is_activated = 0", __FILE__, __LINE__);
		list ($num_waiting) = mysql_fetch_row($request);
		mysql_free_result($request);
	
		// Do we have anyone waiting? If not, say so. 
		if (empty($num_waiting))
		{
			echo '
				<p>' . $txt['regblk_01'] . '</p>';
		}
		// Is there only 1?
		elseif(!empty($num_waiting) && $num_waiting == 1)
		{
			echo '<p>' . $txt['regblk_02'] . '</p>
				<p><a href="' . $scripturl . '?action=regcenter" alt="Registration Management">' . $txt['regblk_07'] . '</a></p>';
		}
		// More than 1?
		elseif(!empty($num_waiting) && $num_waiting > 1)
		{
			echo '<p>' . $txt['regblk_03'] . '<b>'. $num_waiting. '</b>' . $txt['regblk_04'] . '</p>
				<p><a href="' . $scripturl . '?action=regcenter" alt="Registration Management">' . $txt['regblk_07'] . '</a></p>';
		}
		// Something went south, throw the admin a bone.
		else
		{
			echo '<p>' . $txt['regblk_05'] . '</p>';
		}
	}
	// Registrations aren't set-up for Approval, so why use the block?	
	else
	{
		echo '<p>' . $txt['regblk_06'] . '</p>';
	}

}
?>
Return current item: Enigma