Topic RSS
8:37 am
Please replace the ??? with your data!
- URL to the FORM: http://???
- The browser used: firefox
- cforms version: latest
- Your Wordpress version: 2.8.4
[desc]:
_
i am unable to get the post author details in a particular cform.
i have attached <?php insert_cform('Appraisal Form'); ?> in that post template page. and i want to pick dynamically post author.
and i am using the code in myfunctions.php.
function my_cforms_ajax_filter($params) {
### triggers on your third form
if ( $params['id']=='6' ) {
### do something with field #1
### (! for ajax, all form fields are counted sequentially! !)
//$params['field_1'] = 'Mr./Mrs. '.$params['field_1'];
global $authordata;
$nick = get_the_author();
$mail = get_the_author_email();
@mail('gurpreet.singh697@gmail.com', 'cforms my_filter_Ajax test', 'Form data array (Ajax):'.$mail, 'From: your@blog.com');
//@mail('gurpreet.singh697@gmail.com', 'cforms my_filter_Ajax test', 'Form data array (Ajax):'.$userdata->ID, 'From: your@blog.com');
}
return $params;
}
Thanks
Gurpreet
7:14 pm
March 6, 2005
Offlinethe problem is that you're calling the get_the_a..outside the WP LOOP.
the ajax call is a individual back end call and thus you need to consider passing on (via a hidden field) the post ID, which needs to be used to set the context of your WP calls.
- you can simply enable '' under Core Options which will add such a hidden field.
- in your routine add global $Ajaxpid;
- and use it to set the context of a WP call
Most Users Ever Online: 959
Currently Online:
48 Guest(s)
Currently Browsing this Page:
2 Guest(s)
Top Posters:
tracedef: 43
mores: 21
Gyrus: 20
frozenwaste: 18
asuffredini: 15
photoworks: 14
Member Stats:
Guest Posters: 3568
Members: 1464
Moderators: 3
Admins: 1
Forum Stats:
Groups: 1
Forums: 4
Topics: 5172
Posts: 18413
Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass
Moderators: Paul (421), cnymike (8), sonika (95)
Administrators: Oliver (6398)
FAQs
Home
Add Reply
Add Topic
Quote









