I recently solved this problem in Joomla! 1.5 and it may work in Joomla! 1.0 . After reviewing Joomla! internals there is virtually no way of doing this without altering the internals or making or using a custom user component. But you can sneak around this problem using the Joomla! security token. Here is how it is done....
First copy the default.php file from JPATH_BASE/com_user/views/register/tmpl/default.php to your theme JPATH_BASE/templates/*THEME_ID*/html/com_user/register/default.php
Now you must alter your JPATH_BASE/templates/*THEME_ID*/html/com_user/register/default.php file.
First alter the form tag to this... If the user has javascript enabled this will prevent them from seeing the ugly invalid token page.
Code:
<script type="text/javascript"><!--
function checkAgree() {
var agree = document.getElementById('formAgree');
if (!agree.checked) {
alert('To become a member you must agree to our terms of service!');
return false;
}
return true;
}
--></script>
<form action="<?php echo JRoute::_( 'index.php?option=com_user' ); ?>" method="post" id="josForm" name="josForm" class="form-validate" onsubmit="return checkAgree();">
Secondly add in your terms of service after the verify password field. Be sure to change the URL from /path/to/tos.html to where your terms are actually located.
Code:
<?php
// Terms of Service
$tokenHTML = str_replace('type="hidden"','id="formAgree" type="checkbox"',JHTML::_( 'form.token' ));
$tosURL = "/path/to/tos.html"; // REPLACE THIS!
?>
<tr>
<td height="40" style="vertical-align: top;">
<label>
Terms of service:
</label>
</td>
<td>
<iframe src="<?php echo htmlentities($tosURL); ?>" width="250" height="150"></iframe>
</td>
</tr>
<tr>
<td colspan="2">
<p><?php echo $tokenHTML; ?> <b>Agree to terms of service.</b> *</p>
</td>
</tr>
<tr>
Finally you will need to remove the original token from the form.
Change this line ...
Code:
<?php echo JHTML::_( 'form.token' ); ?>
To this....
Code:
<?php if (false) echo JHTML::_( 'form.token' ); ?>
And your done! The user must agree to the terms to register!
Problems like this are why I designed my own platform, sometimes its better to throw out the baby with the bath water cause you don't have to deal with dirty water again!
_________________
Please read forum rules regarding signatures:
viewtopic.php?t=65