Well, i have tried to make a new field in item-post.php.
I put this code in item-post.php
<label for="contactPhone"><?php _e('Phone', 'modern'); ?> *</label>
<?php ItemForm::contact_phone_text(); ?>
</div>
And this one in the Item.Form.class.php
static public function contact_phone_text($item = null) {
if($item==null) { $item = osc_item(); };
if( Session::newInstance()->_getForm('contactPhone') != "" ) {
$item['s_contact_phone'] = Session::newInstance()->_getForm('contactPhone');
}
parent::generic_input_text('contactPhone', (isset($item['s_contact_phone'])) ? $item['s_contact_phone'] : null);
return true;
}
The problem is whatever i write in this new field, the value that appears in the database is null.
What i´m doing wrong? Can you help me?
Grateful
put this Code in item.post.php.........For modern Theme
<!-- seller info -->
<?php if(!osc_is_web_user_logged_in() ) { ?>
<div class="box seller_info">
<h2><?php _e("Anbieter information", 'modern'); ?></h2>
<div class="row">
<label for="contactName"><?php _e('Name', 'modern'); ?></label>
<?php ItemForm::contact_name_text(); ?>
</div>
<div class="row">
<label for="phone">Mobil</label>
<input id="cityArea" type="text" name="cityArea" value="" /><input id="cityAreaId" type="hidden" name="cityAreaId" value="" />
</div>
<div class="row">
<label for="contactEmail"><?php _e('E-Mail', 'modern'); ?> *</label>
<?php ItemForm::contact_email_text(); ?>
</div>
<div class="row">
<div style="width: 120px;text-align: right;float:left;">
<?php ItemForm::show_email_checkbox(); ?>
</div>
<label for="showEmail" style="width: 250px;"><?php _e('E-Mail Adresse anzeigen', 'modern'); ?></label>
</div>
</div>
<?php }; ?>
<?php ItemForm::plugin_post_item(); ?>
<?php if( osc_recaptcha_items_enabled() ) {?>
<div class="box">
<div class="row">
<?php osc_show_recaptcha(); ?>
</div>
</div>
<?php }?>
<div class="clear"></div>
<button type="submit"><?php _e('Absenden', 'modern'); ?></button>
</fieldset>
</form>
</div>
<?php osc_current_web_theme_path('footer.php'); ?>
</body>
</html>
and this Code in Item.php......Modern Theme
<div id="contact">
<h2><?php _e("Anbieter kontaktieren", 'modern'); ?></h2>
<?php if( osc_item_is_expired () ) { ?>
<p>
<?php _e("Das Inserat ist abgelaufen!. Kein Kontakt mehr möglich.", 'modern'); ?>
</p>
<?php } else if( ( osc_logged_user_id() == osc_item_user_id() ) && osc_logged_user_id() != 0 ) { ?>
<p>
<?php _e("Das ist ihr eigenes Inserat.", 'modern'); ?>
</p>
<?php } else if( osc_reg_user_can_contact() && !osc_is_web_user_logged_in() ) { ?>
<p>
<?php _e("Du musst Dich einloggen oder ein Konto erstellen, um den Inserenten zu kontaktieren", 'modern'); ?>
</p>
<p class="contact_button">
<strong><a href="<?php echo osc_user_login_url(); ?>"><?php _e('Einloggen', 'modern'); ?></a></strong>
<strong><a href="<?php echo osc_register_account_url(); ?>"><?php _e('Registrieren Sie sich für ein kostenloses Konto', 'modern'); ?></a></strong>
</p>
<?php } else { ?>
<?php if( osc_item_user_id() != null ) { ?>
<p class="name"><?php _e('Name', 'modern') ?>: <a href="<?php echo osc_user_public_profile_url( osc_item_user_id() ); ?>" ><?php echo osc_item_contact_name(); ?></a></p>
<?php } else { ?>
<p class="name"><?php _e('Name', 'modern') ?>: <?php echo osc_item_contact_name(); ?></p>
<?php } ?>
<?php if( osc_item_show_email() ) { ?>
<p class="email"><?php _e('E-Mail', 'modern'); ?>: <?php echo osc_item_contact_email(); ?></p>
<?php } ?>
<?php if( osc_item_city_area() ) { ?>
<p class="phone"><?php _e('Mobil', 'modern'); ?>: <?php echo osc_item_city_area(); ?></p>
<?php } ?>
<?php if ( osc_user_phone() != '' ) { ?>
<p class="phone"><?php _e("Tel", 'modern'); ?>.: <?php echo osc_user_phone(); ?></p>
<?php } ?>
<ul id="error_list"></ul>
<?php ContactForm::js_validation(); ?>
<form action="<?php echo osc_base_url(true); ?>" method="post" name="contact_form" id="contact_form">
<?php osc_prepare_user_info(); ?>
<fieldset>
<label for="yourName"><?php _e('Ihr Name', 'modern'); ?>:</label> <?php ContactForm::your_name(); ?>
<label for="yourEmail"><?php _e('Ihre E-Mail Adresse', 'modern'); ?>:</label> <?php ContactForm::your_email(); ?>
<label for="phoneNumber"><?php _e('Phone number', 'modern'); ?> (<?php _e('optional', 'modern'); ?>):</label> <?php ContactForm::your_phone_number(); ?>
<?php osc_run_hook('item_contact_form', osc_item_id()); ?>
<label for="message"><?php _e('Nachricht', 'modern'); ?>:</label> <?php ContactForm::your_message(); ?>
<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('Geben Sie den Code ein','modern'); ?>:</span>
<input type="text" id="recaptcha_response_field" name="recaptcha_response_field" />
<div><a href="javascript:Recaptcha.showhelp()"><?php _e('Hilfe', 'modern'); ?></a></div>
</div>
<?php } ?>
<?php osc_show_recaptcha(); ?>
<button type="submit"><?php _e('Senden', 'modern'); ?></button>
</fieldset>
</form>
<?php } ?>
</div>
</div>
</div>
<?php osc_current_web_theme_path('footer.php'); ?>
</body>
</html>