Просмотр файла modules/share/dirs.php

Размер файла: 2.01Kb
  1. <?php
  2. /**********************************
  3. * @package: PerfCMS *
  4. * @year: 2012 *
  5. * @author: Artas *
  6. * @link: http://perfcms.org.ua *
  7. **********************************/
  8. $locate = 'in_share';
  9. if(!isset($_GET['rid'])) { go('/share/'); }
  10. $rid = abs(intval($_GET['rid']));
  11. if($db->query("SELECT * FROM `share` WHERE `id` = '". $rid ."'")->rowCount() == 0) {
  12. $title = $lang->word('share');
  13. require_once(SYS.'/view/header.php');
  14. $tpl->div('menu', $lang->word('dir_not_exists'));
  15. $tpl->div('block', NAV.' <a href="/share/">'. $lang->word('share') .'</a><br/>' . HICO .' <a href="/">'. $lang->word('home') .'</a>');
  16. require_once(SYS.'/view/footer.php');
  17. exit;
  18. }
  19. $sharef = $db->query("SELECT * FROM `share` WHERE `id` = '". $rid ."'")->fetch();
  20. $title = $sharef['name'] .' | '.$lang->word('share');
  21. require_once(SYS.'/view/header.php');
  22. $tpl->div('title', $sharef['name'] .' | '.$lang->word('share'));
  23. $share_r = $db->query("SELECT * FROM `share_c` WHERE `rid` = '". $rid ."'")->rowCount();
  24. if($share_r == 0) {
  25. echo $tpl->div('menu', $lang->word('no_folders'));
  26. }
  27. else {
  28. $share_q = $db->query("SELECT * FROM `share_c` WHERE `rid` = '". $rid ."' ORDER BY name");
  29. while($share = $share_q->fetch()) {
  30. $tpl->div('menu', img('folder.png') . ' <a href="/share/folder/'. $share['id'] .'/">'. $share['name'] .'</a> ('. $db->query("SELECT * FROM `share_files` WHERE `cat_id` = '". $share['id'] ."'")->rowCount() .') ' . ($user['level'] >= 6 ? ' [<a href="/share/delete_folder/'.$share['id'].'/'. abs(intval($_GET['rid'])).'/">'.img('delete.png').'</a> | <a href="/share/edit_folder/'.$share['id'].'/">'.img('edit.png').'</a>]' : NULL) .' <br/>
  31. <span style="font-size: xx-small;">'. $share['desc'] .'</span>');
  32. }
  33. }
  34. $tpl->div('block', ($user['level'] >=6 ? NAV.' <a href="/share/add_folder/'. $rid .'/">'. $lang->word('create_dir') .'</a><br/>' : NULL) . NAV . ' <a href="/share/">'. $lang->word('share') .'</a><br/>' . HICO .' <a href="/">'. $lang->word('home') .'</a>');
  35. require_once(SYS.'/view/footer.php');
  36. ?>