[aur-dev] [PATCH 2/6] Use absolute URIs for style sheets and images

Ike Devolder ike.devolder at gmail.com
Mon Jul 16 05:06:01 EDT 2012


Op zondag 15 juli 2012 23:23:51 schreef Lukas Fleischer:
> This is needed for our new URI scheme, since we will use virtual
> directories, such as "/packages/" instead of "/packages.php" etc.
> 
> Having relative URIs results in incorrect paths, such as
> "/packages/css/aur.css" (instead of "/css/aur.css").
> 
> Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
> ---
>  web/template/header.php       | 6 +++---
>  web/template/pkg_comments.php | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/web/template/header.php b/web/template/header.php
> index 6dd52f7..246b304 100644
> --- a/web/template/header.php
> +++ b/web/template/header.php
> @@ -5,9 +5,9 @@
>  	xml:lang="<?php print htmlspecialchars($LANG, ENT_QUOTES) ?>" lang="<?php
> print htmlspecialchars($LANG, ENT_QUOTES) ?>"> <head>
>      <title>AUR (<?php print htmlspecialchars($LANG); ?>)<?php if ($title !=
> "") { print " - " . htmlspecialchars($title); } ?></title> -	<link
> rel='stylesheet' type='text/css' href='css/archweb.css' /> -	<link
> rel='stylesheet' type='text/css' href='css/aur.css' />
> -	<link rel='shortcut icon' href='images/favicon.ico' />
> +	<link rel='stylesheet' type='text/css' href='/css/archweb.css' />
> +	<link rel='stylesheet' type='text/css' href='/css/aur.css' />
> +	<link rel='shortcut icon' href='/images/favicon.ico' />
>  	<link rel='alternate' type='application/rss+xml' title='Newest Packages
> RSS' href='rss.php' /> <meta http-equiv="Content-Type" content="text/html;
> charset=UTF-8" /> </head>
> diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php
> index 02f4963..b2d9ca5 100644
> --- a/web/template/pkg_comments.php
> +++ b/web/template/pkg_comments.php
> @@ -19,7 +19,7 @@ $count = package_comments_count($_GET['ID']);
>  						<input type="hidden" name="action" 
value="do_DeleteComment" />
>  						<input type="hidden" name="comment_id" 
value="<?php echo $row['ID']
> ?>" /> <input type="hidden" name="token" value="<?php echo
> htmlspecialchars($_COOKIE['AURSID']) ?>" /> -						
<input type="image"
> src="images/x.png" alt="<?php echo __('Delete comment') ?> name="submit"
> value="1" /> +						<input type="image" 
src="/images/x.png" alt="<?php echo
> __('Delete comment') ?> name="submit" value="1" /> </fieldset>
>  				</form>
>  			<?php endif; ?>

maybe a suggestion to use a general BASEPATH defined, and use this as a prefix
this would make sure the code is more portable.

example: 
+	<link rel='stylesheet' type='text/css' href='<?php echo 
BASEPATH;?>css/archweb.css' />

--Ike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://mailman.archlinux.org/pipermail/aur-dev/attachments/20120716/4872a25c/attachment.asc>


More information about the aur-dev mailing list