Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

AttachlistEnhanced

Summary: How to list missing or orphaned attachments.
Version:
Prerequisites: Probably requires at least PmWiki version: 2 beta 14; last tested on PmWiki version: 2 beta 26
Status:
Maintainer: Schlaefer
Categories: Uploads

Questions answered by this recipe

How to list missing or orphaned attachments.

Answer

Usage

  • (:attachlist find=orphaned <-ImagesAutoResizing>:)
  • (:attachlist find=missing:)

Notes

  • For PmWiki 1 updater (see also PITS 00088): the script ignores entries in RecentUploads and AllRecentUploads
  • Attachlist only shows fields for the current group or page
  • known bugs
  • much room for improvements
    • option for sorting
    • option for show referencing pages
    • speed
  • specify group=namewithwildcards or page=namewithwildcards

See Also

Comments

It works now, but as I am using the module minimage as described in ImagesAutoResizing, all my images are considered orphans (this works similarly as Attach:file Δ, but with Img:image.ext, which also creates the files image.p.ext and image.s.ext) - Note that pm have expressed that he may add some galleries functionnalities in PmWiki, so this recipe may be less used in the future. Maybe... PRZ

I changed the markup to stay away from trouble with recent changes to (:attachlist:) made in beta28. I also added a -ImageAutoResizing option to ignore *.p.ext and *.s.ext files.

I took a look into ImageAutoResizing, but it is seems a little bit complex. Is there a simple rule when there should be a "p" "s" or achive file? However feel free to try this script: http://schlaefer.macbay.de/uploads/Main/attachlistenhanced.txt
Schlaefer

Rules are: for Img:image.ext, image.s.ext (thumbnail) should exist, if not this is a missing file. image.p.ext is optional (plain image), and image.ext is also optional (source image which can be removed by admin, only there for other later resizing). Thinking to it, this convention is probably a mistake, but it is too late... PRZ

Ok, if we can't determinate this after upload, tell me what's the best solution for you. We look for .s. files only and (optionally) ignore .p. files ? -- Schlaefer


This happened when I used the script.
The page output was O.K. but following warnings raised.

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in D:\Abyss Web Server\htdocs\obuwiki\cookbook\attachlistenhanced.php on line 148
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in D:\Abyss Web Server\htdocs\obuwiki\cookbook\attachlistenhanced.php on line 148
Warning: Cannot modify header information - headers already sent by (output started at D:\Abyss Web Server\htdocs\obuwiki\cookbook\attachlistenhanced.php:148) in D:\Abyss Web Server\htdocs\obuwiki\pmwiki.php on line 709

Jiri - mailto:admin@obutex.com

Ok, this cookbook is number one on my todo list now and here we go. I put up a new version v0.4 with much cleaner code than v0.3. There are is still a lot of things to do. So use with care and report bugs. - Schlaefer November 11, 2005, at 12:15 PM

I just upgraded to beta-65 and got the same error

Warning: array_merge_recursive() [function.array-merge-recursive]: Argument #1 is not an array in E:\home\InfoStore\cookbook\attachlistenhanced.php on line 187
Simon

I am getting the same "line 187" error as Simon above. I am running it on beta-65. Any updates?

skumar? February 04, 2008, at 10:43 AM
(:attachlist find=orphaned -ImagesAutoResizing:)