示例#1
0
 public function render()
 {
     $view = View::factory('feed/' . $this->type . '_' . $this->action)->bind('lecture', $lecture)->bind('user', $user)->bind('span', $span)->bind('role', $role)->bind('feed_id', $feed_id)->bind('comments', $comments)->bind('url', $url);
     if ($this->action == 'add') {
         $lecture = ORM::factory('lecture', $this->respective_id);
         if ($this->check_deleted($lecture)) {
             return View::factory('feed/unavaliable')->render();
         }
     } else {
         if ($this->action == 'canceled') {
             $lecture = Model_Lecture::get_lecture_from_event($this->respective_id);
             $event = ORM::factory('event', $this->respective_id);
             if ($this->check_deleted($lecture)) {
                 return View::factory('feed/unavaliable')->render();
             }
             $view->bind('event', $event);
         }
     }
     $user = ORM::factory('user', $this->actor_id);
     $span = Date::fuzzy_span($this->time);
     $feed_id = $this->id;
     $curr_user = Auth::instance()->get_user();
     $role = $curr_user->role()->name;
     $comment = ORM::factory('feedcomment');
     $comment->where('feed_id', '=', $feed_id)->order_by('date', 'DESC');
     $comments = $comment->find_all();
     $url = Url::site('profile/view/id/');
     return $view->render();
 }
示例#2
0
 public function render()
 {
     $span = Date::fuzzy_span($this->time);
     $feed_id = $this->id;
     $comment = ORM::factory('feedcomment');
     $comment->where('feed_id', '=', $feed_id)->order_by('date', 'DESC');
     $comments = $comment->find_all();
     $curr_user = Auth::instance()->get_user();
     $role = $curr_user->role()->name;
     $url = Url::site('profile/view/id/');
     if ($this->action == "publish_result") {
         $examgroup = ORM::factory('examgroup', $this->respective_id);
         if ($this->check_deleted($examgroup)) {
             return View::factory('feed/unavaliable')->render();
         }
         $percent = $examgroup->get_ExamGroupPercent();
         $user = ORM::factory('user', $this->actor_id);
         $view = View::factory('feed/' . $this->type . '_' . $this->action)->bind('user', $user)->bind('percent', $percent)->bind('id', $this->respective_id)->bind('span', $span)->bind('role', $role)->bind('feed_id', $feed_id)->bind('comments', $comments)->bind('url', $url);
     } else {
         $exam = ORM::factory('exam', $this->respective_id);
         if ($this->check_deleted($exam)) {
             return View::factory('feed/unavaliable')->render();
         }
         $user = ORM::factory('user', $this->actor_id);
         $event = ORM::factory('event', $exam->event_id);
         $view = View::factory('feed/' . $this->type . '_' . $this->action)->bind('exam', $exam)->bind('user', $user)->bind('event', $event)->bind('span', $span)->bind('role', $role)->bind('feed_id', $feed_id)->bind('comments', $comments)->bind('url', $url);
     }
     return $view->render();
 }
示例#3
0
 public function logs()
 {
     $return = array();
     if (count($this->logs) > 0) {
         foreach ($this->logs as $log) {
             $return[] = array('time' => Date::fuzzy_span($log->time), 'message' => __($log->message, array(':username' => $log->params['username'], ':item_name' => $log->params['item_name'], ':price' => $log->params['price'])));
         }
     }
     return $return;
 }
示例#4
0
 public static function process($datetime, $fuzzy = TRUE)
 {
     $format = __('DateTimeFormat');
     // default datetime format if DateTimeFormat for current language is not set:
     if ($format == 'DateTimeFormat') {
         $format = 'Y-m-d H:i:s';
     }
     if ($fuzzy) {
         return "<span class='datetimefuzzy'>" . "<span class='fuzzy'>" . __(Date::fuzzy_span(strtotime($datetime))) . "</span>" . "<span class='datetime'>" . date($format, strtotime($datetime)) . "</span>" . "</span>";
     } else {
         $date = date_create($datetime);
         return date_format($date, $format);
     }
 }
示例#5
0
文件: info.php 项目: anqh/core
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        ?>

<dl>

		<?php 
        echo $this->user->homepage ? '<dt>' . __('Homepage') . '</dt><dd>' . HTML::anchor($this->user->homepage, HTML::chars($this->user->homepage)) . '</dd>' : '';
        ?>
		<?php 
        echo $this->user->gender ? '<dt>' . __('Gender') . '</dt><dd>' . ($this->user->gender == 'm' ? __('Male') : __('Female')) . '</dd>' : '';
        ?>
		<?php 
        echo $this->user->dob ? '<dt>' . __('Date of Birth') . '</dt><dd>' . Date::format('DMYYYY', $this->user->dob) . ' (' . Date::age($this->user->dob) . ')</dd>' : '';
        ?>

		<dt><?php 
        echo __('Registered');
        ?>
</dt><dd><?php 
        echo HTML::time(Date::fuzzy_span($this->user->created), $this->user->created);
        ?>
			(<?php 
        echo __('member #:member', array(':member' => '<var>' . number_format($this->user->id) . '</var>'));
        ?>
)</dd>
		<dt><?php 
        echo __('Updated');
        ?>
</dt><dd><?php 
        echo HTML::time(Date::fuzzy_span($this->user->modified), $this->user->modified);
        ?>
</dd>
		<dt><?php 
        echo __('Last login');
        ?>
</dt><dd><?php 
        echo HTML::time(Date::fuzzy_span($this->user->last_login), $this->user->last_login);
        ?>
			(<?php 
        echo __($this->user->login_count == 1 ? ':logins login' : ':logins logins', array(':logins' => '<var>' . number_format($this->user->login_count) . '</var>'));
        ?>
)</dd>

</dl>

<?php 
        return ob_get_clean();
    }
示例#6
0
文件: hovercard.php 项目: anqh/core
 /**
  * Render view.
  *
  * @return  string
  */
 public function content()
 {
     ob_start();
     // Title
     if ($this->user['title']) {
         echo HTML::chars(trim($this->user['title'])) . '<br />';
     }
     // Image
     if ($this->user['thumb']) {
         echo '<figure>' . HTML::image($this->user['thumb'], array('width' => 160)) . '</figure>';
     }
     // Last login
     echo __('Last login: :login', array(':login' => HTML::time(Date::fuzzy_span($this->user['last_login']), $this->user['last_login'])));
     return ob_get_clean();
 }
示例#7
0
 public function render()
 {
     $span = Date::fuzzy_span($this->time);
     $flashcard = ORM::factory('flashcard', $this->respective_id);
     if ($this->check_deleted($flashcard)) {
         return View::factory('feed/unavaliable')->render();
     }
     $user = ORM::factory('user', $this->actor_id);
     $feed_id = $this->id;
     $comment = ORM::factory('feedcomment');
     $comment->where('feed_id', '=', $feed_id)->order_by('date', 'DESC');
     $comments = $comment->find_all();
     $curr_user = Auth::instance()->get_user();
     $role = $curr_user->role()->name;
     $url = Url::site('profile/view/id/');
     $view = View::factory('feed/' . $this->type . '_' . $this->action)->bind('flashcard', $flashcard)->bind('user', $user)->bind('span', $span)->bind('role', $role)->bind('feed_id', $feed_id)->bind('comments', $comments)->bind('url', $url);
     return $view->render();
 }
示例#8
0
 public function render()
 {
     $user = ORM::factory('user', $this->actor_id);
     $event = ORM::factory('event', $this->respective_id);
     if ($this->check_deleted($event)) {
         return View::factory('feed/unavaliable')->render();
     }
     $attendance = $event->get_Attendance();
     $class = 'Event_' . $event->eventtype;
     $dynamic_object = new $class($this->respective_id);
     $event_details = $dynamic_object->get_event_details();
     $span = Date::fuzzy_span($this->time);
     $feed_id = $this->id;
     $comment = ORM::factory('feedcomment');
     $comment->where('feed_id', '=', $feed_id)->order_by('date', 'DESC');
     $comments = $comment->find_all();
     $curr_user = Auth::instance()->get_user();
     $role = $curr_user->role()->name;
     $url = Url::site('profile/view/id/');
     $view = View::factory('feed/' . $this->type . '_' . $this->action)->bind('user', $user)->bind('event', $event)->bind('event_details', $event_details)->bind('attendance', $attendance)->bind('span', $span)->bind('role', $role)->bind('feed_id', $feed_id)->bind('comments', $comments)->bind('url', $url);
     return $view->render();
 }
示例#9
0
文件: index.php 项目: anqh/blog
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        if ($this->blog_entries && count($this->blog_entries)) {
            // List blog entries
            foreach ($this->blog_entries as $blog_entry) {
                /** @var  Model_Blog_Entry  $blog_entry */
                $author = $blog_entry->author();
                ?>

<article class="row blog-entry">
	<div class="span1"><?php 
                echo HTML::avatar($author['avatar'], $author['username']);
                ?>
</div>

	<div class="span7">
		<header>
			<h4><?php 
                echo HTML::anchor(Route::model($blog_entry), HTML::chars($blog_entry->name));
                ?>
</h4>
			<p><?php 
                echo __('By :user :ago', array(':user' => HTML::user($author), ':ago' => HTML::time(Date::fuzzy_span($blog_entry->created), $blog_entry->created)));
                ?>
</p>
		</header>
	</div>
</article>

<?php 
            }
        } else {
            // No blog entries available
            echo new View_Alert(__('Alas, the quill seems to be dry, no blog entries found.'), View_Alert::INFO);
        }
        return ob_get_clean();
    }
示例#10
0
 public function render()
 {
     $view = View::factory('feed/' . $this->type . '_' . $this->action)->bind('post', $post)->bind('user', $user)->bind('span', $span)->bind('role', $role)->bind('feed_id', $feed_id)->bind('comments', $comments)->bind('url', $url)->bind('link', $query)->bind('video', $query_video);
     $feed_id = $this->id;
     $post = ORM::factory('post', $this->respective_id);
     $user = ORM::factory('user', $this->actor_id);
     $curr_user = Auth::instance()->get_user();
     $role = $curr_user->role()->name;
     $span = Date::fuzzy_span($this->time);
     $comment = ORM::factory('feedcomment');
     $comment->where('feed_id', '=', $feed_id)->order_by('date', 'DESC');
     $comments = $comment->find_all();
     $url = Url::site('profile/view/id/');
     $query = "";
     if ($post->link == 'link') {
         $query = DB::select('key', 'value')->from('post_meta')->where('post_id', '=', $post->id)->execute()->as_array('key', 'value');
     }
     $query_video = "";
     if ($post->link == 'video') {
         $query_video = DB::select('key', 'value')->from('post_meta')->where('post_id', '=', $post->id)->execute()->as_array('key', 'value');
     }
     return $view->render();
 }
示例#11
0
' style='width: 40px; height: 40px;' /></a>
                                </td>
                                <td class='vatop pad5' style='width: 350px;'>
                                    <a href="<?php 
            echo $url . "/" . $comment->user_id;
            ?>
" style='font-size: 14px; font-weight: bold;'><?php 
            echo $comment_user->firstname . " " . $comment_user->lastname;
            ?>
</a>
                                    <span class='hpad10' style='font-size: 12px;'><?php 
            echo Html::chars($comment->comment);
            ?>
</span>
                                    <p class='vpad10' style='font-size: 11px; color: #777;'><?php 
            echo Date::fuzzy_span($comment->date);
            ?>
</p>
                                </td>
                                <td class="vatop w2 pad5">
                                    <?php 
            if (Acl::instance()->is_allowed('post_delete') && $role == 'Admin') {
                ?>
                                        <a onclick="delete_comment(this, <?php 
                echo $comment->id;
                ?>
);" class="del-comment" style="font-size: 11px; font-weight: bold; display: none; cursor: pointer;">X</a>
                                    <?php 
            } else {
                if (Acl::instance()->is_allowed('post_delete') && $role == 'studentmoderator' && $user->role()->name == 'Student') {
                    ?>
示例#12
0
文件: music.php 项目: anqh/anqh
 /**
  * Action: music track
  */
 public function action_track()
 {
     $track_id = (int) $this->request->param('id');
     // Load track
     $track = Model_Music_Track::factory($track_id);
     if (!$track->loaded()) {
         throw new Model_Exception($track, $track_id);
     }
     Permission::required($track, Model_Music_Track::PERMISSION_READ);
     // Build page
     $author = $track->author();
     $this->view = new View_Page($track->name);
     $this->view->tab = 'music';
     $this->view->subtitle = __('By :user :ago', array(':user' => HTML::user($track->author(), null, null, Route::url('profile_music', array('username' => urlencode($author['username'])))), ':ago' => HTML::time(Date::fuzzy_span($track->created), $track->created)));
     // Set actions
     $this->_set_page_actions(false);
     $this->view->actions[] = array('link' => Route::model($track, 'listen'), 'text' => '<i class="fa fa-play"></i> ' . __('Listen'), 'class' => 'btn btn-primary', 'target' => '_blank', 'rel' => 'nofollow');
     $this->view->tabs['music'] = array('link' => Route::model($track), 'text' => $track->type == Model_Music_Track::TYPE_MIX ? __('Mixtape') : __('Track'));
     if ($track->forum_topic_id) {
         $this->view->tabs[] = array('link' => Route::url('forum_topic', array('id' => $track->forum_topic_id)), 'text' => __('Forum') . ' &raquo;');
     }
     if (Permission::has($track, Model_Music_Track::PERMISSION_UPDATE)) {
         $this->view->actions[] = array('link' => Route::model($track, 'edit'), 'text' => '<i class="fa fa-edit"></i> ' . __('Edit'));
     }
     // Share
     Anqh::page_meta('type', $track->type == Model_Music_Track::TYPE_MIX ? 'album' : 'song');
     Anqh::page_meta('title', $track->name);
     Anqh::page_meta('url', URL::site(Route::model($track), true));
     Anqh::page_meta('description', $track->description);
     if (Valid::url($track->cover)) {
         Anqh::page_meta('image', $track->cover);
     }
     Anqh::share(true);
     // Content
     $this->view->add(View_Page::COLUMN_CENTER, $this->section_track_main($track));
     $this->view->add(View_Page::COLUMN_RIGHT, $this->section_track_info($track));
 }
示例#13
0
文件: topic.php 项目: anqh/forum
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        $offset = $this->pagination->offset;
        $previous = null;
        foreach ($this->forum_topic->posts($offset, $this->pagination->items_per_page) as $post) {
            // Ignore
            if (!Permission::has($post, Model_Forum_Post::PERMISSION_READ, self::$_user)) {
                continue;
            }
            // Time difference between posts
            $current = strtotime($post->created);
            $difference = $previous && $current - $previous > Date::YEAR ? Date::fuzzy_span($previous, $current) : false;
            if ($difference) {
                ?>

		<div class="offset1 post-old">
			<span class="label label-inverse muted">&iexcl; <?php 
                echo __('Previous post :ago', array(':ago' => $difference));
                ?>
 !</span>
		</div>

<?php 
            }
            $previous = $current;
            $post = new View_Forum_Post($post, $this->forum_topic);
            $post->nth = ++$offset;
            $post->private = $this->private;
            echo $post;
        }
        ?>

<script>
head.ready('anqh', function() {

	// Edit post
	$('section.topic').on('click', 'a.post-edit', function _editPost(e) {
		e.preventDefault();

		var href = $(this).attr('href')
		  , post = href.match(/([0-9]*)\/edit/);

		$('#post-' + post[1] + ' .ago').fadeOut();
		$.get(href, function _loaded(data) {
			$('#post-' + post[1] + ' .bubble').replaceWith(data);
		});
	});

	// Delete post
	$('a.post-delete').each(function deletePost() {
		var $action = $(this);
		$action.data('action', function addAction() {
			var post = $action.attr('href').match(/([0-9]*)\/delete/);
			if (post) {
				$('#post-' + post[1]).slideUp();
				$.get($action.attr('href'));
			}
		});
	});

	// Quote post
	$('section.topic').on('click', 'a.post-quote', function _quotePost(e) {
		e.preventDefault();

		var href    = $(this).attr('href')
		  , post    = href.match(/([0-9]*)\/quote/)
		  , $article = $(this).closest('article');

		$('#post-' + post[1] + ' .ago').fadeOut();
		$.get(href, function _loaded(data) {
			$article.after(data);

			// Scroll form to view
			var $quote = $article.next('article');
			if ($quote.offset().top + $quote.outerHeight() > $(window).scrollTop() + $(window).height()) {
				window.scrollTo(0, $quote.offset().top + $quote.outerHeight() - $(window).height() );
			}

		});
	});

	// Save post
	$('section.topic').on('submit', '.post form', function(e) {
		e.preventDefault();

		var post = $(this).closest('article');

		post.loading();
		$.post($(this).attr('action'), $(this).serialize(), function(data) {
			post.replaceWith(data);
		});
	});

	// Cancel quote
	$('section.topic').on('click', '.quote a.cancel', function cancelQuote(e) {
		e.preventDefault();

		var $quote   = $(this).closest('article')
		  , $article = $quote.prev('article');

		$quote.slideUp(null, function slided() { $quote.remove(); });
		$article.find('.ago').fadeIn();
	});

	// Cancel edit
	$('section.topic').on('click', '.post-edit a.cancel', function cancelEdit(e) {
		e.preventDefault();

		var $post = $(this).closest('article');

		if (!$post.hasClass('quote')) {
			$.get($(this).attr('href'), function loaded(data) {
				$post.replaceWith(data);
			});
		}
	});

});
</script>

	<?php 
        return ob_get_clean();
    }
示例#14
0
                            <li><?php 
    echo $exam->passing_marks;
    ?>
 Marks Passing Out of <?php 
    echo $exam->total_marks;
    ?>
 </li>
		                    <li>On <?php 
    echo date('d M Y h:i A', $exam->event->eventstart);
    ?>
</li>
							<li><span class="<?php 
    echo $exam->event->eventstart < time() + 86500 ? "upcomingAttention" : "";
    ?>
"><?php 
    echo Date::fuzzy_span($exam->event->eventstart);
    ?>
</span></li>
                        </ul>
                    </li>                    
                <?php 
}
?>
            </ul>
        </div>
        <br/><br/><br/>
        <div id="upcoming_exams">
            <div class="sectionTitle">
				<span class="l">Past Exams</span>
				<span class="rm30 r h5"><?php 
echo HTML::anchor('exammarksheet', 'View Marksheet');
示例#15
0
 /**
  * Get User Profile Info
  * @param type $data
  * @return type as Array
  */
 public static function get_profile_info($data)
 {
     try {
         $user_info = ORM::factory('UserInfo')->select('cfm_users.email', 'cfm_users.is_active', 'cfm_users.last_login', DB::expr('cfm_users.created_at AS profile_created_at'), DB::expr('cfm_users.updated_at AS profile_activated_at'), 'cfm_pre_qualification.*', DB::expr('count(cfm_client_personal_info.user_id) AS clients_count'))->join('cfm_users', 'RIGHT OUTER')->on('user_id', '=', 'cfm_users.id')->join('cfm_pre_qualification', 'RiGHT OUTER')->on('cfm_pre_qualification.user_id', '=', 'cfm_users.id')->join('cfm_client_personal_info', 'RiGHT OUTER')->on('cfm_client_personal_info.user_id', '=', 'cfm_users.id')->where('cfm_users.id', '=', $data)->find()->as_array();
         $user_info['last_login'] = Date::fuzzy_span($user_info['last_login']);
         return array('success' => true, "user_info" => $user_info);
     } catch (ErrorException $ex) {
         return array('success' => false, "message" => "Internal sever problem");
     }
 }
示例#16
0
文件: view.php 项目: jmhobbs/Sanity
<p><?php 
echo HTML::chars($item->item);
?>
</p>

<p>
	<b>Project:</b> <?php 
echo HTML::chars($item->project->name);
?>
<br/>
	<b>Created:</b> <?php 
echo Date::fuzzy_span($item->created);
?>
</p>

<ul data-role="listview" data-inset="true">
	<li><?php 
echo HTML::anchor('item/complete/' . $item->id, 'Complete', array('onclick' => 'return ( true == confirm("Complete This Item?") );'));
?>
</li>
	<li><?php 
echo HTML::anchor('item/delete/' . $item->id, 'Delete', array('onclick' => 'return ( true == confirm("Delete This Item?") );'));
?>
</li>
</ul>
示例#17
0
 /**
  * Test of Date::fuzy_span()
  *
  * @test
  * @dataProvider provider_fuzzy_span
  * @param string $expected Expected output
  * @param integer $timestamp Timestamp to use
  */
 function test_fuzzy_span($expected, $timestamp)
 {
     $this->assertSame($expected, Date::fuzzy_span($timestamp));
 }
示例#18
0
 *
 * @package    Anqh
 * @author     Antti Qvickström
 * @copyright  (c) 2010 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
?>

<?php 
if ($user->title) {
    echo HTML::chars(trim($user->title)) . '<br />';
}
?>

<?php 
if ($user->default_image->id) {
    ?>
	<?php 
    echo HTML::image($user->default_image->get_url('thumbnail')) . '<br />';
} elseif (Validate::url($user->picture)) {
    ?>
	<?php 
    echo HTML::image($user->picture, array('width' => 160)) . '<br />';
}
?>

<?php 
echo __('Last login: :login', array(':login' => HTML::time(Date::fuzzy_span($user->last_login), $user->last_login)));
?>
<br />
示例#19
0
文件: category.php 项目: nergal/2mio
    echo $this->uri($page);
    ?>
#img"><img src="<?php 
    echo $this->photo($page, '135x100') . '?' . md5(date('YmdH'));
    ?>
" alt="" width="135" height="100" /></a></div>
							<div class="text">
								<a href="<?php 
    echo $this->uri($page);
    ?>
" class="none visited"><h2 class="top"><?php 
    echo Helper::filter($page->title);
    ?>
</h2></a>
								<p class="small darkgray"><?php 
    echo Date::fuzzy_span($page->date);
    ?>
 / <?php 
    echo $this->link($page->section, NULL, array('class' => 'none'));
    ?>
</p>
								<?php 
    echo Helper::filter($page->description);
    ?>

								<div class="viewcom">
									<?php 
    if (isset($page->views_count) and isset($page->comments_count)) {
        ?>
									<?php 
        if ($page->views_count > 0) {
示例#20
0
文件: topic.php 项目: anqh/forum
/**
 * Forum topic
 *
 * @package    Forum
 * @author     Antti Qvickström
 * @copyright  (c) 2010-2011 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
foreach ($posts as $post) {
    // Ignore
    if (!Permission::has($post, Model_Forum_Post::PERMISSION_READ, $user)) {
        continue;
    }
    // Time difference between posts
    $current = strtotime($post->created);
    $difference = isset($previous) && $current - $previous > Date::YEAR ? Date::fuzzy_span($previous, $current) : false;
    if ($difference) {
        ?>

<div class="divider post-old"><?php 
        echo __('Previous post :ago', array(':ago' => $difference));
        ?>
</div>

<?php 
    }
    $previous = $current;
    echo View::factory('forum/post', array('topic' => $topic, 'post' => $post, 'number' => $first++, 'user' => $user, 'private' => isset($private) && $private));
}
?>
示例#21
0
文件: post.php 项目: anqh/forum
}
?>
				</nav>
			</header>

			<?php 
if ($post->parent_id) {
    echo __('Replying to :parent', array(':parent' => HTML::anchor(Route::get($private ? 'forum_private_post' : 'forum_post')->uri(array('topic_id' => Route::model_id($topic), 'id' => $post->parent_id)) . '#post-' . $post->parent_id, HTML::chars($post->parent()->topic()->name))));
}
?>

<?php 
echo BB::factory($post->post)->render();
?>

			<footer>
				<?php 
if ($post->modify_count > 0) {
    echo __('Edited :ago', array(':ago' => HTML::time(Date::fuzzy_span($post->modified), $post->modified)));
}
?>

				<?php 
echo $author['signature'] ? BB::factory("\n--\n" . $author['signature'])->render() : '';
?>

			</footer>
		</section>

	</article>
示例#22
0
<div class="center_side clear">
    <article class="article" itemscope itemtype="http://schema.org/Article">

        <h1 class="big_header" itemprop="name">
            <?php 
echo $article->title;
?>
        </h1>
        <div class="article_info">
            <meta itemprop="datePublished" content="<?php 
echo date(DATE_ISO8601, strtotime($article->dt_create));
?>
" />
            <time><?php 
echo Date::fuzzy_span($article->dt_create);
?>
</time>
            <div class="ava_holder">
                <div itemscope itemtype="http://schema.org/Person" itemprop="author">
                    <span class="list_user_ava">
                        <img src="<?php 
echo $article->author->photo;
?>
" alt="<?php 
echo $article->author->name;
?>
"  itemprop="image">
                    </span>
                    <meta itemprop="url" href="/user/<?php 
echo $article->user_id;
?>
示例#23
0
 public function action_comment()
 {
     $feed_id = $this->request->post('id');
     $data = $this->request->post('data');
     $comment = ORM::factory('feedcomment');
     $comment->comment = $data;
     $comment->feed_id = $feed_id;
     $comment->date = strtotime(date('d-m-Y G:i:s'));
     $comment->user_id = Auth::instance()->get_user()->id;
     $comment->save();
     $image = CacheImage::instance();
     $curr_user = Auth::instance()->get_user();
     $curr_avatar = $image->resize($curr_user->avatar, 40, 40);
     $span = Date::fuzzy_span($comment->date);
     $json = array('name' => $curr_user->firstname . " " . $curr_user->lastname, 'img' => $curr_avatar, 'text' => Html::chars($comment->comment), 'time' => $span, 'comment_id' => $comment->id);
     echo json_encode($json);
     exit;
 }
示例#24
0
    <li><b>Oficina: </b><?php 
echo $oficina;
?>
</li>
    <li><b>Nombre: </b><?php 
echo $user->nombre;
?>
</li>
    <li><b>Cargo: </b><?php 
echo $user->cargo;
?>
</li>    
    <li><b>Email: </b><?php 
echo $user->email;
?>
</li>
    <li><b>Hora de Ingreso: </b><?php 
echo Date::fuzzy_span($user->last_login);
?>
    <?php 
$fecha = Date::span($user->last_login);
echo '(<b>' . date('H:i:s d-m-Y', $user->last_login) . '</b>)';
?>
</li>
    <li>Numero de ingresos al sistema: <?php 
echo $user->logins;
?>
</li>   
</ul>

示例#25
0
文件: entries.php 项目: anqh/blog
/**
 * Blog entries
 *
 * @package    Blog
 * @author     Antti Qvickström
 * @copyright  (c) 2010-2011 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
foreach ($entries as $entry) {
    $author = $entry->author();
    ?>

<article>
	<header>
		<?php 
    echo HTML::avatar($author['avatar'], $author['username']);
    ?>
		<h4><?php 
    echo HTML::anchor(Route::model($entry), HTML::chars($entry->name), array('title' => $entry->name));
    ?>
</h4>
		<span class="details">
		<?php 
    echo __('By :user :ago', array(':user' => HTML::user($author), ':ago' => HTML::time(Date::fuzzy_span($entry->created), $entry->created)));
    ?>
		</span>
	</header>
</article>

<?php 
}
示例#26
0
文件: post.php 项目: anqh/forum
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        ?>

<div class="pull-left">

	<?php 
        if ($this->author) {
            ?>
		<?php 
            echo HTML::avatar($this->author->avatar, $this->author->username);
            ?>

		<p>
			<small><?php 
            echo __('Posts: :posts', array(':posts' => '<var>' . Num::format($this->author->post_count, 0) . '</var>'));
            ?>
</small>
		</p>
	<?php 
        } else {
            ?>
		<?php 
            echo HTML::avatar(false);
            ?>

	<?php 
        }
        ?>

</div>

<div class="arrow"></div>

<div class="media-body">
	<header<?php 
        echo $this->forum_post->id == $this->forum_topic->last_post_id ? ' id="last"' : '';
        ?>
>
		<small class="ago">
			<?php 
        echo HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('id' => Route::model_id($this->forum_post), 'topic_id' => Route::model_id($this->forum_topic))) . '#post-' . $this->forum_post->id, '#' . $this->nth, array('title' => __('Permalink')));
        ?>

			&bull;

			<?php 
        if (Permission::has($this->forum_post, Model_Forum_Post::PERMISSION_UPDATE, self::$_user)) {
            echo HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('id' => Route::model_id($this->forum_post), 'topic_id' => Route::model_id($this->forum_topic), 'action' => 'edit')), __('Edit'), array('class' => 'post-edit')) . ' &bull; ';
        }
        ?>

			<?php 
        if (Permission::has($this->forum_post, Model_Forum_Post::PERMISSION_DELETE, self::$_user)) {
            echo HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('id' => Route::model_id($this->forum_post), 'topic_id' => Route::model_id($this->forum_topic), 'action' => 'delete')) . '?token=' . Security::csrf(), __('Delete'), array('class' => 'post-delete')) . ' &bull; ';
        }
        ?>

			<?php 
        if (Permission::has($this->forum_topic, Model_Forum_Topic::PERMISSION_POST, self::$_user)) {
            echo HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('id' => Route::model_id($this->forum_post), 'topic_id' => Route::model_id($this->forum_topic), 'action' => 'quote')), __('Reply'), array('class' => 'post-quote')) . ' &bull; ';
        }
        ?>

			<?php 
        echo HTML::time(Date::short_span($this->forum_post->created, true, true), $this->forum_post->created);
        ?>
		</small>

		<?php 
        if ($this->author) {
            echo HTML::user($this->author->light_array());
            if ($this->author->title) {
                echo ' <small>&ldquo;' . HTML::chars($this->author->title) . '&rdquo;</small>';
            }
        } else {
            echo $this->forum_post->author_name;
            echo ' <small>&ldquo;' . __('Guest') . '&rdquo;</small>';
        }
        ?>
	</header>

	<?php 
        if ($this->forum_post->parent_id) {
            echo __('Replying to :parent', array(':parent' => HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('topic_id' => Route::model_id($this->forum_topic), 'id' => $this->forum_post->parent_id)) . '#post-' . $this->forum_post->parent_id, HTML::chars($this->forum_post->parent()->topic()->name))));
        }
        ?>

	<?php 
        echo BB::factory($this->forum_post->post)->render();
        ?>

	<footer>
		<?php 
        echo $this->author && $this->author->signature ? BB::factory("\n--\n" . $this->author->signature)->render() : '';
        ?>

		<?php 
        if ($this->forum_post->modify_count > 0) {
            echo '<br /><br />' . __('Edited :ago', array(':ago' => HTML::time(Date::fuzzy_span($this->forum_post->modified), $this->forum_post->modified)));
        }
        ?>
	</footer>
</div>

<?php 
        return ob_get_clean();
    }
示例#27
0
            ?>
" alt="<?php 
            echo __('Profile image');
            ?>
" height="140px"></a>
            </div>
            <div class="col-xs-12 col-sm-12 col-md-9 span6">
                <div class="row">
                    <div class="col-xs-12 col-sm-12 col-md-12 span6">
                        <ul class="meta-search list-inline">
                            <li><i class="glyphicon glyphicon-calendar"></i> <span><?php 
            echo $review->created;
            ?>
</span></li>
                            <li><i class="glyphicon glyphicon-time"></i> <span><?php 
            echo Date::fuzzy_span(Date::mysql2unix($review->created));
            ?>
</span></li>
                            <li><i class="glyphicon glyphicon-user"></i> <span><?php 
            echo $review->user->name;
            ?>
</span></li>
                        <?php 
            if ($review->rate !== NULL) {
                ?>
                    
                        <div class="rating">
                            <h1 class="rating-num"><?php 
                echo round($review->rate, 2);
                ?>
.0</h1>
示例#28
0
文件: info.php 项目: anqh/core
	<dt><?php 
echo __('Registered');
?>
</dt><dd><?php 
echo HTML::time(Date::fuzzy_span($user->created), $user->created);
?>
		(<?php 
echo __('member #:member', array(':member' => '<var>' . number_format($user->id) . '</var>'));
?>
)</dd>
	<dt><?php 
echo __('Updated');
?>
</dt><dd><?php 
echo HTML::time(Date::fuzzy_span($user->modified), $user->modified);
?>
</dd>
	<dt><?php 
echo __('Last login');
?>
</dt><dd><?php 
echo HTML::time(Date::fuzzy_span($user->last_login), $user->last_login);
?>
		(<?php 
echo __($user->login_count == 1 ? ':logins login' : ':logins logins', array(':logins' => '<var>' . number_format($user->login_count) . '</var>'));
?>
)</dd>

</dl>
示例#29
0
								<p>
									<strong><?php 
        echo __('Price');
        ?>
</strong>: <?php 
        echo i18n::money_format($message->price);
        ?>
								</p>
							<?php 
    }
    ?>
						</div>
						
					</div>
					<div class="text-right mess-date"><small><?php 
    echo Date::fuzzy_span(Date::mysql2unix($message->created));
    ?>
 - <?php 
    echo $message->created;
    ?>
</small></div>
					</div>
			</div>
		<?php 
}
?>
		
			<div>
				<form method="post" action="<?php 
echo Route::url('oc-panel', array('controller' => 'messages', 'action' => 'message', 'id' => Request::current()->param('id')));
?>
示例#30
0
						<p class="comment-author">
							<?php 
            echo $reply->user->username(true);
            ?>
						</p>
						<p>
							<?php 
            echo $reply->user->points();
            ?>
 point<?php 
            echo $talk->user->points() == 1 ? '' : 's';
            ?>
						</p>
						<p class="comment-detail">
							<?php 
            echo Date::fuzzy_span($reply->created);
            ?>
						</p>
						<div class="comment-meta">
							<div class="votes"><?php 
            echo $reply->votes();
            ?>
 liked</div>
						</div>
					<?php 
        }
        ?>
				</div>
				<div class="comment-content completearea">
					<?php 
        if (!$reply->deleted()) {