Esempio n. 1
0
File: list.php Progetto: 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();
    }
Esempio n. 2
0
 /**
  * Render content.
  *
  * @return  string
  */
 public function content()
 {
     ob_start();
     // Stamp
     echo HTML::time(Date('l ', $this->event->stamp_begin) . Date::format('DDMMYYYY', $this->event->stamp_begin), $this->event->stamp_begin, true);
     // Location
     if ($this->event->venue) {
         echo ' @ ', HTML::anchor(Route::model($this->event->venue), HTML::chars($this->event->venue->name)), ', ', HTML::chars($this->event->venue->city_name);
     } elseif ($this->event->venue_name) {
         echo ' @ ', $this->event->venue_url ? HTML::anchor($this->event->venue_url, $this->event->venue_name) : HTML::chars($this->event->venue_name), $this->event->city_name ? ', ' . HTML::chars($this->event->city_name) : '';
     } elseif ($this->event->city_name) {
         echo ' @ ', HTML::chars($this->event->city_name);
     }
     // Flyer
     if ($flyer = $this->event->flyer()) {
         echo '<figure>', HTML::image($flyer->image_url(Model_Image::SIZE_THUMBNAIL)), '</figure>';
     } elseif ($this->event->flyer_front_url) {
         echo '<figure>', HTML::image($this->event->flyer_front_url, ['class' => 'img-responsive']), '</figure>';
     }
     // Favorites
     if ($this->event->favorite_count) {
         echo '<span class="stats"><i class="fa fa-heart"></i> ' . $this->event->favorite_count . '</span>';
     }
     return ob_get_clean();
 }
Esempio n. 3
0
 /**
  * Render content.
  *
  * @return  string
  */
 public function content()
 {
     ob_start();
     // Stamp
     echo HTML::time(Date('l ', $this->event->stamp_begin) . Date::format('DDMMYYYY', $this->event->stamp_begin), $this->event->stamp_begin, true);
     // Location
     if ($this->event->venue) {
         echo ' @ ', HTML::anchor(Route::model($this->event->venue), HTML::chars($this->event->venue->name)), ', ', HTML::chars($this->event->venue->city_name);
     } elseif ($this->event->venue_name) {
         echo ' @ ', $this->event->venue_url ? HTML::anchor($this->event->venue_url, $this->event->venue_name) : HTML::chars($this->event->venue_name), $this->event->city_name ? ', ' . HTML::chars($this->event->city_name) : '';
     } elseif ($this->event->city_name) {
         echo ' @ ', HTML::chars($this->event->city_name);
     }
     // Flyer
     if ($this->event->flyer_front) {
         echo '<figure>', HTML::image($this->event->flyer_front->get_url(Model_Image::SIZE_THUMBNAIL)), '</figure>';
     } elseif ($this->event->flyer_back) {
         echo '<figure>', HTML::image($this->event->flyer_back->get_url(Model_Image::SIZE_THUMBNAIL)), '</figure>';
     } elseif (Valid::url($this->event->flyer_front_url)) {
         echo '<br /><figure>', HTML::image($this->event->flyer_front_url, array('width' => 160)), '</figure>';
     }
     // Favorites
     if ($this->event->favorite_count) {
         echo '<span class="stats"><i class="icon-heart"></i> ' . $this->event->favorite_count . '</span>';
     }
     return ob_get_clean();
 }
Esempio n. 4
0
File: info.php Progetto: anqh/anqh
 /**
  * Render content.
  *
  * @return  string
  */
 public function content()
 {
     ob_start();
     // Cover
     if (Valid::url($this->track->cover)) {
         echo HTML::image($this->track->cover, array('class' => 'cover img-responsive', 'alt' => __('Cover')));
     }
     // Time
     if ($this->track->size_time) {
         echo '<i class="fa fa-fw fa-clock-o"></i> ' . $this->track->size_time . '<br />';
     }
     // Listen count
     if ($this->track->listen_count > 1) {
         echo '<i class="fa fa-fw fa-play"></i> ' . ($this->track->listen_count == 1 ? __(':count play', array(':count' => $this->track->listen_count)) : __(':count plays', array(':count' => $this->track->listen_count))) . '<br />';
     }
     // Tags
     if ($tags = $this->track->tags()) {
         echo '<i class="fa fa-fw fa-music"></i> ' . implode(', ', $tags) . '<br />';
     } elseif (!empty($this->track->music)) {
         echo '<i class="fa fa-fw fa-music"></i> ' . $this->track->music . '<br />';
     }
     // Meta
     echo '<footer class="meta text-muted">';
     echo __('Added :date', array(':date' => HTML::time(Date::format(Date::DMY_SHORT, $this->track->created), $this->track->created)));
     echo '</footer>';
     return ob_get_clean();
 }
Esempio n. 5
0
File: shouts.php Progetto: anqh/anqh
    /**
     * Render content.
     *
     * @return  string
     */
    public function content()
    {
        $shouts = array();
        foreach (Model_Shout::find_latest($this->limit) as $shout) {
            $shouts[] = array('created' => $shout->created, 'user_id' => $shout->author_id, 'shout' => $shout->shout);
        }
        if ($shouts) {
            ob_start();
            ?>

<ul class="list-unstyled">

	<?php 
            foreach (array_reverse($shouts) as $shout) {
                ?>
	<li>
		<?php 
                echo HTML::time(Date::format('HHMM', $shout['created']), array('datetime' => $shout['created'], 'class' => 'muted'));
                ?>
		<?php 
                echo HTML::user($shout['user_id']);
                ?>
:
		<?php 
                echo Text::smileys(Text::auto_link_urls(HTML::chars($shout['shout'])));
                ?>
	</li>
	<?php 
            }
            ?>

</ul>

<?php 
            if ($this->_can_shout) {
                ?>
<form <?php 
                echo $this->aside ? 'class="ajaxify"' : '';
                ?>
 action="<?php 
                echo Route::url('shouts', array('action' => 'shout'));
                ?>
" method="post">
	<input class="form-control" type="text" name="shout" maxlength="300" placeholder="<?php 
                echo __('Shout, and ye shall be heard..');
                ?>
" />
	<?php 
                echo Form::CSRF();
                ?>
</form>
<?php 
            }
            return ob_get_clean();
        }
        return '';
    }
Esempio n. 6
0
    /**
     * 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();
    }
Esempio n. 7
0
File: info.php Progetto: 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();
    }
Esempio n. 8
0
 /**
  * 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();
 }
Esempio n. 9
0
    /**
     * 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!');
    }
Esempio n. 10
0
    /**
     * 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();
    }
Esempio n. 11
0
File: index.php Progetto: 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();
    }
Esempio n. 12
0
    /**
     * 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!');
    }
Esempio n. 13
0
    ?>
" 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 
        }
Esempio n. 14
0
File: group.php Progetto: 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();
    }
Esempio n. 15
0
<?php

defined('SYSPATH') or die('No direct access allowed.');
/**
 * Shout
 *
 * @package    Anqh
 * @author     Antti Qvickström
 * @copyright  (c) 2010 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
$ordered = array();
foreach ($shouts as $shout) {
    $ordered[] = '<li>' . HTML::time(Date::format('HHMM', $shout->created), $shout->created) . ' ' . HTML::user($shout->author) . ': ' . Text::smileys(HTML::chars($shout->shout)) . '</li>';
}
?>

<ul>
	<?php 
echo implode("\n", array_reverse($ordered));
?>
</ul>

<?php 
if ($can_shout) {
    ?>

<?php 
    echo Form::open(Route::get('shouts')->uri(array('action' => 'shout')));
    ?>
<fieldset class="horizontal">
Esempio n. 16
0
    /**
     * Add event subtitle.
     *
     * @param   Model_Event  $event
     * @return  string
     */
    protected function _event_subtitle(Model_Event $event)
    {
        $subtitle = array();
        // Date
        $subtitle[] = '<i class="icon-calendar icon-white"></i> ' . HTML::time(Date('l', $event->stamp_begin) . ', ' . Date::format(Date::DMY_LONG, $event->stamp_begin), $event->stamp_begin, true);
        // Time
        if ($event->stamp_begin != $event->stamp_end) {
            $subtitle[] = $event->stamp_end ? '<i class="icon-time icon-white"></i> ' . __(':from until :to', array(':from' => HTML::time(Date::format('HHMM', $event->stamp_begin), $event->stamp_begin), ':to' => HTML::time(Date::format('HHMM', $event->stamp_end), $event->stamp_end))) : '<i class="icon-time icon-white"></i> ' . __('From :from onwards', array(':from' => HTML::time(Date::format('HHMM', $event->stamp_begin), $event->stamp_begin)));
        }
        // Venue
        if ($_venue = $event->venue()) {
            // Venue found from db
            $venue = HTML::anchor(Route::model($_venue), HTML::chars($_venue->name));
            $address = 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() {
	$("a[href=#map]").on("click", function toggleMap(event) {
		$("#map").toggle("fast", function openMap() {
			$("#map").googleMap(' . json_encode($map) . ');
		});

		return false;
	});
});
'));
            }
        } else {
            if ($event->venue_name) {
                // No venue in db
                $venue = $event->venue_url ? HTML::anchor($event->venue_url, HTML::chars($event->venue_name)) : HTML::chars($event->venue_name);
                $address = HTML::chars($event->city_name);
            } else {
                // Venue not set
                $venue = $event->venue_hidden ? __('Underground') : __('(Unknown)');
                $address = HTML::chars($event->city_name);
            }
        }
        $subtitle[] = '<i class="icon-map-marker icon-white"></i> ' . $venue . ($address ? ', ' . $address : '');
        if (isset($map)) {
            $subtitle[] = HTML::anchor('#map', __('Show map'));
            return implode(' &nbsp; ', $subtitle) . '<div id="map" style="display: none">' . __('Map loading') . '</div>';
        }
        return implode(' &nbsp; ', $subtitle);
    }
Esempio n. 17
0
/**
 * 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 
}
Esempio n. 18
0
File: info.php Progetto: 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>
Esempio n. 19
0
    /**
     * 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();
    }
Esempio n. 20
0
    ?>
">
		<article>
			<div class="thumb">
				<?php 
    echo HTML::anchor(Route::model($gallery, isset($approval) ? 'pending' : null), $default_image ? HTML::image($default_image->get_url('thumbnail', $gallery->dir)) : __('New gallery'));
    ?>
			</div>
			<h4><?php 
    echo HTML::anchor(Route::model($gallery, isset($approval) ? 'pending' : null), HTML::chars($gallery->name));
    ?>
</h4>
			<div class="info">
				<!--
				<?php 
    echo HTML::time(Date::format('DMYYYY', $gallery->date), array('datetime' => $gallery->date, 'title' => __('Updated :updated', array(':updated' => Date::format('DMYYYY_HM', $gallery->modified)))), true);
    ?>
<br />
				-->

				<?php 
    if (isset($approval)) {
        $copyrights = array();
        $pending_images = $gallery->find_images_pending($approval ? null : $user);
        foreach ($pending_images as $image) {
            $copyrights[$image->author_id] = $image->author();
        }
        foreach ($copyrights as $copyright_id => &$copyright) {
            $copyright = HTML::user($copyright);
        }
        ?>
Esempio n. 21
0
File: group.php Progetto: 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();
    }
Esempio n. 22
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 />
Esempio n. 23
0
    /**
     * 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();
    }
Esempio n. 24
0
File: info.php Progetto: 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();
 }
Esempio n. 25
0
 *
 * @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>
Esempio n. 26
0
File: post.php Progetto: 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();
    }
Esempio n. 27
0
 /**
  * Set gallery specific title and actions.
  *
  * @param  Model_Gallery  $gallery
  */
 protected function _set_gallery(Model_Gallery $gallery)
 {
     // Set title
     $images = count($gallery->images());
     $this->view->tab = 'gallery';
     $this->view->title = $gallery->name;
     $this->view->subtitle = __($images == 1 ? ':images image' : ':images images', array(':images' => $images)) . ' - ' . HTML::time(Date::format('DMYYYY', $gallery->date), $gallery->date, true);
     // Set actions
     $this->view->tabs['galleries']['link'] = Route::url('galleries', array('action' => 'browse', 'year' => date('Y', $gallery->date), 'month' => date('m', $gallery->date)));
     if ($this->view->actions['upload'] && Permission::has(new Model_Gallery(), Model_Gallery::PERMISSION_UPLOAD, self::$user)) {
         $this->view->actions['upload']['link'] = Route::model($gallery, 'upload');
     }
     $this->view->tabs['gallery'] = array('link' => Route::model($gallery), 'text' => '<i class="icon-camera icon-white"></i> ' . __('Gallery'));
     if ($event = $gallery->event()) {
         $this->view->tabs[] = array('link' => Route::model($event), 'text' => '<i class="icon-calendar icon-white"></i> ' . __('Event') . ' &raquo;');
     }
 }
Esempio n. 28
0
 /**
  * Create new view.
  *
  * @param  Model_Event  $event
  */
 public function __construct(Model_Event $event)
 {
     parent::__construct();
     $this->event = $event;
     $this->title = HTML::chars($this->event->name) . ' ' . HTML::time(Date('l ', $this->event->stamp_begin) . Date::format('DDMMYYYY', $this->event->stamp_begin), $this->event->stamp_begin, true);
 }
Esempio n. 29
0
File: index.php Progetto: 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();
    }
Esempio n. 30
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        // Image basic info
        $info = array(__('Copyright') => $this->image->author_id ? HTML::user($this->image->author_id) : null, __('Added') => HTML::time(Date::format('DMYYYY_HM', $this->image->created), $this->image->created), __('Statistics') => '<i class="icon-comment icon-white"></i> ' . (int) $this->image->comment_count . ', ' . '<i class="icon-eye-open icon-white"></i> ' . (int) $this->image->view_count);
        // Image EXIF
        if ($exif = $this->image->exif()) {
            if ($exif->make || $exif->model) {
                $info[__('Camera')] = ($exif->make ? HTML::chars($exif->make) : '') . ($exif->model ? ($exif->make ? '<br />' : '') . HTML::chars($exif->model) : '');
            }
            if ($exif->exposure) {
                $info[__('Exposure')] = HTML::chars($exif->exposure);
            }
            if ($exif->aperture) {
                $info[__('Aperture')] = HTML::chars($exif->aperture);
            }
            if ($exif->focal) {
                $info[__('Focal length')] = HTML::chars($exif->focal);
            }
            if ($exif->iso) {
                $info[__('ISO speed')] = HTML::chars($exif->iso);
            }
            if ($exif->taken) {
                $info[__('Taken')] = Date::format('DMYYYY_HM', $exif->taken);
            }
            if ($exif->flash) {
                $info[__('Flash')] = HTML::chars($exif->flash);
            }
            if ($exif->program) {
                $info[__('Program')] = HTML::chars($exif->program);
            }
            if ($exif->metering) {
                $info[__('Metering')] = HTML::chars($exif->metering);
            }
            if ($exif->latitude) {
                $info[__('Latitude')] = HTML::chars($exif->latitude);
            }
            if ($exif->longitude) {
                $info[__('Longitude')] = HTML::chars($exif->longitude);
            }
            if ($exif->altitude) {
                $info[__('Altitude')] = HTML::chars($exif->altitude) . 'm';
            }
            if ($exif->lens) {
                $info[__('Lens')] = HTML::chars($exif->lens);
            }
        }
        ob_start();
        if (!empty($info)) {
            ?>

	<dl class="dl-horizontal">
		<?php 
            foreach ($info as $term => $definition) {
                if (!is_null($definition)) {
                    ?>

		<dt><?php 
                    echo $term;
                    ?>
</dt><dd><?php 
                    echo $definition;
                    ?>
</dd>
		<?php 
                }
            }
            ?>

	</dl>

<?php 
        }
        return ob_get_clean();
    }