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


PHP Skin::build_date方法代码示例

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


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

示例1: layout

 /**
  * list comments
  *
  * @param resource the SQL result
  * @return string the rendered text
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // empty list
     if (!SQL::count($result)) {
         $output = array();
         return $output;
     }
     // we return an array of ($url => $attributes)
     $items = array();
     // process all items in the list
     include_once $context['path_to_root'] . 'comments/comments.php';
     while ($item = SQL::fetch($result)) {
         // url to view the comment
         $url = Comments::get_url($item['id']);
         // initialize variables
         $prefix = $label = $suffix = $icon = '';
         // the title as the label
         if ($item['create_name']) {
             $label .= ucfirst($item['create_name']) . ' ';
         }
         // time of creation
         $label .= Skin::build_date($item['create_date']);
         // text beginning
         if ($text = Skin::strip($item['description'], 10, NULL, NULL)) {
             $suffix = ' - ' . $text;
         }
         // list all components for this item
         $items[$url] = array($prefix, $label, $suffix, 'comment', $icon);
     }
     // end of processing
     SQL::free($result);
     return $items;
 }
开发者ID:rair,项目名称:yacs,代码行数:42,代码来源:layout_comments_as_compact.php

示例2: layout

 /**
  * list versions
  *
  * @param resource the SQL result
  * @return string the rendered text
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // empty list
     if (!SQL::count($result)) {
         $output = array();
         return $output;
     }
     // we return an array of ($url => $attributes)
     $items = array();
     // process all items in the list
     while ($item = SQL::fetch($result)) {
         // initialize variables
         $prefix = $suffix = $icon = '';
         // the url to view this item
         $url = '_' . $item['id'];
         // Versions::get_url($item['id']);
         // version description
         $label = sprintf(i18n::s('edited by %s %s'), ucfirst($item['edit_name']), Skin::build_date($item['edit_date']));
         // command to view this version
         $suffix .= ' ' . Skin::build_link(Versions::get_url($item['id'], 'view'), i18n::s('compare to current version'), 'button');
         // list all components for this item
         $items[$url] = array($prefix, $label, $suffix, 'version', $icon);
     }
     // end of processing
     SQL::free($result);
     return $items;
 }
开发者ID:rair,项目名称:yacs,代码行数:36,代码来源:layout_versions.php

示例3: array

 /**
  * text to come in page details
  *
  * @param array the hosting record, if any
  * @return some HTML to be inserted into the resulting page
  */
 function &get_details_text($host = NULL)
 {
     global $context;
     // feed-back to surfer
     $information = array();
     // no end date
     if (!isset($this->attributes['end_date']) || $this->attributes['end_date'] <= NULL_DATE) {
         $information[] = i18n::s('Petition is currently open.');
         $open = TRUE;
         // not ended yet
     } elseif ($this->attributes['end_date'] > gmstrftime('%Y-%m-%d %H:%M:%S')) {
         $information[] = sprintf(i18n::s('Petition is open until %s.'), Skin::build_date($this->attributes['end_date'], 'standalone'));
         $open = TRUE;
         // petition is over
     } else {
         $information[] = sprintf(i18n::s('Petition has ended on %s.'), Skin::build_date($this->attributes['end_date'], 'standalone'));
         $open = FALSE;
     }
     // voters, only before vote end
     if ($open) {
         if (!isset($this->attributes['voters']) || $this->attributes['voters'] == 'members') {
             $information[] = i18n::s('All members of the community are allowed to sign.');
         } elseif ($this->attributes['voters'] == 'editors') {
             $information[] = i18n::s('Editors of this section are allowed to sign.');
         } elseif ($this->attributes['voters'] == 'associates') {
             $information[] = i18n::s('Only associates are allowed to sign.');
         } elseif ($this->attributes['voters'] == 'custom') {
             $information[] = sprintf(i18n::s('Allowed: %s'), isset($this->attributes['voter_list']) && trim($this->attributes['voter_list']) ? $this->attributes['voter_list'] : i18n::s('(to be defined)'));
         }
     }
     // introduce the petition
     $text = join(' ', $information);
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:40,代码来源:petition.php

示例4: layout

 /**
  * list servers
  *
  * @param resource the SQL result
  * @return string the rendered text
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // empty list
     if (!SQL::count($result)) {
         $output = array();
         return $output;
     }
     // we return an array of ($url => $attributes)
     $items = array();
     // process all items in the list
     while ($item = SQL::fetch($result)) {
         // initialize variables
         $prefix = $suffix = $icon = '';
         // the url to view this item
         $url = Servers::get_url($item['id']);
         // use the title as a label
         $label = Skin::strip($item['title'], 10);
         // flag files uploaded recently
         if ($item['edit_date'] >= $context['fresh']) {
             $prefix = NEW_FLAG . $prefix;
         }
         // description
         if ($item['description']) {
             $suffix .= ' ' . ucfirst(trim($item['description']));
         }
         // the menu bar for associates and poster
         if (Surfer::is_empowered() || Surfer::is($item['edit_id'])) {
             $menu = array(Servers::get_url($item['id'], 'edit') => i18n::s('Edit'), Servers::get_url($item['id'], 'delete') => i18n::s('Delete'));
             $suffix .= ' ' . Skin::build_list($menu, 'menu');
         }
         // add a separator
         if ($suffix) {
             $suffix = ' - ' . $suffix;
         }
         // append details to the suffix
         $suffix .= BR . '<span class="details">';
         // details
         $details = array();
         // item poster
         if ($item['edit_name']) {
             $details[] = sprintf(i18n::s('edited by %s %s'), Users::get_link($item['edit_name'], $item['edit_address'], $item['edit_id']), Skin::build_date($item['edit_date']));
         }
         // the edition date
         $details[] = Skin::build_date($item['edit_date']);
         // all details
         if (count($details)) {
             $suffix .= ucfirst(implode(', ', $details)) . "\n";
         }
         // end of details
         $suffix .= '</span>';
         // list all components for this item
         $items[$url] = array($prefix, $label, $suffix, 'server', $icon);
     }
     // end of processing
     SQL::free($result);
     return $items;
 }
开发者ID:rair,项目名称:yacs,代码行数:66,代码来源:layout_servers.php

示例5: layout

 /**
  * list comments as successive notes in a thread
  *
  * @param resource the SQL result
  * @return string the rendered text
  **/
 function layout($result)
 {
     global $context;
     // we return formatted text
     $text = '';
     // empty list
     if (!SQL::count($result)) {
         return $text;
     }
     // build a list of comments
     while ($item = SQL::fetch($result)) {
         // automatic notification
         if ($item['type'] == 'notification') {
             $text = '<dd class="thread_other" style="font-style: italic;">' . ucfirst(trim($item['description'])) . '</dd>' . $text;
         } else {
             // link to user profile -- open links in separate window to enable side browsing of participant profiles
             if ($item['create_id']) {
                 if ($user = Users::get($item['create_id']) && $user['full_name']) {
                     $hover = $user['full_name'];
                 } else {
                     $hover = NULL;
                 }
                 $author = Users::get_link($item['create_name'], $item['create_address'], $item['create_id'], TRUE, $hover);
             } else {
                 $author = Users::get_link($item['edit_name'], $item['edit_address'], $item['edit_id'], TRUE);
             }
             // differentiate my posts from others
             if (Surfer::get_id() && $item['create_id'] == Surfer::get_id()) {
                 $style = ' class="thread_me"';
             } else {
                 $style = ' class="thread_other"';
             }
             // a clickable label
             $stamp = '#';
             // flag old items on same day
             if (!strncmp($item['edit_date'], gmstrftime('%Y-%m-%d %H:%M:%S', time()), 10)) {
                 $stamp = Skin::build_time($item['edit_date']);
             } else {
                 $stamp = Skin::build_date($item['edit_date']);
             }
             // append this at the end of the comment
             $stamp = ' <div style="float: right; font-size: x-small">' . Skin::build_link(Comments::get_url($item['id']), $stamp, 'basic', i18n::s('Edit')) . '</div>';
             // package everything --change order to get oldest first
             $text = '<dt' . $style . '>' . $author . '</dt><dd' . $style . '>' . $stamp . ucfirst(trim($item['description'])) . '</dd>' . $text;
         }
     }
     // end of processing
     SQL::free($result);
     // finalize the returned definition list
     if ($text) {
         $text = '<dl>' . $text . '</dl>';
     }
     // process yacs codes
     $text = Codes::beautify($text);
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:62,代码来源:layout_comments_as_thread.php

示例6: layout

 /**
  * list dates
  *
  * @param resource the SQL result
  * @return string the rendered text
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // we return an array of ($url => $attributes)
     $items = array();
     // empty list
     if (!SQL::count($result)) {
         return $items;
     }
     // process all items in the list
     while ($item = SQL::fetch($result)) {
         // the url to use
         $url = Articles::get_permalink($item);
         // initialize variables
         $prefix = $suffix = $icon = '';
         // signal restricted and private dates/articles
         if (!isset($item['publish_date']) || $item['publish_date'] <= NULL_DATE) {
             $prefix .= DRAFT_FLAG;
         }
         // signal restricted and private dates/articles
         if (!isset($item['active'])) {
         } elseif ($item['active'] == 'N') {
             $prefix .= PRIVATE_FLAG;
         } elseif ($item['active'] == 'R') {
             $prefix .= RESTRICTED_FLAG;
         }
         // flag new dates/articles
         if ($item['edit_date'] >= $context['fresh']) {
             $suffix .= NEW_FLAG;
         }
         // build a valid label
         if (isset($item['title'])) {
             $label = Codes::beautify_title($item['title']);
             if (isset($item['date_stamp'])) {
                 $label .= ' [' . Skin::build_date($item['date_stamp'], 'day') . ']';
             }
         } else {
             $label = Skin::build_date($item['date_stamp'], 'day');
         }
         // may have variant overlay for links
         $link_type = $this->has_variant('overlaid') ? 'overlaid' : 'basic';
         // list all components for this item
         $items[$url] = array($prefix, $label, $suffix, $link_type, NULL, $item['date_stamp']);
     }
     // end of processing
     SQL::free($result);
     return $items;
 }
开发者ID:rair,项目名称:yacs,代码行数:56,代码来源:layout_dates_as_compact.php

示例7: layout

 /**
  * list files
  *
  * @param resource the SQL result
  * @return array of resulting items, or NULL
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // we return an array of ($url => $attributes)
     $items = array();
     // empty list
     if (!SQL::count($result)) {
         return $items;
     }
     // process all items in the list
     while ($item = SQL::fetch($result)) {
         // download the file directly
         $url = Files::get_url($item['id'], 'fetch', $item['file_name']);
         // file title or file name
         $label = Codes::beautify_title($item['title']);
         if (!$label) {
             $label = ucfirst(str_replace(array('%20', '-', '_'), ' ', $item['file_name']));
         }
         // initialize variables
         $prefix = $suffix = '';
         $contributor = Users::get_link($item['create_name'], $item['create_address'], $item['create_id']);
         $flag = '';
         if ($item['create_date'] >= $context['fresh']) {
             $flag = NEW_FLAG;
         } elseif ($item['edit_date'] >= $context['fresh']) {
             $flag = UPDATED_FLAG;
         }
         $suffix .= '<span class="details"> - ' . sprintf(i18n::s('By %s'), $contributor) . ' ' . Skin::build_date($item['create_date']) . $flag . '</span>';
         // signal restricted and private files
         if ($item['active'] == 'N' && defined('PRIVATE_FLAG')) {
             $prefix .= PRIVATE_FLAG;
         } elseif ($item['active'] == 'R' && defined('RESTRICTED_FLAG')) {
             $prefix .= RESTRICTED_FLAG;
         }
         // list all components for this item
         $items[$url] = array($prefix, $label, $suffix, 'file', NULL);
     }
     // end of processing
     SQL::free($result);
     return $items;
 }
开发者ID:rair,项目名称:yacs,代码行数:49,代码来源:layout_files_as_dates.php

示例8: serve

 public static function serve($parameters)
 {
     global $context;
     // the output of this function
     $output = '';
     // we need a valid url
     if (!isset($parameters['url'])) {
         return $output;
     }
     // read the newsfeed
     include_once $context['path_to_root'] . 'included/simplepie.inc';
     $feed = new SimplePie($parameters['url'], $context['path_to_root'] . 'temporary');
     $feed->init();
     // make a string
     $output['text'] = '';
     $even = true;
     $count = 0;
     foreach ($feed->get_items() as $item) {
         // allow for alternate layout
         if ($even) {
             $class = 'class="even"';
         } else {
             $class = 'class="odd"';
         }
         $even = !$even;
         // box title and details
         $content = '<dt ' . $class . '><h2><span>' . Skin::build_link($item->get_permalink(), $item->get_title()) . '</span></h2>' . '<span class="details">' . Skin::build_date($item->get_date('U')) . '</span></dt><dd ' . $class . '>';
         // box content
         if (($enclosure = $item->get_enclosure()) && ($thumbnail = $enclosure->get_thumbnail())) {
             $content .= '<a href="' . $item->get_permalink() . '"><img src="' . $thumbnail . '" class="left_image" style="margin-right: 1em;" alt="" /></a>';
         }
         $content .= '<div style="margin: 0.5em 0 1em 0;">' . $item->get_description() . '<br style="clear:left;" /></div></dd>' . "\n";
         // wrap the full box
         $output['text'] .= '<dl class="newsfeed_item">' . "\n" . $content . '</dl>' . "\n";
     }
     // return everything
     return $output;
 }
开发者ID:rair,项目名称:yacs,代码行数:38,代码来源:proxy_hook.php

示例9: layout

 /**
  * list servers
  *
  * @param resource the SQL result
  * @return string the rendered text
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // empty list
     if (!SQL::count($result)) {
         $output = array();
         return $output;
     }
     // we return an array of ($url => $attributes)
     $items = array();
     // process all items in the list
     while ($item = SQL::fetch($result)) {
         // the url to view this item
         $url = Servers::get_url($item['id']);
         // use the title as a label
         $label = Skin::strip($item['title'], 10);
         // list all components for this item
         $items[$url] = array('', $label, ' ' . Skin::build_date($item['edit_date']), 'server', NULL);
     }
     // end of processing
     SQL::free($result);
     return $items;
 }
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:layout_servers_as_dates.php

示例10: layout

 /**
  * list images
  *
  * @param resource the SQL result
  * @return string the rendered text
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // empty list
     if (!SQL::count($result)) {
         $output = array();
         return $output;
     }
     // we return an array of ($url => $attributes)
     $items = array();
     // process all items in the list
     while ($item = SQL::fetch($result)) {
         // url to view the image
         $url = Images::get_url($item['id']);
         // initialize variables
         $prefix = $suffix = '';
         // flag new images
         if ($item['edit_date'] >= $context['fresh']) {
             $suffix .= NEW_FLAG;
         }
         // image title or image name
         $label = Skin::strip($item['title'], 10);
         if (!$label) {
             $name_as_title = TRUE;
             $label = ucfirst($item['image_name']);
         }
         $label = str_replace('_', ' ', str_replace('%20', ' ', $label));
         // with dates
         $suffix .= ' ' . Skin::build_date($item['edit_date']);
         // list all components for this item
         $items[$url] = array('', $label, $suffix, 'image', NULL);
     }
     // end of processing
     SQL::free($result);
     return $items;
 }
开发者ID:rair,项目名称:yacs,代码行数:44,代码来源:layout_images_as_dates.php

示例11: layout

 /**
  * list comments
  *
  * @param resource the SQL result
  * @return string the rendered text
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // we return some text
     $text = '';
     // empty list
     if (!SQL::count($result)) {
         return $text;
     }
     // process all items in the list
     include_once $context['path_to_root'] . 'comments/comments.php';
     while ($item = SQL::fetch($result)) {
         // automatic notification
         if ($item['type'] == 'notification') {
             $text .= '<dd style="font-style: italic; font-size: smaller;">' . ucfirst(trim($item['description'])) . ' <span class="details">' . Skin::build_date($item['create_date']) . '</span></dd>';
         } else {
             // the title as the label
             if ($item['create_name']) {
                 $label = ucfirst($item['create_name']);
             } else {
                 $label = i18n::s('anonymous');
             }
             // expand a definition list
             $text .= '<dt>' . $label . '</dt>' . '<dd>' . $item['description'] . ' <span class="details">' . Skin::build_date($item['create_date']) . '</span></dd>' . "\n";
         }
     }
     // finalize the definition list
     if ($text) {
         $text = '<dl class="comments">' . $text . '</dl>';
     }
     // process yacs codes at once
     $text = Codes::beautify($text);
     // end of processing
     SQL::free($result);
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:44,代码来源:layout_comments_as_excerpt.php

示例12: layout

 /**
  * list articles for search requests
  *
  * @param resource the SQL result
  * @return array of resulting items ($score, $summary), or NULL
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // we return an array of array($score, $summary)
     $items = array();
     // empty list
     if (!SQL::count($result)) {
         return $items;
     }
     // process all items in the list
     include_once $context['path_to_root'] . 'comments/comments.php';
     include_once $context['path_to_root'] . 'links/links.php';
     while ($item = SQL::fetch($result)) {
         // one box at a time
         $box = '';
         // get the related overlay, if any
         $overlay = Overlay::load($item, 'article:' . $item['id']);
         // get the main anchor
         $anchor = Anchors::get($item['anchor']);
         // the url to view this item
         $url = Articles::get_permalink($item);
         // use the title to label the link
         if (is_object($overlay)) {
             $title = Codes::beautify_title($overlay->get_text('title', $item));
         } else {
             $title = Codes::beautify_title($item['title']);
         }
         // initialize variables
         $prefix = $suffix = $icon = '';
         // flag sticky pages
         if ($item['rank'] < 10000) {
             $prefix .= STICKY_FLAG;
         }
         // signal locked articles
         if (isset($item['locked']) && $item['locked'] == 'Y' && Articles::is_owned($item, $anchor)) {
             $suffix .= ' ' . LOCKED_FLAG;
         }
         // flag articles that are dead, or created or updated very recently
         if ($item['expiry_date'] > NULL_DATE && $item['expiry_date'] <= $context['now']) {
             $prefix .= EXPIRED_FLAG;
         } elseif ($item['create_date'] >= $context['fresh']) {
             $suffix .= ' ' . NEW_FLAG;
         } elseif ($item['edit_date'] >= $context['fresh']) {
             $suffix .= ' ' . UPDATED_FLAG;
         }
         // signal articles to be published
         if ($item['publish_date'] <= NULL_DATE || $item['publish_date'] > gmstrftime('%Y-%m-%d %H:%M:%S')) {
             $prefix .= DRAFT_FLAG;
         }
         // signal restricted and private articles
         if ($item['active'] == 'N') {
             $prefix .= PRIVATE_FLAG;
         } elseif ($item['active'] == 'R') {
             $prefix .= RESTRICTED_FLAG;
         }
         // introduction
         $introduction = '';
         if (is_object($overlay)) {
             $introduction = $overlay->get_text('introduction', $item);
         } else {
             $introduction = $item['introduction'];
         }
         // the introductory text
         if ($introduction) {
             $suffix .= ' -&nbsp;' . Codes::beautify_introduction($introduction);
             // link to description, if any
             if ($item['description']) {
                 $suffix .= ' ' . Skin::build_link($url, MORE_IMG, 'more', i18n::s('View the page')) . ' ';
             }
         }
         // insert overlay data, if any
         if (is_object($overlay)) {
             $suffix .= $overlay->get_text('list', $item);
         }
         // details
         $details = array();
         // the author
         if ($item['create_name'] != $item['edit_name']) {
             $details[] = sprintf(i18n::s('by %s, %s'), Users::get_link($item['create_name'], $item['create_address'], $item['create_id']), Users::get_link($item['edit_name'], $item['edit_address'], $item['edit_id']));
         } else {
             $details[] = sprintf(i18n::s('by %s'), Users::get_link($item['create_name'], $item['create_address'], $item['create_id']));
         }
         // the last action
         $details[] = Anchors::get_action_label($item['edit_action']) . ' ' . Skin::build_date($item['edit_date']);
         // the number of hits
         if (Surfer::is_logged() && $item['hits'] > 1) {
             $details[] = Skin::build_number($item['hits'], i18n::s('hits'));
         }
         // info on related files
         if ($count = Files::count_for_anchor('article:' . $item['id'])) {
             $details[] = sprintf(i18n::ns('%d file', '%d files', $count), $count);
         }
//.........这里部分代码省略.........
开发者ID:rair,项目名称:yacs,代码行数:101,代码来源:layout_articles_as_search.php

示例13: get_invite_default_message

 /**
  * get invitation default message
  *
  * This is put in the invitation form.
  *
  * @see articles/invite.php
  *
  * @param string 'PUBLISH' or 'CANCEL'
  * @return string to be put in the web form
  */
 function get_invite_default_message($method = 'PUBLISH')
 {
     global $context;
     // to be displayed into the web form for this invitation
     $text = '';
     if ($value = $this->anchor->get_title()) {
         $text .= sprintf(i18n::c('%s: %s'), i18n::c('Topic'), Skin::build_link($context['url_to_home'] . $context['url_to_root'] . $this->anchor->get_url(), Codes::beautify_title($value))) . BR;
     }
     // dates
     if (isset($this->attributes['date_stamp']) && $this->attributes['date_stamp']) {
         $text .= sprintf(i18n::c('%s: %s'), i18n::c('Date'), Skin::build_date($this->attributes['date_stamp'], 'day')) . BR;
     }
     // build a link to the chairman page, if any
     if (isset($this->attributes['chairman']) && ($user = Users::get($this->attributes['chairman']))) {
         $text .= sprintf(i18n::c('%s: %s'), i18n::c('Chairman'), Users::get_link($user['full_name'], NULL, $user['id'])) . BR;
     }
     // event has been cancelled
     if ($method == 'CANCEL') {
         $text .= '<div><p>' . i18n::c('Event has been cancelled.') . '</p></div>';
     } else {
         // copy content of the introduction field, if any
         if ($value = $this->anchor->get_value('introduction')) {
             $text .= '<div>' . Codes::beautify('<p>' . $value . '</p>') . '</div>';
         }
         // copy the induction message, if any
         if (isset($this->attributes['induction_message'])) {
             $text .= '<div>' . Codes::render($this->attributes['induction_message']) . '</div>';
         }
     }
     // done
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:42,代码来源:day.php

示例14: layout

 /**
  * list users
  *
  * @param resource the SQL result
  * @return array of resulting items ($score, $summary), or NULL
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // we return an array of array($score, $summary)
     $items = array();
     // empty list
     if (!SQL::count($result)) {
         return $items;
     }
     // flag idle users
     $idle = gmstrftime('%Y-%m-%d %H:%M:%S', time() - 600);
     // process all items in the list
     while ($item = SQL::fetch($result)) {
         // one box at a time
         $box = '';
         // initialize variables
         $prefix = $suffix = $icon = '';
         // the url to view this item
         $url = Users::get_permalink($item);
         // flag profiles updated recently
         if ($item['create_date'] >= $context['fresh']) {
             $suffix .= NEW_FLAG;
         } elseif ($item['edit_date'] >= $context['fresh']) {
             $suffix .= UPDATED_FLAG;
         }
         // signal restricted and private articles
         if ($item['active'] == 'N') {
             $prefix .= PRIVATE_FLAG;
         } elseif ($item['active'] == 'R') {
             $prefix .= RESTRICTED_FLAG;
         }
         // signal locked profiles
         if ($item['capability'] == '?') {
             $prefix .= EXPIRED_FLAG;
         }
         // item title
         if ($item['full_name']) {
             $title = ucfirst(Skin::strip($item['full_name'], 10));
             $hover = $item['nick_name'];
         } else {
             $title = ucfirst(Skin::strip($item['nick_name'], 10));
             $hover = $item['full_name'];
         }
         // show contact information
         if (Surfer::may_contact()) {
             $suffix .= Users::build_presence($item);
         }
         // the introduction
         if ($item['introduction']) {
             if (is_callable(array('codes', 'beautify'))) {
                 $suffix .= ' -&nbsp;' . Codes::beautify($item['introduction']);
             } else {
                 $suffix .= ' -&nbsp;' . $item['introduction'];
             }
         }
         // display all tags
         if ($item['tags']) {
             $suffix .= ' <span class="tags">' . Skin::build_tags($item['tags'], 'user:' . $item['id']) . '</span>';
         }
         // details
         $details = array();
         // capability
         if ($item['capability'] == 'A') {
             $details[] = i18n::s('Associate');
         } elseif ($item['capability'] == 'S') {
             $details[] = i18n::s('Subscriber');
         } else {
             $details[] = i18n::s('Member');
         }
         // creation date
         if ($item['create_date']) {
             $details[] = sprintf(i18n::s('registered %s'), Skin::build_date($item['create_date']));
         }
         // last login
         if ($this->layout_variant == 'dates') {
             if (isset($item['login_date']) && $item['login_date'] > NULL_DATE) {
                 $address = '';
                 if ($item['login_address']) {
                     $address = ' (' . $item['login_address'] . ')';
                 }
                 $details[] = sprintf(i18n::s('last login %s'), Skin::build_date($item['login_date']) . $address);
             } else {
                 $details[] = i18n::s('no login');
             }
         }
         // last post
         if ($this->layout_variant == 'dates') {
             if (isset($item['post_date']) && $item['post_date'] > NULL_DATE) {
                 $details[] = sprintf(i18n::s('last post %s'), Skin::build_date($item['post_date']));
             }
         }
         // posts
//.........这里部分代码省略.........
开发者ID:rair,项目名称:yacs,代码行数:101,代码来源:layout_users_as_search.php

示例15: layout


//.........这里部分代码省略.........
         $text .= '<tr class="' . $class_title . '"><th>' . $prefix . $title . $suffix . '</th><th>' . i18n::s('Poster') . '</th><th>' . i18n::s('Messages') . '</th><th>' . i18n::s('Last active') . '</th></tr>' . "\n";
         $count = 1;
         // get last posts for this board --avoid sticky pages
         if (preg_match('/\\barticles_by_([a-z_]+)\\b/i', $item['options'], $matches)) {
             $order = $matches[1];
         } else {
             $order = 'edition';
         }
         if ($articles =& Articles::list_for_anchor_by($order, 'section:' . $item['id'], 0, 5, 'raw', TRUE)) {
             foreach ($articles as $id => $article) {
                 // get the related overlay, if any
                 $article_overlay = Overlay::load($article, 'article:' . $id);
                 // flag articles updated recently
                 if ($article['expiry_date'] > NULL_DATE && $article['expiry_date'] <= $context['now']) {
                     $flag = EXPIRED_FLAG . ' ';
                 } elseif ($article['create_date'] >= $context['fresh']) {
                     $flag = NEW_FLAG . ' ';
                 } elseif ($article['edit_date'] >= $context['fresh']) {
                     $flag = UPDATED_FLAG . ' ';
                 } else {
                     $flag = '';
                 }
                 // use the title to label the link
                 if (is_object($article_overlay)) {
                     $title = Codes::beautify_title($article_overlay->get_text('title', $article));
                 } else {
                     $title = Codes::beautify_title($article['title']);
                 }
                 // title
                 $title = Skin::build_link(Articles::get_permalink($article), $title, 'article');
                 // poster
                 $poster = Users::get_link($article['create_name'], $article['create_address'], $article['create_id']);
                 // comments
                 $comments = Comments::count_for_anchor('article:' . $article['id']);
                 // last editor
                 $action = '';
                 if ($article['edit_date']) {
                     // label the action
                     if (isset($article['edit_action'])) {
                         $action = Anchors::get_action_label($article['edit_action']);
                     } else {
                         $action = i18n::s('edited');
                     }
                     $action = '<span class="details">' . $action . ' ' . Skin::build_date($article['edit_date']) . '</span>';
                 }
                 // this is another row of the output
                 $text .= '<tr class="' . $class_detail . '"><td>' . $title . $flag . '</td><td>' . $poster . '</td><td style="text-align: center;">' . $comments . '</td><td>' . $action . '</td></tr>' . "\n";
             }
         }
         // more details
         $details = array();
         // board introduction
         if ($item['introduction']) {
             $details[] = Codes::beautify_introduction($item['introduction']);
         }
         // indicate the total number of threads here
         if (($count = Articles::count_for_anchor('section:' . $item['id'])) && $count >= 5) {
             $details[] = sprintf(i18n::s('%d threads'), $count) . '&nbsp;&raquo;';
         }
         // link to the section index page
         if ($details) {
             $details = Skin::build_link(Sections::get_permalink($item), join(' -&nbsp;', $details), 'basic');
         } else {
             $details = '';
         }
         // add a command for new post
         $poster = '';
         if (Surfer::is_empowered()) {
             $poster = Skin::build_link('articles/edit.php?anchor=' . urlencode('section:' . $item['id']), i18n::s('Add a page') . '&nbsp;&raquo;', 'basic');
         }
         // insert details in a separate row
         if ($details || $poster) {
             $text .= '<tr class="' . $class_detail . '"><td colspan="3">' . $details . '</td><td>' . $poster . '</td></tr>' . "\n";
         }
         // more details
         $more = array();
         // board moderators
         if ($moderators = Sections::list_editors_by_name($item, 0, 7, 'comma5')) {
             $more[] = sprintf(i18n::ns('Moderator: %s', 'Moderators: %s', count($moderators)), $moderators);
         }
         // children boards
         if ($children =& Sections::list_by_title_for_anchor('section:' . $item['id'], 0, COMPACT_LIST_SIZE, 'compact')) {
             $more[] = sprintf(i18n::ns('Child board: %s', 'Child boards: %s', count($children)), Skin::build_list($children, 'comma'));
         }
         // as a compact list
         if (count($more)) {
             $content = '<ul class="compact">';
             foreach ($more as $list_item) {
                 $content .= '<li>' . $list_item . '</li>' . "\n";
             }
             $content .= '</ul>' . "\n";
             // insert details in a separate row
             $text .= '<tr class="' . $class_detail . '"><td colspan="4">' . $content . '</td></tr>' . "\n";
         }
     }
     // end of processing
     SQL::free($result);
     $text .= Skin::table_suffix();
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:101,代码来源:layout_sections_as_jive.php


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