I know how to make a plugin to add special attributes for ad, I do not know how you could do that these attributes are sent in the mail to contact publisher ? THX
my attempt, but it does not work. I'm going in the right direction ?
i use Osclass 3.3.2, real estate teme
to realestate/contact.php
<div class="row ui-row-text"><label for="contactmyField"><?php _e('contact myField', 'realestate') ; ?></label> <?php ContactForm::your_myField(); ?></div>
to oc-includes/osclass/controller/contact.php
36: $myField = Params::getParam('myField');
45: Session::newInstance()->_setForm('myField', $myField);
71: Session::newInstance()->_setForm('myField', $myField);
79: $message_myField = sprintf(__('My Field: %s'), $myField);
87: {$message_myField}
to oc-includes/osclass/emails.php
1053: function fn_email_contact_user($id, $yourEmail, $yourName, $phoneNumber, $message, $myField) {
$mPages = new Page();
$aPage = $mPages->findByInternalName('email_contact_user');
$locale = osc_current_user_locale();
$content = array();
if(isset($aPage['locale'][$locale]['s_title'])) {
$content = $aPage['locale'][$locale];
} else {
$content = current($aPage['locale']);
}
$words = array();
$words[] = array(
'{CONTACT_NAME}',
'{USER_NAME}',
'{USER_EMAIL}',
'{USER_PHONE}',
'{MY_FIELD}',
'{COMMENT}'
);
$words[] = array(
osc_user_name(),
$yourName,
$yourEmail,
$phoneNumber,
$message,
$myField
);
$title = osc_apply_filter('email_item_inquiry_title_after', osc_mailBeauty(osc_apply_filter('email_title', osc_apply_filter('email_item_inquiry_title', $content['s_title'])), $words));
$body = osc_apply_filter('email_item_inquiry_description_after', osc_mailBeauty(osc_apply_filter('email_description', osc_apply_filter('email_item_inquiry_description', $content['s_text'])), $words));
$emailParams = array (
'from' => osc_contact_email(),
'subject' => $title,
'to' => osc_user_email(),
'to_name' => osc_user_name(),
'body' => $body,
'alt_body' => $body,
'reply_to' => $yourEmail
);
if( osc_notify_contact_item() ) {
$emailParams['add_bcc'] = osc_contact_email();
}
osc_sendMail($emailParams);
}
osc_add_hook('hook_email_contact_user', 'fn_email_contact_user');
to oc-includes/osclass/frm/contact.for.class.php
90: static public function your_myField() {
if( Session::newInstance()->_getForm("myField") != "" ) {
$myField = Session::newInstance()->_getForm("myField");
parent::generic_textarea("myField", $myField);
} else {
parent::generic_textarea("myField", "");
}
return true;
}
to oc-includes/osclass/classes/emailvariables.php
87: '{MY_FIELD}' => __('My Field'),
themes/realestate/item.php
<fieldset>
<label for="yourName"><?php _e('Your namekk', 'realestate') ; ?>:</label> <?php ContactForm::your_name(); ?>
<label for="yourEmail"><?php _e('Your e-mail address', 'realestate') ; ?>:</label> <?php ContactForm::your_email(); ?>
<label for="phoneNumber"><?php _e('Phone number', 'realestate') ; ?> (<?php _e('optional', 'realestate'); ?>):</label> <?php ContactForm::your_phone_number(); ?>
<label for="message"><?php _e('Message', 'realestate') ; ?>:</label> <?php ContactForm::your_message(); ?>
<label for="myField"><?php _e('myField', 'realestate') ; ?>:</label> <?php ContactForm::your_myField(); ?>
<input type="hidden" name="action" value="contact_post" />
<input type="hidden" name="page" value="item" />
<input type="hidden" name="id" value="<?php echo osc_item_id() ; ?>" />
<?php if( osc_recaptcha_public_key() ) { ?>
<script type="text/javascript">
var RecaptchaOptions = {
theme : 'custom',
custom_theme_widget: 'recaptcha_widget'
};
</script>
<style type="text/css"> div#recaptcha_widget, div#recaptcha_image > img { width:280px; } </style>
<div id="recaptcha_widget">
<div id="recaptcha_image"><img /></div>
<span class="recaptcha_only_if_image"><?php _e('Enter the words above','realestate'); ?>:</span>
<input type="text" id="recaptcha_response_field" name="recaptcha_response_field" />
<div><a href="javascript:Recaptcha.showhelp()"><?php _e('Help', 'realestate'); ?></a></div>
</div>
<?php } ?>
<?php osc_show_recaptcha(); ?>
<a href="#" class="ui-button m-top-15 js-submit"><?php _e('Send', 'realestate') ; ?></a>
</fieldset>
to oc-includes/osclass/upgrade-func.php
187 : $comm->query(sprintf("INSERT INTO %st_pages_description (fk_i_pages_id, fk_c_locale_code, s_title, s_text) VALUES (%d, 'en_US', '{WEB_TITLE} - Someone has a question for you', '<p>Hi {CONTACT_NAME}!</p>\n<p>{USER_NAME} ({USER_EMAIL}, {USER_PHONE}) left you a message:</p>\n<p>{COMMENT}</p>\n<p>{MY_FIELD}</p>\n<p>Regards,</p>\n<p>{WEB_TITLE}</p>')", DB_TABLE_PREFIX, $comm->insertedId()));