|
Cookbook /
Recent Uploads LogSummary: List all uploaded files in RecentUploads pages
Version: 2009-09-03
Maintainer: Petko
Categories: Uploads, Administration
Discussion: RecentUploadsLog-Talk
Questions answered by this recipeHow do I track every uploaded file in the RecentChanges and AllRecentChanges pages and easily review it? DescriptionEvery uploaded file is logged in the Group.RecentUploads pages with a link from (All)RecentChanges for easy review. The format of what is printed in the RecentChanges and RecentUploads pages, is defined with the Initially, the variable Configuration examplesCurrently, the PmWiki.org site logs every upload to the page Site.AllRecentChanges with the following command line: $RecentUploadsFmt['$SiteGroup.AllRecentChanges'] =
'* [[{$Group}/]] / [[(Path:/pmwiki/uploads/{$Group}/)$upname]] '
.'. . . $CurrentTime Uploaded by $AuthorLink to [[{$Group}/{$Name}]] ($upsize $[bytes])';
One could use The format used by the standalone recipe in the past, before inclusion to the core, was: $RecentUploadsFmt['$Group.RecentUploads'] =
'* [[{$Group}/{$Name}]]/[[(Attach:{$Group}.{$Name}/)$upname]]'
.' . . . $CurrentTime $[by] $AuthorLink ($upsize bytes)';
$RecentUploadsFmt['$Group.RecentChanges'] =
'* [[{$Group}/RecentUploads]] . . . $CurrentTime $AuthorLink :'
.' [[{$Group}/{$Name}]]/[[(Attach:{$Group}.{$Name}/)$upname]] ($upsize bytes)';
$RecentUploadsFmt['$SiteGroup.AllRecentChanges'] =
'* [[{$Group}.RecentUploads]] . . . $CurrentTime $AuthorLink :'
.' [[{$Group}/{$Name}]]/[[(Attach:{$Group}.{$Name}/)$upname]] ($upsize bytes)';
This logs every upload to the page Group.RecentUploads, and adds a link to that page both to Group.RecentChanges and Site.AllRecentChanges. Only the latest upload for a Group is displayed in (All)RecentChanges, however, clicking on the link Group.RecentUploads will show you all uploaded files for the Group. Note that in the current PmWiki core, a page named RecentUploads will be excluded from page lists (with list=normal). Notes
Release Notes
CommentsYou may also want to add a link to your RecentUploads pages from (:if exists {*$Group}.RecentUploads:)
View log of [[{*$Group}.RecentUploads|recent uploads]] to this group
(:ifend:)
QuestionsIf I understand the feature correctly, in case the upload structure varies between uploads per group and uploads per page, the above example code does not always create working links. The same also seems to apply if some groups use directories not in the uploads path structure. Is there perhaps a way to query each group's specific upload location to get consistently working links? (Great feature anyhow! :-) --Henning December 15, 2009, at 01:07 PM No, the link will be saved with the settings of the page where you upload the file, and will be displayed with the settings of the Group.RecentUploads or RecentChanges page when you browse it. --Petko December 15, 2009, at 02:18 PM See Also
ContributorsUser notes +4: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |