← WordPress

Directoria de utilizadores registados

Lida 5939 vezes

Offline

Pedro Lopes 
Beta tester
Mensagens 3568 Gostos 18
Feedback +6

Troféus totais: 32
Trófeus: (Ver todos)
Level 6 Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3

Bem, então há ai qualquer confusão... porque:

www.putadaloucura.com/author/bfms
www.putadaloucura.com/author/frias

Mostra-me os artigos todos que eu fiz e o frias fez.
--

Esse plugin que ele está a usar, o perfil fica nessa página? author/nome? Só se for isso realmente

Como eu lhe disse, no author.php em vez de listar os posts pode meter apenas a info do autor, nome, etc, etc. Mas ao fazer isso tirava os posts, ou então podia meter os dois.

Olha vê:
http://libertytuga.com/perfil/ORiOn/  - Perfil
http://libertytuga.com/perfil/ORiOn/?view=posts  - Posts
Offline

bfms 
Equipa
Mensagens 1769 Gostos 40
Feedback +1

Troféus totais: 35
Trófeus: (Ver todos)
Search Level 6 Apple User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Como eu lhe disse, no author.php em vez de listar os posts pode meter apenas a info do autor, nome, etc, etc. Mas ao fazer isso tirava os posts, ou então podia meter os dois.

Olha vê:
http://libertytuga.com/perfil/ORiOn/  - Perfil
http://libertytuga.com/perfil/ORiOn/?view=posts  - Posts

Ah muito bem, agora sim percebi o porquê de não ser como disse.
O plugin usa o author.php

O meu mal é sono, amanhã tenho de ver isto melhor ;)
Offline

Pedro Lopes 
Beta tester
Mensagens 3568 Gostos 18
Feedback +6

Troféus totais: 32
Trófeus: (Ver todos)
Level 6 Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3

Ah muito bem, agora sim percebi o porquê de não ser como disse.
O plugin usa o author.php

O meu mal é sono, amanhã tenho de ver isto melhor ;)

O plugin não usa nada.
Apenas serve para listar os users. :P

Vai dormir pah, ninguém te rouba o PDL. lol
Offline

Roberto Francisco 
Membro
Mensagens 669 Gostos 1
Feedback +3

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Grande discussão esta noite, heim!

Pois o problema é mesmo esse, eu quero ter uma listagem dos utilizadores, clicando no utilizador aparece o perfil  e dentro do perfil, um link ou até mesmo os posts do utilizador em questão mas pelo que encontro no codex devia estar a funcionar, penso eu de que!?

EDIT

Mas também só me aparece o perfil de um admin, dos outros utilizadores fica em branco  :-x
Offline

Pedro Lopes 
Beta tester
Mensagens 3568 Gostos 18
Feedback +6

Troféus totais: 32
Trófeus: (Ver todos)
Level 6 Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3

Mas também só me aparece o perfil de um admin, dos outros utilizadores fica em branco  :-x

Isso já é estranho. Vai vendo no ficheiro author.php pode ser que vejas o erro.

Ou deixa aqui o código.
Offline

Roberto Francisco 
Membro
Mensagens 669 Gostos 1
Feedback +3

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Bem, entretanto já fiz alguns progressos, mas... :cool:

- Ainda não resolvi o problema de mostrar só um perfil, agora aparecem-me dois mas não sei qual é a condicionante para não aparecerem os outros.

- Já consigo mostrar os últimos tópicos na página do perfil, mas só mostra um tópico, se o autor tiver mais, não mostra.

EDIT: Num dos únicos dois perfis mostra os tópicos todos no outro mostra só um.  :-x

O que tenho no author.php é isto:
Código: [Seleccione]
<?php
/**
 * The template for displaying Author Archive pages.
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
 */

get_header(); ?>


<div id="container">
<div id="content" role="main">

<?php
/* Queue the first post, that way we know who
 * the author is when we try to get their name,
 * URL, description, avatar, etc.
 *
 * We reset this later so we can run the loop
 * properly with a call to rewind_posts().
 */
if ( have_posts() )
the_post();
?>


<h1 class="page-title author"><?php printf__'%s''twentyten' ), "<span class='vcard'><a class='url fn n' href='" get_author_posts_urlget_the_author_meta'ID' ) ) . "' title='" esc_attrget_the_author() ) . "' rel='me'>" get_the_author() . "</a></span>" ); ?></h1>

<?php
// If a user has filled out their description, show a bio on their entries.
if ( get_the_author_meta'description' ) ) : ?>

<div id="entry-author-info">
<div id="author-avatar">
<?php echo get_avatarget_the_author_meta'user_email' ), apply_filters'twentyten_author_bio_avatar_size'100 ) ); ?>
</div><!-- #author-avatar -->
<br>
<p>Nome: <b><?php the_author_meta'user_firstname' ); ?> <?php the_author_meta'user_lastname' ); ?></b></p>
<p>Twitter: <?php the_author_meta('Twitter'); ?></p>
<br>
<p>Data de registo: <?php the_author_meta'user_registered' ); ?></p>
<p><?php the_author(); ?> has blogged <?php the_author_posts(); ?> posts</p>
<p>Other posts by <?php the_author_posts_link(); ?></p>
<br>
<div>
<div id="author-description">
<h2><?php printf__'Sobre %s''twentyten' ), get_the_author() ); ?></h2>
<?php the_author_meta'description' ); ?>
</div><!-- #author-description -->
</div><!-- #entry-author-info -->
<br>
<h1>Artigos do Autor</h1>
<br>
<?php if (have_posts()) : ?>
   <?php while (have_posts()) : the_post(); ?>
<div class="post">
<h2 id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small><?php the_time('F jS, Y'?> <!-- by <?php the_author() ?> --></small>
  </div>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft">
<?php posts_nav_link('','','&laquo; Previous Entries'?>
</div>
<div class="alignright">
<?php posts_nav_link('','Next Entries &raquo;',''?>
</div>
  </div>
<?php else : ?>
  <h2 class="center">Sem artigos</h2>
<p class="center"><?php _e("Este utilizador ainda não possui artigos."); ?></p>
  <?php endif; ?>
<?php endif; ?>

<?php
/* Since we called the_post() above, we need to
 * rewind the loop back to the beginning that way
 * we can run the loop properly, in full.
 */
rewind_posts();

/* Run the loop for the author archive page to output the authors posts
 * If you want to overload this in a child theme then include a file
 * called loop-author.php and that will be used instead.
 */
 get_template_part'loop''author' );
?>

</div><!-- #content -->
</div><!-- #container -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

Obrigado
Roberto Francisco
Offline

Pedro Lopes 
Beta tester
Mensagens 3568 Gostos 18
Feedback +6

Troféus totais: 32
Trófeus: (Ver todos)
Level 6 Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3

Bem... Fica aqui o meu ficheiro.

Código: [Seleccione]
    <?php
        
if(get_query_var('author_name')) :
            
$curauth get_userdatabylogin(get_query_var('author_name'));
        else :
            
$curauth get_userdata(get_query_var('author'));
        endif;

        global 
$wp_query;
        
$curauth $wp_query->get_queried_object();

        
$key_adsense="wpum_"."author_adsense";
        
$author_adsense get_usermeta($curauth->ID$key_adsense);
    
?>

   
    <?php if (isset($_GET['view']) && ($_GET['view'] == 'posts')) { ?>
        <div id="artigos">
            <?php
                
if (have_posts()) :
                
$count 1;
                while (
have_posts()) : the_post(); 
            
?>

            <div class="artigo" id="post-<?php the_ID(); ?>">
                <div class="miniatura">
                    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
                        <?php
                            
if (has_post_thumbnail())
                                
the_post_thumbnail'thumbnail' );
                            else
                                echo 
'<img src="http://libertytuga.com/wp-content/themes/libertytugav4/images/nothumbnail.jpg" alt="" title="" />';
                        
?>

                    </a>
                    <div class="data_mini"><div class="content_data_mini"><span><?php the_time('j F, Y'?></span></div></div>
                </div>
                <div class="titulo_index">
                    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
                </div>
               
                <div class="texto_index">
                    <div class="texto"><?php the_excerpt(); ?></div>
                   
                    <div class="lermais_comments">
                        <span><a href="<?php the_permalink() ?>">Ler mais...</a></span>
                        <span><?php comments_popup_link('Sem coment&aacute;rios''1 Coment&aacute;rio''% Coment&aacute;rios'); ?></span>
                    </div>
                    <div class="clear"> </div>
                </div>
            </div>
           
            <?php
                
if ($count == || $count == 4) {
                    echo 
'
                    <div class="adsense-posts">
                        <script type="text/javascript">
                            google_ad_client = "pub-2535850433745923";
                            /* DicasWP - Posts (468x60) */
                            google_ad_slot = "8734478835";
                            google_ad_width = 468;
                            google_ad_height = 60;
                        </script>
                        <script type="text/javascript"
                        src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
                        </script>
                    </div>
                    '
;
                }
            
?>

           
           
            <?php $count++; ?>
            <?php endwhile; ?>
            <?php else: ?>
           
            <div class="artigo-post" id="post-<?php the_ID(); ?>">
                <div class="titulo">
                    <h2>Pagina N&atilde;o Encontrada!</h2>
                </div>
                <div class="post-info">
                   
                </div>
               
                <div class="texto">
                    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/404.jpg" width="610" height="432" alt="404" />
                   
                    <strong style="margin: 0 12px;">Voltar ao <a href="<?php echo get_option('home'); ?>/" title="Inicio">Inicio</a>?</strong>
                   
                    <div class="rounded-menu" style="margin: 10px 12px;">
                        <strong>Procurar:</strong>
                        <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
                            <input class="procura_input" alt="Procurar" type="text" value="<?php echo wp_specialchars($s1); ?>" name="s" id="s" />
                            <input class="button" type="submit" value="Procurar" />
                        </form>
                    </div>
                </div>
            </div>
           
            <?php endif; ?>


            <?php if(function_exists('wp_pagenavi')) { ?>
            <div id="pagination">
                <?php wp_pagenavi(); ?>
            </div>
            <?php ?>
        </div>
       
    <?php } elseif (empty($_GET['view'])) { ?>
       
        <div id="artigos">
            <div class="artigo-post" id="post-<?php the_ID(); ?>">
                <div class="titulo">
                    <h2>Pagina de Perfil de <?php echo $curauth->display_name?></h2>
                </div>
                <div class="post-info">
                   
                </div>
               
                <div class="texto">
                    <div id="author">
                        <?php echo userphoto($curauth); ?>
                        <div id="autor_info">
                            <h4 id="nome_autor">
                                <?php if ($curauth->first_name != '') { ?>
                                    <?php echo $curauth->first_name?> <?php echo $curauth->last_name?> <small>(<a href="<?php echo get_option('home'); ?>/wp-admin/admin.php?page=rwpm_send&recipient=<?php echo $curauth->display_name?>">Enviar Mensagem Privada</a>)</small>
                                <?php } else { ?>
                                    <?php echo $curauth->display_name?> <small>(<a href="<?php echo get_option('home'); ?>/wp-admin/admin.php?page=rwpm_send&recipient=<?php echo $curauth->display_name?>">Enviar Mensagem Privada</a>)</small>
                                <?php ?>
                            </h4>
                            <p><?php echo $curauth->description?></p>
                           
                            <div id="infosub"><strong>Estatuto:</strong>
                                <?php if ($curauth->user_level == || $curauth->user_level == || $curauth->user_level == || $curauth->user_level == || $curauth->user_level == || $curauth->user_level == || $curauth->user_level == 7) { ?>
                                    <span style="color: #38773B;">Colaborador</span>
                                <?php } elseif($curauth->user_level == || $curauth->user_level == || $curauth->user_level == 10) { ?>
                                    <span style="color: #951C1C;">Administrador</span>
                                <?php } elseif($curauth->user_level == || $curauth->user_level == NULL) { ?>
                                    <span style="color: #000;">Usu&aacute;rio Normal</span>
                                <?php ?>
                            </div>
                           
                            <?php if ($curauth->user_url != '') { ?>
                                <div id="infosub"><strong>Site:</strong> <?php echo '<a href="'.$curauth->user_url.'" target="_blank">'.$curauth->user_url.'</a>'?></div>
                            <?php ?>
                           
                            <?php if ($curauth->twitter != '') { ?>
                                <div id="infosub"><strong>Twitter:</strong> <?php echo '<a href="http://twitter.com/'.$curauth->twitter.'" target="_blank">'.$curauth->twitter.'</a>'?></div>
                            <?php ?>
                           
                            <?php if ($curauth->user_level == || $curauth->user_level == || $curauth->user_level == || $curauth->user_level == || $curauth->user_level == || $curauth->user_level == || $curauth->user_level == || user_level == || $curauth->user_level == || $curauth->user_level == 10) { ?>
                                <div id="autor_verposts"><a href="?view=posts">Ver Posts do Autor</a></div>
                            <?php ?>
                        </div>
                        <div class="clear"></div>
                       
                        <div id="twitter_div">
                            <h3>&Uacute;ltimos Coment&aacute;rios</h3>
            <?php $usuario $curauth->user_emailrecent_user_comments($usuario,6); ?>
            </div>
                       
                        <?php if ($curauth->video != '') { ?>
                        <div id="video_author">
                            <h3>Video Favorito</h3>
                            <embed src="http://libertytuga.com/player/player.swf" width="250" height="200" allowscriptaccess="always" allownetworking="all" allowfullscreen="true" flashvars="file=<?php echo $curauth->video?>&skin=http://libertytuga.com/player/modieus.swf&stretching=fill&backcolor=ffffff&frontcolor=000000&lightcolor=B7302C&screencolor=000000&controlbar=none" />
                        </div>
                        <?php ?>
                       
                        <div class="clear"></div>
                       
                        <?php if ($curauth->user_level == 10 ||  $curauth->user_level == 1) { ?>
                        <?php if (get_usermeta($curauth->ID$key_adsense) != '') { ?>
                            <center><div id="author_adsense">
                                <?php echo $author_adsense?>
                            </div></center>
                        <?php ?>
                        <?php ?>
                    </div>
                </div>
               
                <div class="clear"><br /><br /></div>
            </div>
        </div>
       
    <?php ?>

Uso também o plugin WP User Manager para adicionar mais campos ao perfil.
Offline

Roberto Francisco 
Membro
Mensagens 669 Gostos 1
Feedback +3

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Obrigado Pedro.

Entretanto tentei utilizar o author.php de outro tema para fazer a comparação e tentar perceber o que podia mudar e acabei por utilizar o desse tema e ficou a funcionar.

Como não conheço muito de php ainda não cheguei à conclusão do que me estava a faltar mas vou ver se comparo também com o teu.

Por acaso também estou a usar o WP User Manager  :cool:

Obrigado,
Roberto Francisco