Come on guys there is only one change needed in it, 118 views and no one corrected, common zealots..
<?php
/**
* Xoops_sef Preloads & Language Stylesheet loader
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* 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.
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* @author Cointin Maxime (AKA Kraven30)
* @author Andricq Nicolas (AKA MusS)
* @version $Id: Sef.php 12537 2014-05-19 14:19:33Z beckmi $
*/
if (!function_exists('xoops_sef'))
{
/**
* Xoops safe encoded url elements
*
* @param unknown $datab
* @param string $char
* @return string
*/
function xoops_sef($value = '', $stripe ='-')
{
$replacement_chars = array();
$accepted = array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","m","o","p","q",
"r","s","t","u","v","w","x","y","z","0","9","8","7","6","5","4","3","2","1");
for($i=0;$i<256;$i++){
if (!in_array(strtolower(chr($i)),$accepted))
$replacement_chars[] = chr($i);
}
$result = (str_replace($replacement_chars, $stripe, ($value)));
while(substr($result, 0, strlen($stripe)) == $stripe)
$result = substr($result, strlen($stripe), strlen($result) - strlen($stripe));
while(substr($result, strlen($result) - strlen($stripe), strlen($stripe)) == $stripe)
$result = substr($result, 0, strlen($result) - strlen($stripe));
while(strpos($result, $stripe . $stripe))
$result = str_replace($stripe . $stripe, $stripe, $result);
return(strtolower($result));
}
}
/**
* Class ModuleSefPreload
*/
class ModuleSefPreload extends XoopsPreloadItem
{
/**
*
* @param array $arg
*/
function eventCoreHeaderAddmeta($arg)
{
$parts = explode(DIRECTORY_SEPARATOR, $_SERVER['PHP_SELF']);
$moddir = basename(dirname(dirname(__FILE__)));
if (in_array($moddir, $parts))
$GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . '/modules/' . $moddir . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/' . $moddir . '.css', array(), '' );
}
}