Skip to content

Commit

Permalink
intermediate step for git issue 11
Browse files Browse the repository at this point in the history
Signed-off-by: Taggic <taggic@t-online.de>
  • Loading branch information
Taggic committed Feb 2, 2012
1 parent e5abbef commit 5b8835a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2012-01-27
2012-02-02
12 changes: 6 additions & 6 deletions config.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/\<code\>.*^\<\/code\>/smU
/\<file\>.*^\<\/file\>/smU
/\<nowiki\>.*^\<\/nowiki\>/smU
/%%.*^%%/smU
/\<html\>.*^\<\/html\>/smU
/\<php\>.*^\<\/php\>/smU
code = "/\<code\>.*^\<\/code\>/smU"
file = "/\<file\>.*^\<\/file\>/smU"
nowiki = "/\<nowiki\>.*^\<\/nowiki\>/smU"
nowiki2 = "/%%.*^%%/smU"
html = "/\<html\>.*^\<\/html\>/smU"
php = "/\<php\>.*^\<\/php\>/smU"
2 changes: 1 addition & 1 deletion plugin.info.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
base orphanmedia
author Taggic
email Taggic@t-online.de
date 2012-01-27
date 2012-02-02
name OrphanMedia Plugin
desc Display orphan and missing media files.
'url' => 'http://dokuwiki.org/plugin:orphanmedia',
14 changes: 8 additions & 6 deletions syntax.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
/******************************************************************************/
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
if(!defined('DOKU_PAGES')) define('DOKU_PAGES',DOKU_INC.'data/pages/');
if(!defined('DOKU_MEDIA')) define('DOKU_MEDIA',DOKU_INC.'data/media/');
require_once(DOKU_INC.'inc/search.php');
/******************************************************************************
* All DokuWiki plugins to extend the parser/rendering mechanism
Expand Down Expand Up @@ -91,8 +89,11 @@ function render($format, &$renderer, $data) {
// echo sprintf("<p>%s</p>\n", var_dump($listPageFile_MediaLinks));

// analyse matches of media files and pages->media links
$doku_media = str_replace("\\","/",DOKU_MEDIA);
$doku_pages = str_replace("\\","/",DOKU_PAGES);
// what if savedir option is used ? => $conf['mediadir']
$doku_media = $conf['mediadir'].'/';
$doku_pages = $conf['datadir'].'/';
//$doku_media = str_replace("\\","/",DOKU_MEDIA);
//$doku_pages = str_replace("\\","/",DOKU_PAGES);

$listMediaFiles = array($listMediaFiles,array_pad(array(),count($listMediaFiles),'0'));
$position = 0;
Expand Down Expand Up @@ -207,7 +208,9 @@ function render($format, &$renderer, $data) {
foreach($listMediaFiles[1] as $check) {
if($check === '0') {
$orphan_counter++;
$rt2 = str_replace("/", ":", $listMediaFiles[0][$position]);
if(!$conf['useslash']) $rt2 = str_replace("/", ":", $listMediaFiles[0][$position]);
else $rt2 = $listMediaFiles[0][$position];

$picturepreview = '<a href="' . DOKU_URL . 'lib/exe/detail.php?media=' . $rt2
. '" class="media" title="'. $listMediaFiles[0][$position]
. '"><img src="'. DOKU_URL . 'lib/exe/fetch.php?media=' . $rt2
Expand Down Expand Up @@ -372,7 +375,6 @@ function _get_allMediaLinks($listPageFiles, $defFileTypes) {
// get all defined tags where media links inbetween are to be ignored
$ignore_tags = array();
$ignore_tags = parse_ini_file(DOKU_PLUGIN."orphanmedia/config.ini");
// echo var_dump($ignore_tags);

foreach($listPageFiles as $page_filepath) {
$_all_links[$pageCounter][0] = $page_filepath;
Expand Down

0 comments on commit 5b8835a

Please sign in to comment.