{rel} function adds the good thing before an url to make it absolute.
authorx2000habouzit <x2000habouzit>
Mon, 22 Nov 2004 11:00:39 +0000 (11:00 +0000)
committerx2000habouzit <x2000habouzit>
Mon, 22 Nov 2004 11:00:39 +0000 (11:00 +0000)
only use url modifier if it may be http://sth

plugins/function.rel.php [new file with mode: 0644]

diff --git a/plugins/function.rel.php b/plugins/function.rel.php
new file mode 100644 (file)
index 0000000..eba6f9f
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2004 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  This program is free software; you can redistribute it and/or modify   *
+ *  it under the terms of the GNU General Public License as published by   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************
+        $Id: function.rel.php,v 1.1 2004-11-22 11:00:39 x2000habouzit Exp $
+ ***************************************************************************/
+
+function smarty_function_url($string)
+{
+    global $globals;
+    $url = parse_url($globals->baseurl);
+    return $url['path'];
+}
+
+?>