interpim Posted March 8, 2007 Share Posted March 8, 2007 Hey all, I installed a quick modification to help prevent spam on my phpbb boards... Well, it works fine, but I would like to be able to change the settings of it from the admin page. Basically I have modded the profile_add_body.tpl file and added the following code above the visual confirmation... <tr> <td class="row1"><span class="gen">What Realm of DAoC does Fenris Belong? (lower case) *</span></td> <td class="row2"> <input type="text" class="post" style="width: 200px" name="math_question" size="45" maxlength="45" value="" /> </td> </tr> in the includes/usercp_register.php file i changed the code around line 260 or so from the original to this else if ( $mode == 'register' ) { if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) ) { $error = TRUE; $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty']; } if (!isset($_POST['math_question']) || $_POST['math_question'] != 'midgard') {$error = TRUE; $error_msg .= (isset($error_msg) ? '<br />' : '') . "Incorrect answer to simple question..."; } } My question is... where do i load the answer 'midgard' (of course will change to a variable) and the question to be changed or edited from teh admin panel? Any help on this is appreciated. I am running version phpBB 2.0.18 Quote Link to comment Share on other sites More sharing options...
SammyGunnz Posted March 8, 2007 Share Posted March 8, 2007 You can write both the question and answer to either a flat text file or to a table in the same database which you can change from your admin area. You then either query the db or include the text file...and use the variables accordingly. Quote Link to comment Share on other sites More sharing options...
interpim Posted March 9, 2007 Author Share Posted March 9, 2007 yes... i figured that much, my question is, does anyone know what files I should input this code? I know how to query a db and write/read from a flat file... the problem is, this code is a bit over my head and I need to know where to go to make changes etc. in phpbb Quote Link to comment Share on other sites More sharing options...
interpim Posted March 9, 2007 Author Share Posted March 9, 2007 *bump* Quote Link to comment Share on other sites More sharing options...
All4172 Posted March 9, 2007 Share Posted March 9, 2007 The phpbb mod boards is a better place to ask this question since its no php related. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.