Exemple #1
0
/**
 * Return the URL to a specified template file
 *
 * Converts filename to URL after finding location and then returns it
 *
 * @since 1.0
 *
 * @param string $file Filename to find, relative to template directory
 * @return string Absolute URL to the file
 */
function get_template_file($file)
{
    return Templates::path_to_url(Templates::get_file($file));
}
Exemple #2
0
 * @package Lilina
 * @version 1.0
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 */
/** */
define('LILINA_PATH', dirname(__FILE__));
define('LILINA_INCPATH', LILINA_PATH . '/inc');
define('LILINA_PAGE', 'favicon');
// Hide errors
ini_set('display_errors', false);
require_once LILINA_INCPATH . '/contrib/simplepie.class.php';
if (!isset($_GET['i'])) {
    die;
}
require_once LILINA_INCPATH . '/core/conf.php';
require_once LILINA_INCPATH . '/core/plugin-functions.php';
function faux_hash($input)
{
    return $input;
}
if ($_GET['i'] != 'default' && file_exists(LILINA_CACHE_DIR . $_GET['i'] . '.spi')) {
    SimplePie_Misc::display_cached_file($_GET['i'], LILINA_CONTENT_DIR . '/system/cache', 'spi', 'SimplePie_Cache', 'faux_hash');
} else {
    require_once LILINA_INCPATH . '/core/class-templates.php';
    Locale::load_default_textdomain();
    header('Content-Type: image/png');
    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT');
    // 7 days
    echo file_get_contents(Templates::get_file('feed.png'));
    die;
}
 /**
  * Return the URL to a specified file
  *
  * Equivalent of {@link get_file} for URLs
  * @param string $file_name Filename to attempt to find
  * @return string|boolean Path to file found, false if none found
  */
 public static function get_url($file_name)
 {
     if ($path = Templates::get_file($file_name)) {
         return Templates::path_to_url($path);
     }
     return false;
 }