| Post |
|
Guest
| Tom 2:47 pm July 7, 2009
| |
|
|
hello
i want to create form which allow me to automaticly count limited number of invitation.
So i need contact informatios and one field which will be containing number of requested number of invitations. General number of invitation should be stored in database or file for futher calculation.
So how to consider this ?can i do it through only cforms ? or rather should i use java to take number from form and store it to file ?
|
|
|
Guest
| Tom 12:43 am July 8, 2009
| |
|
|
solved
fetching through php field value from cforms and then updating option and displaying this option.
http://codex.wordpress.org/Fun…..ate_option
|
|
|
Admin
| Oliver Munich, Germany posts 6237 7:14 am July 8, 2009
| |
|
|
cforms supports 'counting' of submissions directly, see "Core Form Admin / Email Options". there is also an API call (Help page) to retrieve number of submissions left…
|
|
|
|
|
Guest
| Tom 10:42 am July 8, 2009
| |
|
|
thanks for answer
I didn't describe my problem clearly enough. One submission isn't always equal to one invite, because one person can request more invitations, for example 3 invitation, this number is filled in one field called "number of invitations" and this number is subtracted from general number of invitations.
|
|
|
Admin
| Oliver Munich, Germany posts 6237 7:14 am July 9, 2009
| |
|
|
right, in that case you need to custom code something
|
|
|
|
|
Member | mores posts 21 10:45 am July 9, 2009
| |
|
|
Tom … care to share how you did it? my-functions.php-magic? Or did you hack the plugin itself?
|
|
|
Guest
| Tom 1:27 am July 10, 2009
| |
|
|
no, at this moment it is very short and simple code which is included on page with form. ( i have exec-php plugin installed which allows to include code on page).
<?php add_option("zaproszenia", '100', '', 'yes'); $zapro=$_POST["cf4_field_1"];
$all_zapro=get_option('zaproszenia');
$option_name = 'zaproszenia' ; $newvalue = $all_zapro-$zapro ; if ( get_option($option_name) ) { update_option($option_name, $newvalue); } echo "<strong>Liczba dostępnych zaproszeń: "; echo get_option('zaproszenia'); echo "</strong>"; ?> <br> <p><!–cforms4–></p> <br>
|
|