لینک فارسی برای دیتالایف
این هک رو Sam.Razm در فروم قبلی قرار داده بودند که پاک شد .
1. فایل Engine/Inc/include/functions.inc.php رو باز کنید :
کد زیر رو پیدا کنید :
function totranslit($var, $lower = true, $punkt = true) {
$NpjLettersFrom = "àáâãäåçèêëìíîïðñòóôöû³";
$NpjLettersTo = "abvgdeziklmnoprstufcyi";
$NpjBiLetters = array ("é" => "j", "¸" => "yo", "æ" => "zh", "õ" => "x", "÷" => "ch", "ø" => "sh", "ù" => "shh", "ý" => "ye", "þ" => "yu", "ÿ" => "ya", "ú" => "", "ü" => "", "¿" => "yi", "º" => "ye" );
$NpjCaps = "ÀÁÂÃÄŨÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÜÚÛÝÞ߯ª²";
$NpjSmall = "àáâãäå¸æçèéêëìíîïðñòóôõö÷øùüúûýþÿ¿º³";
$var = str_replace( ".php", "", $var );
$var = trim( strip_tags( $var ) );
$var = preg_replace( "/\s+/ms", "-", $var );
$var = strtr( $var, $NpjCaps, $NpjSmall );
$var = strtr( $var, $NpjLettersFrom, $NpjLettersTo );
$var = strtr( $var, $NpjBiLetters );
if ( $punkt ) $var = preg_replace( "/[^a-z0-9\_\-.]+/mi", "", $var );
else $var = preg_replace( "/[^a-z0-9\_\-]+/mi", "", $var );
$var = preg_replace( '#[\-]+#i', '-', $var );
if ( $lower ) $var = strtolower( $var );
if( strlen( $var ) > 50 ) {
$var = substr( $var, 0, 50 );
if( ($temp_max = strrpos( $var, '-' )) ) $var = substr( $var, 0, $temp_max );
}
return $var;
}
$NpjLettersFrom = "àáâãäåçèêëìíîïðñòóôöû³";
$NpjLettersTo = "abvgdeziklmnoprstufcyi";
$NpjBiLetters = array ("é" => "j", "¸" => "yo", "æ" => "zh", "õ" => "x", "÷" => "ch", "ø" => "sh", "ù" => "shh", "ý" => "ye", "þ" => "yu", "ÿ" => "ya", "ú" => "", "ü" => "", "¿" => "yi", "º" => "ye" );
$NpjCaps = "ÀÁÂÃÄŨÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÜÚÛÝÞ߯ª²";
$NpjSmall = "àáâãäå¸æçèéêëìíîïðñòóôõö÷øùüúûýþÿ¿º³";
$var = str_replace( ".php", "", $var );
$var = trim( strip_tags( $var ) );
$var = preg_replace( "/\s+/ms", "-", $var );
$var = strtr( $var, $NpjCaps, $NpjSmall );
$var = strtr( $var, $NpjLettersFrom, $NpjLettersTo );
$var = strtr( $var, $NpjBiLetters );
if ( $punkt ) $var = preg_replace( "/[^a-z0-9\_\-.]+/mi", "", $var );
else $var = preg_replace( "/[^a-z0-9\_\-]+/mi", "", $var );
$var = preg_replace( '#[\-]+#i', '-', $var );
if ( $lower ) $var = strtolower( $var );
if( strlen( $var ) > 50 ) {
$var = substr( $var, 0, 50 );
if( ($temp_max = strrpos( $var, '-' )) ) $var = substr( $var, 0, $temp_max );
}
return $var;
}
به جاش کد زیر رو قرار بدید :
function totranslit($var, $lower = true, $punkt = true) {
$var = str_replace(".php", "", $var);
$var = trim(strip_tags($var));
$var = preg_replace( "/\s+/ms", "-", $var );
if (strlen($var) > 70) {
$var = substr ($var, 0, 70);
if (($temp_max = strrpos($var, '-'))) $var = substr ($var, 0, $temp_max);
}
return $var;
}
$var = str_replace(".php", "", $var);
$var = trim(strip_tags($var));
$var = preg_replace( "/\s+/ms", "-", $var );
if (strlen($var) > 70) {
$var = substr ($var, 0, 70);
if (($temp_max = strrpos($var, '-'))) $var = substr ($var, 0, $temp_max);
}
return $var;
}
2. فایل Engine/modules/functions.php رو باز کنید :
کد زیر رو پیدا کنید :
function totranslit($var, $lower = true, $punkt = true) {
$NpjLettersFrom = "àáâãäåçèêëìíîïðñòóôöû³";
$NpjLettersTo = "abvgdeziklmnoprstufcyi";
$NpjBiLetters = array ("é" => "j", "¸" => "yo", "æ" => "zh", "õ" => "x", "÷" => "ch", "ø" => "sh", "ù" => "shh", "ý" => "ye", "þ" => "yu", "ÿ" => "ya", "ú" => "", "ü" => "", "¿" => "yi", "º" => "ye" );
$NpjCaps = "ÀÁÂÃÄŨÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÜÚÛÝÞ߯ª²";
$NpjSmall = "àáâãäå¸æçèéêëìíîïðñòóôõö÷øùüúûýþÿ¿º³";
$var = str_replace( ".php", "", $var );
$var = trim( strip_tags( $var ) );
$var = preg_replace( "/\s+/ms", "-", $var );
$var = strtr( $var, $NpjCaps, $NpjSmall );
$var = strtr( $var, $NpjLettersFrom, $NpjLettersTo );
$var = strtr( $var, $NpjBiLetters );
if ( $punkt ) $var = preg_replace( "/[^a-z0-9\_\-.]+/mi", "", $var );
else $var = preg_replace( "/[^a-z0-9\_\-]+/mi", "", $var );
$var = preg_replace( '#[\-]+#i', '-', $var );
if ( $lower ) $var = strtolower( $var );
if( strlen( $var ) > 50 ) {
$var = substr( $var, 0, 50 );
if( ($temp_max = strrpos( $var, '-' )) ) $var = substr( $var, 0, $temp_max );
}
return $var;
}
$NpjLettersFrom = "àáâãäåçèêëìíîïðñòóôöû³";
$NpjLettersTo = "abvgdeziklmnoprstufcyi";
$NpjBiLetters = array ("é" => "j", "¸" => "yo", "æ" => "zh", "õ" => "x", "÷" => "ch", "ø" => "sh", "ù" => "shh", "ý" => "ye", "þ" => "yu", "ÿ" => "ya", "ú" => "", "ü" => "", "¿" => "yi", "º" => "ye" );
$NpjCaps = "ÀÁÂÃÄŨÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÜÚÛÝÞ߯ª²";
$NpjSmall = "àáâãäå¸æçèéêëìíîïðñòóôõö÷øùüúûýþÿ¿º³";
$var = str_replace( ".php", "", $var );
$var = trim( strip_tags( $var ) );
$var = preg_replace( "/\s+/ms", "-", $var );
$var = strtr( $var, $NpjCaps, $NpjSmall );
$var = strtr( $var, $NpjLettersFrom, $NpjLettersTo );
$var = strtr( $var, $NpjBiLetters );
if ( $punkt ) $var = preg_replace( "/[^a-z0-9\_\-.]+/mi", "", $var );
else $var = preg_replace( "/[^a-z0-9\_\-]+/mi", "", $var );
$var = preg_replace( '#[\-]+#i', '-', $var );
if ( $lower ) $var = strtolower( $var );
if( strlen( $var ) > 50 ) {
$var = substr( $var, 0, 50 );
if( ($temp_max = strrpos( $var, '-' )) ) $var = substr( $var, 0, $temp_max );
}
return $var;
}
به جاش کد زیر رو قرار بدید :
function totranslit($var, $lower = true, $punkt = true) {
$var = str_replace(".php", "", $var);
$var = trim(strip_tags($var));
$var = preg_replace( "/\s+/ms", "-", $var );
if (strlen($var) > 70) {
$var = substr ($var, 0, 70);
if (($temp_max = strrpos($var, '-'))) $var = substr ($var, 0, $temp_max);
}
return $var;
}
$var = str_replace(".php", "", $var);
$var = trim(strip_tags($var));
$var = preg_replace( "/\s+/ms", "-", $var );
if (strlen($var) > 70) {
$var = substr ($var, 0, 70);
if (($temp_max = strrpos($var, '-'))) $var = substr ($var, 0, $temp_max);
}
return $var;
}
عدد 70 تعداد کاراکترهای هر لینک هست که پیش فرض روی 50 هست . من رو 70 گذاشتم . دوستان اگر خواستن به پیش فرض برگردونن.
----------------------------------------
اینم روش Saron
در فایلهای : addnews.php . editnews.php در پوشه ی engine/inc
وفایل addnews.php در پوشه ی engine/modules کافیست این کار رو بکنید :
کد زیر رو پیدا کنید :
if( $alt_name == "" or ! $alt_name ) $alt_name = totranslit( stripslashes( $title ), true, false );
else $alt_name = totranslit( $alt_name, true, false );
else $alt_name = totranslit( $alt_name, true, false );
به جاش کد زیر رو بگذارید :
if( trim( $alt_name ) == "" or ! $alt_name ) $alt_name = strip_tags( stripslashes( trim( str_replace(" ", "-", $title))));
else $alt_name = strip_tags( stripslashes( trim( str_replace(" ", "-", $alt_name))));
else $alt_name = strip_tags( stripslashes( trim( str_replace(" ", "-", $alt_name))));