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


PHP UserHelper::isLoggedIn方法代码示例

本文整理汇总了PHP中UserHelper::isLoggedIn方法的典型用法代码示例。如果您正苦于以下问题:PHP UserHelper::isLoggedIn方法的具体用法?PHP UserHelper::isLoggedIn怎么用?PHP UserHelper::isLoggedIn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserHelper的用法示例。


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

示例1: get_profile_box

 /**
  * An ajax call to get the current logged-in-user's profile page when logged in.
  * Loaded via ajax so the front page can be cached easily
  * Loads a login box if the user is not logged in, and a profile
  *  box if they are
  */
 public function get_profile_box()
 {
     if (UserHelper::isLoggedIn()) {
         $this->load->view('global/_profile_box');
     } else {
         $this->load->view('global/_login_form');
     }
 }
开发者ID:souparno,项目名称:getsparks.org,代码行数:14,代码来源:contributors.php

示例2: rate

 /**
  * Rate a package
  */
 public function rate($package_name)
 {
     $this->load->model('spark');
     $this->load->model('rating');
     $spark = Spark::getInfo($package_name);
     if (!$spark) {
         show_404();
     }
     if ($this->input->post('rating') && UserHelper::isLoggedIn()) {
         $this->load->model('rating');
         $this->rating->rate(UserHelper::getId(), $spark->id, $this->input->post('rating'));
     } else {
         $this->error("You are not logged in, or your request was invalid");
     }
     $this->success(array('ratings' => $this->rating->getRatings($spark->id)));
 }
开发者ID:souparno,项目名称:getsparks.org,代码行数:19,代码来源:packages.php

示例3: base_url

        <td>Contributor</td>
        <td>: <a href="<?php 
echo base_url();
?>
contributors/<?php 
echo $contributor->username;
?>
/profile"><?php 
echo $contributor->username;
?>
</a></td>
    </tr>
    <tr>
        <td>Email</td>
        <td>: <?php 
echo UserHelper::isLoggedIn() ? $contributor->email : "Log in to view";
?>
</td>
    </tr>
    <tr>
        <td>Author Website</td>
        <td>: <a target="_blank" href="<?php 
echo prep_url($contributor->website);
?>
"><?php 
echo $contributor->website;
?>
</a></td>
    </tr>
    <?php 
if ($contribution->website) {
开发者ID:souparno,项目名称:getsparks.org,代码行数:31,代码来源:show.php

示例4: show

 /**
  * Show the public information page for a spark
  * @param string $package_name The package being viewed
  */
 public function show($package_name)
 {
     #UtilityHelper::tryPageCache();
     $this->load->model('spark');
     $this->load->model('rating');
     $this->load->model('contributor');
     $spark = Spark::getInfo($package_name);
     if (!$spark) {
         show_404();
     }
     $contributor = $spark->getContributor();
     if ($spark->fork_id > 0) {
         $forks = Spark::getForks($spark->fork_id);
         array_unshift($forks, Spark::getById($spark->fork_id));
     } else {
         $forks = Spark::getForks($spark->id);
     }
     // Get the stats for this Spark
     $data['stats'] = $spark->getStats($spark->id);
     $this->load->helper('google_chart');
     $data['contribution'] = $spark;
     $data['contributor'] = $contributor;
     $data['versions'] = $spark->getVersions(TRUE);
     $data['versions_unverified'] = $spark->getVersions(FALSE);
     $data['is_author'] = $contributor->id == UserHelper::getId();
     $data['current_user_rating'] = FALSE;
     $data['ratings'] = $this->rating->getRatings($spark->id);
     $data['forks'] = $forks;
     if (UserHelper::isLoggedIn()) {
         $data['current_user_rating'] = $this->rating->getUserRating(UserHelper::getId(), $spark->id);
     }
     $this->load->view('packages/show', $data);
 }
开发者ID:souparno,项目名称:getsparks.org,代码行数:37,代码来源:packages.php


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