当前位置: 首页>>代码示例>>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;未经允许,请勿转载。