當前位置: 首頁>>代碼示例>>PHP>>正文


PHP osc_reg_user_can_contact函數代碼示例

本文整理匯總了PHP中osc_reg_user_can_contact函數的典型用法代碼示例。如果您正苦於以下問題:PHP osc_reg_user_can_contact函數的具體用法?PHP osc_reg_user_can_contact怎麽用?PHP osc_reg_user_can_contact使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了osc_reg_user_can_contact函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _e

                <?php 
    _e("The listing is expired. You can't contact the publisher.", 'bender');
    ?>
            </p>
        <?php 
} else {
    if (osc_logged_user_id() == osc_item_user_id() && osc_logged_user_id() != 0) {
        ?>
            <p>
                <?php 
        _e("It's your own listing, you can't contact the publisher.", 'bender');
        ?>
            </p>
        <?php 
    } else {
        if (osc_reg_user_can_contact() && !osc_is_web_user_logged_in()) {
            ?>
            <p>
                <?php 
            _e("You must log in or register a new account in order to contact the advertiser", 'bender');
            ?>
            </p>
            <p class="contact_button">
                <strong><a href="<?php 
            echo osc_user_login_url();
            ?>
"><?php 
            _e('Login', 'bender');
            ?>
</a></strong>
                <strong><a href="<?php 
開發者ID:mylastof,項目名稱:os-class,代碼行數:31,代碼來源:item-sidebar.php

示例2: doModel


//.........這裏部分代碼省略.........
             Session::newInstance()->_setForm("yourEmail", Params::getParam('yourEmail'));
             Session::newInstance()->_setForm("yourName", Params::getParam('yourName'));
             Session::newInstance()->_setForm("friendName", Params::getParam('friendName'));
             Session::newInstance()->_setForm("friendEmail", Params::getParam('friendEmail'));
             Session::newInstance()->_setForm("message_body", Params::getParam('message'));
             if (osc_recaptcha_private_key() != '' && Params::existParam("recaptcha_challenge_field")) {
                 if (!osc_check_recaptcha()) {
                     osc_add_flash_error_message(_m('The Recaptcha code is wrong'));
                     $this->redirectTo(osc_item_send_friend_url());
                     return false;
                     // BREAK THE PROCESS, THE RECAPTCHA IS WRONG
                 }
             }
             $mItem = new ItemActions(false);
             $success = $mItem->send_friend();
             if ($success) {
                 Session::newInstance()->_clearVariables();
                 $this->redirectTo(osc_item_url());
             } else {
                 $this->redirectTo(osc_item_send_friend_url());
             }
             break;
         case 'contact':
             $item = $this->itemManager->findByPrimaryKey(Params::getParam('id'));
             if (empty($item)) {
                 osc_add_flash_error_message(_m("This listing doesn't exist"));
                 $this->redirectTo(osc_base_url(true));
             } else {
                 $this->_exportVariableToView('item', $item);
                 if (osc_item_is_expired()) {
                     osc_add_flash_error_message(_m("We're sorry, but the listing has expired. You can't contact the seller"));
                     $this->redirectTo(osc_item_url());
                 }
                 if (osc_reg_user_can_contact() && osc_is_web_user_logged_in() || !osc_reg_user_can_contact()) {
                     $this->doView('item-contact.php');
                 } else {
                     osc_add_flash_error_message(_m("You can't contact the seller, only registered users can"));
                     $this->redirectTo(osc_item_url());
                 }
             }
             break;
         case 'contact_post':
             $item = $this->itemManager->findByPrimaryKey(Params::getParam('id'));
             $this->_exportVariableToView('item', $item);
             if (osc_recaptcha_private_key() != '' && Params::existParam("recaptcha_challenge_field")) {
                 if (!osc_check_recaptcha()) {
                     osc_add_flash_error_message(_m('The Recaptcha code is wrong'));
                     Session::newInstance()->_setForm("yourEmail", Params::getParam('yourEmail'));
                     Session::newInstance()->_setForm("yourName", Params::getParam('yourName'));
                     Session::newInstance()->_setForm("phoneNumber", Params::getParam('phoneNumber'));
                     Session::newInstance()->_setForm("message_body", Params::getParam('message'));
                     $this->redirectTo(osc_item_url());
                     return false;
                     // BREAK THE PROCESS, THE RECAPTCHA IS WRONG
                 }
             }
             if (osc_isExpired($item['dt_expiration'])) {
                 osc_add_flash_error_message(_m("We're sorry, but the listing has expired. You can't contact the seller"));
                 $this->redirectTo(osc_item_url());
             }
             $mItem = new ItemActions(false);
             $result = $mItem->contact();
             if (is_string($result)) {
                 osc_add_flash_error_message($result);
             } else {
                 osc_add_flash_ok_message(_m("We've just sent an e-mail to the seller"));
開發者ID:semul,項目名稱:Osclass,代碼行數:67,代碼來源:item.php

示例3: doModel


//.........這裏部分代碼省略.........
             Session::newInstance()->_setForm("yourEmail", Params::getParam('yourEmail'));
             Session::newInstance()->_setForm("yourName", Params::getParam('yourName'));
             Session::newInstance()->_setForm("friendName", Params::getParam('friendName'));
             Session::newInstance()->_setForm("friendEmail", Params::getParam('friendEmail'));
             Session::newInstance()->_setForm("message_body", Params::getParam('message'));
             if (osc_recaptcha_private_key() != '' && Params::existParam("recaptcha_challenge_field")) {
                 if (!osc_check_recaptcha()) {
                     osc_add_flash_error_message(_m('The Recaptcha code is wrong'));
                     $this->redirectTo(osc_item_send_friend_url());
                     return false;
                     // BREAK THE PROCESS, THE RECAPTCHA IS WRONG
                 }
             }
             $mItem = new ItemActions(false);
             $success = $mItem->send_friend();
             if ($success) {
                 Session::newInstance()->_clearVariables();
                 $this->redirectTo(osc_item_url());
             } else {
                 $this->redirectTo(osc_item_send_friend_url());
             }
             break;
         case 'contact':
             $item = $this->itemManager->findByPrimaryKey(Params::getParam('id'));
             if (empty($item)) {
                 osc_add_flash_error_message(_m('This item doesn\'t exist'));
                 $this->redirectTo(osc_base_url(true));
             } else {
                 $this->_exportVariableToView('item', $item);
                 if (osc_item_is_expired()) {
                     osc_add_flash_error_message(_m('We\'re sorry, but the item has expired. You can\'t contact the seller'));
                     $this->redirectTo(osc_item_url());
                 }
                 if (osc_reg_user_can_contact() && osc_is_web_user_logged_in() || !osc_reg_user_can_contact()) {
                     $this->doView('item-contact.php');
                 } else {
                     osc_add_flash_error_message(_m('You can\'t contact the seller, only registered users can'));
                     $this->redirectTo(osc_item_url());
                 }
             }
             break;
         case 'contact_post':
             $item = $this->itemManager->findByPrimaryKey(Params::getParam('id'));
             $this->_exportVariableToView('item', $item);
             if (osc_recaptcha_private_key() != '' && Params::existParam("recaptcha_challenge_field")) {
                 if (!osc_check_recaptcha()) {
                     osc_add_flash_error_message(_m('The Recaptcha code is wrong'));
                     Session::newInstance()->_setForm("yourEmail", Params::getParam('yourEmail'));
                     Session::newInstance()->_setForm("yourName", Params::getParam('yourName'));
                     Session::newInstance()->_setForm("phoneNumber", Params::getParam('phoneNumber'));
                     Session::newInstance()->_setForm("message_body", Params::getParam('message'));
                     $this->redirectTo(osc_item_url());
                     return false;
                     // BREAK THE PROCESS, THE RECAPTCHA IS WRONG
                 }
             }
             $category = Category::newInstance()->findByPrimaryKey($item['fk_i_category_id']);
             if ($category['i_expiration_days'] > 0) {
                 $item_date = strtotime($item['dt_pub_date']) + $category['i_expiration_days'] * (24 * 3600);
                 $date = time();
                 if ($item_date < $date && $item['b_premium'] != 1) {
                     // The item is expired, we can not contact the seller
                     osc_add_flash_error_message(_m('We\'re sorry, but the item has expired. You can\'t contact the seller'));
                     $this->redirectTo(osc_item_url());
                 }
             }
開發者ID:nsswaga,項目名稱:OSClass,代碼行數:67,代碼來源:item.php

示例4: _e

_e('<strong>Remember</strong> that you must configure reCAPTCHA first');
?>
</div>
                                </div>
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="form-label"> <?php 
_e('Contact publisher');
?>
</div>
                            <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');
開發者ID:mylastof,項目名稱:os-class,代碼行數:31,代碼來源:settings.php

示例5: osc_item_is_expired

<?php

$is_expired = osc_item_is_expired();
$is_user = osc_logged_user_id() != osc_item_user_id();
$is_can_contact = osc_reg_user_can_contact() && osc_is_web_user_logged_in() || !osc_reg_user_can_contact();
$is_comments_enabled = osc_comments_enabled();
$is_can_comment = osc_reg_user_post_comments() && osc_is_web_user_logged_in() || !osc_reg_user_post_comments();
?>
<!DOCTYPE html>
<html dir="ltr" lang="<?php 
echo str_replace('_', '-', osc_current_user_locale());
?>
">
    <head>
        <?php 
osc_current_web_theme_path('head.php');
?>
        <script type="text/javascript" src="<?php 
echo osc_current_web_theme_js_url('fancybox/jquery.fancybox-1.3.4.js');
?>
"></script>
        <script type="text/javascript" src="<?php 
echo osc_current_web_theme_js_url('bootstrap-modal.js');
?>
"></script>
        <link href="<?php 
echo osc_current_web_theme_js_url('fancybox/jquery.fancybox-1.3.4.css');
?>
" rel="stylesheet" type="text/css" />
        <script type="text/javascript">
            $(document).ready(function(){
開發者ID:nsswaga,項目名稱:OSClass,代碼行數:31,代碼來源:item.php


注:本文中的osc_reg_user_can_contact函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。