Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jpjoao committed Mar 11, 2016
2 parents d5fe435 + b346652 commit 1444c8e
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 48 deletions.
62 changes: 62 additions & 0 deletions category-comunidade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
/**
* The template for displaying Category pages.
*
* Used to display archive-type pages for posts in a category.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>

<section class="content cat archive">
<div class="row-fluid span12">
<h1 class="blue-block"><strong>RFCs do PHPSP</h1>
<table class="table table-striped">
<thead>
<tr>
<th>Título</th>
<th>Status</th>
<th>Autor</th>
<th>Criação</th>
<th>Fim da Votação</th>
</tr>
</thead>
<tbody>
<?php while ( have_posts() ) :
the_post();
$vote_end = date_create_from_format('Y-m-d', get_post_meta(get_the_ID(), '_wti_like_post_expiration_date', true));
if ($vote_end) {
$vote_end->setTime(23,59,59);
$vote_end_full = date_format($vote_end, 'Y-m-d H:i:s');
$vote_end_display = date_format($vote_end, 'd/m/Y');
}
else{
$vote_end_full = '--';
$vote_end_display = '--';
}
$status = get_post_meta(get_the_ID(), 'wti_like_post_status', true);
$internal_sign = has_category('rfc-internals')?'*':'';
?>
<tr>
<td><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); echo $internal_sign; ?></a></td>
<td><?php echo $status ?></td>
<td><?php the_author() ?></td>
<td><time itemprop="dateCreated" datetime="<?php the_time('Y-m-d H:i:s'); ?>"><?php the_date(); ?></time></td>
<td><time itemprop="dateVoteEnded" datetime="<?php echo $vote_end_full; ?>"><?php echo $vote_end_display; ?></time></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
<?php if ( current_user_can('edit_users') ) :?>
<blockquote> * Significa que a RFC é privada</blockquote>
<?php endif; ?>
<div class="nav-previous">&nbsp;<?php previous_posts_link( '<< Página Anterior' ); ?></div>
<div class="nav-next">&nbsp;<?php next_posts_link( 'Próxima Página >>' ); ?></div>
</div>
</section>

<?php get_footer(); ?>
58 changes: 58 additions & 0 deletions category-rfc-internals.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
/**
* The template for displaying Category pages.
*
* Used to display archive-type pages for posts in a category.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>

<section class="content cat archive">
<div class="row-fluid span12">
<h1 class="blue-block"><strong>RFCs do PHPSP</h1>
<table class="table table-striped">
<thead>
<tr>
<th>Título</th>
<th>Status</th>
<th>Autor</th>
<th>Criação</th>
<th>Fim da Votação</th>
</tr>
</thead>
<tbody>
<?php while ( have_posts() ) :
the_post();
$vote_end = date_create_from_format('Y-m-d', get_post_meta(get_the_ID(), '_wti_like_post_expiration_date', true));
if ($vote_end) {
$vote_end->setTime(23,59,59);
$vote_end_full = date_format($vote_end, 'Y-m-d H:i:s');
$vote_end_display = date_format($vote_end, 'd/m/Y');
}
else{
$vote_end_full = '--';
$vote_end_display = '--';
}
$status = get_post_meta(get_the_ID(), 'wti_like_post_status', true);
?>
<tr>
<td><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></td>
<td><?php echo $status ?></td>
<td><?php the_author() ?></td>
<td><time itemprop="dateCreated" datetime="<?php the_time('Y-m-d H:i:s'); ?>"><?php the_date(); ?></time></td>
<td><time itemprop="dateVoteEnded" datetime="<?php echo $vote_end_full; ?>"><?php echo $vote_end_display; ?></time></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
<div class="nav-previous">&nbsp;<?php previous_posts_link( '<< Página Anterior' ); ?></div>
<div class="nav-next">&nbsp;<?php next_posts_link( 'Próxima Página >>' ); ?></div>
</div>
</section>

<?php get_footer(); ?>
61 changes: 37 additions & 24 deletions category-rfc.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,48 @@
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/

//check for private RFCs
if (!current_user_can('edit_private_posts'))
{
global $wp_query;
$wp_query->set_404();
status_header(404);
nocache_headers();
include( get_query_template( '404' ) );
die();
}

get_header(); ?>

<section class="content cat archive">
<div class="row-fluid span12">
<div class="span8">
<h1 class="blue-block"><strong>Categoria: </strong><?php echo single_cat_title('', false ); ?></h1>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'archive', 'post' ); ?>
<h1 class="blue-block"><strong>RFCs do PHPSP</h1>
<table class="table table-striped">
<thead>
<tr>
<th>Título</th>
<th>Status</th>
<th>Autor</th>
<th>Criação</th>
<th>Fim da Votação</th>
</tr>
</thead>
<tbody>
<?php while ( have_posts() ) :
the_post();
$vote_end = date_create_from_format('Y-m-d', get_post_meta(get_the_ID(), '_wti_like_post_expiration_date', true));
if ($vote_end) {
$vote_end->setTime(23,59,59);
$vote_end_full = date_format($vote_end, 'Y-m-d H:i:s');
$vote_end_display = date_format($vote_end, 'd/m/Y');
}
else{
$vote_end_full = '--';
$vote_end_display = '--';
}
$status = get_post_meta(get_the_ID(), 'wti_like_post_status', true);
?>
<tr>
<td><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></td>
<td><?php echo $status ?></td>
<td><?php the_author() ?></td>
<td><time itemprop="dateCreated" datetime="<?php the_time('Y-m-d H:i:s'); ?>"><?php the_date(); ?></time></td>
<td><time itemprop="dateVoteEnded" datetime="<?php echo $vote_end_full; ?>"><?php echo $vote_end_display; ?></time></td>
</tr>
<?php endwhile; ?>
<div class="nav-previous">&nbsp;<?php previous_posts_link( '<< Página Anterior' ); ?></div>
<div class="nav-next">&nbsp;<?php next_posts_link( 'Próxima Página >>' ); ?></div>
</div>
<div class="span4 right-column">
<?php if (is_active_sidebar('content-right-column-1')) : ?>
<?php dynamic_sidebar('content-right-column-1'); ?>
<?php endif; ?>
</div>
</tbody>
</table>
<div class="nav-previous">&nbsp;<?php previous_posts_link( '<< Página Anterior' ); ?></div>
<div class="nav-next">&nbsp;<?php next_posts_link( 'Próxima Página >>' ); ?></div>
</div>
</section>

Expand Down
4 changes: 2 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,8 @@ function phpsp_busca_menu( $args ) {
}

function removeRFCFromFeed($query) {
$cat = get_category_by_slug('rfc');
if ($query->is_feed) {
$cat = get_category_by_slug('rfc-internals');
if (!current_user_can( 'edit_users' )) {
$query->set('cat','-'.$cat->term_id);
}
return $query;
Expand Down
50 changes: 29 additions & 21 deletions single.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
* @since Twenty Twelve 1.0
*/

$is_rfc = (has_category('rfc-internals') || has_category('rfc')) ? true : false;

//check for private RFCs
if (has_category('rfc') && !current_user_can('edit_private_posts'))
if (has_category('rfc-internals') && !current_user_can('edit_users'))
{
global $wp_query;
$wp_query->set_404();
Expand All @@ -24,7 +26,9 @@

<section class="content sing single">
<div class="row-fluid span12">
<?php if (!$is_rfc) : ?>
<div class="span8">
<?php endif; ?>
<article itemtype="http://schema.org/Article" itemscope>
<h2><?php the_title(); ?></h2>
<div class="author">
Expand All @@ -35,33 +39,37 @@
<div class="excerpt"><?php the_content(); ?></div>
<?php the_tags( '<p class="tags">Tags: ', ', ', '</p>'); ?>
</article>
<?php
if ( get_the_author_meta( 'description' ) ) : ?>
<div class="author-info">
<div class="author-description">
<h2 class="blue-block"><?php printf( __( 'Sobre <strong>%s</strong>' ), get_the_author() ); ?></h2>
<div class="author-avatar">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 120 ) ); ?>
</div><!-- .author-avatar -->
<p><?php the_author_meta( 'description' ); ?></p>
</div><!-- .author-description -->
<?php if(get_the_author_meta('url')): ?>
<div class="author-card">
<p class="author-link">Site: <a href="<?php echo get_the_author_meta('url');?>"><?php echo get_the_author_meta('url'); ?></a></p>
</div>
<?php endif; ?>
<p>Mais posts de <?php echo the_author_posts_link(); ?>.</p>
</div><!-- .author-info -->
<?php else: ?>

<?php if (!$is_rfc) : ?>
<?php
if ( get_the_author_meta( 'description' ) ) : ?>
<div class="author-info">
<div class="author-description">
<h2 class="blue-block"><?php printf( __( 'Sobre <strong>%s</strong>' ), get_the_author() ); ?></h2>
<div class="author-avatar">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 120 ) ); ?>
</div><!-- .author-avatar -->
<p><?php the_author_meta( 'description' ); ?></p>
</div><!-- .author-description -->
<?php if(get_the_author_meta('url')): ?>
<div class="author-card">
<p class="author-link">Site: <a href="<?php echo get_the_author_meta('url');?>"><?php echo get_the_author_meta('url'); ?></a></p>
</div>
<?php endif; ?>
<p>Mais posts de <?php echo the_author_posts_link(); ?>.</p>
</div><!-- .author-info -->
<?php endif; // author meta ?>
<?php endif; //is_rfc ?>
<?php if (!$is_rfc) : ?>
<?php comments_template(); ?>
<?php endif; ?>
<?php comments_template(); ?>
<?php if (!$is_rfc) : ?>
</div>
<div class="span4 right-column">
<?php if (is_active_sidebar('content-right-column-1')) : ?>
<?php dynamic_sidebar('content-right-column-1'); ?>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</section>

Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: http://phpsp.org.br/
Author: phpsp contributors
Author URI: https://github.com/PHPSP/phpsp-blog-theme/graphs/contributors
Description: Tema Wordpress do site do phpsp.org.br
Version: 1.6.2.1
Version: 1.6.3
License: Creative Commons
License URI: http://creativecommons.org/licenses/by-nc-nd/3.0/deed.pt
Tags: php, phpsp
Expand Down

0 comments on commit 1444c8e

Please sign in to comment.