Browse Source

Merge branch 'development'

pull/24/head
Teknikode 8 years ago
parent
commit
c825711112
  1. 4
      README.md
  2. 9
      includes/common.php
  3. 1
      includes/update_profile.php
  4. 21
      templates/default/header.php

4
README.md

@ -70,8 +70,8 @@ git clone git://teknik.io/Teknik @@ -70,8 +70,8 @@ git clone git://teknik.io/Teknik
```
cd /var/www/Teknik/templates/default
mkdir -p cache/js
chmod -R 777 cache
mkdir cache
chmod 777 cache
cd /var/www/Teknik/git
mkdir cache

9
includes/common.php

@ -593,4 +593,13 @@ function trim_value(&$value) @@ -593,4 +593,13 @@ function trim_value(&$value)
{
$value = trim($value); // this removes whitespace and related characters from the beginning and end of the string
}
function compress($buffer)
{
/* remove comments */
$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
/* remove tabs, spaces, newlines, etc. */
$buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer);
return $buffer;
}
?>

1
includes/update_profile.php

@ -1,6 +1,5 @@ @@ -1,6 +1,5 @@
<?php
require_once('config.php');
require_once('Git.php');
//initialize php variables used in the form
$current_password = "";

21
templates/default/header.php

@ -152,14 +152,14 @@ @@ -152,14 +152,14 @@
$js .= \JShrink\Minifier::minify(file_get_contents(dirname(__FILE__).'/js/'.$file));
}
file_put_contents(dirname(__FILE__)."/cache/js/".$CONF['page'].".teknik.min.js", $js);
file_put_contents(dirname(__FILE__)."/cache/".$CONF['page'].".teknik.min.js", $js);
}
/*
// Check to see if the CSS files have changed //
$cssChanged = false;
$cssCacheFile = dirname(__FILE__).'/cache/css_cache_'.$CONF['page'].'.txt';
if (file_exists($cssCacheFile) && file_exists(dirname(__FILE__)."/cache/css/".$CONF['page'].".teknik.min.css"))
if (file_exists($cssCacheFile) && file_exists(dirname(__FILE__)."/cache/".$CONF['page'].".teknik.min.css"))
{
$cache_arr = explode('|', file_get_contents($cssCacheFile));
$time_str = $cache_arr[0];
@ -201,22 +201,21 @@ @@ -201,22 +201,21 @@
{
$css_str .= file_get_contents(dirname(__FILE__)."/css/".$file)."\r\n";
}
$minifier = new CssMinifier($css_str, $CONF['css_min_filters'], $CONF['css_min_plugins']);
$final_css = $minifier->getMinified();
$final_css = compress($css_str);
file_put_contents(dirname(__FILE__)."/cache/css/".$CONF['page'].".teknik.min.css", $css_str);
file_put_contents(dirname(__FILE__)."/cache/".$CONF['page'].".teknik.min.css", $css_str);
}
*/
/*
foreach ($cssFiles as $file)
{
?>
<link href="<?php echo get_page_url("cdn", $CONF); ?>/<?php echo $CONF['template']; ?>/css/<?php echo $file; ?>" rel="stylesheet" />
<?php
}
}*/
?>
<!--<link href="<?php echo get_page_url("cdn", $CONF); ?>/<?php echo $CONF['template']; ?>/cache/css/<?php echo $CONF['page']; ?>.teknik.min.css" rel="stylesheet" />-->
<script src="<?php echo get_page_url("cdn", $CONF); ?>/<?php echo $CONF['template']; ?>/cache/js/<?php echo $CONF['page']; ?>.teknik.min.js"></script>
<link href="<?php echo get_page_url("cdn", $CONF); ?>/<?php echo $CONF['template']; ?>/cache/<?php echo $CONF['page']; ?>.teknik.min.css" rel="stylesheet" />
<script src="<?php echo get_page_url("cdn", $CONF); ?>/<?php echo $CONF['template']; ?>/cache/<?php echo $CONF['page']; ?>.teknik.min.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>

Loading…
Cancel
Save