]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/output_functions.php
Deleting of surfbar URLs added, a lot templates rewritten
[mailer.git] / inc / libs / output_functions.php
index 9b5be757323c57b63af559b145b69e3ac8d1aeca..45f0eb40699784ab28511bad144b5ec37e057506 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -78,15 +78,14 @@ function get_template ($template, $return=false, $content="")
 
        if ($template == "member_support_form") {
                // Support request of a member
-               $ID = bigintval($GLOBALS['userid']);
-               $result = SQL_QUERY_ESC("SELECT sex, surname, family FROM "._MYSQL_PREFIX."_user_data WHERE userid='%s' LIMIT 1", array($ID), __FILE__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT sex, surname, family FROM "._MYSQL_PREFIX."_user_data WHERE userid='%s' LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
                list($sex, $surname, $family) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
                $salut = TRANSLATE_SEX($sex);
        }
 
        // Base directory
-       $BASE = PATH."templates/".GET_LANGUAGE()."/html/";
+       $BASE = sprintf("%stemplates/%s/html/", PATH, GET_LANGUAGE());
        $MODE = "";
 
        // Check for admin/guest/member templates
@@ -114,20 +113,20 @@ function get_template ($template, $return=false, $content="")
                $file2 = sprintf("%s%s%s_%s.tpl", $BASE, $MODE, $template, SQL_ESCAPE($_GET['what']));
 
                // Probe for it...
-               if ((file_exists($file2)) && (is_readable($file2))) $file = $file2;
+               if (FILE_READABLE($file2)) $file = $file2;
 
                // Remove variable from memory
                unset($file2);
-       }
+       } // END - if
 
        // Does the special template exists?
-       if ((!file_exists($file)) || (!is_readable($file))) {
+       if (!FILE_READABLE($file)) {
                // Reset to default template
-               $file = PATH."templates/".GET_LANGUAGE()."/html/".$template.".tpl";
-       }
+               $file = sprintf("%stemplates/%s/html/%s.tpl", PATH, GET_LANGUAGE(), $template);
+       } // END - if
 
        // Now does the final template exists?
-       if ((file_exists($file)) && (is_readable($file))) {
+       if (FILE_READABLE($file)) {
                // The local file does exists so we load it. :)
                $tmpl_file = implode("", file($file));
                $tmpl_file = str_replace("'", '{QUOT}', $tmpl_file);