View file jpmobile/moduls/avatar/selected.php

File size: 1.05Kb
<?php
if (!is_file($cms.'user/'.$_SESSION['user_login'].'/profile.php'))
{
echo 'Ошибка загрузки';
exit;
}

if ($_GET['select'] != '' and is_file($cms.'moduls/avatar/cms_avatar/'.$_GET['select']))
{
  $fp = fopen ($cms.'user/'.$_SESSION['user_login'].'/avatar.txt', "w+");
  fwrite ($fp, 'moduls/avatar/cms_avatar/'.$_GET['select']);
  fclose ($fp);


$activ = 'Смена фото.';
include($cms.'moduls/act/act_add.php');


echo 'Фото успешно выбрано!<br>
<a href="?page=prof">Мой профиль</a>
';
$_SESSION['ava_ok'] = 1;
}
else
{          $dir = opendir ($cms.'moduls/avatar/cms_avatar');
          while ($file = readdir ($dir))
         { if (( $file != ".") && ($file != ".."))
          {
           echo '
           <a href="?page='.$_GET['page'].'&select='.$file.'">
           <img
           src="/moduls/avatar/cms_avatar/'.$file.'"
           width="100" alt="" border="0">
           </a> <br> <br>
           ';
          }
         }
          closedir ($dir);     }



?>