PDA

View Full Version : سوال: مشکل فایل های فارسی در دایرکتوری



nsco_nsco
پنج شنبه 05 اردیبهشت 1392, 03:27 صبح
سلام دوستان من برای یک پروژه احتیاج به یک دایرکتوری پوشه داشتم که فایل های روی هاست رو نمایش و کاربر بتونه به راحتی انها را دانه دانه دانلود کند خوشبختانه یک خوب و سادش را پیدا کردم اما مشکش اینجاست که پوشه ها و فایل هایی که به نام فارسی هست را درست نشون نمی دهد یعنی به این صورت نمایش می دهد ???? مسئله یونیکد صفحه هم فکر نمی کنم باشد چون چک کردم ممنون میشوم دوستان کمک کنید تا این مسئله حل شود با تشکر از همه دوستان



##### SETTINGS ###################################
$site_title = 'نمايش فايل'; //Title of the page or your website
$file_dir = 'file'; //Folder to start indexing from
$script_file = 'index.php'; //Script file name, default is index.php
$admin_email = 'webmaster@example.com'; //E-mail address, displayed if error occurs
$icons_dir = 'icons'; //Directory containing icon images
$table_width = '920'; //Width of the table
$single_img = 'off'; //Use simgle image: _file.png for all files, on/off
$anti_leech = 'on'; //Enable download link protection, on/off
$font_family = 'tahoma,arial,sans-serif'; //Font options
$body_color = '#fff'; //Page background color
$text_color = '#666666'; //Text color
$link_color = '#006699'; //Link color
$dots_color = '#888888'; //Dots/border color
$show_icon = 'yes'; //Show file icon column, yes/no
$show_size = 'yes'; //Show file size column, yes/no
$show_type = 'yes'; //Show file type column, yes/no
$show_modf = 'yes'; //Show file last modified column, yes/no
$show_parent = 'yes'; //Show parent directory, yes/no
$show_ext = 'yes'; //Show file extension, yes/no
$login_user = 'test'; //Login username
$login_pass = ''; //Login password, leave blank to open access
##### SETTINGS ###################################
include('date.php');
if(!empty($login_pass)){
session_start();
}
if($_GET['l']=='logout'){
unset($_SESSION['username']);
unset($_SESSION['password']);
header('Location:'.$script_file.'');
exit();
}
if(!empty($login_pass)){
if(($_POST['username']==$login_user)&&($_POST['password']==$login_pass)){
$_SESSION['username'] = $login_user;
$_SESSION['password'] = md5($login_pass);
header('Location:'.$script_file.'');
exit();
}
elseif((($_POST['username'])||($_POST['password']))&&(($_POST['username']!==$login_user)||($_POST['password']!==$login_pass))){
err("ERROR 401","The username and password you provided are incorrect.<br/>Please <a href='$script_file'>click here</a> to go back.");
}
}
function h(){
global $site_title, $font_family, $body_color, $text_color, $link_color, $dots_color;
print'<html>
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />

<meta charset="UTF-8" />
<title>'.$site_title.'</title>
<style type="text/css">
body,td,div,input{
font-family:'.$font_family.';
font-size:14px;
margin: 0;
padding: 0;
border: 0;
vertical-align:baseline;
font-family:Tahoma;
font-size:16px;
font-weight:normal;
direction:rtl;
text-align:right;
margin: 0 auto;
}
body,td,input{
background-color:'.$body_color.';
color:'.$text_color.';
}
a{
color:'.$link_color.';
text-decoration:none;
}
a:hover{
color:'.$link_color.';
text-decoration:underline;
}
hr.x{
color:'.$body_color.';
background-color:'.$body_color.';
border:1px dotted '.$dots_color.';
border-style:none none dotted;
}
td.y{
vertical-align:bottom;
}
td.z{
font-size:16px;
}
td.w{
font-size:12px;
text-align:right;
}
div.box{
position:absolute;
width:460px;
height:200px;
top:50%;
left:50%;
margin-left:-230px;
margin-top:-100px;
}
div.box .x{
font-size:14px;
text-align:center;
border-bottom:1px dotted '.$dots_color.';
font-weight:bold;
padding-bottom:10px;
}
div.box .y{
font-size:13px;
text-align:center;
margin-top:10px;
}
form label{
display:block;
width:80px;
padding-top:3px;
margin-left:40px;
float:left;
}
form input{
display:block;
margin-bottom:10px;
padding:5px;
border:solid 1px '.$dots_color.';
width:250px;
height:25px;
font-size:12px;
}
.button{
width:80px;
font-size:12px;
padding-top:3px;
}
</style>

</head>
<body>';
}
function f() {
print'</body>
</html>';
exit();
}
function x($s){
$p=strrpos($s,'.');
return substr($s,$p+1,strlen($s));
}
function y($a,$c,$o='asc',$t=SORT_STRING){
if(!isset($a[0][$c])){
return $a;
}
for($i=0;$i<count($a);$i++){
$w[$i]=&$a[$i][$c];
}
$o=($o=='asc')?SORT_ASC:SORT_DESC;
array_multisort($w,$o,$t,$a);
return $a;
}
function z($x){
$y=strrpos($x,".");
$z=substr($x,$y+1);
return $z;
}
function err($x,$y){
h();
print'<div class="box">
<div class="x">'.$x.'</div>
<div class="y">'.$y.'</div>
</div>';
f();
}
$b=$_GET["d"];
$q=$_GET["f"];
if((!empty($login_pass))&&((!isset($_SESSION['username']))||(!isset($_SESSION['password'])))){
if($q){
err("ERROR 403","You are not authorized to access the requested file.<br>Please contact the webmaster at $admin_email.");
}
h();
print'<div class="box">
<div class="x">'.$site_title.'</div>
<div class="y">'.$y.'</div>
<form method="post" action="'.$script_file.'">
<label>Username:</label><input type="text" name="username">
<label>Password:</label><input type="password" name="password">
<label></label><input type="submit" class="button" value="Login">
</form>
</div>';
f();
}
elseif((empty($login_pass))||(isset($_SESSION['username']))&&(isset($_SESSION['password']))){
if((substr($b,0,1)=='.')||(substr($q,0,1)=='.')||( substr($b,0,3)=='%2e')||(substr($q,0,3)=='%2e')){
err("ERROR 400","Access denied due to bad request.<br>Please contact the webmaster at $admin_email.");
}
elseif(($b!='')&&($q!='')){
$cwd=getcwd();
$n=strtolower($_SERVER["HTTP_USER_AGENT"]);
if($b=='d'){
$g="$cwd/$file_dir/";
}
else{
$g="$cwd/$file_dir/$b/";
}
$e=$g.$q;
if(!file_exists($e)){
err("ERROR 404","The file you have requested is not found.<br>Please contact the webmaster at $admin_email.");
}
elseif(!is_readable($e)){
err("ERROR 500","Internal server error with read permission.<br>Please contact the webmaster at $admin_email.");
}
$m=fopen($g.$q,"r");
$v=fread($m,filesize($g.$q));
fclose($m);
header('Content-Type: application/download');
header('Content-Disposition:attachment;filename="'.$q.'"');
print $v;
exit();
}
else{
$j=isset($_GET['s'])?$_GET['s']:"n";
$k=isset($_GET['o'])?$_GET['o']:'asc';
$l=$j==='s'||$j==='m'?SORT_NUMERIC:SORT_STRING;
$d=isset($_GET['d'])?urldecode($_GET['d']):'';
$d=$d!==''&&$d!=='/'?trim($d,'/').'/':'';
$dir="$file_dir/";
$p=$dir.$d;
$h=@opendir($p);
if(strstr($d,'../')){
err("ERROR 403","Access to the requested directory is forbidden.<br>Please contact the webmaster at $admin_email.");
}
elseif(!$h){
err("ERROR 404","The directory you have requested is not found.<br>Please contact the webmaster at $admin_email.");
}
$y=array();
$x=array();
while(FALSE!==($f=readdir($h))){
if($f[0]!=='.'){
if(is_dir($p.$f)){
$x[]=array('n'=>$f,'m'=>filemtime($p.$f),'s'=>filesize($p.$f),'t'=>'Directory');
}
else{
$y[]=array('n'=>$f,'m'=>filemtime($p.$f),'t'=>x($f),'s'=>filesize($p.$f));
}
}
}
if($j){
$y=y($y,$j,$k,$l);
$x=y($x,$j,$k,$l);
}
h();
print'<div align="center">';
print'<table cellspacing="2" cellpadding="1" width="'.$table_width.'">';
print'<tr>';
if(!empty($login_pass)){
print'<td class="z" colspan="4">';
}
else{
print'<td class="z" colspan="5">';
}
print($d!=='')?"<a href='$script_file' style='text-decoration:none'><b>$site_title</b></a> / ":"<b>$site_title</b>";
if($d!==''){
$t=explode('/',trim($d,'/'));
for($i=0,$r=array(),$z='';($r[]=@$t[$i]),$z=@$t[$i];$i++){
print(implode('/',$r)!==trim($d,'/'))?('<a href="'.$script_file.'?d='.implode('%2F',$r).'" style="text-decoration:none"><b>'.$z.'</b></a> / ' ):"<b>$z</b>";
}
}
$f=trim($d,'/');
print'</td>';
if(!empty($login_pass)){
print'<td class="w"><a href="'.$script_file.'?l=logout">Logout</a></td>';
}
print'</tr>';
print'<tr><td colspan="5"><hr class="x"/></td></tr>';
print'<tr>';
if($show_icon=='yes'){
print'<td class="y" width="3%"><img src="'.$icons_dir.'/_spacer.png"></td>';
}
print'<td class="y" width="42%"><a href="'.$script_file.'?s=n&amp;o='.($k=='asc'?'dsc':'asc').' &amp;d='.urlencode($f).'">نام فايل</a></td>';
if($show_size=='yes'){
print'<td class="y" width="18%" align="right"><a href="'.$script_file.'?s=s&amp;o='.($k=='asc'?'dsc':'asc').' &amp;d='.urlencode($f).'">حجم فايل</a></td>';
}
if($show_type=='yes'){
print'<td class="y" width="12%" align="right"><a href="'.$script_file.'?s=t&amp;o='.($k=='asc'?'dsc':'asc').' &amp;d='.urlencode($f).'">نوع فايل</a></td>';
}
if($show_modf=='yes'){
print'<td class="y" width="25%" align="right"><a href="'.$script_file.'?s=m&amp;o='.($k=='asc'?'dsc':'asc').' &amp;d='.urlencode($f).'">تاريخ درج</a></td>';
}
print'</tr>';
print'<tr><td colspan="5"><hr class="x"/></td></tr>';
if($show_parent=='yes'){
$pd = str_replace(array("\r\n","\r","\n"),' ',dirname($d).PHP_EOL);
if(($pd=='. ')||(($pd!=="")&&($pd!==" "))){
print'<tr>';
if($show_icon=='yes'){
print'<td><img src="'.$icons_dir.'/_parent.png"></td>';
}
}
if($pd=='. '){
print'<td><a href="'.$script_file.'">...بازگشت</a></td>';
}
elseif(($pd!=="")&&($pd!==" ")){
print'<td><a href="'.$script_file.'?d='.$pd.'">...بازگشت</a></td>';
}
if(($pd=='. ')||(($pd!=="")&&($pd!==" "))){
if($show_size=='yes'){
print'<td></td>';
}
if($show_type=='yes'){
print'<td></td>';
}
if($show_modf=='yes'){
print'<td align="right">بازگشت</td>';
}
print'</tr>';
}
}
for($i=0,$c='';($c=@$x[$i++]);){
print'<tr>';
if($show_icon=='yes'){
print'<td><img src="'.$icons_dir.'/_folder.png"></td>';
}
print'<td><a href="'.$script_file.'?d='.urlencode($d.$c['n']).'&amp;s=n&amp;o=asc">'.$c['n'].'</a></td>';
if($show_size=='yes'){
print'<td></td>';
}
if($show_type=='yes'){
print'<td></td>';
}
if($show_modf=='yes'){
print'<td align="right">'.$s1 = jdate('l,d F y ',$c['m'], strtotime($row['date'])).'</td>';
}
print'</tr>';
}
for($i=0,$c='';($c=@$y[$i++]);){
if($c['n']!==$script_file){
print'<tr>';
if($show_icon=='yes'){
if($single_img=='on'){
print'<td><img src="'.$icons_dir.'/_file.png"></td>';
}
else{
print'<td><img src="'.$icons_dir.'/'.$c['t'].'.png"></td>';
}
}
if($show_ext=='yes'){
$fn=$c['n'];
}
else{
$fn=str_replace('.'.$c['t'].'','',$c['n']);
}
if($anti_leech!=='on'){
print'<td><a href="'.$dir.$d.$c['n'].'">'.$c['n'].'</td>';
}
elseif($d==''){
print'<td><a href="'.$script_file.'?d=d&f='.$c['n'].'">'.$fn.'</a></td>';
}
else{
print'<td><a href="'.$script_file.'?d='.substr($d,0,-1).'&f='.$c['n'].'">'.$fn.'</a></td>';
}
if($show_size=='yes'){
print'<td align="right">حجم'.number_format($c['s']/1048576,2).'مگابايت</td>';
}
if($show_type=='yes'){
print'<td align="right">'.strtoupper($c['t']).'</td>';
}
if($show_modf=='yes'){

print'<td align="right">'.$s1 = jdate('l,d F y ',$c['m'], strtotime($row['date'])).'</td>';
}
print'</tr>';
}
}
print'<tr><td colspan="5"><hr class="x"/></td></tr>';
print'</table>';
print'</div>';
f();
}
}






:قلب:

nsco_nsco
پنج شنبه 05 اردیبهشت 1392, 17:13 عصر
سلام دوستان من نمی دونم چرا هر وقت تاپینگی می زنم هیچکس از دوستان یه یاری نمیرسونه

nsco_nsco
پنج شنبه 05 اردیبهشت 1392, 18:50 عصر
سلام دوستان اگر این کد رو نمی دونید چطور درست میشه لا اقل یه دایرکتی معرفی کنید که فایل های فارسی رو متنش رو درست نشون بده ممنون

Tarragon
پنج شنبه 05 اردیبهشت 1392, 19:47 عصر
<?php

$path = __DIR__;

$files = scandir($path);

foreach($files as $file) {

echo '<p>'.iconv('windows-1256', 'utf-8', $file).'</p>'.PHP_EOL;

}

?>

nsco_nsco
پنج شنبه 05 اردیبهشت 1392, 20:49 عصر
سلام
ممنون میشم بگید این دایرکتوری رو چطور مشکلش را حل کنم با تشکر

nsco_nsco
جمعه 06 اردیبهشت 1392, 18:50 عصر
سلام
دوستان یه کمکی کنید

Tarragon
جمعه 06 اردیبهشت 1392, 18:53 عصر
سلام
شما باید بجای
$NAME_OF_FILE
از
iconv('windows-1256', 'utf-8', $NAME_OF_FILE)
استفاده کنید.
هرچی گشتم از کدتو سر در نیاوردم.

nsco_nsco
پنج شنبه 19 اردیبهشت 1392, 05:41 صبح
سلام دوستان من این مشکل فارسی سازی را حل کردم العان فایل ها لیست میشه به صورت فارسی اما با کلیک روی فایل که نامش فارسی هست بازش نمیکند و فایل را نمایش نمی دهد و وارد زیر گروه فایل فارسی نمیشود ممنون میشم کمک کنید این مشکل حل بشه چون لازماته ممنون دوستان جان ما این رو جواب بدید ممنون :
http://uplod.ir/u12bu6x8lvnw/f.zip.htm

با تشکر

nsco_nsco
پنج شنبه 19 اردیبهشت 1392, 05:42 صبح
حجم فایل کم هست لطفا دانلود کنید و یه کمک بکنید ممنون

nsco_nsco
پنج شنبه 19 اردیبهشت 1392, 12:11 عصر
سلام دوستان این همه تو انجمن مطلب درج می کنید یه نگاه این فایل هم بندازید بازم ممنون .

MMSHFE
پنج شنبه 19 اردیبهشت 1392, 12:44 عصر
این نمونه رو ببینید.


<?php
function ToArabic($unicode) {
return iconv('utf-8', 'windows-1256', str_replace('ک', 'ك', str_replace('ی', 'ي', $unicode)));
}
function ToUnicode($arabic) {
return str_replace('ك', 'ک', str_replace('ي', 'ی', iconv('windows-1256', 'utf-8', $arabic)));
}
if(isset($_FILES['file'])) {
$file = &$_FILES['file'];
$name = ToArabic($file['name']);
move_uploaded_file($file['tmp_name'], $name);
}
?>
<!doctype html>
<html>
<head>
<title>Upload</title>
<meta charset="utf-8" />
</head>
<body>
<form action="" enctype="multipart/form-data" method="post">
File: <input name="file" type="file" />
<input type="submit" value="Upload" />
</form>
<p>Files:</p>
<?php
$files = scandir('.');
$exts = array('doc', 'txt');
foreach($files as $file) {
if (in_array(strtolower(end(explode('.', $file))), $exts)) {
echo '<p>' . ToUnicode($file) . '</p>' . PHP_EOL;
}
}
?>
</body>
</html>

Tarragon
پنج شنبه 19 اردیبهشت 1392, 12:48 عصر
بفرمایید:
اگر از شی گرا استفاده می کردید خیلی مرتب تر بود.
الان من هیچی از کدتون نمی فهمم(در حد 10٪)

<?php
/************************************************** *****************
* PHP Directory Explorer
* Version 1.3
* Website: www.n-s.ir
************************************************** *****************/
##### SETTINGS ###################################
$site_title = 'نمايش فايل'; //Title of the page or your website
$file_dir = 'file'; //Folder to start indexing from
$script_file = 'index.php'; //Script file name, default is index.php
$admin_email = 'webmaster@example.com'; //E-mail address, displayed if error occurs
$icons_dir = 'icons'; //Directory containing icon images
$table_width = '920'; //Width of the table
$single_img = 'off'; //Use simgle image: _file.png for all files, on/off
$anti_leech = 'on'; //Enable download link protection, on/off
$font_family = 'tahoma,arial,sans-serif'; //Font options
$body_color = '#fff'; //Page background color
$text_color = '#666666'; //Text color
$link_color = '#006699'; //Link color
$dots_color = '#888888'; //Dots/border color
$show_icon = 'yes'; //Show file icon column, yes/no
$show_size = 'yes'; //Show file size column, yes/no
$show_type = 'yes'; //Show file type column, yes/no
$show_modf = 'yes'; //Show file last modified column, yes/no
$show_parent = 'yes'; //Show parent directory, yes/no
$show_ext = 'yes'; //Show file extension, yes/no
$login_user = 'test'; //Login username
$login_pass = ''; //Login password, leave blank to open access
##### SETTINGS ###################################
include('date.php');
if(!empty($login_pass)){
session_start();
}
if($_GET['l']=='logout'){
unset($_SESSION['username']);
unset($_SESSION['password']);
header('Location:'.$script_file.'');
exit();
}
if(!empty($login_pass)){
if(($_POST['username']==$login_user)&&($_POST['password']==$login_pass)){
$_SESSION['username'] = $login_user;
$_SESSION['password'] = md5($login_pass);
header('Location:'.$script_file.'');
exit();
}
elseif((($_POST['username'])||($_POST['password']))&&(($_POST['username']!==$login_user)||($_POST['password']!==$login_pass))){
err("ERROR 401","The username and password you provided are incorrect.<br/>Please <a href='$script_file'>click here</a> to go back.");
}
}
function h(){
global $site_title, $font_family, $body_color, $text_color, $link_color, $dots_color;
print'<html>
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />

<meta charset="UTF-8" />
<title>'.$site_title.'</title>
<style type="text/css">
body,td,div,input{
font-family:'.$font_family.';
font-size:14px;
margin: 0;
padding: 0;
border: 0;
vertical-align:baseline;
font-family:Tahoma;
font-size:16px;
font-weight:normal;
direction:rtl;
text-align:right;
margin: 0 auto;
}
body,td,input{
background-color:'.$body_color.';
color:'.$text_color.';
}
a{
color:'.$link_color.';
text-decoration:none;
}
a:hover{
color:'.$link_color.';
text-decoration:underline;
}
hr.x{
color:'.$body_color.';
background-color:'.$body_color.';
border:1px dotted '.$dots_color.';
border-style:none none dotted;
}
td.y{
vertical-align:bottom;
}
td.z{
font-size:16px;
}
td.w{
font-size:12px;
text-align:right;
}
div.box{
position:absolute;
width:460px;
height:200px;
top:50%;
left:50%;
margin-left:-230px;
margin-top:-100px;
}
div.box .x{
font-size:14px;
text-align:center;
border-bottom:1px dotted '.$dots_color.';
font-weight:bold;
padding-bottom:10px;
}
div.box .y{
font-size:13px;
text-align:center;
margin-top:10px;
}
form label{
display:block;
width:80px;
padding-top:3px;
margin-left:40px;
float:left;
}
form input{
display:block;
margin-bottom:10px;
padding:5px;
border:solid 1px '.$dots_color.';
width:250px;
height:25px;
font-size:12px;
}
.button{
width:80px;
font-size:12px;
padding-top:3px;
}
</style>

</head>
<body>';
}
function f() {
print'</body>
</html>';
exit();
}
function x($s){
$p=strrpos($s,'.');
return substr($s,$p+1,strlen($s));
}
function y($a,$c,$o='asc',$t=SORT_STRING){
if(!isset($a[0][$c])){
return $a;
}
for($i=0;$i<count($a);$i++){
$w[$i]=&$a[$i][$c];
}
$o=($o=='asc')?SORT_ASC:SORT_DESC;
array_multisort($w,$o,$t,$a);
return $a;
}
function z($x){
$y=strrpos($x,".");
$z=substr($x,$y+1);
return $z;
}
function err($x,$y){
h();
print'<div class="box">
<div class="x">'.$x.'</div>
<div class="y">'.$y.'</div>
</div>';
f();
}
$b=$_GET["d"];
$q=$_GET["f"];
if((!empty($login_pass))&&((!isset($_SESSION['username']))||(!isset($_SESSION['password'])))){
if($q){
err("ERROR 403","You are not authorized to access the requested file.<br>Please contact the webmaster at $admin_email.");
}
h();
print'<div class="box">
<div class="x">'.$site_title.'</div>
<div class="y">'.$y.'</div>
<form method="post" action="'.$script_file.'">
<label>Username:</label><input type="text" name="username">
<label>Password:</label><input type="password" name="password">
<label></label><input type="submit" class="button" value="Login">
</form>
</div>';
f();
}
elseif((empty($login_pass))||(isset($_SESSION['username']))&&(isset($_SESSION['password']))){
if((substr($b,0,1)=='.')||(substr($q,0,1)=='.')||( substr($b,0,3)=='%2e')||(substr($q,0,3)=='%2e')){
err("ERROR 400","Access denied due to bad request.<br>Please contact the webmaster at $admin_email.");
}
elseif(($b!='')&&($q!='')){
$cwd=getcwd();
$n=strtolower($_SERVER["HTTP_USER_AGENT"]);
if($b=='d'){
$g="$cwd/$file_dir/";
}
else{
$g="$cwd/$file_dir/$b/";
}
$e=$g.$q;
if(!file_exists($e)){
err("ERROR 404","The file you have requested is not found.<br>Please contact the webmaster at $admin_email.");
}
elseif(!is_readable($e)){
err("ERROR 500","Internal server error with read permission.<br>Please contact the webmaster at $admin_email.");
}
$m=fopen($g.$q,"r");
$v=fread($m,filesize($g.$q));
fclose($m);
header('Content-Type: application/download');
header('Content-Disposition:attachment;filename="'.$q.'"');
print $v;
exit();
}
else{
$j=isset($_GET['s'])?$_GET['s']:"n";
$k=isset($_GET['o'])?$_GET['o']:'asc';
$l=$j==='s'||$j==='m'?SORT_NUMERIC:SORT_STRING;
$d=isset($_GET['d'])?urldecode(iconv('utf-8', 'windows-1256', $_GET['d'])):'';
$d=$d!==''&&$d!=='/'?trim($d,'/').'/':'';
$dir="$file_dir/";
$p=$dir.$d;
$h=@opendir($p);
//if(strstr($d,'../')){
// err("ERROR 403","Access to the requested directory is forbidden.<br>Please contact the webmaster at $admin_email.");
//}
//elseif(!$h){
// err("ERROR 404","The directory you have requested is not found.<br>Please contact the webmaster at $admin_email.");
//}
$y=array();
$x=array();
//$h1=array('windows-1256', 'utf-8', $h);
while(FALSE!==($f=readdir($h))){
if($f[0]!=='.'){
if(is_dir($p.$f)){

$x[]=array('n'=>iconv('windows-1256', 'utf-8', $f),'m'=>filemtime($p.$f),'s'=>filesize($p.$f),'t'=>'Directory');
}
else{
$y[]=array('n'=>iconv('windows-1256', 'utf-8', $f),'m'=>filemtime($p.$f),'t'=>x($f),'s'=>filesize($p.$f));

}
}
}
if($j){
$y=y($y,$j,$k,$l);
$x=y($x,$j,$k,$l);
}
h();
print'<div align="center">';
print'<table cellspacing="2" cellpadding="1" width="'.$table_width.'">';
print'<tr>';
if(!empty($login_pass)){
print'<td class="z" colspan="4">';
}
else{
print'<td class="z" colspan="5">';
}
print($d!=='')?"<a href='$script_file' style='text-decoration:none'><b>$site_title</b></a> / ":"<b>$site_title</b>";
if($d!==''){
$t=explode('/',trim($d,'/'));
for($i=0,$r=array(),$z='';($r[]=@$t[$i]),$z=@$t[$i];$i++){
print(implode('/',$r)!==trim($d,'/'))?('<a href="'.$script_file.'?d='.implode('%2F',$r).'" style="text-decoration:none"><b>'.$z.'</b></a> / ' ):"<b>$z</b>";
}
}
$f=trim($d,'/');

print'</td>';
if(!empty($login_pass)){
print'<td class="w"><a href="'.$script_file.'?l=logout">Logout</a></td>';
}
print'</tr>';
print'<tr><td colspan="5"><hr class="x"/></td></tr>';
print'<tr>';
if($show_icon=='yes'){
print'<td class="y" width="3%"><img src="'.$icons_dir.'/_spacer.png"></td>';
}
print'<td class="y" width="42%"><a href="'.$script_file.'?s=n&amp;o='.($k=='asc'?'dsc':'asc').' &amp;d='.urlencode($f).'">نام فايل</a></td>';
if($show_size=='yes'){
print'<td class="y" width="18%" align="right"><a href="'.$script_file.'?s=s&amp;o='.($k=='asc'?'dsc':'asc').' &amp;d='.urlencode($f).'">حجم فايل</a></td>';
}
if($show_type=='yes'){
print'<td class="y" width="12%" align="right"><a href="'.$script_file.'?s=t&amp;o='.($k=='asc'?'dsc':'asc').' &amp;d='.urlencode($f).'">نوع فايل</a></td>';
}
if($show_modf=='yes'){
print'<td class="y" width="25%" align="right"><a href="'.$script_file.'?s=m&amp;o='.($k=='asc'?'dsc':'asc').' &amp;d='.urlencode($f).'">تاريخ درج</a></td>';
}
print'</tr>';
print'<tr><td colspan="5"><hr class="x"/></td></tr>';
if($show_parent=='yes'){
$pd = str_replace(array("\r\n","\r","\n"),' ',dirname($d).PHP_EOL);
if(($pd=='. ')||(($pd!=="")&&($pd!==" "))){
print'<tr>';
if($show_icon=='yes'){
print'<td><img src="'.$icons_dir.'/_parent.png"></td>';
}
}
if($pd=='. '){
print'<td><a href="'.$script_file.'">...بازگشت</a></td>';
}
elseif(($pd!=="")&&($pd!==" ")){
print'<td><a href="'.$script_file.'?d='.$pd.'">...بازگشت</a></td>';
}
if(($pd=='. ')||(($pd!=="")&&($pd!==" "))){
if($show_size=='yes'){
print'<td></td>';
}
if($show_type=='yes'){
print'<td></td>';
}
if($show_modf=='yes'){
print'<td align="right">بازگشت</td>';
}
print'</tr>';
}
}
for($i=0,$c='';($c=@$x[$i++]);){
print'<tr>';
if($show_icon=='yes'){
print'<td><img src="'.$icons_dir.'/_folder.png"></td>';
}

$ddd=iconv('windows-1256', 'utf-8', $c['n']);
//$lll=iconv('windows-1256', 'utf-8', $d);

print'<td><a href="'.$script_file.'?d='.$d.$c['n'].'&amp;s=n&amp;o=asc"target ="_blank">'.$c['n'].'</a></td>';





if($show_size=='yes'){
print'<td></td>';
}
if($show_type=='yes'){
print'<td></td>';
}
if($show_modf=='yes'){
print'<td align="right">'.$s1 = jdate('l,d F y ',$c['m'], strtotime($row['date'])).'</td>';
}
print'</tr>';
}
for($i=0,$c='';($c=@$y[$i++]);){
if($c['n']!==$script_file){
print'<tr>';
if($show_icon=='yes'){
if($single_img=='on'){
print'<td><img src="'.$icons_dir.'/_file.png"></td>';
}
else{
print'<td><img src="'.$icons_dir.'/'.$c['t'].'.png"></td>';
}
}
if($show_ext=='yes'){
$fn=$c['n'];
}
else{
$fn=str_replace('.'.$c['t'].'','',$c['n']);
}
if($anti_leech!=='on'){
print'<td><a href="'.$dir.$d.$c['n'].'">'.$c['n'].'</td>';
}
elseif($d==''){
print'<td><a href="'.$script_file.'?d=d&f='.$c['n'].'">'.$fn.'</a></td>';
}
else{
print'<td><a href="'.$script_file.'?d='.substr($d,0,-1).'&f='.$c['n'].'">'.$fn.'</a></td>';
}
if($show_size=='yes'){
print'<td align="right">حجم'.number_format($c['s']/1048576,2).'مگابايت</td>';
}
if($show_type=='yes'){
print'<td align="right">'.strtoupper($c['t']).'</td>';
}
if($show_modf=='yes'){

print'<td align="right">'.$s1 = jdate('l,d F y ',$c['m'], strtotime($row['date'])).'</td>';
}
print'</tr>';
}
}
print'<tr><td colspan="5"><hr class="x"/></td></tr>';
print'</table>';
print'</div>';
f();
}
}
?>

nsco_nsco
پنج شنبه 19 اردیبهشت 1392, 12:50 عصر
سلام دوست من این مشکل فارسی حل شده یا نه باقیه ؟

nsco_nsco
جمعه 20 اردیبهشت 1392, 01:51 صبح
سلام ممنون میشم کمکم کنید با تشکر

nsco_nsco
جمعه 20 اردیبهشت 1392, 11:34 صبح
سلام دوستان یه یاریی برسونید

nsco_nsco
جمعه 20 اردیبهشت 1392, 12:08 عصر
این متغیری هست که ادرس رو نشون میدهد و با کلیک روی لینک باید پوشه باز شود که متاسفانه پوشه فارسی را باز نمی کند $c['n'] این هست


$c['n']

ممنون

nsco_nsco
جمعه 20 اردیبهشت 1392, 12:09 عصر
فقط اگر دوستان سریع کمک کنید ممنون میشوم مرسی

nsco_nsco
شنبه 21 اردیبهشت 1392, 15:46 عصر
واقعا از همه دوستانی که کمک نکردند متشکرم

Tarragon
شنبه 21 اردیبهشت 1392, 16:19 عصر
شما کد رو ک بار امتحان می کردید متوجه می شد که صحیحه!