Este é um post de José Lopes.
Este plugin possibilita a apresentação de uma lista completa de artigos de um autor incluíndo os artigos em que foi co-autor, calculando
ainda o número total de artigos.
Esta é a versão 2.0 do plugin
Author Complete Post List já descrito neste site.
Nesta versão está incluída a internacionalização do plugin, com versão inglesa (por defeito), portuguesa e francesa.
Todas as funcionalidades foram preservadas e a chamada das funções é compatível com a versão anterior. Basta fazer o download e activar
sem que sejam necessárias quaisquer alterações.
Posted by José Lopes.
This plugin displays the complete post list of one Author including his participations has co-author, calculating the total number of posts.
This is the version 2.0 of the
Author Complete Post List plugin already presented on this site.
This version includes the internacionalization, with english, portuguese and french versions.
All the funcionalities were preserved and the functions call is compatible with the previous version. Just download and activate without any
other changes.
Download
Pode fazer o download de um dos ficheiros:
Também pode obter este Plugin no reportório do Wordpress em
Instalação
- Descomprimir o ficheiro para o directório wp-content/plugins.
- Será criada a directoria author-complete-post-list aquando da descompressão, caso contrário criar manualmente e
colocar os ficheiros do plugin dentro dela.
- Activar o plugin Author Complete Post List através do painel administrativo.
Modo de Utilização
Este plugin foi criado com o objectivo de ser aplicado no ficheiro author.php, criado a partir do
exemplo do Wordpress,
pelo que o modo de utilização é definido neste âmbito.
Assim, bastam as duas linhas de código seguintes para obter a lista de artigos do autor.
<?php total_posts($author, $curauth->user_login) ; ?>
<?php full_post_list($author, $curauth->user_login) ; ?>
Se estiver a fazer uma actualização da versão não necessita de mudar estas linhas no seu template.
Descrevendo o código:
- A primeira linha devolve o texto introdutório para a lista de artigos, com o total de artigos.
- A segunda linha devolve a lista de todos os artigos do autor, incluído aqueles que é co-autor, ordenada pelo mais recente.
- Quanto aos argumentos das funções:
- O primeiro representa o autor para a página em visionamento.
- O segundo selecciona o login do autor do posto com o tag user_login
Exemplo de output:
O autor tem 3 artigo(s) neste site:
- Artigo 3 a 06/07/2007, arquivado em Sem Categoria
- Artigo 2 a 06/07/2007, arquivado em Sem Categoria
- Artigo 1 a 05/07/2007, arquivado em Sem Categoria
Notas finais
Deve fazer atenção a como regista o co-autor:
- Para inserir um co-autor (ou mais) num artigo, utilizo o plugin
multiple-authors que permite incluir no Campo Personalizado uma chave de nome other_author cujo valor deve ser o
nome de login do co-autor (uma chave por cada co-autor).
- O uso do plugin multiple-authors permite incluir facilmente no
artigo os nomes dos vários autores ou de um só se for o caso, assim como registar automaticamente um co-autor se o utilizador tiver o papel
de Editor. Tem as suas vantagens e desvantagens pois ao adicionar automaticamente autores pode adicionar um que por engano editou e gravou
o artigo, embora se possa posteriormente anular essa acção apagando a respectiva entrada no Campo Personalizado do artigo.
- Caso não utilize este plugin, não é obrigatório, pode adicionar a chave manualmente desde que mantenha o nome other_author
que o nosso plugin funcionará. É importante que a chave tenha o nome other_author.
- Tem ainda de fazer atenção que o valor da chave tem de ser o nome de login do autor, caso contrário ele não será reconhecido.
Deixe uma mensagem se quiser contribuir com outra versão linguística.
Download
You can download one of the files that serves you better:
You may also find this Plugin in the Wordpress repository at
Installation
- Descompress the file to the directory wp-content/plugins.
- The directory author-complete-post-list will be created, but if not do it manually and place the plugin files inside.
- Activate the plugin Author Complete Post List on the administration pannel.
How to use it
This plugin was created to be used in the file author.php, defined on the Wordpress
example, so the way to use it is
defined with this assumption.
Two code lines are enough to get the author's post list.
<?php total_posts($author, $curauth->user_login) ; ?>
<?php full_post_list($author, $curauth->user_login) ; ?>
If you are updating the version you don't need to change these lines in your template.
Explaining the code:
- The first line returns the introduction text for the post list, with the total of posts.
- The second line returns the author's post lists, including the ones in which he is co-author, sorted by the most recent post.
- Checking the function args:
- The first identifies the author.
- The second selects the author login with the tag user_login.
Output example:
The author has 3 post(s) :
- Post 3 on 06/07/2007, stored in Nowhere
- Post 2 on 06/07/2007, stored in Nowhere
- Post 1 on 05/07/2007, stored in Nowhere
Final notes
You should be aware how you define the co-author:
- To insert one or more co-authors in a post you can use the plugin
multiple-authors that allows to set on Personalized Field the key word other_author, whose value should be the
co-author login name (one key by co-author).
- The use of the plugin multiple-authors allows to
easily include several author names in the post and to automatically record the co-author if the user edits the post.
It has advantages and disadvantages because recording automatically the co-author it may include an author by mistake.
- If you don't use the plugin, you don't have to, you always have to use the other_author key word to manually
add the author name. It is important to keep the name other_author as the key word otherwise it won't work.
- You must place the author login name in the key word value, otherwise it will not be recognized.
Leave us your message if you want to send us a new language version.
BTW, thanks for plugin.