From 6de3759a1b7a74492845c76e1f0bd1078e2220c7 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 14 Aug 2005 12:18:34 +0200 Subject: 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 --- inc/template.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'inc/template.php') 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 ''; - print ''; + print ''; print ''; } -- cgit v1.2.3