예제 #1
0
</div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="message"><?php 
            _e('Message', 'bender');
            ?>
:</label>
                    <div class="controls textarea"><?php 
            ContactForm::your_message();
            ?>
</div>
                </div>

                <?php 
            if (osc_item_attachment()) {
                ?>
                    <div class="control-group">
                        <label class="control-label" for="attachment"><?php 
                _e('Attachment', 'bender');
                ?>
:</label>
                        <div class="controls"><?php 
                ContactForm::your_attachment();
                ?>
</div>
                    </div>
                <?php 
            }
            ?>
예제 #2
0
파일: emails.php 프로젝트: nsswaga/OSClass
function fn_email_item_inquiry($aItem)
{
    $id = $aItem['id'];
    $yourEmail = $aItem['yourEmail'];
    $yourName = $aItem['yourName'];
    $phoneNumber = $aItem['phoneNumber'];
    $message = $aItem['message'];
    $path = NULL;
    $item = Item::newInstance()->findByPrimaryKey($id);
    View::newInstance()->_exportVariableToView('item', $item);
    $mPages = new Page();
    $aPage = $mPages->findByInternalName('email_item_inquiry');
    $locale = osc_current_user_locale();
    $content = array();
    if (isset($aPage['locale'][$locale]['s_title'])) {
        $content = $aPage['locale'][$locale];
    } else {
        $content = current($aPage['locale']);
    }
    $item_url = osc_item_url();
    $item_url = '<a href="' . $item_url . '" >' . $item_url . '</a>';
    $words = array();
    $words[] = array('{CONTACT_NAME}', '{USER_NAME}', '{USER_EMAIL}', '{USER_PHONE}', '{WEB_URL}', '{ITEM_TITLE}', '{ITEM_URL}', '{COMMENT}');
    $words[] = array($item['s_contact_name'], $yourName, $yourEmail, $phoneNumber, '<a href="' . osc_base_url() . '" >' . osc_base_url() . '</a>', $item['s_title'], $item_url, $message);
    $title = osc_mailBeauty(osc_apply_filter('email_title', osc_apply_filter('email_item_inquiry_title', $content['s_title'])), $words);
    $body = osc_mailBeauty(osc_apply_filter('email_description', osc_apply_filter('email_item_inquiry_description', $content['s_text'])), $words);
    $from = osc_contact_email();
    $from_name = osc_page_title();
    $add_bbc = '';
    if (osc_notify_contact_item()) {
        $add_bbc = osc_contact_email();
    }
    $emailParams = array('add_bcc' => $add_bbc, 'from' => $from, 'from_name' => $from_name, 'subject' => $title, 'to' => $item['s_contact_email'], 'to_name' => $item['s_contact_name'], 'body' => $body, 'alt_body' => $body, 'reply_to' => $yourEmail);
    if (osc_item_attachment()) {
        $attachment = Params::getFiles('attachment');
        $resourceName = $attachment['name'];
        $tmpName = $attachment['tmp_name'];
        $resourceType = $attachment['type'];
        $path = osc_content_path() . 'uploads/' . time() . '_' . $resourceName;
        if (!is_writable(osc_content_path() . 'uploads/')) {
            osc_add_flash_error_message(_m('There has been some errors sending the message'));
            //$this->redirectTo( osc_base_url() );
        }
        if (!move_uploaded_file($tmpName, $path)) {
            unset($path);
        }
    }
    if (isset($path)) {
        $emailParams['attachment'] = $path;
    }
    osc_sendMail($emailParams);
    @unlink($path);
}
예제 #3
0
                            <div class="form-controls">
                                <div class="form-label-checkbox">
                                    <label>
                                        <input type="checkbox" <?php 
echo osc_reg_user_can_contact() ? 'checked="checked"' : '';
?>
 name="reg_user_can_contact" value="1" />
                                        <?php 
_e('Only allow registered users to contact publisher');
?>
                                    </label>
                                </div>
                                <div class="separate-top-medium">
                                    <label>
                                        <input type="checkbox" <?php 
echo osc_item_attachment() ? 'checked="checked"' : '';
?>
 name="item_attachment" value="1" />
                                        <?php 
_e('Allow attached files in contact publisher form');
?>
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="form-label"> <?php 
_e('Notifications');
?>
</div>
                            <div class="form-controls">
예제 #4
0
                                    </td>
                                    <td>
                                        <input type="checkbox" <?php 
echo osc_reg_user_can_contact() ? 'checked="true"' : '';
?>
 name="reg_user_can_contact" value="1" />
                                        <?php 
_e('Only allow registered users to contact publisher');
?>
                                    </td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>
                                        <input type="checkbox" <?php 
echo osc_item_attachment() ? 'checked="true"' : '';
?>
 name="item_attachment" value="1" />
                                        <?php 
_e('Allow attach files in contact publisher form');
?>
                                    </td>
                                </tr>
                                <!-- /contact publisher -->
                                <!-- notifications -->
                                <tr class="separate">
                                    <td class="labeled">
                                        <?php 
_e('Notifications');
?>
                                    </td>