3

Is there a way of finding for a given file in /images what (if any) articles are using it? Or conversely, what dead links towards files exist?

The objective is to restore sanity to a wholly messed-up media folder with traces of several different restructuration attempts... So subfolders by year, subfolders by theme, folders named /other or /newer etc, plus loads at the top level, and many images and textdocuments in multiple copies of differing versions. So to bundle all versions of an image ('our team leader') or document, it's important that no broken links are created (or: that they get quickly repaired).

So is there a Joomla trick or extension that would do this, or a non-Joomla approach?

  • 1
    From the top of my head, you could try searching every article content for the name of your image file. It might take a while, though. If you want to do this, take a look at your database and become familiar with the articles' structure first. Then look for the name only in the content field and return the id if you have a match. It should be easy enough to change the path to something else once you've found it. – mattosmat May 27 '15 at 3:38
  • 1
    That's... describing an extension I'd love to exist but doesn't. What you're saying is GREPping around in a database dump or PHPmyadmin, with the images/downloads/attachments folder contents list at hand... We're speaking hundreds of articles and hundreds of images, so automation is the only solution. – user3445853 May 29 '15 at 12:25
  • Of course I meant automatically. You can program the extension yourself. In fact, you can use the Joomla API to fetch the information from your database. You should also keep in mind that you can send ANY database query, you don't have to use the wrapper unless you want to. The regular expression part you should do directly on the database (ie. via queries) and not in the php end because it takes longer. The only reason you would need something like PHPMyAdmin is to take a look at the table structure so that you now the names and types of the fields you're interested in. – mattosmat May 29 '15 at 15:44
2

You can try this script https://gist.github.com/renekreijveld/27d9062b941a2d0c80f3

it help you to find used and unused content files in your Joomla website

  • This is close to what I want (very good to cut unused, inherited "media library" content), and it's obvious how to edit it so it really does what I want (not only say which are used, but who uses them). Excellent find! – user3445853 Jun 10 '15 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.