Registration & Nr of Form-Fields
(5 posts) (2 voices)-
Hi!
I use your plugin and i´m satisfied with the abilities. It worked on the first try. But at the moment i´m a little stuck in the customization process. Can i deactivate any of the form-fields (which i don´t need). For e.g.: Bio is something i have no need for.
Thanks a lot!!Posted 3 years ago # -
In the current release, you cannot do that. You will have to edit the code if you really want that.Posted 3 years ago #
-
Hi Binny,
at the moment i´m more than just stuck. i did edit the code, but i ran in a lot of problems. one of the problems is that most of your code-comments seem to belong to another "quiz"(?)-plug-in...? so had to try to understand your construction via the code itself.
here´s what i tried to do:
- exchange database-tables 'description' to 'lastname' and "mediumtext" to "varchar(50)" > worked. but i didn´t get the point woth the form fields
- deactivate 'url' & 'picture' > didn´t work
(- custom css for form-fields > didn´t really work. would have to make custom classes/ids and so on)
i don´t need more than that, because everything else is just fine the way it is. could you provide me a helping hand/list for finding the files and row-numbers to exchange "description" and deactivate "url"&"picture"?
Thanks a lot!Posted 3 years ago # -
The easiest option is to remove just the HTML for those fields - its in the 'show_registeration_form.php' file...
<label for="picture">Image</label><input type="file" name="picture" id="picture" /><br />
<p class="help">150x150 picture works best</p>
and
<label for="description">Bio</label><textarea name="description" id="description" rows="5" cols="50"><?=$_POST['description']?></textarea><br />
<p class="help">All HTML other than the <A> tag will be removed. nofollow will be added to the links to prevent spamming.</p>
and
<label for="site_url">Url</label><input type="text" name="site_url" id="site_url" value="<?=($_POST['site_url']) ? $_POST['site_url'] : 'http://'?>" /><br />
<p class="help">Your primary site</p>
could be removed. Or you could do a more through job by removing the PHP that handles this as well - this is found in the same file itself - but towards the top...
After the code
if($_POST['email'] and !preg_match('/^[\w\-\.]+\@[\w\-\.]+\.[a-z\.]{2,5}$/', $_POST['email'])) $errors[] = 'Please provide a valid email address';
replace the existing code with this...
if($_POST['email'] and !preg_match('/^[\w\-\.]+\@[\w\-\.]+\.[a-z\.]{2,5}$/', $_POST['email'])) $errors[] = 'Please provide a valid email address';
if(!count($errors)) { // No errors - insert the thingy
//Insert the guy.
$wpdb->query($wpdb->prepare("INSERT INTO {$wpdb->prefix}eventr_attendee(name, email, phone ) "
. " VALUES(%s, %s, %s)", strip_tags($_POST['attendee_name']), strip_tags($_POST['email']), strip_tags($_POST['phone'])));
$attendee_id = $wpdb->insert_id;
}
}Posted 3 years ago # -
Hi Binnya,
thanks! that´s pretty close to what i did. Due to the fact, that i am in need of "first" and "last name", i had to miss-use 'description' for "last name" and change it from mediumtext to a varchar(50). (i didn´t deactivate the db-rows for image and url, because it simply has no effect and no error when left empty. i just commented away the html-part of the form.)
but my problems are now,
1. that there´s still an error/problem with sanitizeinput - i deactivated the sanitizeinput and the image-folder-generator and everything works fine. in show_registeration_form-php, i replaced "$description = sanitizeinput($_POST['description']);" with "$description = $_POST['description'];." that enters the description as the lastname. so i get everything into db where i need it
2. BUT: it seems that there´s a problem with more than one registration-form-submit-button on one page. is there a possibility to sign the submit/action-button to a particular event? or do you see another possible solution?
if there´s no possibility to sign the button to only one form, than i´m really in trouble. i can´t stop the submit-button(s) from sending 3x the attendee to the db-table, because one submit hits all 3 buttons for all 3 events... i tried replacing with an image and giving the event_id as value, but nothing works. your code (beyond) can´t work in this issue, because it check´s for double assigning before the attendee get´s signed in and afterwards the submit-buttons are sending the attendee 3 times.
if($attendee_id) {
// First, check to see if this guy has already registered.
if($wpdb->get_row($wpdb->prepare("SELECT added_on FROM {$wpdb->prefix}eventr_event_attendee WHERE event_ID=%d AND attendee_ID=%d", $_POST['event_id'], $attendee_id))) {
print "Sie wurden bereits für {$event->name} angemeldet.";
thanks. i´m pretty stuck.Posted 3 years ago #
Reply
You must log in to post.