Skip to content

Instantly share code, notes, and snippets.

@bazooka07
Last active May 17, 2018 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bazooka07/0b8401610dbda39e990052f01e29c6cb to your computer and use it in GitHub Desktop.
Save bazooka07/0b8401610dbda39e990052f01e29c6cb to your computer and use it in GitHub Desktop.
diff --git a/core/admin/top.php b/core/admin/top.php
index adcd25b..fe02892 100644
--- a/core/admin/top.php
+++ b/core/admin/top.php
@@ -21,10 +21,7 @@ if(isset($_GET["del"]) AND $_GET["del"]=="install") {
<link rel="stylesheet" type="text/css" href="<?php echo PLX_CORE ?>admin/theme/fonts/fontello.css?ver=<?php echo PLX_VERSION ?>" media="screen" />
<link rel="icon" href="<?php echo PLX_CORE ?>admin/theme/images/favicon.png" />
<?php if(is_file(PLX_ROOT.$plxAdmin->aConf['custom_admincss_file'])) echo '<link rel="stylesheet" type="text/css" href="'.PLX_ROOT.$plxAdmin->aConf['custom_admincss_file'].'" media="screen" />'."\n" ?>
- <?php
- if(file_exists(PLX_ROOT.$plxAdmin->aConf['racine_plugins'].'admin.css'))
- echo '<link rel="stylesheet" type="text/css" href="'.PLX_ROOT.$plxAdmin->aConf['racine_plugins'].'admin.css" media="screen" />'."\n";
- ?>
+ <?php $plxAdmin->pluginsCss(true); ?>
<script src="<?php echo PLX_CORE ?>lib/functions.js?ver=<?php echo PLX_VERSION ?>"></script>
<script src="<?php echo PLX_CORE ?>lib/visual.js?ver=<?php echo PLX_VERSION ?>"></script>
<script src="<?php echo PLX_CORE ?>lib/mediasManager.js?ver=<?php echo PLX_VERSION ?>"></script>
diff --git a/core/lib/class.plx.motor.php b/core/lib/class.plx.motor.php
index 8420e97..63d7667 100644
--- a/core/lib/class.plx.motor.php
+++ b/core/lib/class.plx.motor.php
@@ -8,6 +8,8 @@
**/
class plxMotor {
+ const TIME_MASK = 4194303; # 2 puissance 22 - 1; base_convert(4194303, 10, 16) -> 3fffff; => 48,54 jours
+
public $get = false; # Donnees variable GET
public $racine = false; # Url de PluXml
public $path_url = false; # chemin de l'url du site
@@ -298,7 +300,7 @@ class plxMotor {
$url = $this->urlRewrite('?article'.intval($this->plxRecord_arts->f('numero')).'/'.$this->plxRecord_arts->f('url'));
eval($this->plxPlugins->callHook('plxMotorDemarrageNewCommentaire'));
if($retour[0] == 'c') { # Le commentaire a été publié
- $_SESSION['msgcom'] = L_COM_PUBLISHED;
+ $_SESSION['msgcom'] = L_COM_PUBLISHED;
header('Location: '.$url.'#'.$retour);
} elseif($retour == 'mod') { # Le commentaire est en modération
$_SESSION['msgcom'] = L_COM_IN_MODERATION;
@@ -1120,5 +1122,17 @@ class plxMotor {
}
}
+ public function pluginsCss($admin=false) {
+ $cible = ($admin) ? 'admin' : 'site';
+ $filename = "{$this->aConf['racine_plugins']}$cible.css";
+ if(is_file(PLX_ROOT.$filename)) {
+ $href = ($admin) ? PLX_ROOT.$filename : $this->plxMotor->urlRewrite($filename);
+ $href .= '?d='.base_convert(filemtime(PLX_ROOT.$filename) & self::TIME_MASK, 10, 36);
+ echo <<< LINK
+<link rel="stylesheet" type="text/css" href="$href" media="screen" />\n
+LINK;
+ }
+ }
+
}
-?>
\ No newline at end of file
+?>
diff --git a/core/lib/class.plx.show.php b/core/lib/class.plx.show.php
index e3a9bd3..b76b9cf 100755
--- a/core/lib/class.plx.show.php
+++ b/core/lib/class.plx.show.php
@@ -1966,10 +1966,7 @@ class plxShow {
public function pluginsCss() {
# Hook Plugins
if(eval($this->plxMotor->plxPlugins->callHook('plxShowPluginsCss'))) return;
-
- $filename = $this->plxMotor->aConf['racine_plugins'].'site.css';
- if(is_file(PLX_ROOT.$filename))
- echo '<link rel="stylesheet" type="text/css" href="'.$this->urlRewrite($filename).'" media="screen" />'."\n";
+ $this->plxMotor->pluginsCss();
}
/**
@@ -2045,4 +2042,4 @@ class plxShow {
}
}
-?>
\ No newline at end of file
+?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment