Look up in engine.php this:
// Limpiemos el nombre
// --> Tambien me quedo "super rico".
$lower = strtolower($tmp_name); // Solo minusculas
$alnum = ereg_replace("[^[:alnum:]]","",$lower); // Solo alfanumericos
if ($exten==peg) { unset($exten); $exten = 'jpg'; }
$clear = substr_replace($alnum, '', -3); // sin extension ni punto
// Cortemos el nombre (si hace falta)
$conteo = strlen($clear);
// Random
$ch_1 = chr(rand(ord("a"), ord("z")));
$ch_2 = chr(rand(ord("z"), ord("a")));
if ($conteo>$max_name) {
$renombre = substr("$clear", 0, $max_name);
} else {
if (empty($clear)) {
$renombre = $ch_1.$ch_2.$ch_1;
} else {
$renombre = $clear;
}
}
// Si existe el nombre, renombramos el que estamos subiendo.
if (file_exists(DIR_IM.$renombre.'.'.$exten)) {
if ($conteo>$totalchars) {
// Si el nombre es muy largo, corta
$renombra = substr("$renombre", 0, $max_name-4); // 4 -> El remplazo de mas abajo
} else {
$renombra = $renombre;
}
// Vamos a darle caracteres aleatorios.
$name = $renombra.$ch_1.$ch_2.$ch_1.'.'.$exten;
} else {
$name = $renombre.'.'.$exten;
}
That is all the "name thing". If you want some changes you must take care of:
- What happens if the file already exists?
- What kind of rename should i use?
So, try to make your way trhought that code, is not too hard.
rodolfoberrios.com |
PLEASE use Tech Support forums to ask for support!