EG-Attachments crée un shortcode vous permettant d’afficher la liste des pièces jointes d’un article. WordPress propose des fonctions pour ajouter des pièces jointes, mais il ne fournit rien pour les présenter/afficher correctement. EG-Attachments affiche la liste des pièces jointes, dans le format que vous souhaitez: vous pouvez choisir la liste des pièces à lister, la taille des icônes, … La liste contient des informations comme le nom, la taille du fichier.
Description
EG-Attachments ajoute donc le shortcode [ attachments]. Ce shortcode accepte de multiples options. Contrairement à d’autres shortcode, vous n’avez pas besoin de retenir toutes ces options, puisque EG-Attachments est intégré à TinyMCE: depuis la page d’édition d’un article, cliquer simplement sur l’icône représentant un trombone, le plugin affichera alors une fenêtre vous permettant de choisir l’ensemble des paramètres du shortcode.
Cette fonction n’est visible qu’à partir de WordPress 2.7.
Si vous le souhaitez, vous pouvez utiliser le shortcode de façon classique:
- dans un article en tapant
[ attachments <options>], - dans une template d’un thème, en utilisant la commande
do_shortcode('[ attachments >options<]');.
A partir de la version 1.20 du plugin, vous avez également la possibilité, grâce à une option spécifique, d’ajouter automatiquement la liste des pièces jointes à tout les articles qui en disposent sans utiliser de shortcode. Il s’agit de la fonction Shortcode automatique.
Installation
Ce plugin s’installe de façon tout à fait classique:
- EG-Attachments est disponible sur le site WordPress.org, ou vous pouvez le télécharger,
- Une fois téléchargé, décompresser le fichier
eg-attachments.zip, - Copier les fichiers obtenus dans un sous-répertoire du répertoire
plugins(en généralwp-content/pluginssur votre plateforme WordPress, - Activer le plugin via le menu approprié dans l’interface d’administration.
Le plugin est alors prêt à être utilisé. Avec WordPress 2.7, vous pouvez effectuer l’installation directement depuis l’interface d’administration, en utilisant les fonctionnalités de cette version.
Vous pouvez télécharger le plugin à cette adresse.
Utilisation
Comme indiqué précédemment, EG-Attachments peut être utilisé:
- dans un article, en insérant le shortcode
[ attachments <options>], - dans un fichier template (pour le développement d’un thème par exemple), en utilisant la fonction
do_shortcode.
Les options du shortcode sont:
- size: indique la taille de la liste. Trois valeurs possibles: large (valeur par défaut), medium et small
- docid: liste des identifiants des pièces jointes à afficher. Ces identifiants doivent être séparés par un virgule. Si cette option est vide, ou non spécifiée, toutes les pièces seront affichées. Vous avez la possibilité également de demander le premier ou le dernier élément avec les mots-clés
firstetlast(docid=firstpar exemple). Attention, la notion de premier et dernier dépend bien sur des règles de tri demandées. Ces mots-clés doivent être employés seuls. - orderby: permet de spécifier la clé de tri. Les valeurs possibles sont ID ou titre. Cette opton permet également d’indiquer le sens du tri (Ascendant ou descendant). Par défaut les pièces jointes sont triés par leur titre, et par ordre alphabétique,
- title: titre à afficher avant la liste. Par défaut aucun titre n’est affiché. Si le titre contient des espaces, il doit obligatoirement être encadrer de guillemets (exemple: titre= »Essai de titre avec espaces »),
- titletag: balise HTML qui sera utilisé pour l’affichage du titre. Par défaut la balise est H2,
- label: choix du label indiquant le nom du document. Valeurs possibles: filename ou doctitle. Valeur par défaut: filename. Cette option n’est valable que pour les listes de taille Large et Medium.
- fields: list of fields to display. Values: none, caption, description, or a set of values such as « caption,description » (comma separated). Default: caption (same behavior than previous version)
- force_saveas permet de « forcer » l’apparition de la boîte de dialogue proposant le téléchargement. Cela évite d’avoir des comportements hétérogènes (affichage pour certains documents, téléchargement pour d’autres). Les valeurs possibles sont TRUE ou FALSE. La valeur par défaut est définie par l’option équivalente dans le plugin.
Exemples
Voici quelques copies d’écran de l’affichage:
Utilisation avancée
Vous pouvez modifier le style d’affichage en modifiant la feuille de styles eg-attachments.css. Cette feuille de styles est stockée dans le répertoire du plugin, mais vous pouvez en créer une copie dans le répertoire de votre thème, puis modifier cette copie. Vous pouvez également compléter ou remplacer les icônes du plugin. Il suffit pour cela, de copier des fichiers de type GIF, JPG ou PNG dans le sous-répertoire images du plugin. Ces icônes ne doivent pas dépasser 48×48 ou 52×52.






English
It’s WordPress 3.0.1
@Janet: I tried again the plugin, using files with the same name than your example, and I haven’t the sort error.
The plugin is using
get_childrenfunction from WordPress to get attachments and sort them.Which version of WordPress are you using?
Here is the page where that shortcode is in use: http://www.storage-brain.com/papers/
@Janet: I tried the shortcode you mentionned, and didn’t the problem on my test platform.
Could you give me an example of the title you have?
Emmanuel, I added that to the short code, but it is still not working. It now reads:
[attachments label=doctitle fields=,description force_saveas="1" logged_users="0" orderby="title ASC"]
@Janet: you can add the attribute orderby and specify the sort key. For exemple: orderby= »title ASC »
I have installed this plug-in for a client and he is very happy with it, except that it is displaying the PDFs in the order they were added, and not alphabetically by title, which is what I put in the settings.
My shortcode is: [attachments label=doctitle fields=,description force_saveas="1" logged_users="0"]
Do I need to add something to that?
@Manmeet:
I don’t understand this behavior, because the ‘Force Save As’ option is not used to get the url of the document.
You said that « My full url path is empty and uploads folder is default path. » . What about the two other parameters: WordPress address (menu settings / General),
and Site address (menu settings / General). They are similar or different?
Hi EG
I removed the ‘force save as’ option from the settings and again added shortcode.Now they work.They dont force save as but the attachments are downloading and working fine.
Check if you this bug.
My full url path is empty and uploads folder is default path.
@Manmeet:
For this problem, I see two possible causes:
- Security: the plugin cannot access to the file,
- Path and/or url
Could you give me your configuration for the following parameters:
- WordPress address (menu settings / General),
- Site address (menu settings / General),
- Store uploads in this folder (menu settings / Media),
- Full URL path to files (menu settings / Media) ?
With these information, I will try to understand what happen
Hi, I was just wondering if you have managed to resolve the issue Hani raised previously on 22 March i.e. is it possible to show the attachment from another post? Thanks.
Hi EG
I have got the 0 kb bug.
I dont know what went wrong.I am not able to download files thru EG attachments.I get 0 KB files.
I m using wordpress 3.0.I made some changes and it stopped working but i restored everything from back up but still its not working.
Also it works on xampp local host but on server it doesnt.It used to work on server too.
Pls tell the solution.
For this problem, I see two possible causes:
- Security (but you adress it)
- Path / url
Could you give me your configuration for the following parameters:
- WordPress address (menu settings / General),
- Site address (menu settings / General),
- Store uploads in this folder (menu settings / Media),
- Full URL path to files (menu settings / Media) ?
Hey Emmanual, I have:
1) created a new group in the system (« wppgroup »),
2) created a new user on the system « userapache »
3) added « userapache » to the « wppgroup »
4) updated httpd.conf with User « userapache » and restarted
5) ownership of all files in my WordPress directories to admin:wppgroup
Still nothing. Cannot see the filesize, cannot even download. I download a zero (0k) file.
I am at wit’s end here. Any suggestion?
Rebonjour,
La page de configuration indique que le choix des champs à afficher (légende, description) est applicable pour la liste au format moyen ou grand. Il y a un bug, car la description n’est jamais affichée pour le format moyen.
Bonjour,
Je découvre votre très bon plugin. Je vous signale un bug mineur de traduction dans eg-attachments/lang/eg-attachments-fr_FR.po
#: eg-attachments-admin.inc.php:
msgid « Display icons: »
msgstr « Afficher les icôones: »
qui donne « Afficher les icôones: », avec donc le ‘o’ en trop.
Et juste une remarque pour pinailler : en principe, les double points sont séparés du mot qui précède par un espace. A corriger éventuellement dans les traductions suivantes :
msgstr « Url du formulaire de connexion ou d’enregistrement: »
msgstr « Afficher les icônes: »
msgstr « Format personnalisé, préfixe de la liste: »
msgstr « Format personnalisé, format de la liste: »
msgstr « Format personnalisé, suffixe de la liste: »
Emmanual,
Great plugin. I, like Hani, am looking for the functionality to list attachments that are not part of the post. This is because I have to use an inline post displayer to bring data in via shortcode into wp e-commerce plugin. But when i reference the post, the EG-attachments will not show, perhaps because it is trying to display outside of the original post (where the files are attached). I hope this makes sense.
Anyway, looking forward to your implementation of that feature if you find the time. Thanks again.
Bonjour Philippe,
Ce problème est commun à tout site web. Tout objet étant référencé par une url, peut être utilisé par une personne extérieure au site. Certains sites peut scrupuleux font ainsi des liens vers nos propres sites, ce qui leur permet d’afficher nos ressources, sans consommer de bande passante supplémentaire.
La solution ne se trouve, ni au niveau des plugins, ni au niveau de WordPress (sauf a protéger les articles par des mots de passe), mais au niveau de apache, en modifiant le fichier htaccess, pour que seul le site ait le droit de faire référence aux fichiers jpg, gif, png, pdf, …
Il existe de nombreux tutoriaux sur le sujet sur Internet.
Bonjour Emmanuel,
J’utilise depuis qqs temps votre magnifique plugin. Je viens d’apprendre que qqun peut donner un lien directe a un PDF au lieu d’etre obliger d’etre inscrit au site. Est-ce que c’est un bug ou est-ce-qu’il serait possible dans une nouvelle version du plugin d’assurer la securite des fichiers attaches pour que les gens ne puissent pas les telechargers sans etre enregistre sur le site?
Cordialement,
Philippe
Hi Rob,
In the menu Settings / EG-Attachments, you have two ways:
Check the option Force Save As when users click on the attachments,
Use the custom format, and specify target= »blank » in the a href tag
Is there a way to make documents load in a new window. I am using .pdf files.
Thanks
Great plugin
Rob
EG-Attachments uses standard mecanisms of WP. That means he can get only documents or files considered as attachments. For WP, attachments are listed in the WP database…
Great plugins. I like it. I have 1 question: Is it possible to attach a file/doc from a folder that’s not uploaded by the WP media database ?
@Elisa: for the error, I need to know which version of WordPress and PHP you use.
For the sidebar, the next version of the plugin will include a widget.
another question: is there a way to add this to a sidebar?
Hi, I’m having trouble with the TinyMCE button, when I click on it I get an error:
« 500 Internal Server Error
The request was not completed. The server met an unexpected condition.
Any suggestions?
@Cameron: I use the PHP
filesizeto get the size of attachments. For me, this function requires « Read only » permission. This permission must be set for the user account used to start apache.Tell me, if you don’t solve the problem.
@SCP: J’ai rencontre le probleme lors de certains essais avec le version 1.6.0. Je vais essayer de sortir la version 1.7 avant fin mai, elle devrait corriger l’erreur.
Love the plugin. Thanks for your work.
I have a question about the permissions necessary to display filesize.
On my development box, I am running Ubuntu and am able to see the filesize value after the attachment link.
However, on my staging box, I am not seeing it. The EG-Attachments settings are 100% identical.
Is there a file permission on the server that needs to be set in order to make the file size appear?
Bonjour,
Le module de statistique ne semble pas fonctionner chez moi.
J’ai activé la case à cocher « Enregistrer les statistiques des clics sur les pièces jointes ». Mais je n’ai rien qui apparait dans le menu « outils ».
J’utilise WordPress 2.9.2 avec la version 1.6.0 du plugin. Quelqu’un a t’il déjà rencontré ce problème ?
Hi Pavel,
Did you change anything in your blog?
- Parameters such as blog url?
- Security (rights on files)?
- Install a new plugin?
- Change a parameter in your PHP configuration?
Hi Enmanuel, thanks for great plugin!
On my site all work fine, but recently the download file have 0 kb. Uninstall and reinstall the plugin and the bug still. Search information for this bug, but nothing. Please helpme. I use currently WordPress 2.9.2 and EG-attachments 1.6.0
Hi Hani,
In fact, I take a look to the document of the plugin, and I understand your question. Today, EG-Attachments doesn’t allow to display attachments from another posts.
I will modify it to include this feature, and publish it soon.
Emmanuel
Thank you for your reply
but please help me how to do that.
how to attache one document in more that a post using your plugin and using the short code.
Hi Hani,
In WordPress, we have to levels: the database (data organization), the display.
For WordPress, an attachment (image, pdf doc) is nothing else than a post that are attached to other SINGLE post. An attachment can be attached to one and only one post. WordPress attachs the document just after the upload phase.
Then, in the media manager, wordpress displays all attachments.
When you want to display a document in a post (an image for example), WordPress shows you a list of documents (not only documents on the current post), and insert the link of the document when you select it.
So, for EG-Attachments:
- if you don’t want to see the list of attachments of the current post, you just delete the shortcode (supposing that auto-shortcode is disabled)
- if you want to display the list of attachments of another post, you can specify in the shortcode, the id of the post to which document is attached.
hi Emmanuel
this is the point
the EG-attachments work fine for one file attached for only one post and in the media library it shows that the PDF (for example) is attache to the « post name ». thats why i cant de-attached the document just from removing the short code.
if i want to attache the same PDF to another post i have to delete it from my media library. and re-uploaded and re attache it again.
wordpress allow to attache any file to any post. while EG-attachment cant recognize the attachment in that post.
Thanks for reply – and i am sorry for using your commenting area
@Hani:
1) EG-Attachment is just displaying what is existing in WordPress. If you attach a document, EG-Attachment will display this document. If you don’t want to display the document, you delete the shortcode, or disable the auto-shortcode feature. If you want to detach the document, you have to delete the attachment into WordPress.
2) In WordPress, an attachment is always attached to a single post or page. But you can display this attachment in other posts or pages by specifying the id of the post where documents are attached.
@ Emmanuel
when i need to attached a file to a post, this will work very nice and i really like its output.
but there is two major problem
First — i cannot de-attached a file from a post.
Second — i cannot attache the same file to many other posts.
@Hani:
Could you describe the problems you faced, and with which language(s)?
hi
the plugins is what i have searched for from a long time, but i faced some problem in WP with the RLT admin pages.
Emmanuel,
Tout me semble parfait a present!
Ton dernier post m’a bien aide!!
Merci encore!
Js
@JS:
Il y a un croisement de commentaires. Ma remarque sur les cookies concerne un probleme de visibilite des pieces jointes sur un article protege par mot de passe (message de Bruno).
Concernant le probleme du double affichage, ma question etait: y-a-t-il un shortcode [ attachments] dans l’article.
- Si oui, le double affichage est normal: il y a celui du shortcode « manuel », et celui du shortcode automatique,
- Si non, il y a effectivement un probleme.
Emmanuel.
De plus, lorsque je modifie l’option « page d’activation » a « sur toutes les pages », le problème est présent également sur la page d’accueil…
Bonjour,
Merci de vous être penche sur le problème.
Je viens d’effectuer le test(suppression des cookies et deconnection) mais le problème persiste…
Cordialement,
Js
@Bruno
J’ai effectué quelques tests dans les memes conditions, et je n’ai pas réussi à reproduire le problème. Par contre, j’ai une piste potentielle: WordPress ne demande qu’une seule fois le mot de passe, en mémorisant (avec des cookies certainement) l’authentification.
Donc, lors du premier passage, WordPress demande le mot de passe, et les passages suivants, il affiche directement l’article (si le mot de passe etait correct la premiere fois). J’ai constate ce mode de fonctionnement en faisant les tests.
Pour confirmer cela, il faut:
- se deconnecter de l’interface d’administration de wordpress
- Effacer les cookies du navigateur
- Consulter le blog, notamment la page ou se trouve l’article pour voir si le comportement a changer.
Emmanuel.
Bonjour JS,
Je n’arrive pas a reproduire l’erreur (double affichage).
Ce type d’affichage correspond a l’utilisation simultanee du shortcode, et de l’activation du shortcode automatique, avec comme option « Seulement pour les articles et les pages ».
Sur la page d’accueil le shortcode s’affiche. Sur la page de l’article, le shortcode s’affiche, ainsi que l’auto-shortcode.
Si les problemes d’affichage ne viennent pas de là, il me faudrait la liste des valeurs des options du plugins, pour que je puisse cibler les tests.
Emmanuel.
Bonjour,
J’adore ce plugin mais je rencontre aujourd’hui un problème que je ne parviens pas a régler.
J’utilise la version 1.6 sur wordpress 2.9.2.
Sur ma page d’accueil, la liste de mes articles est parfaite, l’attachement est correct.
Par contre, lorsque je vais sur un article, l’attachement est en double.
Je peux fournir des screenshots si nécessaire.
D’avance merci !
Js
Bonjour,
J’utilise EG-Attachements depuis quelques temps avec satisfaction, mais j’ai un p’tit problème avec la fonction qui permet de restreindre l’accès au(x) fichier(s) aux utilisateurs enregistrés : ça ne semble pas fonctionner !
J’ai coché l’option dans la page des options, mais rien n’y fait, le document que je publie est visible, que je sois connecté ou non.
WP est en version 2.9.2 FR, les plugins installés sont : EG-Attachments, iMasters WP Statistics, Lightbox 2, Quotes Collection, Secure WordPress, SEO Ultimate, SI CAPTCHA Anti-Spam, Similarity, Theme My Login, User Photo, wp-forecast et wp-Typography.
Merci d’avance.
Thanks a lot for creating this plugin.. I was wondering though if I could display the date that each attachment has been modified as well?
Title – Size – Date
Thanks!
Thanks.
First you have to activate stats in the menu Settings/EG-Attachments,
Then you will see an EG-Attachments item in the Tools menu.
Your plugin is awesome! Only one problem found, cant find the click stats, where i need to look?
The attachments are not always showing up.
I’m using the same files for each test (PDF, Word and JPG) and getting different results.
If I attach all three, then all three show up.
If I attach the PDF, then the Word, only the Word shows up.
If I attach the Word, then the PDF, nothing shows up.
Hi Daniel,
To « attach » a document or an image, WordPress needs the ID of the current post, which is not created until
this post is saved. With Quickpress, post (and ID) doesn’t exist in the database until you press « save draft » or « publish ». That means, all documents you upload during QuickPress edition are NOT attached to the post, and EG-Attachments or any other plugins cannot get them.
See Ticket 8932 on WordPress trac.
I think we have the same problem with the desktop applications.
Emmanuel.
Is there a way to get this plugin to work when posting from « Quickpress » on the dashboard or using a desktop app like MarsEdit?
I am using the following:
PHP version 5.2.11, MySQL version 5.0.81-community-
log
Wordpress Version 2.8.6
Thanks,
Rebekah
Thanks so much for this tutorial Rebekah.
But the fatal error message during activation is very good, even if the plugin still works …
Which PHP version do you use?
Hello Emmanual, Thank you so much for this plugin. I’ve created a video tutorial on installing and using the eg-attachement plugin.
Everyone that is needing help using this plugin with WordPress 2.8 can view this video here: http://www.learntowebdesign.com/2009/12/placing-attachments-wordpress-post-page/
Thanks again,
Rebekah
Bonjour,
Pouvez vous me preciser les conditions d’utilisation, et ce que vous entendez par « accès unique »?
Emmanuel.
L’accès unique au téléchargement aux utilisateurs enregistrés ne fonctionne pas avec l’autoshortcode
Bonjour … et merci également pour ce très beau travail.
J’utilise la dernière version, et j’ai un soucis avec l’ordre de tri des documents affichés par le code que je génère :
[attachments size=small label=doctitle docid=660,648,647,639,183,182,181 orderby=docid]
voir http://www.amavie.org/?page_id=48
Je ne trouve pas comment provoquer l’affichage en ordre inverse (récent=>ancien)(je n’utilise pas le shortcode automatique).
Merci de votre aide.
@Trem_r:
Je vais vérifier cela. A priori, je ne comprends pas trop, parce que je me base sur le permalien …
@Max : il suffit de mettre label=doctitle dans ton shortcode, pour que son « Titre » s’affiche au lieu du nom de fichier.
Je suis tombé sur un os, certains de mes utilisateurs envoient des fichiers avec accents (éèù) contrairement à mes instructions, j’essaye de vérifier au maximum, mais certains passent à traver, et malheureusement le plugin est incapable de trouver correctement les fichiers (erreur 404) alors que l’insertion « classique » WP fonctionne.
bonjour Emmanuel,
Serait-il possible d’ajouter dans les paramètres du plugin au niveau des choix d’affichage la possibilité de ne pas afficher le « nom du fichier » inséré (le « titre » et le « poids de fichier » pouvant eux aussi être proposé de la même manière) ?
I fix this bug in the new version 1.4.3, published this morning.
Just to help, I noticed that when I do a shortcode, if I put the option force_saveas=false, document won’t load, but will if I do force_saveas=0, fixing the issue.
I will look at these issues.
Hi, just wanted to report two issued I’ve encountered:
1. When you set a List size preference in the Admin settings for EG Attachments, it would be nice if that was the default selected when using the Tiny MCE button.
2. There is an incompatibility with the « Improved Include Page » which lets you include the contents of one page into another. Very useful when using WP as a CMS.
The problem is that when using the « At the End » activation setting, any page that uses the « Improved Include Page » plug-in will show a seemingly random bunch of images as attachments for some reason.
-Michael
I add this feature in the version 1.4.0, published this afternoon (CET timezone).
Hope is what you want!
Hey Emmanuel – thx for the plugin. I want to use it to offer readers some of my custom templates. However, I have ONE SUGGESTION for you: Would it be possible to put an option that applies to only registered users. For example, I put attachments, but I only want folks who are registered users to be able to download that. If they are not, they are directed to the ‘register’ page to sign up so they have access to the attachment download function. If this option in the plugin settings was available, I would not have to use the HIDEPOST plugin as well. Let me know what you think.
Bonjour Max,
Je ne rencontre pas le probleme chez moi …
Il faudrait regarder les URL des pieces jointes, pour savoir si elles pointent directement sur la piece jointe, ou si elles pointent vers le script PHP.
Bonjour Emmanuel,
Depuis quelques temps l’option proposant les fichiers joints en téléchargement ne fonctionne plus. J’ai désactivé/supprimé/réinstallé l’extension, mais rien y fait malheureusement.
Une idée ?
bravo et merci pour ce plugin bien utile !
Bonjour Bertrand,
Je viens de corriger le probleme. Avec la version 1.3.1 qui devrait apparaitre dans la soiree, les pieces jointes ne devraient plus apparaitre dans les articles proteges par mot de passe.
Oui dans le sens ou je n’ai pas traite la protection des posts,
Non dans le sens ou il faudrait …
Je vais regarder cela de plus près.
Est-ce normal que pour un post protégé par mot de passe, les fichiers en téléchargement apparaissent même lorsque l’on n’a pas saisi son mot de passe ?
i like your file attachement plugin. i too would like to see number of click a file gets. also i would like to modify the title, file and size text to better suit my needs. what changes do i have to make in the css? thank you.
Bonjour,
Je viens de decouvrir egalement WPML. Ce plugin de multilinguisme me semble assez prometteur.
Je vais regarder comment WPML gere ces propres elements pour voir ce que l’on peut faire.
Emmanuel.
Bonjour,
J’ai un petit problème avec EG-attachments qui, en dehors de çà, est un très bon plugin, bravo !
En fait, je ne parviens pas à le faire fonctionner correctement avec WPML. Mon langage par défaut (fr) permet de créer correctement la liste des pièces jointes. Par contre, dans le deuxième langage, ca ne fonctionne pas. L’article est indiqué comme n’ayant aucune pièce jointe dans le TinyMCE. Insérer un code comme [attachments docid=272] ne génère rien non plus, je pense que c’est normal si le TinyMCE considère l’article sans pièce jointe.
Une idée de l’origine du problème et, surtout, d’une solution ?
D’avance merci.
Anthony
That is the solution, thanks Emmanuel — I didn’t realize I had selected the « automatically activate » feature — so I was getting the attachment listed twice.
I don’t see this error with WordPress 2.8 and EG-Attachments 1.3.0.
Did you active the auto-shortcode?
If you activate it, and add the [ attachment] shortcode in the post, you will see attachments twice …
I made this error when I use my own plugin for the first time.
I’m experiencing the same problem as others mentioned with the 1.3.0 version using WordPress 2.8 — each download item is listed twice. Is there any fix for this?
Thanks — great plugin!
Rétrolien: links for 2009-06-29 — Chroniques du web
@Markus:
The question was already asked, and initially I said no. Now, I don’t know… Perhaps it could be interesting if attachments are files you publish for download.
Did you study the plugin Oz click counter, or WP Click Tracker ?
I will study these new features, but I think they need some time …
Hi …
at first thanks, for this great plugin …. and at the same time .. sorry for my terrible english
i had two ideas for new features for this plugin
- count downloads and show number of downloads in post
- list of downloads per user (if they are logged in) for the admin-panel
list could be selected and sorted by user and filename
best regards
markus
@Serb: I sent to you a new version of EG-Attachments. Try it, and tell me if it’s what you want.
This version is not public, I have to check also if the plugin works also without the other plugin HidePost.
I have a question: why to you use this plugin with this option (Hide link)? it’s heavy for the readers.
How would I make this plugin compatible with HidePost plugin (here: http://wordpress.org/extend/plugins/hidepost/)
Because, while using both, and enabling only « link protection » in posts in HidePost plugin, all the attachments listed by EG plugin bypass that setting and are publicly visible to everyone, even though I’d like them to be protected/rewritten via HidePost.
Is that even possible?
Heck, I’ll pay you for this modification if I have to… so please let me know!
@ jmp_from_carnac: Malheureusement, l’icone ne fonctionne qu’avec la Version 2.7 de WordPress. Je ne comprends pas tres bien pourquoi d’ailleurs.
Ce bug est dans ma liste des choses a faire sur ce plugin, par contre, en ce moment, mon temps est compte, je ne peux donc pas donner de delai.
Thanks for this SEG-Attachments (Super EG Attachments).
That is exactly what I was looking for
Bonjour, v 2.6.5 php aucune idée
je n’ose pas trop up-grader
En quelle version de WordPress et de PHP etes-vous?
Bonjour,
Merci Emmanuel ce dev à l’air superbe !
J’ai néanmoins un petit pb :
Après installation du plug in et activation sous WP, je ne vois pas le boutton « trombone » dans mes pages et articles ?
D’avance merci
Id or class?
There are potentially several EG-Attachments blocks in a single post. So should be better to class.
What do you think about that?
Oh, and the div should have an id, of course, perhaps « attachments »
Thanks!
-M
In future versions, can you include a div around everything the EG Attachments drops into the post? (i.e. one div around all attachments) This would make it easier to target in css and also wrap them in a unifying box or border.
Thanks,
Michael
In WordPress 2.7 Mu there is a constant warning that your plugin requires wordpress 2.5. Why is that when it works in 2.7?
I see the bug.
Version 1.2.6 will be published soon.
Great plugin, but I’m having a problem with the medium size setting (which is the one I want to use!)
When medium is selected, the plugin is listing each attached document more than once.
When 1 document is attached, it lists it twice.
when 2 documents are attached, it lists:
doc 1
doc 1
doc 2
doc 1
doc 1
doc 2
I’m using v1.2.5
Any ideas?
EG-Attachments just queries the WP database, and display the result.
The button in the TinyMCE toolbar, is added with a specific method dedicated to TinyMCE, and doesn’t allow upload.
If you want a button allowing your users to upload file, perhaps, you should look at the wordpress plugin database.
In fact, several people ask also your question in the prologue forum, perhaps you will get an answer from the developer.
Hello, Emmanuel,
Thanx for answering.
I mean: your plugin integrates with TinyMCE at the backstage admin interface of WordPress, right? There is, if I want to attach a file, I have to log in at /wp-admin and edit the post.
I’m not that super-user of wordpress and I’m not a developer, but what I want to do is to use the Prologue Theme at my domain . Prologue have an external interface where logged in users don’t have to access the admin interface, called post-form.php. I wonder if I could have a function in your plugin that allows me to browse for the attachment without the need of editing the post in /wp-admin. Can you understand?
In simple terms, Prologue is like a twitter. And what I would like to have is your plugin integrated on the external publishing interface.
I don’t understand your question.
Could you give me an example, and what is the link with the plugin?
Hi. Great Plugin!
How could I add an « upload button » to my Prologue Theme? Is there any function I my call to view an input button on the post-form of Prologue? (I mean, the integration with tinyMCE is perfect, but I would like this button also in the post-form for my « twitter » users…)
During the night, I sleep …
(you wrote to me at midnight).
In the PHP code I gave you previously, if you can get date with
The format is the same for the three sentences: yyyy-mm-dd HH:MM:SS.
If you want to change date format, you can use the PHP function date().
For example:
echo date('M dS, Y - H:i', $attachment->post_modified)will display March 21, 2009 18:10No worries! Got it working by myself. Thanks for a great plugin!
Thank you very much for the « latest attachment » code, its working great! Just one last thing, im trying to figure out a way to add some code to get the date from the latest attachment. Ive been looking in the wordpress codex but cant figure it out. Awesome if you could help me out with this!
Unfortunately, new feature, new bug …
This error occurs when you don’t want to display neither caption, nor description.
Version 1.2.5 will solve this problem (publication very soon).
Emmanuel,
With your previous version, I always saw the « pass-by-reference has been deprecated » error on the admin pages. With your new version 1.2.4, that error is gone.
However, a new error message has taken its place, this time at the top of every public-facing page (a more significant problem):
Warning: implode() [function.implode]: Invalid arguments passed in /home/dir/site.com/wp-content/plugins/eg-attachments/eg-attachments-public.inc.php on line 321
Thank you,
David
In fact, Caption is still the field displayed by default, to keep the same behavior than the previous version of the plugin.
If you want to display description field, without the option fields=description, you can edit the file eg-attachments.php, and replace the line 43: ‘shortcode_auto_fields’ => ‘caption’, with ‘shortcode_auto_fields’ => ‘description’.
But you will have to do that every time, you will update the plugin.
Perfect Emmanuel,
worked with the tag [ attachments fields=description]. in the post.
thanks a lot for sharing this… and also made me enter a little bit more into wordpress codes.
The plugin is not planned to provide this kind of things.
But the following code will help you.
Put it in the functions.php file of your theme.
function last_attachment_url($type='url', $order_by='date', $order='DESC' ) {global $post;
$returned_value = '';
if (isset($post)) {
$attachment_list = get_children( array('post_parent' => $post->ID,
'numberposts' => -1,
'post_type' => 'attachment',
'orderby' => $order_by,
'order' => $order
)
);
if ($attachment_list !== FALSE) {
$attachment = current($attachment_list);
if ($type == 'url')
$returned_value = $attachment->guid;
else
$returned_value = '< a href="'.$attachment->guid.'">'.htmlspecialchars(strip_tags($attachment->post_title)).'';
}
}
return ($returned_value);
}
Then, where you want to put the url or link, use the function as:
echo last_attachment_url();or
echo ast_attachment_url('link');Working great with the shortcodes in my template file, the only thing I need now is a possibility to get only the url of the latest attachment. Like « fields=url » or something that would return a link, or just an url that I can put inside an . That would be awesome!
Description line is displayed only if the field is not empty.
Syntax: [ attachments fields=caption,description] or [ attachments fields=description].
I checked the plugin on my dev platform, all is running properly.
What is your configuration (WP Version, and PHP Version)?
Hi. seems that you just uploaded a modified version (1.2.4) with a switch between « Caption » and « Description », but here seems that only « Caption » is working…
The version 1.2.4 is out.
Some bug fixes, and the ability to choose the fields to display.
In the shortcode, you can specify a page or post ID. The shortcode will then display the attachments of the post you specify. [ attachments id=...]
Emmanuel,
I am also getting the « deprecated » error with WordPress 2.7.1. It appears on every admin page, and often within admin widget windows as well. Here’s my full error message.
Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of method_exists(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /home/dir/site.com/wp-content/plugins/eg-attachments/lib/eg-forms.inc.php on line 261
Great plugin!
I have an newsletter archive-page to wich i upload newsletters using your plugin. On the front page i want to have a link to the most recently uploaded newsletter. That would work using the “latest” option. But I also need to get the attachements from another page? Is there a way to do this, maybe by calling the function manually in my frontpage template?
J’avais pas vu le français :O)
bon alors voilà :
Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of method_exists(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /home/www/74daa4f7126c2f9b51e7dd7637d78296/web/cms/wordpress/wp-content/plugins/eg-attachments/lib/eg-forms.inc.php on line 261
Le plugin semble marcher quand même, et l’erreur n’apparait que dans l’admin
Could you give me the whole message (with function and line number)?
Thanks
Hi,
I try to upgrade, but,
I get: Warning: Call-time pass-by-reference has been deprecated,
with the 1.2.3 version, but not with the old 1.1.4 version
my system: wordpress 2.7.1 and php 5.2.6
any idea to solve this ?
thanks
The choice of field will be included in the next version.
I mean: the field shown as description at the container is in fact the Label field, isn’t it? Threś another field with more words that could show in that place.
Hi,
good job. thanks a lot.
Could we show the « Description » field of the attachment inside the containers?
I already thought of this feature, but it will need to store the counters somewhere.
If you already use Google Analytics to follow the traffic of your blog, you can easily add some javascript to follow downloads.
or you can use existing « Google analytics plugins »
not perfect… could you add hit counter…? how many time the file has been download.
@Veeco
@Lethe:
There was an incident during the publication of the version 1.2.2.
I don’t know how to use SVN very well. The tool added some lines at the begin of the file eg-attachment.php
I push a new set of file with version number 1.2.3
Well I guess you can ignore my previous comment as I followed veeco’s instructions and been able to get the plugin back to work
Thanks a lot it really rocks and I love it
Lethe.
My apologies, the orderby DOES work (my IDs weren’t set correctly).
So I guess remove that code mentioned above and it will work!
Emmanuel, thank you for all your hard work and quick response time!
I just updated to 1.2.2 and I receive the following error when trying to activate the plugin:
Parse error: syntax error, unexpected T_SL in eg-attachments.php on line 34
I went into that file and deleted lines 34, 36, 37, 38.
The plugin activated and then upon going to my site I got the error:
Parse error: syntax error, unexpected T_SL in eg-attachments-public.inc.php on line 188
I then went into that file and deleted line 188, and lines 197-205. The plugins works but the orderby does not.
I’m not sure why this code is there, causing errors:
<<<<<<>>>>>> .r99697
Hello I’ve just upgraded this wonderful plugin to verison 1.2.2 but as soon I’ve done this when I try to activate it I get an error saying « T_SL eg-attachments.php on line 34″, this used to work like a charm before the update so I can’t understand what went wrong, I’m running wordpress 2.7.1.
Thanks in advance L.
Thanks a lot.
I don’t plan to develop a plugin to generate PDF file from posts.
But some plugins already exist such as Post2PDF, or Article2PDF
Hi,
I haven’t launched my site yet but I’ll be using your plugin. I just wanted to thank you and tell you how amazing it is. Solves a lot of my issues.
Can you also consider making a plugin/modifying this one to autogenerate a pdf of the post?
Merci beaucoup mon ami.
Very sorry for this new error.
I found the bug. I am checking again the plugin before publish it. Hope be ready tomorrow morning (GMT+1)
All of my attachments are PDF.
Do you have image (jpeg, png, gif, …) in your attachments?
Thank you for the response. I tried version 1.2.1 and now only 5 of my 13 documents show up, no matter what options I select.
Two errors:
the documentation is not clear (readme.txt),
there is a bug in the shortcode function.
With the version 1.2.1 (available soon in the wordpress repository), the orderby option will run properly.
You can sort with key
ID, title, dateormime, and choose the order withASCandDESC.The default is: title ASC.
Examples of use:
orderby= »mime desc » to sort with mime_type, in descending order,
orderby=date to sort with date field, in ascending order.
The shortcode orderby is not working for me. I can’t get any of the values to work. I want to sort by ID but no orderby options are working. It is sorting by the order I added the files by default.
I am preparing a new version, I will add this feature.
An another way could be use specific htaccess rules
Is there a way to make the attachments where clicking wll force a download dialog box, rather than the user having to right click and save target as?
I’d love to have a shortcode for showing only the latest attachment for a page. Or is this possible as it is now??
Ok, I think I found the bug.
I published the version 1.1.3. I hope all is working properly now.
I have a question: do you use custom wp-content directory?
Could you send me the list of your active plugins, i will try to simulate your installation, to find what happen!
When you say « shortcode doesn’t work », do you see the shortcode [ attachements ...] ? or is there nothing?
Hello Emmanuel
Same problem here : the icon doesn’t display in éditor (and by hand short code doesn’t work either)/
WP: 2.7.1
Plug ins :
Akismet 2.2.3
All in One SEO Pack 1.4.7
EG-Attachments 1.1.1
Facebook Connector 1.2.1
GigPress 1.4.4
Google Analytics for WordPress 2.7
Google XML Sitemaps 3.1.2
Lightbox 2 2.0.2
SABRE 0.8.1
Seesmic WordPress plugin 0.1.6
Sociable Zyblog Edition 2.0.12
Thumbnail For Excerpts 1.3
Viper’s Video Quicktags 6.1.15
WordPress.com Stats
Got it working now! Thank you very nuch for the plug!
Hi Ross,
In the file single.php of your templates, you can add the following code:
<?php echo do_shortcode('[attachments title="Test"]'); ?>This will display the list of attachments with the title « Test ». You can use any of the shortcode options.
Sorry cant seem to get my code into the post, but ive added the do_shortcode with no options so the default should be to show all attachments
I have tried adding:
to my template, but none of my attachments show up on the page??
Great plugin! Is it possible to make this plug-in automaticly show all the attachment on a page? What do I put in my template file??
Do you use plugins such as Advanced TinyMCE or WP Super Edit?
Could you give me the list of your active plugins?
Hi, Emmanuel..
This plugin is what I’ve been looking for. I’ve installed it, downloaded from wordpress plugin site (v1.1.1). It has been activated. But unfortunately, I can’t find the TinyMCE button/icon you mentioned above. I wonder what could’ve been wrong? By the way, i’m using 2.7. Any help would be greatly appreciated..
Thanks!
I am just publishing a new version without cache management (version 1.1.1).
I will add the cache management in a next version.
Hope it will solve your problem
No delay. The plugin just requests database.
Perhaps a delay of 15 minutes if you use a cache plugin.
If you don’t solve the problem, could you send me the list of your documents (name + extension).
Is there a delay between the time that a file is added to the Media Library and when it shows up in the Document List of EG Attachments?
I’ve added some files to the Media Library and they aren’t showing up?
Good idea, I will add this option in the next version.
This is a great plug-in! One question – with the « small » setting – is it possible to change the text label to be the user-defined « Title » instead of the file name?
Rétrolien: The Spirit of Wordpress #9
hi. Thanks for plugin
perfect.
Regards