2016-07-18 16:39:37 +00:00
< ? php
$blogs = DB :: selectAll ( " select blogs.id, title, poster, post_time from important_blogs, blogs where is_hidden = 0 and important_blogs.blog_id = blogs.id order by level desc, important_blogs.blog_id desc limit 5 " );
?>
2017-11-25 04:00:00 +00:00
< ? php echoUOJPageHeader ( UOJConfig :: $data [ 'profile' ][ 'oj-name-short' ]) ?>
2019-09-10 02:15:20 +00:00
< div class = " card card-default " >
< div class = " card-body " >
2016-07-18 16:39:37 +00:00
< div class = " row " >
< div class = " col-sm-12 col-md-9 " >
2019-09-10 02:15:20 +00:00
< table class = " table table-sm " >
2016-07-18 16:39:37 +00:00
< thead >
< tr >
< th style = " width:60% " >< ? = UOJLocale :: get ( 'announcements' ) ?> </th>
< th style = " width:20% " ></ th >
< th style = " width:20% " ></ th >
</ tr >
</ thead >
< tbody >
< ? php $now_cnt = 0 ; ?>
< ? php foreach ( $blogs as $blog ) : ?>
< ? php
$now_cnt ++ ;
$new_tag = '' ;
if (( time () - strtotime ( $blog [ 'post_time' ])) / 3600 / 24 <= 7 ) {
$new_tag = '<sup style="color:red"> new</sup>' ;
}
?>
< tr >
style(web): change link location of blog functions
When using sub-directory blog, the 'blogof' not looks so good.
And, there are duplicate 'blog' characters, which making people uncomfortable.
So, for sub-directory blog, use 'blog' instead of 'blogof'.
'blog' is not as a sub folder or type anymore, use 'post' instead.
BREAKING CHANGE: Due to the conflict of 'blog' sub-directory, when go to blog post,
now should use 'blogs/{id}'; but when subdomain mode is on, you can still use 'blog'
to access these blog posts. 'blogof' is no longer used, and you need to inform users
that blog link is changed, to avoid the inaccessbility.
2019-07-12 04:13:30 +00:00
< td >< a href = " /blogs/<?= $blog['id'] ?> " >< ? = $blog [ 'title' ] ?> </a><?= $new_tag ?></td>
2016-07-18 16:39:37 +00:00
< td > by < ? = getUserLink ( $blog [ 'poster' ]) ?> </td>
< td >< small >< ? = $blog [ 'post_time' ] ?> </small></td>
</ tr >
< ? php endforeach ?>
< ? php for ( $i = $now_cnt + 1 ; $i <= 5 ; $i ++ ) : ?>
< tr >< td colspan = " 233 " >& nbsp ; </ td ></ tr >
< ? php endfor ?>
< tr >< td class = " text-right " colspan = " 233 " >< a href = " /announcements " >< ? = UOJLocale :: get ( 'all the announcements' ) ?> </a></td></tr>
</ tbody >
</ table >
</ div >
< div class = " col-xs-6 col-sm-4 col-md-3 " >
2019-09-10 02:15:20 +00:00
< img class = " media-object img-thumbnail " src = " /images/logo.png " alt = " Logo " />
2016-07-18 16:39:37 +00:00
</ div >
</ div >
</ div >
</ div >
2022-03-21 02:51:31 +00:00
2022-04-03 10:18:17 +00:00
< ? php if ( Auth :: check () && isNormalUser ( $myUser )) : ?>
2022-03-21 02:51:31 +00:00
< div class = " row " >
< div class = " col-sm-12 mt-4 " >
< h3 >< ? = UOJLocale :: get ( 'top solver' ) ?> </h3>
< ? php echoRanklist ( array ( 'echo_full' => true , 'top10' => true , 'by_accepted' => true )) ?>
< div class = " text-center " >
< a href = " /solverlist " >< ? = UOJLocale :: get ( 'view all' ) ?> </a>
</ div >
</ div >
</ div >
< ? php endif ?>
2016-07-18 16:39:37 +00:00
< ? php echoUOJPageFooter () ?>