Summary: Discussion of RecentUploadsLog
Version: 2009-09-03

From PmWiki version 2.2.6 this recipe is included in the core, this means if you were using the recipe in version 2.2.5 or earlier you need to remove from config.php the line

if(@$_REQUEST['action'] == 'postupload') { include_once("$FarmD/cookbook/recentuploads.php");}

and replace it with all or some of the lines

$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)';

I'd suggest as an improvement that consideration should be given to

  • making this recipe on by default, (as are recent changes)
  • move the default three format lines above into the recipe
  • adding a single line to config.php allowing the recipe to be disabled

thanks, simon October 16, 2009, at 11:52 PM

Hello. Pm opposed to making this recipe "on" by default, he agreed to allow this function only if it didn't change the PmWiki defaults. Making it easier to install could be possible though, like $EnableRecentUploads -- only I'm not sure the 3 pages from the recipe are good, or the current thing on is better (only log uploads to Site.AllRecentChanges). --Petko October 17, 2009, at 03:15 AM

OK, perhaps best to leave the way it is, although providing $EnableRecentUploads with maybe =1 (AllRecentChanges only) and other pages added as above might be less formidable to newer users. Perhaps also adding these (commented out) to the sample config.php. thanks simon October 17, 2009, at 01:02 PM


You may also want to add a link to your RecentUploads pages from action=upload pages by adding something like the following near the top of your Site.UploadQuickReference page: --Eemeli Aro April 18, 2009, at 07:41 AM

(:if exists {*$Group}.RecentUploads:)
View log of [[{*$Group}.RecentUploads|recent uploads]] to this group

If 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

I can`t get this running. I added the code below to my config.php. If i load the Site Group.RecentUploads it says, that the site does not exist. I use the latest pmwiki. I`m sure i overlooked something. Thanks for help. -- Micha September 16, 2021

$RecentUploadsFmt['$Group.RecentUploads'] =
  '* [[{$Group}/{$Name}]]/[[(Attach:{$Group}.{$Name}/)$upname]]'
  .'  . . . $CurrentTime $[by] $AuthorLink ($upsize bytes)';

You need to upload a file. Only newly uploaded files will be added to this page. Also, if you upload a file to the "Main" group like to Main.WikiSandbox, then the list with recent uploads will appear in the page Main.RecentUploads. --Petko September 16, 2021, at 06:02 PM

Talk page for the Recent Uploads Log recipe (users).