Skip to content

Commit

Permalink
Merge pull request #142 from manualdousuario/Fix-Dez-3
Browse files Browse the repository at this point in the history
Adaptações ao Dez 3.0 e pequenas melhorias
  • Loading branch information
Gabriel Nunes authored Apr 8, 2024
2 parents 19d9e29 + 0c35343 commit e2e3d31
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 41 deletions.
4 changes: 2 additions & 2 deletions orbita.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Órbita
* Plugin URI: https://gnun.es
* Description: Órbita é o plugin para criar um sistema Hacker News-like para o Manual do Usuário
* Version: 1.12.1
* Version: 1.13
* Author: Gabriel Nunes
* Author URI: https://gnun.es
* License: GPL v3
Expand Down Expand Up @@ -40,7 +40,7 @@
/**
* Define plugin version constant
*/
define( 'ORBITA_VERSION', '1.21' );
define( 'ORBITA_VERSION', '1.13' );
define( 'ORBITA_IMAGE_MAX_SIZE', '10' ); // MB

/**
Expand Down
4 changes: 2 additions & 2 deletions public/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/main.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 38 additions & 34 deletions single-orbita.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,47 +40,47 @@

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

<header class="entry-header">
<?php
<header class="entry-header">
<?php

wp_timezone_string( 'America/Sao_Paulo' );
$date = get_the_date( 'd/m/Y H:i' );
wp_timezone_string( 'America/Sao_Paulo' );
$date = get_the_date( 'j/n/y, G\hi' );

$author_display_name = esc_html( get_the_author_meta( 'display_name', $post->post_author ) );
$author_nickname = esc_html( get_the_author_meta( 'nickname', $post->post_author ) );
$author_display_name = esc_html( get_the_author_meta( 'display_name', $post->post_author ) );
$author_nickname = esc_html( get_the_author_meta( 'nickname', $post->post_author ) );

echo do_shortcode( '[orbita-header]' );
echo do_shortcode( '[orbita-header]' );

if ( $external_url ) :
$separator = '?';
if(strpos($external_url, '?') !== false) :
$separator = '&';
if ( $external_url ) :
$separator = '?';
if(strpos($external_url, '?') !== false) :
$separator = '&';
endif;
the_title( '<h1 class="entry-title orbita-post-title"><a href="' . esc_url( $external_url ) . $separator . 'utm_source=ManualdoUsuarioNet&utm_medium=Orbita" rel="ugc">', '</a>&nbsp;' . orbita_link_options( $external_url, get_the_title() ) . '<span class="domain">' . $only_domain . '</span></h1>' );
else :
the_title( '<h1 class="entry-title orbita-post-title">', '</h1>' );
endif;
the_title( '<h1 class="entry-title orbita-post-title"><a href="' . esc_url( $external_url ) . $separator . 'utm_source=ManualdoUsuarioNet&utm_medium=Orbita" rel="ugc">', '</a>&nbsp;' . orbita_link_options( $external_url, get_the_title() ) . '<span class="domain">' . $only_domain . '</span></h1>' );
else :
the_title( '<h1 class="entry-title orbita-post-title">', '</h1>' );
endif;
?>

<div class="entry-meta orbita-meta">
<?php echo do_shortcode( '[orbita-vote]' ); ?><span data-votes-post-id="<?php the_ID(); ?>"><?php echo esc_html( $count ); ?></span> <?php echo esc_html( $votes_text ); ?> · <?php echo $author_display_name; ?> · <?php echo esc_html( $date ); ?>
</div>
</header>
?>

<div class="orbita-meta link-alt">
<?php echo do_shortcode( '[orbita-vote]' ); ?><span data-votes-post-id="<?php the_ID(); ?>"><?php echo esc_html( $count ); ?></span> <?php echo esc_html( $votes_text ); ?> · <?php echo $author_display_name; ?> · <?php echo esc_html( $date ); ?>
</div>
</header>

<div class="entry-content">
<?php
<div class="entry-content">
<?php
$oembed = false;
if( $external_url ) {
$providers = ['youtube.com', 'youtu.be', 'vimeo.com', 'dailymotion.com', 'dai.ly'];
foreach($providers as $provider) {
if( strpos( $only_domain, $provider ) !== false ) {
$oembed = true;
?>
<div class="orbita-oembed orbita-oembed-16by9">
<?php echo wp_oembed_get( $external_url ); ?>
</div>
<div class="orbita-oembed orbita-oembed-16by9">
<?php echo wp_oembed_get( $external_url ); ?>
</div>
<?php
break;
}
Expand All @@ -100,19 +100,23 @@
}
}
esc_textarea( the_content() );
?>
</div>
?>
</div>

<footer class="entry-footer">
<p><a href="/orbita">&laquo; Voltar ao índice de links</a></p>
</footer>
<?php the_post_navigation(
array(
'prev_text' => '<span class="nav-title">%title</span> <span class="nav-subtitle">' . esc_html__( '&raquo;', 'dez' ) . '</span>',
'next_text' => '<span class="nav-subtitle">' . esc_html__( '&laquo;', 'dez' ) . '</span> <span class="nav-title">%title</span>',
'class' => 'link-alt',
)
); ?>

</article>
</article>
<?php
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
endif;

endwhile; // End of the loop.
?>
Expand Down
4 changes: 2 additions & 2 deletions src/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ $desktop: "only screen and (min-width : 700px)";
}

.orbita_post-template-default {
.post-navigation {
display: none;
.navigation {
margin: var(--med-salto-grande) 0 !important;
}
}

Expand Down

0 comments on commit e2e3d31

Please sign in to comment.