[dokuwiki] Image backlinks / references

  • From: william.lee@xxxxxxxxxxxxxx
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Fri, 19 May 2006 15:30:32 +0100

Dear *,

I've been struggling for some time with this problem, and I hope now is the 
time to ask for help. I am wanting to change detail.php in the default template 
so that when you click on an image what is shown is:

namespace + filename
the image
the embedded data
"back to" link
and a list of ALL the pages which include the image.

The idea is to provide an interesting way of browsing to new pages, and an 
admin tool for sorting out when people put images in the wrong namespaces! ;-)

I initially put the "include" at the top of detail.php 

if(!defined('DOKU_INC')) 
define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
require_once (DOKU_INC.'inc/search.php');

and then added the following "search" bit from the image-delete-checker with 
some alterations.

      <?php
      $mediareferences = array();
      $medianame = ltrim(strrchr($IMG,':'),':'); 
      search($mediareferences,$conf['datadir'],'search_reference',array('query' 
=> $medianame));
      print_r ($mediareferences);
      ?>
      </p>

(I put this below the 'backto' bit)

The array always comes back empty.

Now, I have verified that $IMG is the filename of the image including the 
namespace and a :, so I trimmed that as search_reference seems to only want a 
filename, but still nothing.

Have I missed something obvious?

I enjoy dokuwiki very much.

The server runs Apache and has been flawless throughout.

DokuWiki version: Release 2005-09-22e
PHP version 4.3.10

You can check it out at www.uk-cherub.org (but watch out the front page is 
plain html)

Will


________________________________________________________________________

Andrew Dillon, Chief Executive of NICE, answers your questions in the
latest Doctors.net.uk podcast. http://www.doctors.net.uk/podcast
________________________________________________________________________


--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: