I'd love to use Cforms for every directory listing we have, but that would require making hundreds of forms, each directed to a different email address. Any thoughts on automating something like this? In PhpMyDirectory it creates an email form for each directory listing, it would be nice to be able to do that with Cforms in Wordpress.
Directory listings each have their own page in WP, and currently just have an email link to each specific farm and am using an email obfuscator plugin which I'm not sure is working.
What I would do, is create a Wordpress custom field (on the write page UI) for each page, call it e.g. "email_address" and enter the listings email address.
After implementing this customization, it was working for a while. But now, for some reason, every time I save a post in Wordpress, I get this error …
.
Warning: implode() [function.implode]: Invalid arguments passed in /home/cyntheal/public_html/authorsnow/wp-content/plugins/cforms/lib_aux.php on line 170
Warning: implode() [function.implode]: Invalid arguments passed in /home/cyntheal/public_html/authorsnow/wp-content/plugins/cforms/lib_aux.php on line 170
Warning: implode() [function.implode]: Invalid arguments passed in /home/cyntheal/public_html/authorsnow/wp-content/plugins/cforms/lib_aux.php on line 170
Warning: implode() [function.implode]: Invalid arguments passed in /home/cyntheal/public_html/authorsnow/wp-content/plugins/cforms/lib_aux.php on line 170
Warning: implode() [function.implode]: Invalid arguments passed in /home/cyntheal/public_html/authorsnow/wp-content/plugins/cforms/lib_aux.php on line 170
Warning: Cannot modify header information – headers already sent by (output started at /home/cyntheal/public_html/authorsnow/wp-content/plugins/cforms/lib_aux.php:170) in /home/cyntheal/public_html/authorsnow/wp-includes/pluggable.php on line 770
I double-checked the code in lib_aux.php and it looks right to me. I'm at a loss as to what I did wrong. And I would really like to have cforms working on my website. Any ideas?
I am attempting to follow your instructions for this mod but apparently you have changed the code since writing this. I'm actually stumped at step one which is to replace the code you specified… The only code that is close to what you specified is this
So that leads me to believe that whatever code I'm supposed to replace that with has also changed. Could you please update your response so that I don't screw something up? thanks.
Hi again, sorry to be such a dunce, but what you just said made no sense to me. I'm a slow learner. But I'll tell you what… if you can explain it in a step by step fashion, I'll then make a video tutorial for you which you can then direct people to. Deal?
What i need to do is to have each of my business directory listings be able to utilize a cforms email form but by automatically grabbing the email somehow from each business listing.
what I have is a website for wedding service providers. Each business belongs to a category and I have categories set up for "Photographers", "Reception Halls", "Florists" and so on.
I could not really figure out the best way to approach this with WordPress since WordPress can't assign categories to Pages. So I approached it from a Post point of view with each business being a post and each post is assigned to a category. Do you think that is the best way for my project?
So each business is listed by means of a Post and each Post is assigned to the appropriate category. I am not using any sort of directory database plugin or anything of that nature. I would if one existed that did what I want, but so far I haven't found one… but that's besides the point.
So each business listing is a simple Post which includes the business name, address, phone number, linked email address and linked website address, description and photo.
I do not have any custom fields defined because as of now, I don't really understand how they work… but I'm certainly willing to learn how they work and incorporate them if necessary… and it appears from other posts in this forum, that a custom field will be necessary.
The existing website is http://www.cnyweddings.com . The existing website is static at this point but I am in the process of moving to WordPress and the new site under development is at
Since the site is under development, I do not actually have working email and website links in place for all the buinesses yet, so the links are dead, at least most of them.
I could not really figure out the best way to approach this with WordPress since WordPress can't assign categories to Pages. So I approached it from a Post point of view with each business being a post and each post is assigned to a category. Do you think that is the best way for my project?
that's certainly one way.
So each business listing is a simple Post which includes the business name, address, phone number, linked email address and linked website address, description and photo. I do not have any custom fields defined because as of now, I don't really understand how they work… but I'm certainly willing to learn how they work and incorporate them if necessary… and it appears from other posts in this forum, that a custom field will be necessary.
correct. beside showing the listing info inside the post (so users can actually view them you need to store them in custom fields for future access, otherwise, you'd have to parse your post content for keywords and extract e.g. the email address – way to much effort.
you need to
add all necessary custom fields to your listings (could be as few as only one: the email address) -> what is 'necessary' depends on what data you need to retrieve in the future (probably, email/name)
note: format of the future email is "name" <email>
please also see this thread it includes the general example on how to modify the admin email field at run time
this includes configuring a placeholder for your form's adminTo config field
editing my-functions.php (logic routine): adjust the example to fetch (instead of the user name of the author-page-context) your posts' custom fields (name, email) and assemble both to the format described in 1.1
I could not really figure out the best way to approach this with WordPress since WordPress can't assign categories to Pages. So I approached it from a Post point of view with each business being a post and each post is assigned to a category. Do you think that is the best way for my project?
that's certainly one way.
Do you feel there is a better way that I should consider? Because right now, I could change everything if there was a good reason to. I am more familiar with a CMS like CMSmadesimple as oppoesed to WordPress.
Thanks for the other info. I'll give it a go after Christmas and see if I can implement your example.
It's the easiest/quickest way. I personally would completely do it outside of PHP, but that's just me and it would take 10x as long and require strong PHP and SQL skills.
Thanks for the other info. I'll give it a go after Christmas and see if I can implement your example.
Next I went into cForms and duplicated the default "Contact Us" form and renamed it "Contact a Vendor". Then I went to "Core Form Admin / Email Options" and changed the value to "placeholder"
Next I uncommented the my-functions.php logic so that it now looks like this…
Is that the correct logic code to modify and did I do that correctly?
Next, I looked at the three code examples in my-functions.php and compared them to each other. Is there a typo (bug?) in there? It seems as if you have the same comment code for the first two examples…
### example: changes the name of the uploaded file in the email (adding a prefix taken form a form field)
if ( $setting == "adminTO" ){
### example: changes the name of the uploaded file in the email (adding a prefix taken form a form field)
So that is confusing me since I'm easily confused.
Assuming that it -is- a typo, I'm guessing that I'm supposed to use and modify the first example and change the code so that it pulls the custom field value "email". But I do not know how to pull that info into the example
function my_cforms_logic($cformsdata,$oldvalue,$setting) {
### example: changes the name of the uploaded file in the email (adding a prefix taken form a form field)
if ( $setting == "adminTO" ){
### the below rewrite only triggers when admin email="placecholder" to avoid all forms go to the changed address if ( $oldvalue=='placeholder' ) return 'test123 <my@different-email.com>';
}
I think I'm supposed to change this part but not sure how to pull in the custom field email address in to there…
if ( $oldvalue=='placeholder' ) return 'test123 <my@different-email.com>';
}
That's basically where I'm at right now. Not sure how to proceed.
the above needs to be reversed again (### are required here).
however you need to remove the /* in line 13 and move it to line 63 (after the function).
Next, I looked at the three code examples in my-functions.php and compared them to each other. Is there a typo (bug?) in there? It seems as if you have the same comment code for the first two examples…
you're right, I fixed this in v10.0 -to be released soon- (a silly copy and paste mistake).
Oliver, you've been very gracious to me and my continued questions. I thank you for that. But I'm not having any luck. I think I've done what you instructed but i'ts not working so here are screenshots…
When I submit the form I get the "Thank you for your comment" but I do not recieve the email. cForms is working though because the default Contact Us form does send me an email when a form is submitted. But of course, that form is not using placeholder or custom fields.
Clearly I've done something wrong and i hope you wll be able to tell me what.