$total = 0;
- if(get_config('system','invitations_only')) {
+ if(get_config('system','invitation_only')) {
$invonly = true;
$x = get_pconfig(local_user(),'system','invites_remaining');
if((! $x) && (! is_site_admin()))
if($invonly && ($x || is_site_admin())) {
$code = autoname(8) . srand(1000,9999);
$nmessage = str_replace('$invite_code',$code,$message);
- // store in db
+
+ $r = q("INSERT INTO `register` (`hash`,`created`) VALUES ('%s', '%s') ",
+ dbesc($code),
+ dbesc(datetime_convert())
+ );
if(! is_site_admin()) {
$x --;
if($x >= 0)
- set_pconfig(local_user(),'system','invites_remaining,$x);
+ set_pconfig(local_user(),'system','invites_remaining',$x);
else
return;
}
$tpl = get_markup_template('invite.tpl');
$invonly = false;
- if(get_config('system','invitations_only')) {
+ if(get_config('system','invitation_only')) {
$invonly = true;
$x = get_pconfig(local_user(),'system','invites_remaining');
if((! $x) && (! is_site_admin())) {