コード例 #1
0
ファイル: user.php プロジェクト: nathan-osman/Stack-Mobile
 public static function GenerateUserList($site_prefix, $response, $paginate = FALSE)
 {
     $users_html = array();
     // IF total > 30 then we display page numbers
     if ($paginate && $response->Total(TRUE) > 30) {
         $users_html[] = Page::GeneratePageNumbers(ceil($response->Total() / 30));
     }
     while ($user = $response->Fetch(FALSE)) {
         // Get the user's location
         $user['location'] = ViewUtils::GetIndexValue($user, 'location');
         // Generate the URL of their profile
         $profile_url = "{$site_prefix}/users/{$user['user_id']}";
         $users_html[] = '<li><span class="ui-li-count">' . Number::FormatUnit($user['reputation']) . "</span><a href='{$profile_url}'><img src='{$user['profile_image']}&s=16' class='site-icon ui-li-icon' />" . self::GenerateUsername($user) . "<p>{$user['location']}</p></a></li>";
     }
     if (count($users_html)) {
         return implode('', $users_html);
     } else {
         return '<li><span class="unknown">[empty]</span></li>';
     }
 }
コード例 #2
0
ファイル: User.php プロジェクト: RobertDuy/vnup
 private function sendmail($email, $type, $data = array())
 {
     $subject = '';
     $messageBody = '';
     if ($type == 'WELCOME') {
         $subject = 'WELCOME TO VNUP';
         $filePath = config_item('root_dir') . 'c/application/views/themes/default/template/email/welcome.tpl';
         $messageBody = ViewUtils::loadTemplate($filePath, $data);
     } else {
         if ($type == 'ACTIVATE') {
             $subject = 'Thank you for signup VNUP';
             $filePath = config_item('root_dir') . 'c/application/views/themes/default/template/email/activate.tpl';
             $messageBody = ViewUtils::loadTemplate($filePath, $data);
         }
     }
     $this->email->to($email);
     $this->email->subject($subject);
     $this->email->message($messageBody);
     $this->email->send();
 }