Les avertissements suivants se sont produits :
Warning [2] Undefined array key 0 - Line: 1640 - File: showthread.php PHP 8.2.18 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 1640 errorHandler->error_callback
/showthread.php 915 buildtree




Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
Un ShowRoom publique pour Cms Made Simple
#30
Joli, mais attention aux espaces et caractères spéciaux. Remplace-les par des tirets (comme les alias qui se créent à partir du titre).
Voir : /lib/misc.functions.php ligne 1337
Code :
/**
* convert a human readable string into something that is suitable for use in URLS
* because many browsers don't support UTF-8 characters in URLS
*
* @internal
* @param string String to convert
* @param boolean indicates whether output string should be converted to lower case
* @return string
*/
function munge_string_to_url($alias, $tolower = false)
{
    // replacement.php is encoded utf-8 and must be the first modification of alias
    include(dirname(__FILE__) . '/replacement.php');
    $alias = str_replace($toreplace, $replacement, $alias);

    // lowercase only on empty aliases
    if ($tolower == true)
    {
        $alias = strtolower($alias);
    }

    $alias = preg_replace('/[^a-z0-9-_]+/i','-',$alias);
    //$alias = preg_replace("/[^\w-]+/", "-", $alias);
    $alias = trim($alias, '-');

    return $alias;
}
Répondre


Messages dans ce sujet

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)