diff options
author | Andreas Gohr <andi@splitbrain.org> | 2005-08-14 12:18:34 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2005-08-14 12:18:34 +0200 |
commit | 6de3759a1b7a74492845c76e1f0bd1078e2220c7 (patch) | |
tree | 96975cbac21a72f29934013e1e6bd6f4711f60d7 /inc/template.php | |
parent | 706882dcf32358de6c9300ced7b5fcfa9ba28771 (diff) | |
download | rpg-6de3759a1b7a74492845c76e1f0bd1078e2220c7.tar.gz rpg-6de3759a1b7a74492845c76e1f0bd1078e2220c7.tar.bz2 |
URL rewriting for media files
This patch adds nicer URLs for media files (for fetch.php and
detail.php)
!IMPORTANT! Users of rewrite mode 1 need to adjust their .htaccess
See .htaccess.dist for an example
darcs-hash:20050814101834-7ad00-37ef1dea00affc9d808d9ee1289fa7454199cd24.gz
Diffstat (limited to 'inc/template.php')
-rw-r--r-- | inc/template.php | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/inc/template.php b/inc/template.php index 34fdfb009..9f39b6b79 100644 --- a/inc/template.php +++ b/inc/template.php @@ -674,11 +674,7 @@ function tpl_mediafilelist(){ $h = floor($h * $ratio); } - $p = array(); - $p['w'] = $w; - $p['h'] = $h; - $p['media'] = $item['id']; - $src = DOKU_BASE.'lib/exe/fetch.php?'.buildURLParams($p); + $src = ml($item['id'],array('w'=>$w,'h'=>$h)); $p = array(); $p['width'] = $w; @@ -854,12 +850,9 @@ function tpl_img($maxwidth=900,$maxheight=700){ $h = floor($ratio*$h); } - //prepare URL - $p = array(); - $p['cache'] = $_REQUEST['cache']; - $p['media'] = $IMG; - $p = buildURLparams($p); - $url=DOKU_BASE.'lib/exe/fetch.php?'.$p; + //prepare URLs + $url=ml($IMG,array('cache'=>$_REQUEST['cache'])); + $src=ml($IMG,array('cache'=>$_REQUEST['cache'],'w'=>$w,'h'=>$h)); //prepare attributes $alt=tpl_img_getTag('Simple.Title'); @@ -876,7 +869,7 @@ function tpl_img($maxwidth=900,$maxheight=700){ $p = buildAttributes($p); print '<a href="'.$url.'">'; - print '<img src="'.$url.'&w='.$w.'&h='.$w.'" '.$p.'/>'; + print '<img src="'.$src.'" '.$p.'/>'; print '</a>'; } |