当前位置: 首页>>代码示例>>PHP>>正文


PHP osc_logged_user_id函数代码示例

本文整理汇总了PHP中osc_logged_user_id函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_logged_user_id函数的具体用法?PHP osc_logged_user_id怎么用?PHP osc_logged_user_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了osc_logged_user_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doModel


//.........这里部分代码省略.........
                 $this->redirectTo(osc_user_login_url());
             }
             $this->redirectTo(osc_user_login_url());
             break;
         case 'resend':
             $id = Params::getParam('id');
             $email = Params::getParam('email');
             $user = User::newInstance()->findByPrimaryKey($id);
             if ($id == '' || $email == '' || !isset($user) || $user['b_active'] == 1 || $email != $user['s_email']) {
                 osc_add_flash_error_message(_m('Incorrect link'));
                 $this->redirectTo(osc_user_login_url());
             }
             if (time() - strtotime($user['dt_access_date']) > 1200) {
                 // EACH 20 MINUTES
                 if (osc_notify_new_user()) {
                     osc_run_hook('hook_email_admin_new_user', $user);
                 }
                 if (osc_user_validation_enabled()) {
                     osc_run_hook('hook_email_user_validation', $user, $user);
                 }
                 User::newInstance()->update(array('dt_access_date' => date('Y-m-d H:i:s')), array('pk_i_id' => $user['pk_i_id']));
                 osc_add_flash_ok_message(_m('Validation email re-sent'));
             } else {
                 osc_add_flash_warning_message(_m('We have just sent you an email to validate your account, you will have to wait a few minutes to resend it again'));
             }
             $this->redirectTo(osc_user_login_url());
             break;
         case 'recover':
             //form to recover the password (in this case we have the form in /gui/)
             $this->doView('user-recover.php');
             break;
         case 'recover_post':
             //post execution to recover the password
             osc_csrf_check();
             require_once LIB_PATH . 'osclass/UserActions.php';
             // e-mail is incorrect
             if (!preg_match('|^[a-z0-9\\.\\_\\+\\-]+@[a-z0-9\\.\\-]+\\.[a-z]{2,3}$|i', Params::getParam('s_email'))) {
                 osc_add_flash_error_message(_m('Invalid email address'));
                 $this->redirectTo(osc_recover_user_password_url());
             }
             $userActions = new UserActions(false);
             $success = $userActions->recover_password();
             switch ($success) {
                 case 0:
                     // recover ok
                     osc_add_flash_ok_message(_m('We have sent you an email with the instructions to reset your password'));
                     $this->redirectTo(osc_base_url());
                     break;
                 case 1:
                     // e-mail does not exist
                     osc_add_flash_error_message(_m('We were not able to identify you given the information provided'));
                     $this->redirectTo(osc_recover_user_password_url());
                     break;
                 case 2:
                     // recaptcha wrong
                     osc_add_flash_error_message(_m('The recaptcha code is wrong'));
                     $this->redirectTo(osc_recover_user_password_url());
                     break;
             }
             break;
         case 'forgot':
             //form to recover the password (in this case we have the form in /gui/)
             $user = User::newInstance()->findByIdPasswordSecret(Params::getParam('userId'), Params::getParam('code'));
             if ($user) {
                 $this->doView('user-forgot_password.php');
             } else {
                 osc_add_flash_error_message(_m('Sorry, the link is not valid'));
                 $this->redirectTo(osc_base_url());
             }
             break;
         case 'forgot_post':
             osc_csrf_check();
             if (Params::getParam('new_password', false, false) == '' || Params::getParam('new_password2', false, false) == '') {
                 osc_add_flash_warning_message(_m('Password cannot be blank'));
                 $this->redirectTo(osc_forgot_user_password_confirm_url(Params::getParam('userId'), Params::getParam('code')));
             }
             $user = User::newInstance()->findByIdPasswordSecret(Params::getParam('userId'), Params::getParam('code'));
             if ($user['b_enabled'] == 1) {
                 if (Params::getParam('new_password', false, false) == Params::getParam('new_password2', false, false)) {
                     User::newInstance()->update(array('s_pass_code' => osc_genRandomPassword(50), 's_pass_date' => date('Y-m-d H:i:s', 0), 's_pass_ip' => Params::getServerParam('REMOTE_ADDR'), 's_password' => osc_hash_password(Params::getParam('new_password', false, false))), array('pk_i_id' => $user['pk_i_id']));
                     osc_add_flash_ok_message(_m('The password has been changed'));
                     $this->redirectTo(osc_user_login_url());
                 } else {
                     osc_add_flash_error_message(_m("Error, the password don't match"));
                     $this->redirectTo(osc_forgot_user_password_confirm_url(Params::getParam('userId'), Params::getParam('code')));
                 }
             } else {
                 osc_add_flash_error_message(_m('Sorry, the link is not valid'));
             }
             $this->redirectTo(osc_base_url());
             break;
         default:
             //login
             Session::newInstance()->_setReferer(osc_get_http_referer());
             if (osc_logged_user_id() != '') {
                 $this->redirectTo(osc_user_dashboard_url());
             }
             $this->doView('user-login.php');
     }
 }
开发者ID:oanav,项目名称:closetshare,代码行数:101,代码来源:login.php

示例2: item_success_item_validate

function item_success_item_validate()
{
    if (Params::getParam('page') == 'item' && Params::getParam('action') == 'activate') {
        $secret = Params::getParam('secret');
        $id = Params::getParam('id');
        $item = Item::newInstance()->listWhere("i.pk_i_id = '%s' AND ((i.s_secret = '%s') OR (i.fk_i_user_id = '%d'))", addslashes($id), addslashes($secret), addslashes(osc_logged_user_id()));
        // item doesn't exist
        if (count($item) == 0) {
            Rewrite::newInstance()->set_location('error');
            header('HTTP/1.1 404 Not Found');
            osc_current_web_theme_path('404.php');
            exit;
        }
        View::newInstance()->_exportVariableToView('item', $item[0]);
        if ($item[0]['b_active'] == 0) {
            // ACTIVETE ITEM
            $mItems = new ItemActions(false);
            $success = $mItems->activate($item[0]['pk_i_id'], $item[0]['s_secret']);
            if ($success) {
                osc_add_flash_ok_message(_m('The listing has been validated'));
                item_success_redirect(Item::newInstance()->findByPrimaryKey($item[0]['pk_i_id']));
                exit;
            } else {
                osc_add_flash_error_message(_m("The listing can't be validated"));
            }
        } else {
            osc_add_flash_warning_message(_m('The listing has already been validated'));
        }
        osc_redirect_to(osc_item_url());
    }
}
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:index.php

示例3: osc_deleteResource

/**
 * Remove resources from disk
 * @param <type> $id
 * @param boolean $admin
 * @return boolean
 */
function osc_deleteResource($id, $admin)
{
    if (defined('DEMO')) {
        return false;
    }
    if (is_array($id)) {
        $id = $id[0];
    }
    $resource = ItemResource::newInstance()->findByPrimaryKey($id);
    if (!is_null($resource)) {
        Log::newInstance()->insertLog('item', 'delete resource', $resource['pk_i_id'], $id, $admin ? 'admin' : 'user', $admin ? osc_logged_admin_id() : osc_logged_user_id());
        $backtracel = '';
        foreach (debug_backtrace() as $k => $v) {
            if ($v['function'] == "include" || $v['function'] == "include_once" || $v['function'] == "require_once" || $v['function'] == "require") {
                $backtracel .= "#" . $k . " " . $v['function'] . "(" . $v['args'][0] . ") called@ [" . $v['file'] . ":" . $v['line'] . "] / ";
            } else {
                $backtracel .= "#" . $k . " " . $v['function'] . " called@ [" . $v['file'] . ":" . $v['line'] . "] / ";
            }
        }
        Log::newInstance()->insertLog('item', 'delete resource backtrace', $resource['pk_i_id'], $backtracel, $admin ? 'admin' : 'user', $admin ? osc_logged_admin_id() : osc_logged_user_id());
        @unlink(osc_base_path() . $resource['s_path'] . $resource['pk_i_id'] . "." . $resource['s_extension']);
        @unlink(osc_base_path() . $resource['s_path'] . $resource['pk_i_id'] . "_original." . $resource['s_extension']);
        @unlink(osc_base_path() . $resource['s_path'] . $resource['pk_i_id'] . "_thumbnail." . $resource['s_extension']);
        @unlink(osc_base_path() . $resource['s_path'] . $resource['pk_i_id'] . "_preview." . $resource['s_extension']);
        osc_run_hook('delete_resource', $resource);
    }
}
开发者ID:naneri,项目名称:Osclass,代码行数:33,代码来源:utils.php

示例4: watchlist_exists

function watchlist_exists($id)
{
    $conn = getConnection();
    $detail = $conn->osc_dbFetchResult("SELECT * FROM %st_item_watchlist WHERE fk_i_item_id = %d and fk_i_user_id = %d", DB_TABLE_PREFIX, $id, osc_logged_user_id());
    //If nothing returned then we can process
    if (isset($detail['fk_i_item_id'])) {
        return true;
    }
    return false;
}
开发者ID:oanav,项目名称:closetshare,代码行数:10,代码来源:index.php

示例5: __construct

 function __construct()
 {
     parent::__construct();
     $this->itemManager = Item::newInstance();
     // here allways userId == ''
     if (osc_is_web_user_logged_in()) {
         $this->userId = osc_logged_user_id();
         $this->user = User::newInstance()->findByPrimaryKey($this->userId);
     } else {
         $this->userId = null;
         $this->user = null;
     }
 }
开发者ID:semul,项目名称:Osclass,代码行数:13,代码来源:item.php

示例6: voting_item_detail_user

/**
 * Show form to vote a seller if item belongs to a registered user. (itemDetail)
 *
 * @param type $item item array or userId
 */
function voting_item_detail_user($item = null)
{
    $userId = null;
    if ($item == null) {
        $userId = osc_item_user_id();
    } else {
        if (is_numeric($item)) {
            $userId = $item;
        } else {
            if (is_array($item)) {
                $userId = $item['fk_i_user_id'];
            } else {
                exit;
            }
        }
    }
    if (osc_get_preference('user_voting', 'voting') == 1 && is_numeric($userId) && isset($userId) && $userId > 0) {
        // obtener el avg de las votaciones
        $aux_vote = ModelVoting::newInstance()->getUserAvgRating($userId);
        $aux_count = ModelVoting::newInstance()->getUserNumberOfVotes($userId);
        $vote['vote'] = $aux_vote['vote'];
        $vote['total'] = $aux_count['total'];
        $vote['userId'] = $userId;
        $vote['can_vote'] = false;
        if (osc_is_web_user_logged_in() && can_vote_user($userId, osc_logged_user_id())) {
            $vote['can_vote'] = true;
        }
        require 'item_detail_user.php';
    }
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:35,代码来源:index.php

示例7: prepareData

        /**
         * Return an array with all data necessary for do the action (ADD OR EDIT)
         * @param <type> $is_add
         * @return array
         */
        public function prepareData( $is_add )
        {
            $aItem = array();
            $data = array();

            $userId = null;
            if( $this->is_admin ) {
                // user
                $data   = User::newInstance()->findByEmail(Params::getParam('contactEmail'));
                if( isset($data['pk_i_id']) && is_numeric($data['pk_i_id']) ) {
                    $userId = $data['pk_i_id'];
                }
            } else {
                $userId = Session::newInstance()->_get('userId');
                if( $userId == '' ) {
                    $userId = NULL;
                } elseif ($userId != NULL) {
                    $data   = User::newInstance()->findByPrimaryKey( $userId );
                }
            }

            if( $userId != null ) {
                $aItem['contactName']   = $data['s_name'];
                $aItem['contactEmail']  = $data['s_email'];
                Params::setParam('contactName', $data['s_name']);
                Params::setParam('contactEmail', $data['s_email']);
            } else {
                $aItem['contactName']   = Params::getParam('contactName');
                $aItem['contactEmail']  = Params::getParam('contactEmail');
            }
            $aItem['userId']        = $userId;

            if( $is_add ) {   // ADD
                if($this->is_admin) {
                    $active = 'ACTIVE';
                } else {
                    if(osc_moderate_items()>0) { // HAS TO VALIDATE
                        if(!osc_is_web_user_logged_in()) { // NO USER IS LOGGED, VALIDATE
                            $active = 'INACTIVE';
                        } else { // USER IS LOGGED
                            if(osc_logged_user_item_validation()) { //USER IS LOGGED, BUT NO NEED TO VALIDATE
                                $active = 'ACTIVE';
                            } else { // USER IS LOGGED, NEED TO VALIDATE, CHECK NUMBER OF PREVIOUS ITEMS
                                $user = User::newInstance()->findByPrimaryKey(osc_logged_user_id());
                                if($user['i_items']<osc_moderate_items()) {
                                    $active = 'INACTIVE';
                                } else {
                                    $active = 'ACTIVE';
                                }
                            }
                        }
                    } else if(osc_moderate_items()==0 ){
                        if(osc_is_web_user_logged_in() && osc_logged_user_item_validation() ) {
                            $active = 'ACTIVE';
                        } else {
                            $active = 'INACTIVE';
                        }
                    } else {
                        $active = 'ACTIVE';
                    }
                }
                $aItem['active']        = $active;
            } else {          // EDIT
                $aItem['secret']    = Params::getParam('secret');
                $aItem['idItem']    = Params::getParam('id');
            }

            // get params
            $aItem['catId']         = Params::getParam('catId');
            $aItem['countryId']     = Params::getParam('countryId');
            $aItem['country']       = Params::getParam('country');
            $aItem['region']        = Params::getParam('region');
            $aItem['regionId']      = Params::getParam('regionId');
            $aItem['city']          = Params::getParam('city');
            $aItem['cityId']        = Params::getParam('cityId');
            $aItem['price']         = (Params::getParam('price') != '') ? Params::getParam('price') : null;
            $aItem['cityArea']      = Params::getParam('cityArea');
            $aItem['address']       = Params::getParam('address');
            $aItem['currency']      = Params::getParam('currency');
            $aItem['showEmail']     = (Params::getParam('showEmail') != '') ? 1 : 0;
            $aItem['title']         = Params::getParam('title');
            $aItem['description']   = Params::getParam('description');
            $aItem['photos']        = Params::getFiles('photos');
            $ajax_photos            = Params::getParam('ajax_photos');
            $aItem['s_ip']          = get_ip();
            $aItem['d_coord_lat']   = (Params::getParam('d_coord_lat')  != '') ? Params::getParam('d_coord_lat') : null;
            $aItem['d_coord_long']  = (Params::getParam('d_coord_long') != '') ? Params::getParam('d_coord_long') : null;
            $aItem['s_zip']         = (Params::getParam('zip')  != '') ? Params::getParam('zip') : null;

            // $ajax_photos is an array of filenames of the photos uploaded by ajax to a temporary folder
            // fake insert them into the array of the form-uploaded photos
            if(is_array($ajax_photos)) {
                foreach($ajax_photos as $photo) {
                    if(file_exists(osc_content_path().'uploads/temp/'.$photo)) {
                        $aItem['photos']['name'][]      = $photo;
//.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:101,代码来源:ItemActions.php

示例8: prepareData

 /**
  * Return an array with all data necessary for do the action (ADD OR EDIT)
  * @param <type> $is_add
  * @return array
  */
 public function prepareData($is_add)
 {
     $aItem = array();
     // prepare user
     $userId = null;
     if ($this->is_admin) {
         if (Params::getParam('userId') != '') {
             $userId = Params::getParam('userId');
         }
     } else {
         $userId = Session::newInstance()->_get('userId');
         if ($userId == '') {
             $userId = NULL;
         }
     }
     if ($is_add) {
         // ADD
         if ($this->is_admin) {
             $active = 'ACTIVE';
         } else {
             if (osc_moderate_items() > 0) {
                 // HAS TO VALIDATE
                 if (!osc_is_web_user_logged_in()) {
                     // NO USER IS LOGGED, VALIDATE
                     $active = 'INACTIVE';
                 } else {
                     // USER IS LOGGED
                     if (osc_logged_user_item_validation()) {
                         //USER IS LOGGED, BUT NO NEED TO VALIDATE
                         $active = 'ACTIVE';
                     } else {
                         // USER IS LOGGED, NEED TO VALIDATE, CHECK NUMBER OF PREVIOUS ITEMS
                         $user = User::newInstance()->findByPrimaryKey(osc_logged_user_id());
                         if ($user['i_items'] < osc_moderate_items()) {
                             $active = 'INACTIVE';
                         } else {
                             $active = 'ACTIVE';
                         }
                     }
                 }
             } else {
                 if (osc_moderate_items() == 0) {
                     if (osc_is_web_user_logged_in() && osc_logged_user_item_validation()) {
                         $active = 'ACTIVE';
                     } else {
                         $active = 'INACTIVE';
                     }
                 } else {
                     $active = 'ACTIVE';
                 }
             }
         }
         if ($userId != null) {
             $data = User::newInstance()->findByPrimaryKey($userId);
             $aItem['contactName'] = $data['s_name'];
             $aItem['contactEmail'] = $data['s_email'];
             Params::setParam('contactName', $data['s_name']);
             Params::setParam('contactEmail', $data['s_email']);
         } else {
             $aItem['contactName'] = Params::getParam('contactName');
             $aItem['contactEmail'] = Params::getParam('contactEmail');
         }
         $aItem['active'] = $active;
         $aItem['userId'] = $userId;
     } else {
         // EDIT
         $aItem['secret'] = Params::getParam('secret');
         $aItem['idItem'] = Params::getParam('id');
         if ($userId != null) {
             $data = User::newInstance()->findByPrimaryKey($userId);
             $aItem['contactName'] = $data['s_name'];
             $aItem['contactEmail'] = $data['s_email'];
             Params::setParam('contactName', $data['s_name']);
             Params::setParam('contactEmail', $data['s_email']);
         } else {
             $aItem['contactName'] = Params::getParam('contactName');
             $aItem['contactEmail'] = Params::getParam('contactEmail');
         }
         $aItem['userId'] = $userId;
     }
     // get params
     $aItem['catId'] = Params::getParam('catId');
     $aItem['countryId'] = Params::getParam('countryId');
     $aItem['country'] = Params::getParam('country');
     $aItem['region'] = Params::getParam('region');
     $aItem['regionId'] = Params::getParam('regionId');
     $aItem['city'] = Params::getParam('city');
     $aItem['cityId'] = Params::getParam('cityId');
     $aItem['price'] = Params::getParam('price') != '' ? Params::getParam('price') : null;
     $aItem['cityArea'] = Params::getParam('cityArea');
     $aItem['address'] = Params::getParam('address');
     $aItem['currency'] = Params::getParam('currency');
     $aItem['showEmail'] = Params::getParam('showEmail') != '' ? 1 : 0;
     $aItem['title'] = Params::getParam('title');
     $aItem['description'] = Params::getParam('description');
//.........这里部分代码省略.........
开发者ID:ranjithinnergys,项目名称:OSClass,代码行数:101,代码来源:ItemActions.php

示例9: doModel


//.........这里部分代码省略.........
             } else {
                 if ($logged == 1) {
                     osc_add_flash_error_message(_m('The user has not been validated yet'));
                 } else {
                     if ($logged == 2) {
                         osc_add_flash_error_message(_m('The user has been suspended'));
                     } else {
                         if ($logged == 3) {
                             if (Params::getParam('remember') == 1) {
                                 //this include contains de osc_genRandomPassword function
                                 require_once osc_lib_path() . 'osclass/helpers/hSecurity.php';
                                 $secret = osc_genRandomPassword();
                                 User::newInstance()->update(array('s_secret' => $secret), array('pk_i_id' => $user['pk_i_id']));
                                 Cookie::newInstance()->set_expires(osc_time_cookie());
                                 Cookie::newInstance()->push('oc_userId', $user['pk_i_id']);
                                 Cookie::newInstance()->push('oc_userSecret', $secret);
                                 Cookie::newInstance()->set();
                             }
                             $this->redirectTo($url_redirect);
                         } else {
                             osc_add_flash_error_message(_m('This should never happens'));
                         }
                     }
                 }
             }
             if (!$user['b_enabled']) {
                 $this->redirectTo(osc_user_login_url());
             }
             $this->redirectTo(osc_user_login_url());
             break;
         case 'recover':
             //form to recover the password (in this case we have the form in /gui/)
             $this->doView('user-recover.php');
             break;
         case 'recover_post':
             //post execution to recover the password
             require_once LIB_PATH . 'osclass/UserActions.php';
             // e-mail is incorrect
             if (!preg_match('|^[a-z0-9\\.\\_\\+\\-]+@[a-z0-9\\.\\-]+\\.[a-z]{2,3}$|i', Params::getParam('s_email'))) {
                 osc_add_flash_error_message(_m('Invalid email address'));
                 $this->redirectTo(osc_recover_user_password_url());
             }
             $userActions = new UserActions(false);
             $success = $userActions->recover_password();
             switch ($success) {
                 case 0:
                     // recover ok
                     osc_add_flash_ok_message(_m('We have sent you an email with the instructions to reset your password'));
                     $this->redirectTo(osc_base_url());
                     break;
                 case 1:
                     // e-mail does not exist
                     osc_add_flash_error_message(_m('We were not able to identify you given the information provided'));
                     $this->redirectTo(osc_recover_user_password_url());
                     break;
                 case 2:
                     // recaptcha wrong
                     osc_add_flash_error_message(_m('The recaptcha code is wrong'));
                     $this->redirectTo(osc_recover_user_password_url());
                     break;
             }
             break;
         case 'forgot':
             //form to recover the password (in this case we have the form in /gui/)
             $user = User::newInstance()->findByIdPasswordSecret(Params::getParam('userId'), Params::getParam('code'));
             if ($user) {
                 $this->doView('user-forgot_password.php');
             } else {
                 osc_add_flash_error_message(_m('Sorry, the link is not valid'));
                 $this->redirectTo(osc_base_url());
             }
             break;
         case 'forgot_post':
             if (Params::getParam('new_password') == '' || Params::getParam('new_password2') == '') {
                 osc_add_flash_warning_message(_m('Password cannot be blank'));
                 $this->redirectTo(osc_forgot_user_password_confirm_url(Params::getParam('userId'), Params::getParam('code')));
             }
             $user = User::newInstance()->findByIdPasswordSecret(Params::getParam('userId'), Params::getParam('code'));
             if ($user['b_enabled'] == 1) {
                 if (Params::getParam('new_password') == Params::getParam('new_password2')) {
                     User::newInstance()->update(array('s_pass_code' => osc_genRandomPassword(50), 's_pass_date' => date('Y-m-d H:i:s', 0), 's_pass_ip' => $_SERVER['REMOTE_ADDR'], 's_password' => sha1(Params::getParam('new_password'))), array('pk_i_id' => $user['pk_i_id']));
                     osc_add_flash_ok_message(_m('The password has been changed'));
                     $this->redirectTo(osc_user_login_url());
                 } else {
                     osc_add_flash_error_message(_m('Error, the password don\'t match'));
                     $this->redirectTo(osc_forgot_user_password_confirm_url(Params::getParam('userId'), Params::getParam('code')));
                 }
             } else {
                 osc_add_flash_error_message(_m('Sorry, the link is not valid'));
             }
             $this->redirectTo(osc_base_url());
             break;
         default:
             //login
             if (osc_logged_user_id() != '') {
                 $this->redirectTo(osc_user_dashboard_url());
             }
             $this->doView('user-login.php');
     }
 }
开发者ID:acharei,项目名称:OSClass,代码行数:101,代码来源:login.php

示例10: osc_current_web_theme_url

    $user_picture_url = osc_current_web_theme_url('images/user_default.gif');
}
?>
        <div class="user-avatar">
            <img  src="<?php 
echo $user_picture_url;
?>
" width="50" height="50" />
         </div>
            <div >
                <span class="name"><?php 
echo osc_logged_user_name();
?>
</span>
                <a href="<?php 
echo osc_user_public_profile_url(osc_logged_user_id());
?>
"><?php 
_e('Public profile', 'pop');
?>
</a>
            </div>
        </div>
       <div class="user-menu box">
    <?php 
echo osc_private_user_menu(get_user_menu());
?>
           </div>
</div>
</div>
<div id="dialog-delete-account" title="<?php 
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:user-sidebar.php

示例11:

            if (can_vote($itemId, $userId, $hash)) {
                ModelVoting::newInstance()->insertItemVote($itemId, $userId, $iVote, $hash);
            }
        } else {
            if ($user == 1 && is_null($hash)) {
                if (can_vote($itemId, $userId, $hash)) {
                    ModelVoting::newInstance()->insertItemVote($itemId, $userId, $iVote, $hash);
                }
            }
        }
    }
    // return updated voting
    $item = Item::newInstance()->findByPrimaryKey($itemId);
    View::newInstance()->_exportVariableToView('item', $item);
    if (osc_is_this_category('voting', osc_item_category_id())) {
        $aux_vote = ModelVoting::newInstance()->getItemAvgRating(osc_item_id());
        $aux_count = ModelVoting::newInstance()->getItemNumberOfVotes(osc_item_id());
        $vote['vote'] = $aux_vote['vote'];
        $vote['total'] = $aux_count['total'];
        $vote['can_vote'] = true;
        if (osc_get_preference('user', 'voting') == 1) {
            if (!osc_is_web_user_logged_in()) {
                $vote['can_vote'] = false;
            }
        }
        if (!can_vote(osc_item_id(), osc_logged_user_id(), $hash)) {
            $vote['can_vote'] = false;
        }
        require 'view_votes.php';
    }
}
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:ajax.php

示例12: _e

                                    </div>
                                </form>
                            </div>
</div>
                      </div>
                      <div class="tab-pane" id="deleteprofile">
                      	<div class="delete-profile">
                            <p><?php 
_e('Are you sure you want to delete your account?', 'flatter');
?>
</p>
                            <a class="btn btn-danger" onclick="javascript:return confirm('<?php 
echo osc_esc_js(__('Are you sure you want to continue?', 'flatter'));
?>
')" href="<?php 
echo osc_base_url() . '?page=user&action=delete&id=' . osc_logged_user_id() . '&secret=' . osc_user_field("s_secret");
?>
" class="opt_delete_account"><?php 
_e('Delete', 'flatter');
?>
</a>
                        </div>
                      </div>
                    </div>
                	
                </div>
            </div>
            
            <div class="col-sm-3 visible-xs" style="margin-top:15px;">
            	<?php 
osc_run_hook('before-main');
开发者ID:abhi143u11,项目名称:ads,代码行数:31,代码来源:user-change_email.php

示例13: payment_pro_cart_get

<?php

require_once PAYMENT_PRO_PATH . 'CheckoutDataTable.php';
$products = payment_pro_cart_get();
$extra = array('user' => osc_logged_user_id(), 'email' => osc_logged_user_email());
$checkoutDataTable = new CheckoutDataTable();
$checkoutDataTable->table($products);
$aData = $checkoutDataTable->getData();
$aRawRows = $checkoutDataTable->rawRows();
$columns = $aData['aColumns'];
$rows = $aData['aRows'];
?>
<style type="text/css">
    .payments-ul {
        list-style-type:none;
    }
    .payments-ul li
    {
        display: inline-block;
    }
    .payments-preview {
        float:left;
        width: 40%;
    }
    .payments-options {
        float:left;
        width: 60%;
    }
    table.table {
        width: 100%;
        max-width: 100%;
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:31,代码来源:checkout.php

示例14: getConnection

<?php

if (Params::getParam('id') != '') {
    $id = Params::getParam('id');
    if (osc_is_web_user_logged_in()) {
        //check if the item is not already in the watchlist
        $conn = getConnection();
        $detail = $conn->osc_dbFetchResult("SELECT * FROM %st_item_watchlist WHERE fk_i_item_id = %d and fk_i_user_id = %d", DB_TABLE_PREFIX, $id, osc_logged_user_id());
        //If nothing returned then we can process
        if (!isset($detail['fk_i_item_id'])) {
            $conn = getConnection();
            $conn->osc_dbExec("INSERT INTO %st_item_watchlist (fk_i_item_id, fk_i_user_id) VALUES (%d, '%d')", DB_TABLE_PREFIX, $id, osc_logged_user_id());
            $title = __('Remove from watchlist', 'watchlist');
            echo '<a class="watchlist full" id="' . $id . '"><span title="' . $title . '"></span>' . $title . '</a>';
        } else {
            // remove from watchlist
            $conn = getConnection();
            $conn->osc_dbExec("DELETE FROM %st_item_watchlist WHERE fk_i_item_id = '%d'", DB_TABLE_PREFIX, $id);
            $title = __('Add to watchlist', 'watchlist');
            echo '<a class="watchlist empty" id="' . $id . '"><span title="' . $title . '"></span>' . $title . '</a>';
        }
    } else {
        //error user is not login in
        //echo '<a href="' . osc_user_login_url() . '">' . __('Please login', 'watchlist') . '</a>';
    }
}
开发者ID:oanav,项目名称:closetshare,代码行数:26,代码来源:ajax_watchlist.php

示例15:

                            </a>
                            <?php 
        }
        ?>
                        </div>
                        <?php 
    }
    ?>
                    <?php 
}
?>
                    <?php 
if (!osc_item_is_expired()) {
    ?>
                    <?php 
    if (osc_logged_user_id() != osc_item_user_id()) {
        ?>
                    <?php 
        if (osc_reg_user_can_contact() && osc_is_web_user_logged_in() || !osc_reg_user_can_contact()) {
            ?>
                    <div id="contact">
                        <h2><?php 
            _e("Contact publisher", 'modern');
            ?>
</h2>
                        <p class="name"><?php 
            _e('Name', 'modern');
            ?>
: <?php 
            echo osc_item_contact_name();
            ?>
开发者ID:nsswaga,项目名称:OSClass,代码行数:31,代码来源:item.php


注:本文中的osc_logged_user_id函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。