示例#1
0
文件: list.php 项目: anqh/forum
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        if (!$this->topics) {
            return '';
        }
        ob_start();
        ?>

<ul class="unstyled">

		<?php 
        foreach ($this->topics as $topic) {
            ?>
		<li>
			<small class="ago"><?php 
            echo HTML::time(Date::short_span($topic->last_posted, true), $topic->last_posted);
            ?>
</small>
			<?php 
            echo HTML::anchor(Route::model($topic), '<i class="muted iconic-upload"></i>', array('title' => __('First post')));
            ?>
			<?php 
            echo HTML::anchor(Route::model($topic, '?page=last#last'), HTML::chars($topic->name), array('title' => $topic->name));
            ?>
		</li>
		<?php 
        }
        ?>

</ul>

<?php 
        return ob_get_clean();
    }
示例#2
0
文件: hovercard.php 项目: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        // Title
        if ($this->area->description) {
            echo $this->area->description . '<hr>';
        }
        if ($this->area->topic_count) {
            // Area has topics
            $last_topic = $this->area->last_topic();
            $last_poster = $last_topic->last_post()->author();
            ?>

		<div class="media">
			<div class="pull-left">
				<?php 
            echo HTML::avatar($last_poster ? $last_poster['avatar'] : null, $last_poster ? $last_poster['username'] : null, false);
            ?>
			</div>
			<div class="media-body">
				<small class="ago"><?php 
            echo HTML::time(Date::short_span($last_topic->last_posted, true, true), $last_topic->last_posted);
            ?>
</small>
				<?php 
            echo $last_poster ? HTML::user($last_poster) : HTML::chars($last_topic->last_poster);
            ?>
				<br>
				<?php 
            echo HTML::anchor(Route::model($last_topic, '?page=last#last'), Forum::topic($last_topic), array('title' => HTML::chars($last_topic->name)));
            ?>
<br />
			</div>
		</div>

		<small class="stats muted">
			<i class="icon-comments"></i> <?php 
            echo Num::format($this->area->topic_count, 0);
            ?>
			<i class="icon-comment"></i> <?php 
            echo Num::format($this->area->post_count, 0);
            ?>
		</small>

<?php 
        } else {
            // Empty area
            echo __('No topics yet.');
        }
        return ob_get_clean();
    }
示例#3
0
文件: newsfeed.php 项目: anqh/anqh
    /**
     * Render newsfeed.
     *
     * @return  string
     */
    public function content()
    {
        if ($items = $this->_items()) {
            ob_start();
            ?>

<ul class="media-list">

	<?php 
            foreach ($items as $item) {
                ?>
	<li class="media">
		<div class="pull-left">
			<?php 
                echo HTML::avatar($item['user']['avatar'], $item['user']['username'], $this->mini);
                ?>
		</div>
		<div class="media-body">
			<?php 
                echo HTML::user($item['user']);
                ?>
 <small class="pull-right"><?php 
                echo HTML::time(Date::short_span($item['stamp'], true, true), $item['stamp']);
                ?>
</small>
			<?php 
                echo $item['text'];
                ?>
		</div>
	</li>
	<?php 
            }
            ?>

</ul>

<?php 
            return ob_get_clean();
        }
        return __('Whoa, we are totally out of news items for you!');
    }
示例#4
0
文件: friends.php 项目: anqh/core
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        $friends = array();
        foreach ($this->user->find_friends() as $friend_id) {
            $friend = Model_User::find_user_light($friend_id);
            $friends[$friend['username']] = $friend;
        }
        ksort($friends, SORT_LOCALE_STRING);
        ?>

<ul class="unstyled">
	<?php 
        foreach ($friends as $friend) {
            ?>

	<li class="row-fluid">
		<?php 
            echo HTML::avatar($friend['avatar'], $friend['username']);
            ?>
		<?php 
            echo HTML::user($friend);
            ?>
		<?php 
            if ($friend['last_login']) {
                echo '<small class="ago">' . HTML::time(Date::short_span($friend['last_login'], true, true), $friend['last_login']) . '</small>';
            }
            ?>
	</li>
	<?php 
        }
        ?>

</ul>


<?php 
        return ob_get_clean();
    }
示例#5
0
文件: newsfeed.php 项目: anqh/core
    /**
     * Render newsfeed.
     *
     * @return  string
     */
    public function content()
    {
        if ($items = $this->_items()) {
            ob_start();
            ?>

<ul class="unstyled">

	<?php 
            foreach ($items as $item) {
                ?>
	<li class="row-fluid">
		<?php 
                echo HTML::avatar($item['user']['avatar'], $item['user']['username'], $this->mini);
                ?>
		<?php 
                echo HTML::user($item['user']);
                ?>
 <small class="ago"><?php 
                echo HTML::time(Date::short_span($item['stamp'], true, true), $item['stamp']);
                ?>
</small>
		<?php 
                echo $item['text'];
                ?>
	</li>
	<?php 
            }
            ?>

</ul>

<?php 
            return ob_get_clean();
        }
        return __('Whoa, we are totally out of news items for you!');
    }
示例#6
0
文件: private.php 项目: anqh/forum
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        if (count($this->topics)) {
            ?>

<table class="table">
	<thead>
		<tr>
			<th class="span1 from"><?php 
            echo __('From');
            ?>
</th>
			<th class="span5 topic"><?php 
            echo __('Topic');
            ?>
</th>
			<th class="span1 replies"><?php 
            echo __('Replies');
            ?>
</th>
			<th class="span2 latest"><?php 
            echo __('Latest post');
            ?>
</th>
		</tr>
	</thead>

	<tbody>

		<?php 
            foreach ($this->topics as $topic) {
                ?>

		<tr>
			<td class="from">
				<?php 
                echo HTML::user($topic->author_id, $topic->author_name);
                ?>
			</td>
			<td class="topic">
				<?php 
                echo HTML::anchor(Route::model($topic, '?page=last#last'), '<i class="' . (($recipients = $topic->recipient_count) < 3 ? 'icon-envelope' : 'icon-comment') . ' icon-white"></i> ' . HTML::chars($topic->name), array('title' => $recipients < 3 ? __('Personal message') : __(':recipients recipients', array(':recipients' => Num::format($recipients, 0)))));
                ?>
			</td>
			<td class="replies">
				<?php 
                echo Num::format($topic->post_count - 1, 0);
                ?>
			</td>
			<td class="latest">
				<small class="ago"><?php 
                echo HTML::time(Date::short_span($topic->last_posted, true, true), $topic->last_posted);
                ?>
</small>
				<?php 
                echo HTML::user($topic->last_poster, $topic->last_poster);
                ?>
			</td>
		</tr>

		<?php 
            }
            ?>

	</tbody>
</table>

<?php 
        } else {
            // Empty area
            echo new View_Alert(__('Here be nothing yet.'), null, View_Alert::INFO);
        }
        return ob_get_clean();
    }
示例#7
0
文件: group.php 项目: anqh/forum
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        $areas = $this->group->areas();
        if (count($areas)) {
            ?>

<table class="table">
	<thead>
		<tr>
			<th class="span4"><h3><?php 
            echo HTML::anchor(Route::model($this->group), HTML::chars($this->group->name));
            ?>
</h3></th>
			<th class="span1"><?php 
            echo __('Topics');
            ?>
</th>
			<th class="span1"><?php 
            echo __('Posts');
            ?>
</th>
			<th class="span2"><?php 
            echo __('Latest post');
            ?>
</th>
		</tr>
	</thead>

	<tbody>

	<?php 
            foreach ($areas as $area) {
                ?>

		<?php 
                if (Permission::has($area, Model_Forum_Area::PERMISSION_READ, self::$_user)) {
                    ?>

		<tr>
			<td>
				<h4><?php 
                    echo HTML::anchor(Route::model($area), HTML::chars($area->name));
                    ?>
</h4>
				<?php 
                    echo $area->description;
                    ?>
			</td>
			<td><?php 
                    echo Num::format($area->topic_count, 0);
                    ?>
</td>
			<td><?php 
                    echo Num::format($area->post_count, 0);
                    ?>
</td>
			<td>

			<?php 
                    if ($area->topic_count > 0) {
                        $last_topic = $area->last_topic();
                        ?>

				<small class="ago"><?php 
                        echo HTML::time(Date::short_span($last_topic->last_posted, true, true), $last_topic->last_posted);
                        ?>
</small>
				<?php 
                        echo HTML::user($last_topic->last_post()->author_id, $last_topic->last_poster);
                        ?>
<br />
				<?php 
                        echo HTML::anchor(Route::model($last_topic), '<i class="muted iconic-upload"></i>', array('title' => __('First post')));
                        ?>
				<?php 
                        echo HTML::anchor(Route::model($last_topic, '?page=last#last'), HTML::chars($last_topic->name), array('title' => HTML::chars($last_topic->name)));
                        ?>

			<?php 
                    } else {
                        ?>

				<sup><?php 
                        echo __('No topics yet.');
                        ?>
</sup>

			<?php 
                    }
                    ?>

			</td>
		</tr>

		<?php 
                } elseif ($area->status != Model_Forum_Area::STATUS_HIDDEN) {
                    ?>

		<tr>
			<td colspan="4">
				<h4><?php 
                    echo HTML::chars($area->name);
                    ?>
</h4>
				<?php 
                    echo __('Members only');
                    ?>
			</td>
		</tr>

		<?php 
                }
                ?>

	<?php 
            }
            ?>

	</tbody>
</table>

<?php 
        } else {
            echo new View_Alert(__('No areas yet.'), null, View_Alert::INFO);
        }
        return ob_get_clean();
    }
示例#8
0
文件: comments.php 项目: anqh/core
    ?>
" class="<?php 
    echo implode(' ', $classes);
    ?>
">
	<?php 
    echo HTML::avatar($author['avatar'], $author['username'], true);
    ?>
	<?php 
    echo HTML::user($author);
    ?>
	<small class="ago"><?php 
    echo in_array('new', $classes) ? __('New') : '';
    ?>
 <?php 
    echo HTML::time(Date::short_span($comment->created, true, true), $comment->created);
    ?>
</small>

	<?php 
    if ($user && $comment->user_id == $user->id || $mine) {
        ?>
	<nav class="actions inline">
		<?php 
        if ($private && !$comment->private) {
            ?>
		<?php 
            echo HTML::anchor(sprintf($private, $comment->id), __('Set as private'), array('class' => 'action small comment-private'));
            ?>
		<?php 
        }
示例#9
0
文件: group.php 项目: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        if (!$this->groups) {
            return new View_Alert(__('No groups available..'), __('Oh snap!'), View_Alert::ERROR);
        }
        ob_start();
        ?>

<ol class="list-unstyled">
	<?php 
        foreach ($this->groups as $group) {
            ?>

	<li>
		<h4><?php 
            echo HTML::chars($group->name);
            ?>
</h4>
		<ol class="list-unstyled">

<?php 
            $areas = $group->areas();
            if (count($areas)) {
                foreach ($areas as $area) {
                    ?>

			<li>

<?php 
                    if (Permission::has($area, Model_Forum_Area::PERMISSION_READ)) {
                        // Can read area
                        if ($area->topic_count > 0) {
                            $last_topic = $area->last_topic();
                            if ($last_topic->last_posted) {
                                echo '<small class="pull-right muted">' . HTML::time(Date::short_span($last_topic->last_posted, true, true), $last_topic->last_posted) . '</small>';
                            }
                        }
                        echo HTML::anchor(Route::model($area), HTML::chars($area->name), array('class' => 'hoverable'));
                    } elseif ($area->status != Model_Forum_Area::STATUS_HIDDEN) {
                        // Can't read area
                        echo HTML::chars($area->name);
                    }
                    ?>

			</li>

<?php 
                }
            } else {
                ?>

			<li>
				<?php 
                echo __('No areas available.');
                ?>
<br>

				<?php 
                if (Permission::has($group, Model_Forum_Group::PERMISSION_UPDATE)) {
                    ?>
					<?php 
                    echo HTML::anchor(Route::model($group, 'edit'), '<i class="icon-edit"></i> ' . __('Edit group'), array('class' => 'btn btn-inverse'));
                    ?>
				<?php 
                }
                ?>

				<?php 
                if (Permission::has($group, Model_Forum_Group::PERMISSION_CREATE_AREA)) {
                    ?>
					<?php 
                    echo HTML::anchor(Route::model($group, 'add'), '<i class="icon-plus-sign"></i> ' . __('New area'), array('class' => 'btn btn-primary'));
                    ?>
				<?php 
                }
                ?>

			</li>

<?php 
            }
            ?>

		</ol>
	</li>

	<?php 
        }
        ?>
	</ol>

<?php 
        return ob_get_clean();
    }
示例#10
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();
    }
示例#11
0
文件: post.php 项目: anqh/forum
    echo __('Guest');
    ?>
</small>
			<?php 
}
?>
		</section>

		<section class="post-content grid6">
			<header<?php 
echo $post->id == $topic->last_post_id ? ' id="last"' : '';
?>
>
				<small class="ago">
					<?php 
echo HTML::time(Date::short_span($post->created, true, true), $post->created);
?>
				</small>

				<nav class="actions">
				<?php 
echo HTML::anchor(Route::get($private ? 'forum_private_post' : 'forum_post')->uri(array('id' => Route::model_id($post), 'topic_id' => Route::model_id($topic))) . '#post-' . $post->id, '#' . $number, array('title' => __('Permalink')));
?>

				<?php 
if (Permission::has($post, Model_Forum_Post::PERMISSION_UPDATE, $user)) {
    echo HTML::anchor(Route::get($private ? 'forum_private_post' : 'forum_post')->uri(array('id' => Route::model_id($post), 'topic_id' => Route::model_id($topic), 'action' => 'edit')), __('Edit'), array('class' => 'action post-edit small'));
}
?>

				<?php 
示例#12
0
文件: topics.php 项目: anqh/forum
        ?>

<article>
	<header class="grid6 first topic">
		<?php 
        echo HTML::anchor(Route::model($topic, '?page=last#last'), Forum::topic($topic), array('class' => 'grid5 first'));
        ?>
		<span class="grid1 replies"><?php 
        echo Num::format($topic->post_count - 1, 0);
        ?>
</span>
	</header>

	<p class="grid2 latest">
		<small class="ago"><?php 
        echo HTML::time(Date::short_span($topic->last_posted, true, true), $topic->last_posted);
        ?>
</small>
		<?php 
        echo HTML::user($topic->last_poster, $topic->last_poster);
        ?>
	</p>
</article>

	<?php 
    }
    ?>

<?php 
} else {
    ?>
示例#13
0
文件: newsfeed.php 项目: netbiel/core
 * @copyright  (c) 2010 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
?>

<ul>
	<?php 
foreach ($newsfeed as $item) {
    ?>

		<li class="group">
			<?php 
    echo HTML::avatar($item['user']->avatar, $item['user']->username, isset($mini) && $mini);
    ?>
			<?php 
    echo HTML::user($item['user']);
    ?>
			<small class="ago"><?php 
    echo HTML::time(Date::short_span($item['stamp'], true, true), $item['stamp']);
    ?>
</small>
			<?php 
    echo $item['text'];
    ?>
		</li>
	<?php 
}
?>

</ul>
示例#14
0
文件: topiclist.php 项目: anqh/forum
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
?>

<?php 
if (empty($topics)) {
    ?>
<span class="notice"><?php 
    echo __('No topics found');
    ?>
</span>
<?php 
} else {
    ?>
<ul>

	<?php 
    foreach ($topics as $topic) {
        ?>
	<li>
		<?php 
        echo HTML::anchor(Route::model($topic, '?page=last#last'), HTML::chars($topic->name), array('title' => '[' . Date::short_span($topic->last_posted, false) . '] ' . $topic->name));
        ?>
	</li>
	<?php 
    }
    ?>

</ul>
<?php 
}
示例#15
0
文件: index.php 项目: anqh/forum
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        if (count($this->topics)) {
            ?>

<table class="table">
	<thead>
		<tr>
			<th class="span4 topic"><?php 
            echo __('Topic');
            ?>
</th>
			<th class="span1 replies"><?php 
            echo __('Replies');
            ?>
</th>
			<th class="span2 latest"><?php 
            echo __('Latest post');
            ?>
</th>
		</tr>
	</thead>

	<tbody>

		<?php 
            foreach ($this->topics as $topic) {
                ?>

		<tr>
			<td class="topic">
				<?php 
                echo HTML::anchor(Route::model($topic), Forum::topic($topic));
                ?>
				<?php 
                echo HTML::anchor(Route::model($topic, '?page=last#last'), '<i class="muted iconic-download"></i>', array('title' => __('Last post')));
                ?>
			</td>
			<td class="replies">
				<?php 
                echo Num::format($topic->post_count - 1, 0);
                ?>
			</td>
			<td class="latest">
				<small class="ago"><?php 
                echo HTML::time(Date::short_span($topic->last_posted, true, true), $topic->last_posted);
                ?>
</small>
				<?php 
                echo HTML::user($topic->last_poster, $topic->last_poster);
                ?>
			</td>
		</tr>

		<?php 
            }
            ?>

	</tbody>
</table>

<?php 
        } else {
            // Empty area
            echo new View_Alert(__('Here be nothing yet.'), null, View_Alert::INFO);
        }
        return ob_get_clean();
    }
示例#16
0
文件: comments.php 项目: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        // Comment form
        echo $this->form();
        // Pagination
        if ($this->pagination) {
            echo $this->pagination->render();
        }
        ?>

<ul class="media-list">

<?php 
        $new_comments = isset($new_comments) ? (int) $new_comments : 0;
        foreach ($this->comments as $comment) {
            /** @var  Model_Comment  $comment */
            $author = $comment->author();
            // Ignore
            if (Visitor::$user && Visitor::$user->is_ignored($author)) {
                continue;
            }
            $classes = array('media');
            // Private comment?
            if ($comment->private) {
                $classes[] = 'private';
            }
            // Viewer's post
            if (Visitor::$user && $author['id'] == Visitor::$user->id) {
                $classes[] = 'my';
            }
            // Topic author's post
            if ($author['id'] == $comment->user_id) {
                $classes[] = 'owner';
            }
            // New comment?
            if ($new_comments-- > 0) {
                $classes[] = 'new';
            }
            ?>

	<li class="<?php 
            echo implode(' ', $classes);
            ?>
" id="comment-<?php 
            echo $comment->id;
            ?>
">
		<div class="pull-left">
			<?php 
            echo HTML::avatar($author['avatar'], $author['username']);
            ?>
		</div>
		<div class="arrow"></div>
		<div class="media-body">
			<small class="pull-right">
				<?php 
            if (Visitor::$user && $comment->user_id == Visitor::$user->id || in_array('my', $classes)) {
                if ($this->private && !$comment->private) {
                    echo HTML::anchor(sprintf($this->private, $comment->id), __('Set as private'), array('class' => 'comment-private')) . ' &bull; ';
                }
                if ($this->delete) {
                    echo HTML::anchor(sprintf($this->delete, $comment->id), __('Delete'), array('class' => 'comment-delete')) . ' &bull; ';
                }
            }
            ?>

				<?php 
            echo in_array('new', $classes) ? __('New') : '';
            ?>
 <?php 
            echo HTML::time(Date::short_span($comment->created, true, true), $comment->created);
            ?>
			</small>
			<?php 
            echo HTML::user($author);
            ?>
<br />
			<?php 
            echo $comment->private ? '<span class="label label-special" title="' . __('Private comment') . '">' . __('Priv') . '</span>: ' : '';
            ?>
			<?php 
            echo Text::smileys(Text::auto_link_urls(HTML::chars($comment->comment)));
            ?>
		</div>
	</li>

	<?php 
        }
        ?>

</ul>

<?php 
        // Pagination
        if ($this->pagination) {
            echo $this->pagination->render();
        }
        return ob_get_clean();
    }
示例#17
0
文件: friends.php 项目: anqh/core
 *
 * @package    Anqh
 * @author     Antti Qvickström
 * @copyright  (c) 2011 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
?>
<ul>
	<?php 
foreach ($friends as $friend) {
    ?>

	<li class="group">
		<?php 
    echo HTML::avatar($friend['avatar'], $friend['username']);
    ?>
		<?php 
    echo HTML::user($friend);
    ?>
		<?php 
    if (isset($friend['last_login'])) {
        echo '<small class="ago">', HTML::time(Date::short_span($friend['last_login'], true, true), $friend['last_login']), '</small>';
    }
    ?>
	</li>
	<?php 
}
?>

</ul>
示例#18
0
文件: info.php 项目: anqh/events
 /**
  * Render content.
  *
  * @return  string
  */
 public function content()
 {
     ob_start();
     /*
     // Stamp
     if ($this->event->stamp_begin != $this->event->stamp_end):
     	echo ($this->event->stamp_end ?
     		'<i class="icon-time icon-white"></i> ' . __('From :from to :to', array(
     			':from' => HTML::time(Date::format('HHMM', $this->event->stamp_begin), $this->event->stamp_begin),
     			':to'   => HTML::time(Date::format('HHMM', $this->event->stamp_end), $this->event->stamp_end)
     		)) :
     		'<i class="icon-time icon-white"></i> ' . __('From :from onwards', array(
     			':from' => HTML::time(Date::format('HHMM', $this->event->stamp_begin), $this->event->stamp_begin),
     		))) . '<br />';
     endif;
     */
     // Price
     if ($this->event->price == 0) {
         echo '<i class="icon-shopping-cart icon-white"></i> ' . __('Free entry') . '<br />';
     } elseif ($this->event->price > 0) {
         echo '<i class="icon-shopping-cart icon-white"></i> ' . __('Tickets :price', array(':price' => '<var>' . Num::currency($this->event->price, $this->event->stamp_begin) . '</var>'));
         echo ($this->event->price2 !== null ? ', ' . __('presale :price', array(':price' => '<var>' . Num::currency($this->event->price2, $this->event->stamp_begin) . '</var>')) : '') . '<br />';
     }
     // Age limit
     if ($this->event->age > 0) {
         echo '<i class="icon-user icon-white"></i> ' . __('Age limit') . ': ' . __(':years years', array(':years' => '<var>' . $this->event->age . '</var>')) . '<br />';
     }
     // Homepage
     if (!empty($this->event->homepage)) {
         echo '<i class="icon-home icon-white"></i> ' . HTML::anchor($this->event->homepage, Text::limit_url($this->event->homepage, 25)) . '<br />';
     }
     // Tags
     if ($tags = $this->event->tags()) {
         echo '<i class="icon-music icon-white"></i> ' . implode(', ', $tags) . '<br />';
     } elseif (!empty($this->event->music)) {
         echo '<i class="icon-music icon-white"></i> ' . $this->event->music . '<br />';
     }
     /*
     // Venue
     if ($_venue = $this->event->venue()):
     
     	// Venue found from db
     	$venue   = HTML::anchor(Route::model($_venue), HTML::chars($_venue->name));
     	$address = $_venue->address
     	 ? HTML::chars($_venue->address) . ', ' . HTML::chars($_venue->city_name)
     	 : HTML::chars($_venue->city_name);
     
     	if ($_venue->latitude):
     		$map = array(
     			'marker'     => HTML::chars($_venue->name),
     			'infowindow' => HTML::chars($_venue->address) . '<br />' . HTML::chars($_venue->city_name),
     			'lat'        => $_venue->latitude,
     			'long'       => $_venue->longitude
     		);
     		Widget::add('foot', HTML::script_source('
     head.ready("anqh", function() {
     	$("#event-info a[href=#map]").on("click", function toggleMap(event) {
     $("#map").toggle("fast", function openMap() {
     	$("#map").googleMap(' .  json_encode($map) . ');
     });
     
     return false;
     	});
     });
     '));
     	endif;
     
     elseif ($this->event->venue_name):
     
     	// No venue in db
     	$venue   = $this->event->venue_url
     		? HTML::anchor($this->event->venue_url, HTML::chars($this->event->venue_name))
     		: HTML::chars($this->event->venue_name);
     	$address = HTML::chars($this->event->city_name);
     
     else:
     
     	// Venue not set
     	$venue   = $this->event->venue_hidden ? __('Underground') : __('(Unknown)');
     	$address = HTML::chars($this->event->city_name);
     
     endif;
     echo '<address><strong><i class="icon-map-marker icon-white"></i> ', $venue, '</strong>' . ($address ? ', ' . $address : '') . '<br />';
     if (isset($map)):
     	echo HTML::anchor('#map', __('Toggle map')) . '<br />';
     	echo '<div id="map" style="display: none">', __('Map loading') . '</div>';
     endif;
     echo '</address>';
     */
     // Meta
     echo '<br /><footer class="meta">';
     echo __('Added') . ' ' . HTML::time(Date::format(Date::DMY_SHORT, $this->event->created), $this->event->created);
     if ($this->event->modified) {
         echo ', ' . __('last modified') . ' ' . HTML::time(Date::short_span($this->event->modified, false), $this->event->modified);
     }
     echo '</footer>';
     return ob_get_clean();
 }
示例#19
0
文件: index.php 项目: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        if (count($this->topics)) {
            ?>

<table class="table table-condensed table-striped">
	<tbody>

	<?php 
            foreach ($this->topics as $topic) {
                $last_poster = $topic->last_post()->author();
                $area = $this->area ? false : $topic->area();
                ?>

	<tr>

		<td>
			<h4 class="media-heading">
			<?php 
                if ($this->area || $topic->recipient_count) {
                    ?>
				<?php 
                    echo HTML::anchor(Route::model($topic), Forum::topic($topic));
                    ?>
				<small class="transparent"><?php 
                    echo HTML::anchor(Route::model($topic, '?page=last#last'), '<i class="text-muted fa fa-level-down"></i>', array('title' => __('Last post')));
                    ?>
</small>
			<?php 
                } else {
                    ?>
				<?php 
                    echo HTML::anchor(Route::model($topic, '?page=last#last'), Forum::topic($topic));
                    ?>
				<small class="transparent"><?php 
                    echo HTML::anchor(Route::model($topic), '<i class="text-muted fa fa-level-up"></i>', array('title' => __('First post')));
                    ?>
</small>
			<?php 
                }
                ?>
			</h4>

			<?php 
                if ($area) {
                    ?>
			<small class="muted">
				<?php 
                    echo HTML::anchor(Route::model($area), HTML::chars($area->name), array('class' => 'hoverable'));
                    ?>
			</small>
			<?php 
                }
                ?>

		</td>

		<td class="text-right muted nowrap">
			<small title="<?php 
                echo __('Replies');
                ?>
"><?php 
                echo Num::format($topic->post_count - 1, 0);
                ?>
 <i class="fa fa-comment"></i></small>
		</td>

		<td>
			<?php 
                echo HTML::avatar($last_poster ? $last_poster['avatar'] : null, $last_poster ? $last_poster['username'] : null, 'small');
                ?>
			<?php 
                echo $last_poster ? HTML::user($last_poster) : HTML::chars($topic->last_poster);
                ?>
		</td>

		<td>
			<small class="muted pull-right nowrap"><?php 
                echo HTML::time(Date::short_span($topic->last_posted, true, true), $topic->last_posted);
                ?>
</small>
		</td>

	</tr>

	<?php 
            }
            ?>

	</tbody>
</table>

<?php 
        } else {
            // Empty area
            echo new View_Alert(__('Here be nothing yet.'), null, View_Alert::INFO);
        }
        return ob_get_clean();
    }
示例#20
0
文件: post.php 项目: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        $bbcode = BB::factory();
        ob_start();
        if ($this->my) {
            $panel_class = 'panel-success';
        } elseif ($this->owner) {
            $panel_class = 'panel-info';
        } else {
            $panel_class = 'panel-default';
        }
        ?>

<div class="pull-left">

	<?php 
        if ($this->author) {
            ?>
		<?php 
            echo HTML::avatar($this->author->avatar_url, $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="media-body panel <?php 
        echo $panel_class;
        ?>
">
	<header class="panel-heading"<?php 
        echo $this->forum_post->id == $this->forum_topic->last_post_id ? ' id="last"' : '';
        ?>
>
		<small class="pull-right">
			<?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)) {
            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'));
        }
        ?>

			<?php 
        if (Permission::has($this->forum_post, Model_Forum_Post::PERMISSION_DELETE)) {
            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'));
        }
        ?>

			<?php 
        if (Permission::has($this->forum_topic, Model_Forum_Topic::PERMISSION_POST)) {
            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);
        ?>

			<?php 
        if ($this->forum_post->modify_count > 0) {
            ?>
			&bull;
			<span title="<?php 
            echo __($this->forum_post->modify_count == 1 ? ':edits edit, :ago' : ':edits edits, last :ago', array(':edits' => $this->forum_post->modify_count, ':ago' => Date::fuzzy_span($this->forum_post->modified)));
            ?>
"><?php 
            echo __('Edited');
            ?>
</span>
			<?php 
        }
        ?>

		</small>

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

	<div class="panel-body">

		<?php 
        if ($this->forum_post->parent_id) {
            echo '<p class="text-muted">' . __('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)))) . ':</p>';
        }
        ?>

		<?php 
        echo $bbcode->render($this->forum_post->post);
        ?>

		<?php 
        if ($this->forum_post->attachment) {
            $attachment = 'images/liitteet/' . $this->forum_post->attachment;
            if (file_exists($attachment)) {
                echo HTML::image($attachment);
            }
        }
        ?>

	</div>

	<?php 
        if ($this->author && $this->author->signature) {
            ?>
	<footer class="panel-body">
		<?php 
            echo $this->author && $this->author->signature ? $bbcode->render("\n--\n" . $this->author->signature, true) : '';
            ?>
	</footer>
	<?php 
        }
        ?>
</div>

<?php 
        return ob_get_clean();
    }