Topic RSS
6:01 pm
I just came across cforms, and it looks like it'll do just what I'm looking for! However, being a total novice when it comes to PHP & MySQL, if someone else has already done this, and would be willing to share their code, it would certainly save me some time…
I'm upgrading a website for a community group in which some people will be entering volunteer work projects as posts in certain categories (based on which city they're in). I'm hoping to use cforms then as the signup form for people who want to serve, with a dropdown list that grabs those post titles so they can select which project they want to volunteer for.
Make sense?
Reading the docs here, it looks like it can certainly be done… I'm just wondering if anybody already has. :) If not, I'll share what I come up with once I'm done with it…
Thanks!
PS – The website is http://www.sharefestpc.org , if anyone's interested…
8:01 pm
March 6, 2005
OfflineRich, have you looked at the examples in the HELP section? Start with the simple one, once you have it up and running tailor the code to meet your requirements.
To get a list of post titles you may have either get into MySQL and write the respective SQL queries from scratch or find a plugin that helps to do that.
11:21 pm
Yep, I've looked at the examples, which is what makes me think it's doable. I'm hoping that standard WP function calls will get me where I need to go… but I haven't started digging into it yet. Today's been too busy! :)
10:03 am
OK, I've done it, using the get_posts function and get_the_title function inside the Loop (which should already be there, if you're on a Page or in a Post). The relevant section looks like this:
$fields['label'][4] = 'Sign me up for:#Choose one|-';
$posts = get_posts('numberposts=50&category=4&order=ASC&orderby=post_title');
foreach ($posts as $post) :
$fields['label'][4] .= '#'.get_the_title();
endforeach;
$fields['type'][4] ='selectbox';
You can see it in action at:
http://www.sharefestpc.org/valparaiso/sign-me-up-valparaiso/
The list of post titles it's grabbing can be seen on this page:
http://www.sharefestpc.org/valparaiso/
It's not really integrated into the site yet. Most of it is still last year's site (with last year's method).
The problem I have now is that when I hit the submit button, I get taken to what seems to be a random post (except that it's the same one every time), no email gets sent, and nothing gets put into the database. It's set to give a success message, not redirect, and all the email config information seems to be filled out correctly. It's on WP 2.0.2, Firefox 2.0.0.4 on the Mac. I don't have time to dig into that one right now…
10:39 am
March 6, 2005
OfflineI see you're making good progress, great!
Here is what happens (I think):
Dynamic forms only work in non Ajax mode, hence cforms needs to submit/post the data & reload the page for validation & further processing.
Since you've tinkered with the get_the_title etc. WP function call, it looks like it changed the current get_permalink to the last item in your post list. Cforms uses get_permalink to determine the form action and consequently, when reloading, loads the wrong page and nothing happens – of course.
Two options I see:
- Adjust the way you gather the post data, so it doesn't influence get_permalink()
- Try to "hardcode" the form action via the cforms admin UI: look for Redirect form data to… and set it to
http://www.sharefestpc.org/valparaiso/sign-me-up-valparaiso/
5:31 am
Like I said in my last comment (if it made it thru moderation), the latest version of the plugin fixed my redirect problem. If you want to see it in action, I'm using it at http://www.sharefestpc.org . I'm using it for the "Contact Us" page, but the fun stuff is on the "Sign Me Up" pages. The link above doesn't get you there anymore… now it's http://www.sharefestpc.org/sign-me-up/ and then click on one of the city names to see that city's form.
Thanks for a GREAT plugin! The only thing that would make it better would be the ability to do a CSV export of just one of the forms (without having to click on every individual form entry one at a time). I'm going to have forms for 3-5 cities, plus the Contact Us form, plus another one, for a total of 5-7 forms. I'll never need to export all of them together, because they'll all be different. But right now I don't see any easy way to export just one of the forms' tracked results.
But that's about the only thing I can think of! Thanks again!
5:34 am
You know what, maybe that "last comment" I referred to was just in my head. :)
2:12 pm
March 6, 2005
OfflineRich Schmidt said:
Like I said in my last comment (if it made it thru moderation), the latest version of the plugin fixed my redirect problem. If you want to see it in action, I'm using it at http://www.sharefestpc.org . I'm using it for the "Contact Us" page, but the fun stuff is on the "Sign Me Up" pages. The link above doesn't get you there anymore… now it's http://www.sharefestpc.org/sign-me-up/ and then click on one of the city names to see that city's form.
Thanks for a GREAT plugin! The only thing that would make it better would be the ability to do a CSV export of just one of the forms (without having to click on every individual form entry one at a time). I'm going to have forms for 3-5 cities, plus the Contact Us form, plus another one, for a total of 5-7 forms. I'll never need to export all of them together, because they'll all be different. But right now I don't see any easy way to export just one of the forms' tracked results.
But that's about the only thing I can think of! Thanks again!
good point, I'll put that on the v5.4 todo list.
Most Users Ever Online: 959
Currently Online:
121 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
tracedef: 43
mores: 21
Gyrus: 20
frozenwaste: 18
asuffredini: 15
photoworks: 14
Member Stats:
Guest Posters: 3550
Members: 1464
Moderators: 3
Admins: 1
Forum Stats:
Groups: 1
Forums: 4
Topics: 5158
Posts: 18389
Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass
Moderators: Paul (421), cnymike (8), sonika (95)
Administrators: Oliver (6398)
FAQs
Home
Add Reply
Add Topic
Quote











