210.patch

jobin dcruz, 12/23/2010 11:32 PM

Download (5.55 KB)

View differences:

admin/settings_signup.php
28 28
        mysql_query($sql) or mysql_die($sql);
29 29
    }
30 30
    
31
	if (is_numeric($_POST['signup_age_min']))
32
    {
33
    	 $sql = "UPDATE `config` SET
34
               `config_value`='" . (int) $_POST['signup_age_min'] . "' WHERE
35
               `config_name`='signup_age_min'";
36
        mysql_query($sql) or mysql_die($sql);
37
    }
38
    
39
	if (is_numeric($_POST['signup_age_min_enforce']))
40
    {
41
    	 $sql = "UPDATE `config` SET
42
               `config_value`='" . (int) $_POST['signup_age_min_enforce'] . "' WHERE
43
               `config_name`='signup_age_min_enforce'";
44
        mysql_query($sql) or mysql_die($sql);
45
    }
46
    
31 47
    if (is_numeric($_POST['signup']))
32 48
    {
33 49
        $sql = "UPDATE `config` SET
......
99 115
    }
100 116
}
101 117

  
118
$smarty->assign('signup_age_min', get_config('signup_age_min'));
119
$smarty->assign('signup_age_min_enforce', get_config('signup_age_min_enforce'));
102 120
$smarty->assign('signup_enable', get_config('signup_enable'));
103 121
$smarty->assign('signup_auto_friend', get_config('signup_auto_friend'));
104 122
$smarty->assign('signup_dob', get_config('signup_dob'));
install/sql/upgrade_2.7_to_2.8.sql
52 52

  
53 53
INSERT INTO `config` (`config_name`, `config_value`) VALUES ('vshare_player', 'JW Player');
54 54
INSERT INTO `sconfig` (`soption` ,`svalue`) VALUES ('family_filter', '1');
55
INSERT INTO `config` (`config_name`, `config_value`) VALUES ('signup_age_min_enforce', '0'), ('signup_age_min', '18');
55 56

  
install/sql/vshare.sql
119 119
INSERT INTO `config` (`config_name`, `config_value`) VALUES('guest_upload_user', '');
120 120
INSERT INTO `config` (`config_name`, `config_value`) VALUES('youtube_player', 'youtube');
121 121
INSERT INTO `config` (`config_name`, `config_value`) VALUES('vshare_player', 'JW Player');
122
INSERT INTO `config` (`config_name`, `config_value`) VALUES('signup_age_min_enforce', '0');
123
INSERT INTO `config` (`config_name`, `config_value`) VALUES('signup_age_min', '18');
122 124

  
123 125
-- Table structure for table `contact`
124 126

  
signup.php
192 192
        {
193 193
            $err = $validate_date;
194 194
        }
195
        else 
196
        {
197
        	$signup_age_min_enforce = get_config('signup_age_min_enforce');
198
        	
199
        	if ($signup_age_min_enforce == 1)
200
        	{
201
        		$age = find_age($bdate);
202
        		$age_minimum = get_config('signup_age_min');
203
        		
204
        		if ($age < $age_minimum)
205
        		{	
206
        			$err = str_replace('[AGE_MINIMUM]',$age_minimum,$lang['signup_enforce']);
207
        		}
208
        	}
209
        }
195 210
    }
196 211
    $smarty->assign('signup', $signup);
197 212
    
......
466 481
    $smarty->assign('years', $years);
467 482
}
468 483

  
484
$smarty->assign('age_minimum', get_config('signup_age_min'));
469 485
$smarty->assign('captcha_type', $captcha_type);
470 486
$smarty->assign('signup_dob', $signup_dob);
471 487
$smarty->assign('err', $err);
templates/admin/settings_signup.tpl
53 53
    </div>
54 54
    
55 55
    <div>
56
        <label for="signup_age_min">Age Minimum:</label>
57
            <input type="text" name="signup_age_min" value="{$signup_age_min}" id="signup_age_min">
58
    </div>
59
    
60
     <div>
61
        <label for="signup_age_min_enforce">Age Minimum Enforce:</label>
62
        <select name="signup_age_min_enforce" id="signup_age_min_enforce">
63
            <option value="0" {if $signup_age_min_enforce =='0'}selected="selected"{/if}>No</option>
64
            <option value="1" {if $signup_age_min_enforce =='1'}selected="selected"{/if}>Yes</option>
65
        </select>
66
    </div>
67
    
68
    <div>
56 69
        <label for="signup_auto_friend">Default Friend:</label>
57 70
        <input type="text" name="signup_auto_friend" id="signup_auto_friend" value="{$signup_auto_friend}" />
58 71
    </div>
templates/signup.tpl
111 111
           <div class="indent">
112 112
                <ul>
113 113
                    <li>
114
                        I certify I am over 13 years old.
114
                        I certify I am over {$age_minimum} years old.
115 115
                    </li>
116 116
                    <li>
117 117
                        I agree to the 
118
-