From 6113b6808966ed1ed213b9a41ebd277ef2d3c7b7 Mon Sep 17 00:00:00 2001 From: Seditio CMS Date: Wed, 20 Jul 2022 16:17:12 +0300 Subject: [PATCH] Skinable PFS Start work! --- skins/sympfy/css/cms.css | 5 + skins/sympfy/pfs.edit.standalone.tpl | 116 ++++++ skins/sympfy/pfs.edit.tpl | 105 +++++ skins/sympfy/pfs.standalone.tpl | 348 +++++++++++++++- skins/sympfy/pfs.tpl | 338 ++++++++++++++- system/core/pfs/pfs.edit.inc.php | 127 +++--- system/core/pfs/pfs.editfolder.inc.php | 129 +++--- system/core/pfs/pfs.inc.php | 554 ++++++++++++------------- system/lang/en/main.lang.php | 2 + system/lang/ru/main.lang.php | 8 +- 10 files changed, 1293 insertions(+), 439 deletions(-) create mode 100644 skins/sympfy/pfs.edit.standalone.tpl create mode 100644 skins/sympfy/pfs.edit.tpl diff --git a/skins/sympfy/css/cms.css b/skins/sympfy/css/cms.css index 4d05ae3..9b84594 100644 --- a/skins/sympfy/css/cms.css +++ b/skins/sympfy/css/cms.css @@ -918,3 +918,8 @@ ul.admin-buttons li { padding: 5px; } +.pfs-stats { + color: #cccccc; + padding-bottom: 15px; +} + diff --git a/skins/sympfy/pfs.edit.standalone.tpl b/skins/sympfy/pfs.edit.standalone.tpl new file mode 100644 index 0000000..6280f01 --- /dev/null +++ b/skins/sympfy/pfs.edit.standalone.tpl @@ -0,0 +1,116 @@ + + +{PFS_STANDALONE_HEADER1} + + + + + + +{PFS_STANDALONE_HEADER2} + +
+ +
+ + {BREADCRUMBS} + +

{PFS_SHORTTITLE}

+ +
+ +
+ + + +
+ +
    + +
  • +
    +
    {PFS_EDITFILE_DATE}
    +
  • + +
  • +
    +
    {PFS_EDITFILE_FOLDER}
    +
  • + +
  • +
    +
    {PFS_EDITFILE_URL}
    +
  • + +
  • +
    +
    {PFS_EDITFILE_SIZE}
    +
  • + +
  • +
    +
    {PFS_EDITFILE_FILE}
    +
  • + +
  • +
    +
    {PFS_EDITFILE_TITLE}
    +
  • + +
  • +
    +
    {PFS_EDITFILE_DESC}
    +
  • + +
+ +
+ +
+ +
+ + + + + +
+ +
    + +
  • +
    +
    {PFS_EDITFOLDER_TITLE}
    +
  • + +
  • +
    +
    {PFS_EDITFOLDER_DESC}
    +
  • + +
  • +
    +
    {PFS_EDITFOLDER_TYPE}
    +
  • + +
+ +
+ +
+ +
+ + + +
+ +
+ + + + + +{PFS_STANDALONE_FOOTER} + + diff --git a/skins/sympfy/pfs.edit.tpl b/skins/sympfy/pfs.edit.tpl new file mode 100644 index 0000000..55c008b --- /dev/null +++ b/skins/sympfy/pfs.edit.tpl @@ -0,0 +1,105 @@ + + +
+ +
+ +
+ + {BREADCRUMBS} + +

{PFS_SHORTTITLE}

+ +
+ +
+ + + +
+ +
    + +
  • +
    +
    {PFS_EDITFILE_DATE}
    +
  • + +
  • +
    +
    {PFS_EDITFILE_FOLDER}
    +
  • + +
  • +
    +
    {PFS_EDITFILE_URL}
    +
  • + +
  • +
    +
    {PFS_EDITFILE_SIZE}
    +
  • + +
  • +
    +
    {PFS_EDITFILE_FILE}
    +
  • + +
  • +
    +
    {PFS_EDITFILE_TITLE}
    +
  • + +
  • +
    +
    {PFS_EDITFILE_DESC}
    +
  • + +
+ +
+ +
+ +
+ + + + + +
+ +
    + +
  • +
    +
    {PFS_EDITFOLDER_TITLE}
    +
  • + +
  • +
    +
    {PFS_EDITFOLDER_DESC}
    +
  • + +
  • +
    +
    {PFS_EDITFOLDER_TYPE}
    +
  • + +
+ +
+ +
+ +
+ + + +
+ +
+ +
+ + diff --git a/skins/sympfy/pfs.standalone.tpl b/skins/sympfy/pfs.standalone.tpl index 5ef48ea..b1a7de1 100644 --- a/skins/sympfy/pfs.standalone.tpl +++ b/skins/sympfy/pfs.standalone.tpl @@ -1,7 +1,5 @@ - - {PFS_STANDALONE_HEADER1} @@ -11,8 +9,6 @@ {PFS_STANDALONE_HEADER2} - -
@@ -28,17 +24,347 @@
- - {PFS_BODY} -
+
+ {PFS_STATS} +
+ +
+ + + +
+ +
+ + + +
+ {PFS_UPLOAD_STATUS} +
+ + + + + +

{PFS_FOLDERS_COUNT} {PHP.L.Folders} / {PFS_FOLDERS_SUBFILES_COUNT} {PHP.L.Files} :

+ +
+ +
+ +
+
{PHP.L.Delete}
+
{PHP.L.Edit}
+
{PHP.L.Folder}
+
{PHP.L.Type}
+
{PHP.L.Files}
+
{PHP.L.Size}
+
{PHP.L.Updated}
+
{PHP.L.Hits}
+
+ +
+ +
+ + + +
+
+ + + +
+
+ +
+ +
+ {PFS_LIST_FOLDERS_TYPE} +
+
+ {PFS_LIST_FOLDERS_HITS} +
+
+ {PFS_LIST_FOLDERS_SIZE} +
+
+ {PFS_LIST_FOLDERS_UPDATE} +
+
+ {PFS_LIST_FOLDERS_VIEWCOUNTS} +
+
+ + + +
+ +
+ + + + + +

{PFS_FILES_COUNT} {PHP.L.pfs_filesinthisfolder} :

+ +
+ +
+ +
+
{PHP.L.Delete}
+
{PHP.L.Edit}
+
{PHP.L.File}
+
{PHP.L.Size}
+
{PHP.L.Date}
+
{PHP.L.Title}
+
{PHP.L.Hits}
+
{PHP.L.pfs_setassample}
+
 
+
+ +
+ +
+ + + +
+ +
+ +
+ +
+ +
+ +
+ + {PFS_LIST_FILES_ICON} + +
+ +
+ {PFS_LIST_FILES_SIZE} +
+ +
+ {PFS_LIST_FILES_UPDATE} +
+ + + +
+ {PFS_LIST_FILES_VIEWCOUNTS} +
+ +
+ {PFS_LIST_FILES_SETASSAMPLE} +
+ +
+ {PFS_LIST_FILES_STNDL} +
+ +
+ + + +
+ +
+ + + +
+ + +
+ +

{PHP.L.pfs_newfile}

+ +
+ + {PFS_UPLOAD_MAXFILESIZE} + + {PHP.L.Folder} : {PFS_UPLOAD_FOLDERS} + + + {PFS_UPLOAD_IMG_RESIZE_SIZE} : {PFS_UPLOAD_IMG_RESIZE} + + + + {PHP.L.pfs_addlogo} : {PFS_UPLOAD_ADD_LOGO} + + +
+ +
+ +
+
 
+
{PHP.L.Title}
+
{PHP.L.File}
+
+ +
+ +
+ + + +
+ +
+ #{PFS_UPLOAD_LIST_NUM} +
+ +
+ {PFS_UPLOAD_LIST_TITLE} +
+ +
+ {PFS_UPLOAD_LIST_FILE} + + {PFS_UPLOAD_MORE_ICON} + +
+ +
+ + + +
+ + + +
+ +
+ +
+ +
+ +
+ {PHP.L.pfs_multiuploading} +
+ +
+ {PFS_UPLOAD_MULTIPLE} +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+

{PHP.L.pfs_extallowed}

+ {PFS_ALLOWED_EXT} +
+ +
+ {PFS_HELP} +
+ +
+ + + +
+ +

{PHP.L.pfs_newfolder}

+ +
+ +
    + +
  • +
    +
    {PFS_NEWFOLDER_TITLE}
    +
  • + +
  • +
    +
    {PFS_NEWFOLDER_DESC}
    +
  • + +
  • +
    +
    {PFS_NEWFOLDER_TYPE}
    +
  • + +
+ +
+ +
+ +
+ +
+ + +
+ +
+ +
- + + + {PFS_STANDALONE_FOOTER} - - - \ No newline at end of file + diff --git a/skins/sympfy/pfs.tpl b/skins/sympfy/pfs.tpl index d6f3ce1..971a3d9 100644 --- a/skins/sympfy/pfs.tpl +++ b/skins/sympfy/pfs.tpl @@ -10,15 +10,341 @@

{PFS_SHORTTITLE}

-
- {PFS_SUBTITLE} -
-
+ +
+ {PFS_STATS} +
+ +
+ + + +
+ +
+ + + +
+ {PFS_UPLOAD_STATUS} +
+ + + + + +

{PFS_FOLDERS_COUNT} {PHP.L.Folders} / {PFS_FOLDERS_SUBFILES_COUNT} {PHP.L.Files} :

+ +
+ +
+ +
+
{PHP.L.Delete}
+
{PHP.L.Edit}
+
{PHP.L.Folder}
+
{PHP.L.Type}
+
{PHP.L.Files}
+
{PHP.L.Size}
+
{PHP.L.Updated}
+
{PHP.L.Hits}
+
+ +
+ +
+ + + +
+
+ + + +
+
+ +
+ +
+ {PFS_LIST_FOLDERS_TYPE} +
+
+ {PFS_LIST_FOLDERS_HITS} +
+
+ {PFS_LIST_FOLDERS_SIZE} +
+
+ {PFS_LIST_FOLDERS_UPDATE} +
+
+ {PFS_LIST_FOLDERS_VIEWCOUNTS} +
+
+ + + +
+ +
+ + + + + +

{PFS_FILES_COUNT} {PHP.L.pfs_filesinthisfolder} :

+ +
+ +
+ +
+
{PHP.L.Delete}
+
{PHP.L.Edit}
+
{PHP.L.File}
+
{PHP.L.Size}
+
{PHP.L.Date}
+
{PHP.L.Title}
+
{PHP.L.Hits}
+
{PHP.L.pfs_setassample}
+
 
+
+ +
+ +
+ + + +
+ +
+ +
+ +
+ +
+ +
+ + {PFS_LIST_FILES_ICON} + +
+ +
+ {PFS_LIST_FILES_SIZE} +
+ +
+ {PFS_LIST_FILES_UPDATE} +
+ + + +
+ {PFS_LIST_FILES_VIEWCOUNTS} +
+ +
+ {PFS_LIST_FILES_SETASSAMPLE} +
+ +
+ {PFS_LIST_FILES_STNDL} +
+ +
+ + + +
+ +
+ + + +
+ + +
+ +

{PHP.L.pfs_newfile}

+ +
+ + {PFS_UPLOAD_MAXFILESIZE} + + {PHP.L.Folder} : {PFS_UPLOAD_FOLDERS} + + + {PFS_UPLOAD_IMG_RESIZE_SIZE} : {PFS_UPLOAD_IMG_RESIZE} + + + + {PHP.L.pfs_addlogo} : {PFS_UPLOAD_ADD_LOGO} + + +
+ +
+ +
+
 
+
{PHP.L.Title}
+
{PHP.L.File}
+
+ +
+ +
+ + + +
+ +
+ #{PFS_UPLOAD_LIST_NUM} +
+ +
+ {PFS_UPLOAD_LIST_TITLE} +
+ +
+ {PFS_UPLOAD_LIST_FILE} + + {PFS_UPLOAD_MORE_ICON} + +
+ +
+ + + +
+ + + +
+ +
+ +
+ +
+ +
+ {PHP.L.pfs_multiuploading} +
+ +
+ {PFS_UPLOAD_MULTIPLE} +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+

{PHP.L.pfs_extallowed}

+ {PFS_ALLOWED_EXT} +
+ +
+ {PFS_HELP} +
+ +
+ + + +
+ +

{PHP.L.pfs_newfolder}

+ +
+ +
    + +
  • +
    +
    {PFS_NEWFOLDER_TITLE}
    +
  • + +
  • +
    +
    {PFS_NEWFOLDER_DESC}
    +
  • + +
  • +
    +
    {PFS_NEWFOLDER_TYPE}
    +
  • + +
+ +
+ +
- {PFS_BODY} +
+ +
+ + +
+ +
@@ -26,4 +352,4 @@ - \ No newline at end of file + diff --git a/system/core/pfs/pfs.edit.inc.php b/system/core/pfs/pfs.edit.inc.php index 46c66f0..3d9bd0d 100644 --- a/system/core/pfs/pfs.edit.inc.php +++ b/system/core/pfs/pfs.edit.inc.php @@ -27,7 +27,7 @@ list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = sed_auth('pfs', 'a'); sed_block($usr['auth_write']); -if (!$usr['isadmin'] || $userid=='') +if (!$usr['isadmin'] || $userid == '') { $userid = $usr['id']; } @@ -36,12 +36,14 @@ $more = "userid=".$userid; } -if ($userid!=$usr['id']) +if ($userid != $usr['id']) { sed_block($usr['isadmin']); } $standalone = FALSE; $user_info = sed_userinfo($userid); -$maingroup = ($userid==0) ? 5 : $user_info['user_maingrp']; +$maingroup = ($userid == 0) ? 5 : $user_info['user_maingrp']; + +$moretitle = ($userid > 0 && !empty($more)) ? " «".$user_info['user_name']."»" : ""; reset($sed_extensions); foreach ($sed_extensions as $k => $line) @@ -58,21 +60,19 @@ /* ============= */ -$L['pfs_title'] = ($userid==0) ? $L['SFS'] : $L['pfs_title']; -$title = "".$L['pfs_title'].""; -$shorttitle = $L['pfs_title']; +$title = $L['pfs_editfile']; +$shorttitle = $L['pfs_editfile']; // ---------- Breadcrumbs $urlpaths = array(); -$urlpaths[sed_url("pfs", $more)] = $L['pfs_title']; +$urlpaths[sed_url("pfs", $more)] = $L['PFS'].$moretitle; -if ($userid!=$usr['id']) +if ($userid != $usr['id']) { sed_block($usr['isadmin']); - $title .= ($userid==0) ? '' : " (".sed_build_user($user_info['user_id'], $user_info['user_name']).")"; } - -$title .= " ".$cfg['separator']." ".$L['Edit']; + +$urlpaths[sed_url("pfs", "m=edit&id=".$id."&".$more)] = $L['pfs_editfile']; $sql = sed_sql_query("SELECT * FROM $db_pfs WHERE pfs_userid='$userid' AND pfs_id='$id' LIMIT 1"); @@ -122,71 +122,76 @@ sed_redirect(sed_url("pfs", "f=".$pfs_folderid."&".$more, "", true)); exit; } - -$body .= ""; -$body .= ""; -$body .= ""; -$body .= ""; -$body .= ""; -$body .= ""; -$body .= ""; -$body .= ""; -$body .= ""; -$body .= ""; -$body .= "
".$L['File']." : ".$pfs_file."
".$L['Date']." : ".$pfs_date."
".$L['Folder']." : ".sed_selectbox_folders($userid, "", $pfs_folderid)."
".$L['URL']." : ".$ff."
".$L['Size']." : ".$pfs_size." ".$L['kb']."
".$L['Title']." :
".$L['Description']." :
".sed_textarea('rdesc', $pfs_desc, 8, 56, 'Micro')."
"; - -/* ============= */ - + if ($standalone) { - $pfs_header1 = $cfg['doctype']."".sed_htmlmetas()."".$out['subtitle'].""; - $pfs_header2 = ""; - $pfs_footer = ""; - - /* === New Hook Sed 175 === */ + sed_sendheaders(); + + $pfs_header1 = $cfg['doctype']."\n\n + ".$cfg['maintitle']."".sed_htmlmetas().$moremetas.sed_javascript($morejavascript); + $pfs_header2 = "\n"; + $pfs_footer = "\n"; + + /* === Hook === */ $extp = sed_getextplugins('pfs.stndl'); if (is_array($extp)) { foreach($extp as $k => $pl) { include(SED_ROOT . '/plugins/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } } - /* ================================ */ + /* ===== */ - $mskin = sed_skinfile(array('pfs', 'standalone')); + $mskin = sed_skinfile(array('pfs.edit', 'standalone')); $t = new XTemplate($mskin); $t->assign(array( "PFS_STANDALONE_HEADER1" => $pfs_header1, "PFS_STANDALONE_HEADER2" => $pfs_header2, - "PFS_STANDALONE_FOOTER" => $pfs_footer, - )); - - $t->parse("MAIN.STANDALONE_HEADER"); - $t->parse("MAIN.STANDALONE_FOOTER"); - - $t-> assign(array( - "PFS_TITLE" => $title, - "PFS_SHORTTITLE" => $shorttitle, - "PFS_BREADCRUMBS" => sed_breadcrumbs($urlpaths, 1, false), - "PFS_BODY" => $body + "PFS_STANDALONE_FOOTER" => $pfs_footer )); - - $t->parse("MAIN"); - $t->out("MAIN"); } -else +else { require(SED_ROOT . "/system/header.php"); + $mskin = sed_skinfile('pfs.edit'); + $t = new XTemplate($mskin); + } + +$t->assign(array( + "PFS_EDITFILE_SEND" => sed_url("pfs", "m=edit&a=update&id=".$pfs_id."&".$more), + "PFS_EDITFILE_TITLE" => sed_textbox('rtitle', $pfs_title, 56, 255), + "PFS_EDITFILE_DESC" => sed_textarea('rdesc', $pfs_desc, 8, 56, 'Micro'), + "PFS_EDITFILE_FILE" => $pfs_file, + "PFS_EDITFILE_FOLDER" => sed_selectbox_folders($userid, "", $pfs_folderid), + "PFS_EDITFILE_DATE" => $pfs_date, + "PFS_EDITFILE_URL" => "".$ff."", + "PFS_EDITFILE_SIZE" => $pfs_size." ".$L['kb'], +)); + +$t->parse("MAIN.PFS_EDITFILE"); + +$t-> assign(array( + "PFS_TITLE" => $title, + "PFS_SHORTTITLE" => $shorttitle, + "PFS_BREADCRUMBS" => sed_breadcrumbs($urlpaths), + "PFS_SUBTITLE" => $subtitle +)); + +/* === Hook === */ +$extp = sed_getextplugins('pfs.editfolder.tags'); +if (is_array($extp)) +{ foreach($extp as $k => $pl) { include(SED_ROOT . '/plugins/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } } +/* ===== */ + +$t->parse("MAIN"); +$t->out("MAIN"); - $t = new XTemplate("skins/".$skin."/pfs.tpl"); - - $t-> assign(array( - "PFS_TITLE" => $title, - "PFS_SHORTTITLE" => $shorttitle, - "PFS_BREADCRUMBS" => sed_breadcrumbs($urlpaths), - "PFS_BODY" => $body - )); - - $t->parse("MAIN"); - $t->out("MAIN"); - - require(SED_ROOT . "/system/footer.php"); +if ($standalone) + { + @ob_end_flush(); + @ob_end_flush(); + sed_sql_close($connection_id); } +else + { + require(SED_ROOT . "/system/footer.php"); + } + ?> \ No newline at end of file diff --git a/system/core/pfs/pfs.editfolder.inc.php b/system/core/pfs/pfs.editfolder.inc.php index 6be8e6d..f46d4f1 100644 --- a/system/core/pfs/pfs.editfolder.inc.php +++ b/system/core/pfs/pfs.editfolder.inc.php @@ -32,7 +32,7 @@ $L_pff_type[1] = $L['Public']; $L_pff_type[2] = $L['Gallery']; -if (!$usr['isadmin'] || $userid=='') +if (!$usr['isadmin'] || $userid == '') { $userid = $usr['id']; } @@ -41,12 +41,15 @@ $more = "userid=".$userid; } -if ($userid!=$usr['id']) +if ($userid != $usr['id']) { sed_block($usr['isadmin']); } -$standalone = FALSE; $user_info = sed_userinfo($userid); -$maingroup = ($userid==0) ? 5 : $user_info['user_maingrp']; + +$standalone = FALSE; +$maingroup = ($userid == 0) ? 5 : $user_info['user_maingrp']; + +$moretitle = ($userid > 0 && !empty($more)) ? " «".$user_info['user_name']."»" : ""; reset($sed_extensions); foreach ($sed_extensions as $k => $line) @@ -63,22 +66,19 @@ /* ============= */ -$L['pfs_title'] = ($userid==0) ? $L['SFS'] : $L['pfs_title']; -$title = "".$L['pfs_title'].""; -$shorttitle = $L['pfs_title']; +$title = $L['pfs_editfolder']; +$shorttitle = $L['pfs_editfolder']; // ---------- Breadcrumbs $urlpaths = array(); -$urlpaths[sed_url("pfs", $more)] = $L['pfs_title']; +$urlpaths[sed_url("pfs", $more)] = $L['PFS'].$moretitle; +$urlpaths[sed_url("pfs", "m=editfolder&f=".$f."&".$more)] = $L['pfs_editfolder']; -if ($userid!=$usr['id']) +if ($userid != $usr['id']) { sed_block($usr['isadmin']); - $title .= ($userid==0) ? '' : " (".sed_build_user($user_info['user_id'], $user_info['user_name']).")"; } -$title .= " ".$cfg['separator']." ".$L['Edit']; - $out['subtitle'] = $L['Mypfs']." - ".$L['Edit']; $title_tags[] = array('{MAINTITLE}', '{TITLE}', '{SUBTITLE}'); $title_tags[] = array('%1$s', '%2$s', '%3$s'); @@ -96,7 +96,7 @@ $pff_desc = $row['pff_desc']; $pff_type = $row['pff_type']; $pff_count = $row['pff_count']; - $title .= " : ".sed_cc($pff_title); + $title = sed_cc($pff_title); } else { sed_die(); } @@ -125,73 +125,76 @@ $row['pff_date'] = sed_build_date($cfg['dateformat'], $row['pff_date']); $row['pff_updated'] = sed_build_date($cfg['dateformat'], $row['pff_updated']); -$body .= ""; -$body .= ""; -$body .= ""; -$body .= ""; -$body .= ""; -$body .= ""; -$body .= ""; -$body .= ""; -$body .= "
".$L['Folder']." :
".$L['Date']." : ".$row['pff_date']."
".$L['Updated']." : ".$row['pff_updated']."
".$L['Type']." : "; - -$rtype_arr = ($usr['auth_write_gal']) ? array(0 => $L['Private'], 1 => $L['Public'], 2 => $L['Gallery']) : array(0 => $L['Private'], 1 => $L['Public']); -$body .= sed_radiobox("rtype", $rtype_arr, $row['pff_type']); - -$body .= "
".$L['Description']." :
".sed_textarea('rdesc', $pff_desc, 8, 56, 'Micro')."
"; - -/* ============= */ - if ($standalone) { - $pfs_header1 = $cfg['doctype']."".sed_htmlmetas()."".$out['subtitle'].""; - $pfs_header2 = ""; - $pfs_footer = ""; - - /* === New Hook Sed 175 === */ + sed_sendheaders(); + + $pfs_header1 = $cfg['doctype']."\n\n + ".$cfg['maintitle']."".sed_htmlmetas().$moremetas.sed_javascript($morejavascript); + $pfs_header2 = "\n"; + $pfs_footer = "\n"; + + /* === Hook === */ $extp = sed_getextplugins('pfs.stndl'); if (is_array($extp)) { foreach($extp as $k => $pl) { include(SED_ROOT . '/plugins/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } } - /* ================================ */ + /* ===== */ - $mskin = sed_skinfile(array('pfs', 'standalone')); + $mskin = sed_skinfile(array('pfs.edit', 'standalone')); $t = new XTemplate($mskin); $t->assign(array( "PFS_STANDALONE_HEADER1" => $pfs_header1, "PFS_STANDALONE_HEADER2" => $pfs_header2, - "PFS_STANDALONE_FOOTER" => $pfs_footer, + "PFS_STANDALONE_FOOTER" => $pfs_footer )); - - $t->parse("MAIN.STANDALONE_HEADER"); - $t->parse("MAIN.STANDALONE_FOOTER"); - - $t-> assign(array( - "PFS_TITLE" => $title, - "PFS_SHORTTITLE" => $shorttitle, - "PFS_BREADCRUMBS" => sed_breadcrumbs($urlpaths, 1, false), - "PFS_BODY" => $body - )); - - $t->parse("MAIN"); - $t->out("MAIN"); } -else +else { require(SED_ROOT . "/system/header.php"); + $mskin = sed_skinfile('pfs.edit'); + $t = new XTemplate($mskin); + } - $t = new XTemplate("skins/".$skin."/pfs.tpl"); - - $t-> assign(array( - "PFS_TITLE" => $title, - "PFS_SHORTTITLE" => $shorttitle, - "PFS_BREADCRUMBS" => sed_breadcrumbs($urlpaths), - "PFS_BODY" => $body - )); +$rtype_arr = ($usr['auth_write_gal']) ? array(0 => $L['Private'], 1 => $L['Public'], 2 => $L['Gallery']) : array(0 => $L['Private'], 1 => $L['Public']); + +$t->assign(array( + "PFS_EDITFOLDER_SEND" => sed_url("pfs" ,"m=editfolder&a=update&f=".$pff_id."&".$more), + "PFS_EDITFOLDER_TITLE" => sed_textbox('rtitle', $pff_title, 56, 255), + "PFS_EDITFOLDER_DESC" => sed_textarea('rdesc', $pff_desc, 8, 56, 'Micro'), + "PFS_EDITFOLDER_DATE" => $row['pff_date'], + "PFS_EDITFOLDER_UPDATE" => $row['pff_updated'], + "PFS_EDITFOLDER_TYPE" => sed_radiobox("rtype", $rtype_arr, 0) +)); + +$t->parse("MAIN.PFS_EDITFOLDER"); + + +$t-> assign(array( + "PFS_TITLE" => $title, + "PFS_SHORTTITLE" => $shorttitle, + "PFS_BREADCRUMBS" => sed_breadcrumbs($urlpaths), + "PFS_SUBTITLE" => $subtitle +)); - $t->parse("MAIN"); - $t->out("MAIN"); +/* === Hook === */ +$extp = sed_getextplugins('pfs.editfolder.tags'); +if (is_array($extp)) +{ foreach($extp as $k => $pl) { include(SED_ROOT . '/plugins/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } } +/* ===== */ - require(SED_ROOT . "/system/footer.php"); +$t->parse("MAIN"); +$t->out("MAIN"); + +if ($standalone) + { + @ob_end_flush(); + @ob_end_flush(); + sed_sql_close($connection_id); } +else + { + require(SED_ROOT . "/system/footer.php"); + } + ?> \ No newline at end of file diff --git a/system/core/pfs/pfs.inc.php b/system/core/pfs/pfs.inc.php index 66941f0..f8af7e4 100644 --- a/system/core/pfs/pfs.inc.php +++ b/system/core/pfs/pfs.inc.php @@ -7,7 +7,7 @@ [BEGIN_SED] File=pfs.inc.php Version=179 -Updated=2022-jul-15 +Updated=2022-jul-20 Type=Core Author=Seditio Team Description=PFS @@ -32,7 +32,7 @@ $L_pff_type[1] = $L['Public']; $L_pff_type[2] = $L['Gallery']; -if (!$usr['isadmin'] || $userid=='') +if (!$usr['isadmin'] || $userid == '') { $userid = $usr['id']; } @@ -41,14 +41,17 @@ $more = "userid=".$userid; } -if ($userid!=$usr['id']) +if ($userid != $usr['id']) { sed_block($usr['isadmin']); } $files_count = 0; $folders_count = 0; $standalone = FALSE; +$upload_status = array(); $user_info = sed_userinfo($userid); -$maingroup = ($userid==0) ? 5 : $user_info['user_maingrp']; +$maingroup = ($userid == 0) ? 5 : $user_info['user_maingrp']; + +$moretitle = ($userid > 0 && !empty($more)) ? " «".$user_info['user_name']."»" : ""; $sql = sed_sql_query("SELECT grp_pfs_maxfile, grp_pfs_maxtotal FROM $db_groups WHERE grp_id='$maingroup'"); if ($row = sed_sql_fetchassoc($sql)) @@ -59,7 +62,7 @@ else { sed_die(); } -if (($maxfile==0 || $maxtotal==0) && !$usr['isadmin']) +if (($maxfile == 0 || $maxtotal == 0) && !$usr['isadmin']) { sed_block(FALSE); } if (!empty($c1) || !empty($c2)) @@ -77,18 +80,18 @@ } -$L['pfs_title'] = ($userid==0) ? $L['SFS'] : $L['pfs_title']; +$L['pfs_title'] = ($userid == 0) ? $L['SFS'] : $L['pfs_title']; $title = "".$L['pfs_title'].""; $shorttitle = $L['pfs_title']; // ---------- Breadcrumbs $urlpaths = array(); -$urlpaths[sed_url("pfs", $more)] = $L['pfs_title']; +$urlpaths[sed_url("pfs", $more)] = $L['pfs_title'].$moretitle; -if ($userid!=$usr['id']) +if ($userid != $usr['id']) { sed_block($usr['isadmin']); - $title .= ($userid==0) ? '' : " (".sed_build_user($user_info['user_id'], $user_info['user_name']).")"; + $title .= ($userid == 0) ? '' : " (".sed_build_user($user_info['user_id'], $user_info['user_name']).")"; $urlpaths[sed_url("users", "m=details&id=".$user_info['user_id'])] = $user_info['user_name']; $shorttitle = $user_info['user_name']; } @@ -100,11 +103,11 @@ /* ===== */ -$u_totalsize=0; +$u_totalsize = 0; $sql = sed_sql_query("SELECT SUM(pfs_size) FROM $db_pfs WHERE pfs_userid='$userid' "); -$pfs_totalsize = sed_sql_result($sql,0,"SUM(pfs_size)"); +$pfs_totalsize = sed_sql_result($sql, 0, "SUM(pfs_size)"); -if ($a=='upload') +if ($a == 'upload') { sed_block($usr['auth_write']); $folderid = sed_import('folderid','P','INT'); @@ -120,14 +123,12 @@ { foreach($extp as $k => $pl) { include(SED_ROOT . '/plugins/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } } /* ===== */ - if ($folder_id!=0) + if ($folder_id != 0) { $sql = sed_sql_query("SELECT pff_id FROM $db_pfs_folders WHERE pff_userid='$userid' AND pff_id='$folderid' "); sed_die(sed_sql_numrows($sql) == 0); } - - $disp_errors = ""; + if (!empty($upl_stats)) $upload_status[] = $upl_stats; + } } -elseif ($a=='delete') +elseif ($a == 'delete') { sed_block($usr['auth_write']); sed_check_xg(); @@ -290,7 +291,7 @@ else { sed_die(); } } -elseif ($a=='newfolder') +elseif ($a == 'newfolder') { sed_block($usr['auth_write']); $ntitle = sed_import('ntitle','P','TXT'); @@ -319,13 +320,13 @@ exit; } -elseif ($a=='deletefolder') +elseif ($a == 'deletefolder') { sed_block($usr['auth_write']); sed_check_xg(); $sql = sed_sql_query("SELECT COUNT(*) FROM $db_pfs WHERE pfs_userid='$userid' AND pfs_folderid='$f'"); - $files_count = sed_sql_result($sql,0,"COUNT(*)"); + $files_count = sed_sql_result($sql, 0, "COUNT(*)"); if ($files_count == 0) { $sql = sed_sql_query("DELETE FROM $db_pfs_folders WHERE pff_userid='$userid' AND pff_id='$f'"); @@ -336,7 +337,7 @@ exit; } -elseif ($a=='setsample') +elseif ($a == 'setsample') { sed_block($usr['auth_write']); sed_check_xg(); @@ -348,7 +349,44 @@ $f = (empty($f)) ? '0' : $f; -if ($f>0) +$out['subtitle'] = $L['Mypfs']; +$title_tags[] = array('{MAINTITLE}', '{TITLE}', '{SUBTITLE}'); +$title_tags[] = array('%1$s', '%2$s', '%3$s'); +$title_data = array($cfg['maintitle'], $out['subtitle'], $cfg['subtitle']); +$out['subtitle'] = sed_title('pfstitle', $title_tags, $title_data); + +if ($standalone) + { + sed_sendheaders(); + + $pfs_header1 = $cfg['doctype']."\n\n + ".$cfg['maintitle']."".sed_htmlmetas().$moremetas.sed_javascript($morejavascript); + $pfs_header2 = "\n"; + $pfs_footer = "\n"; + + /* === Hook === */ + $extp = sed_getextplugins('pfs.stndl'); + if (is_array($extp)) + { foreach($extp as $k => $pl) { include(SED_ROOT . '/plugins/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } } + /* ===== */ + + $mskin = sed_skinfile(array('pfs', 'standalone')); + $t = new XTemplate($mskin); + + $t->assign(array( + "PFS_STANDALONE_HEADER1" => $pfs_header1, + "PFS_STANDALONE_HEADER2" => $pfs_header2, + "PFS_STANDALONE_FOOTER" => $pfs_footer + )); + } +else + { + require(SED_ROOT . "/system/header.php"); + $mskin = sed_skinfile('pfs'); + $t = new XTemplate($mskin); + } + +if ($f > 0) { $sql1 = sed_sql_query("SELECT * FROM $db_pfs_folders WHERE pff_id='$f' AND pff_userid='$userid'"); if ($row1 = sed_sql_fetchassoc($sql1)) @@ -384,8 +422,8 @@ } $folders_count = sed_sql_numrows($sql1); - $subfiles_count = sed_sql_result($sql2,0,"COUNT(*)"); - $movebox = sed_selectbox_folders($userid,"/",""); + $subfiles_count = sed_sql_result($sql2, 0, "COUNT(*)"); + $movebox = sed_selectbox_folders($userid, "/", ""); while ($row1 = sed_sql_fetchassoc($sql1)) { @@ -399,30 +437,48 @@ $pff_fsize = floor($pff_filessize[$pff_id]/1024); $pff_fcount = (empty($pff_fcount)) ? "0" : $pff_fcount; $pff_fssize = (empty($pff_fsize)) ? "0" : $pff_fsize; - - $is_folder_delete = ($pff_fcount > 0) ? "-" : "".$out['img_delete'].""; - - $list_folders .= "".$is_folder_delete.""; - $list_folders .= "".$out['img_edit'].""; - - if ($pff_type==2) + + if ($pff_type == 2) { $icon_f = "\"\""; } else { $icon_f = "\"\""; } - if ($pff_type==2 && !$cfg['disable_gallery']) + if ($pff_type == 2 && !$cfg['disable_gallery']) { $icon_g = "\"\""; } else { $icon_g = ''; } - - $list_folders .= "".$pff_title.""; - $list_folders .= "".$icon_f." ".$L_pff_type[$pff_type]." ".$icon_g.""; - $list_folders .= "".$pff_fcount.""; - $list_folders .= "".$pff_fsize." ".$L['kb'].""; - $list_folders .= "".sed_build_date($cfg['dateformat'], $row1['pff_updated']).""; - $list_folders .= "".$pff_count.""; - $list_folders .= ""; + + if ($pff_fcount == 0) + { + $t->assign(array( + "PFS_LIST_FOLDERS_DELETE_URL" => sed_url("pfs", "a=deletefolder&".sed_xg()."&f=".$pff_id."&".$more) + )); + $t->parse("MAIN.PFS_FOLDERS.PFS_LIST_FOLDERS.PFS_LIST_FOLDERS_DELETE_URL"); + } + + $t->assign(array( + "PFS_LIST_FOLDERS_ID" => $pff_id, + "PFS_LIST_FOLDERS_URL" => sed_url("pfs", "f=".$pff_id."&".$more), + "PFS_LIST_FOLDERS_TITLE" => $pff_title, + "PFS_LIST_FOLDERS_EDIT_URL" => sed_url("pfs", "m=editfolder&f=".$pff_id."&".$more), + "PFS_LIST_FOLDERS_TYPE" => $icon_f." ".$L_pff_type[$pff_type]." ".$icon_g, + "PFS_LIST_FOLDERS_HITS" => $pff_fcount, + "PFS_LIST_FOLDERS_SIZE" => $pff_fsize." ".$L['kb'], + "PFS_LIST_FOLDERS_UPDATE" => sed_build_date($cfg['dateformat'], $row1['pff_updated']), + "PFS_LIST_FOLDERS_VIEWCOUNTS" => $pff_count + )); + + $t->parse("MAIN.PFS_FOLDERS.PFS_LIST_FOLDERS"); + } + if ($folders_count > 0) + { + $t->assign(array( + "PFS_FOLDERS_COUNT" => $folders_count, + "PFS_FOLDERS_SUBFILES_COUNT" => $subfiles_count + )); + $t->parse("MAIN.PFS_FOLDERS"); + } } $files_count = sed_sql_numrows($sql); @@ -442,7 +498,7 @@ $pfs_filesize = floor($row['pfs_size']/1024); $pfs_icon = $icon[$pfs_extension]; - $dotpos = mb_strrpos($pfs_file, ".")+1; + $dotpos = mb_strrpos($pfs_file, ".") + 1; $pfs_realext = mb_strtolower(mb_substr($pfs_file, $dotpos, 5)); unset($add_thumbnail, $add_image, $add_file); @@ -457,8 +513,8 @@ if (in_array($pfs_extension, $cfg['gd_supported']) && $cfg['th_amode']!='Disabled') { - $setassample = ($pfs_id==$pff_sample) ? $out['img_checked'] : "".$out['img_set'].""; - $pfs_icon = "\"".$pfs_file."\""; + $setassample = ($pfs_id == $pff_sample) ? $out['img_checked'] : "".$out['img_set'].""; + $pfs_icon = "\"".$pfs_file."\""; if (!file_exists($cfg['th_dir'].$pfs_file) && file_exists($cfg['pfs_dir'].$pfs_file)) { @@ -467,12 +523,12 @@ sed_createthumb($cfg['pfs_dir'].$pfs_file, $cfg['th_dir'].$pfs_file, $cfg['th_x'],$cfg['th_y'], $cfg['th_keepratio'], $pfs_extension, $pfs_file, $pfs_filesize, $th_colortext, $cfg['th_textsize'], $th_colorbg, $cfg['th_border'], $cfg['th_jpeg_quality'], $cfg['th_dimpriority']); } - if ($standalone) - { - $add_thumbnail .= "\"".$L['pfs_insertasthumbnail']."\""; - $add_image = "\"".$L['pfs_insertasimage']."\""; - } - } + if ($standalone) + { + $add_thumbnail .= "\"".$L['pfs_insertasthumbnail']."\""; + $add_image = "\"".$L['pfs_insertasimage']."\""; + } + } $add_file = ($standalone) ? "\"".$L['pfs_insertaslink']."\"" : ''; @@ -483,146 +539,60 @@ $add_image = ""; } - /* === New Hook Sed 170 by Amro === */ $stndl_icons_list = ""; $stndl_icons_disp = ""; + + /* === Hook === */ $extp = sed_getextplugins('pfs.stndl.icons'); if (is_array($extp)) { foreach($extp as $k => $pl) { include(SED_ROOT . '/plugins/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } } - /* =============================== */ - - $list_files .= "".$out['img_delete'].""; - $list_files .= "".$out['img_edit'].""; - $list_files .= "".$pfs_icon.""; - $list_files .= "".$pfs_file."
"; - $list_files .= sed_build_date($cfg['dateformat'], $pfs_date)."
"; - $list_files .= $pfs_filesize.$L['kb'].""; - $list_files .= "".$pfs_title.""; - $list_files .= "".$row['pfs_count'].""; - $list_files .= ($f>0) ? "".$setassample."" : ''; - - $list_files .= (empty($stndl_icons_list)) ? "".$add_thumbnail." ".$add_image." ".$add_file."" : ""; - - /*=== for hook stndl.icons ===*/ - $list_files .= $stndl_icons_list; - /*======*/ - - $list_files .= ""; - $pfs_foldersize = $pfs_foldersize + $pfs_filesize; - } - -if ($files_count>0 || $folders_count>0) - { - if ($folders_count>0) - { - $disp_main .= "

".$folders_count." ".$L['Folders']." / ".$subfiles_count." ".$L['Files']." :

"; - $disp_main .= ""; - $disp_main .= ""; - $disp_main .= ""; - $disp_main .= ""; - $disp_main .= ""; - $disp_main .= ""; - $disp_main .= ""; - $disp_main .= ""; - $disp_main .= ""; - $disp_main .= $list_folders."
".$L['Delete']."".$L['Edit']."".$L['Folder']."".$L['Type']."".$L['Files']."".$L['Size']."".$L['Updated']."".$L['Hits']."
"; - } + /* ===== */ - if ($files_count>0) + if (!empty($pfs_icon)) { - $disp_main .= "

".$files_count." "; + $t->assign(array( + "PFS_LIST_FILES_ICON" => $pfs_icon + )); + $t->parse("MAIN.PFS_FILES.PFS_LIST_FILES.PFS_LIST_FILES_ICON"); + } + + $t->assign(array( + "PFS_LIST_FILES_ID" => $pfs_id, + "PFS_LIST_FILES_DELETE_URL" => sed_url("pfs", "a=delete&".sed_xg()."&id=".$pfs_id."&o=".$o."&".$more), + "PFS_LIST_FILES_URL" => $pfs_fullfile, + "PFS_LIST_FILES_TITLE" => $pfs_title, + "PFS_LIST_FILES_EDIT_URL" => sed_url("pfs" ,"m=edit&id=".$pfs_id."&".$more), + "PFS_LIST_FILES_SIZE" => $pfs_filesize." ".$L['kb'], + "PFS_LIST_FILES_UPDATE" => sed_build_date($cfg['dateformat'], $pfs_date), + "PFS_LIST_FILES_VIEWCOUNTS" => $row['pfs_count'], + "PFS_LIST_FILES_SETASSAMPLE" => $setassample, + "PFS_LIST_FILES_STNDL" => (empty($stndl_icons_list)) ? $add_thumbnail." ".$add_image." ".$add_file : $stndl_icons_list + )); + + $t->parse("MAIN.PFS_FILES.PFS_LIST_FILES"); - if ($f>0) - { $disp_main .= $L['pfs_filesinthisfolder']; } - else - { $disp_main .= $L['pfs_filesintheroot']; } - - $disp_main .= "

"; - - $disp_main .= ""; - $disp_main .= ""; - $disp_main .= ""; - $disp_main .= ""; - $disp_main .= ""; - $disp_main .= ($f>0) ? "" : ''; - - $disp_main .= (empty($stndl_icons_disp)) ? "" : ""; - - /*=== for hook stndl.icons ===*/ - $disp_main .= $stndl_icons_disp; - /*======*/ - - $disp_main .= ""; - $disp_main .= $list_files."
".$L['Delete']."".$L['Edit']."".$L['File'].""; - $disp_main .= " / ".$L['Date']; - $disp_main .= " / ".$L['Size']."".$L['Title']."".$L['Hits']."".$L['pfs_setassample']." 
"; - } - } - else - { - $disp_main = $L['pfs_folderistempty']; + $pfs_foldersize = $pfs_foldersize + $pfs_filesize; } - + + if ($files_count > 0) + { + $t->assign(array( + "PFS_FILES_COUNT" => $files_count + )); + $t->parse("MAIN.PFS_FILES"); + } + // ========== Statistics ========= $pfs_precentbar = @floor(100 * $pfs_totalsize / 1024 / $maxtotal); -$disp_stats = $L['pfs_totalsize']." : ".floor($pfs_totalsize/1024).$L['kb']." / ".$maxtotal.$L['kb']; -$disp_stats .= " (".@floor(100*$pfs_totalsize/1024/$maxtotal)."%) "; +$disp_stats = $L['pfs_totalsize']." : ".floor($pfs_totalsize / 1024).$L['kb']." / ".$maxtotal.$L['kb']; +$disp_stats .= " (".@floor(100 * $pfs_totalsize / 1024 / $maxtotal)."%) "; $disp_stats .= "   ".$L['pfs_maxsize']." : ".$maxfile.$L['kb']; $disp_stats .= "
"; $disp_stats .= "
"; -// ========== Upload ========= - -$disp_upload = "

".$L['pfs_newfile']."

"; -$disp_upload .= "
"; -$disp_upload .= ""; -$disp_upload .= ""; -$disp_upload .= ""; - -for ($ii = 0; $ii < $cfg['pfsmaxuploads']; $ii++) - { - $disp_upload .= "\n"; - $disp_upload .= "\n"; - $disp_upload .= ""; - } - -$disp_upload .= ""; - -for ($ii = $cfg['pfsmaxuploads']; $ii < $cfg['pfsmaxuploads']*2; $ii++) - { - $disp_upload .= "\n"; - $disp_upload .= ""; - $disp_upload .= "\n"; - } -$disp_upload .= ""; - -$disp_upload .= "\n"; -$disp_upload .= ""; -$disp_upload .= "\n"; - -$disp_upload .= "
"; - -$disp_upload .= ""; -$disp_upload .= $L['Folder']." : ".sed_selectbox_folders($userid, "", $f); -$disp_upload .= ($cfg['gallery_imgmaxwidth']>0) ? "     ".sprintf($L['pfs_resize'], $cfg['gallery_imgmaxwidth'])." : ".sed_checkbox('nresize') : ''; -$disp_upload .= (!empty($cfg['gallery_logofile'])) ? "     ".$L['pfs_addlogo']." : ".sed_checkbox('naddlogo')."   \"\"" : ''; - -$disp_upload .= "
 ".$L['Title']."".$L['File']."
#".($ii+1)."\n"; - $disp_upload .= ($ii+1==$cfg['pfsmaxuploads']) ? "   \"\"": ''; - $disp_upload .= "
#".($ii+1)."\n
".$L['pfs_multiuploading']."
"; -$disp_upload .= "
"; - -// ========== Icons Help ========= - -$disp_iconshelp = "

".$L['Help']." :

"; -$disp_iconshelp .= "\"\" : ".$L['pfs_insertasthumbnail']."     - \"\" : ".$L['pfs_insertasimage']."     - \"\" : ".$L['pfs_insertaslink']; - // ========== Allowed ========= -$disp_allowed = "

".$L['pfs_extallowed']." :

"; reset($sed_extensions); sort($sed_extensions); $disp_allowedlist = array(); @@ -630,142 +600,136 @@ { $disp_allowedlist[] = $icon[$line[0]]." .".$line[0]." (".$filedesc[$line[0]].")"; } $disp_allowed .= implode(", ", $disp_allowedlist); -// ========== Create a new folder ========= +// ========== Upload ========= -if ($f==0 && $usr['auth_write']) +if ($usr['auth_write']) { - $disp_newfolder = "

".$L['pfs_newfolder']."

"; - $disp_newfolder .= "
"; - $disp_newfolder .= ""; - $disp_newfolder .= ""; - $disp_newfolder .= ""; - $disp_newfolder .= ""; - $disp_newfolder .= ""; - $disp_newfolder .= ""; - $disp_newfolder .= ""; - $disp_newfolder .= "
".$L['Title']."
".$L['Description']."
".$L['Type'].""; - - $ntype_arr = ($usr['auth_write_gal']) ? array(0 => $L['Private'], 1 => $L['Public'], 2 => $L['Gallery']) : array(0 => $L['Private'], 1 => $L['Public']); - $disp_newfolder .= sed_radiobox("ntype", $ntype_arr, 0); - - $disp_newfolder .= "
"; - $disp_newfolder .= "
"; - } - -// ========== Putting all together ========= -$subtitle = $disp_stats; -$body = (!empty($disp_errors)) ? "
".$disp_errors."
" : '
 
'; + $t->parse("MAIN.PFS_UPLOAD_TAB"); + + if (!empty($cfg['gallery_logofile'])) + { + $t->assign(array( + "PFS_UPLOAD_ADD_LOGO" => sed_checkbox('naddlogo'), + "PFS_UPLOAD_LOGO_FILE" => "\"\"" + )); + $t->parse("MAIN.PFS_UPLOAD.PFS_UPLOAD_ADD_LOGO"); + } + if ($cfg['gallery_imgmaxwidth'] > 0) + { + $t->assign(array( + "PFS_UPLOAD_IMG_RESIZE_SIZE" => sprintf($L['pfs_resize'], $cfg['gallery_imgmaxwidth']), + "PFS_UPLOAD_IMG_RESIZE" => sed_checkbox('nresize') + )); + $t->parse("MAIN.PFS_UPLOAD.PFS_UPLOAD_IMG_RESIZE"); + } -$body .= "
"; - -$body .= ""; + $t->assign(array( + "PFS_UPLOAD_SEND" => sed_url("pfs", "a=upload"."&".$more), + "PFS_UPLOAD_MAXFILESIZE" => sed_textbox_hidden('MAX_FILE_SIZE', $maxfile*1024), + "PFS_UPLOAD_FOLDERS" => sed_selectbox_folders($userid, "", $f), + )); -$body .= "
"; + for ($ii = 0; $ii < $cfg['pfsmaxuploads']*2; $ii++) + { -$body .= "
".$disp_main."
"; -$body .= ($usr['auth_write']) ? "
".$disp_upload."
" : ''; -$body .= ($usr['auth_write']) ? "
".$disp_newfolder."
" : ''; + if ($ii+1 == $cfg['pfsmaxuploads']) + { + $t->assign(array( + "PFS_UPLOAD_MORE_URL" => "javascript:sedjs.toggleblock('moreuploads')", + "PFS_UPLOAD_MORE_ICON" => "\"\"" + )); + $t->parse("MAIN.PFS_UPLOAD.PFS_UPLOAD_LIST.PFS_UPLOAD_MORE"); + } + + $t->assign(array( + "PFS_UPLOAD_LIST_NUM" => ($ii+1), + "PFS_UPLOAD_LIST_TITLE" => sed_textbox("ntitle[".$ii."]", '', 38, 255), + "PFS_UPLOAD_LIST_FILE" => "" + )); + + if ($ii >= $cfg['pfsmaxuploads']) + { + $t->parse("MAIN.PFS_UPLOAD.PFS_UPLOAD_MORE_LIST"); + } + else + { + $t->parse("MAIN.PFS_UPLOAD.PFS_UPLOAD_LIST"); + } -$body .= "
"; + } -$body .= ($standalone) ? "
".$disp_iconshelp."
" : ''; + $t->assign(array( + "PFS_UPLOAD_MULTIPLE" => "", + "PFS_ALLOWED_EXT" => ($usr['auth_write']) ? $disp_allowed : '' + )); -$body .= ($usr['auth_write']) ? "
".$disp_allowed."
" : ''; + $t->parse("MAIN.PFS_UPLOAD"); -$out['subtitle'] = $L['Mypfs']; -$title_tags[] = array('{MAINTITLE}', '{TITLE}', '{SUBTITLE}'); -$title_tags[] = array('%1$s', '%2$s', '%3$s'); -$title_data = array($cfg['maintitle'], $out['subtitle'], $cfg['subtitle']); -$out['subtitle'] = sed_title('pfstitle', $title_tags, $title_data); + } -/* ============= */ +// ========== Create a new folder ========= -if ($standalone) +if ($f == 0 && $usr['auth_write']) { - sed_sendheaders(); - $pfs_header1 = $cfg['doctype']."".sed_htmlmetas()."".$out['subtitle'].""; - $pfs_header2 = ""; - $pfs_footer = ""; + $t->parse("MAIN.PFS_NEWFOLDER_TAB"); - /* === Hook === */ - $extp = sed_getextplugins('pfs.stndl'); - if (is_array($extp)) - { foreach($extp as $k => $pl) { include(SED_ROOT . '/plugins/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } } - /* ====== */ - - $mskin = sed_skinfile(array('pfs', 'standalone')); - $t = new XTemplate($mskin); + $ntype_arr = ($usr['auth_write_gal']) ? array(0 => $L['Private'], 1 => $L['Public'], 2 => $L['Gallery']) : array(0 => $L['Private'], 1 => $L['Public']); $t->assign(array( - "PFS_STANDALONE_HEADER1" => $pfs_header1, - "PFS_STANDALONE_HEADER2" => $pfs_header2, - "PFS_STANDALONE_FOOTER" => $pfs_footer, - )); + "PFS_NEWFOLDER_SEND" => sed_url("pfs", "a=newfolder"."&".$more), + "PFS_NEWFOLDER_TITLE" => sed_textbox('ntitle', '', 56, 255), + "PFS_NEWFOLDER_DESC" => sed_textarea('ndesc', '', 8, 56, 'Micro'), + "PFS_NEWFOLDER_TYPE" => sed_radiobox("ntype", $ntype_arr, 0) + )); + + $t->parse("MAIN.PFS_NEWFOLDER"); + } + +if (count($upload_status) > 0) + { + $t->assign(array( + "PFS_UPLOAD_STATUS" => implode('
', $upload_status) + )); + $t->parse("MAIN.PFS_UPLOAD_STATUS"); + } + +// ========== Icons Help ========= - $t->parse("MAIN.STANDALONE_HEADER"); - $t->parse("MAIN.STANDALONE_FOOTER"); +$disp_iconshelp = "

".$L['Help']." :

"; +$disp_iconshelp .= "\"\" : ".$L['pfs_insertasthumbnail']."     + \"\" : ".$L['pfs_insertasimage']."     + \"\" : ".$L['pfs_insertaslink']; - $t-> assign(array( - "PFS_TITLE" => $title, - "PFS_SHORTTITLE" => $shorttitle, - "PFS_BREADCRUMBS" => sed_breadcrumbs($urlpaths, 1, false), - "PFS_BODY" => $body - )); +$t-> assign(array( + "PFS_TITLE" => $title, + "PFS_SHORTTITLE" => $shorttitle, + "PFS_BREADCRUMBS" => sed_breadcrumbs($urlpaths), + "PFS_SUBTITLE" => $subtitle, + "PFS_STATS" => $disp_stats, + "PFS_HELP" => ($standalone) ? $disp_iconshelp : '' +)); - $t->parse("MAIN"); - $t->out("MAIN"); +/* === Hook === */ +$extp = sed_getextplugins('pfs.tags'); +if (is_array($extp)) +{ foreach($extp as $k => $pl) { include(SED_ROOT . '/plugins/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } } +/* ===== */ - +$t->parse("MAIN"); +$t->out("MAIN"); + +if ($standalone) + { @ob_end_flush(); @ob_end_flush(); - - sed_sql_close($connection_id); + sed_sql_close($connection_id); } -else +else { - if (defined('SED_ADMIN')) - { - $t = new XTemplate(sed_skinfile("admin.apfs", true)); - } - else - { - require(SED_ROOT . "/system/header.php"); - $t = new XTemplate(sed_skinfile("pfs")); - } - - sed_breadcrumbs($urlpaths); - - $t-> assign(array( - "PFS_TITLE" => $title, - "PFS_SHORTTITLE" => $shorttitle, - "PFS_BREADCRUMBS" => sed_breadcrumbs($urlpaths), - "PFS_SUBTITLE" => $subtitle, - "PFS_BODY" => $body - )); - - /* === Hook === */ - $extp = sed_getextplugins('pfs.tags'); - if (is_array($extp)) - { foreach($extp as $k => $pl) { include(SED_ROOT . '/plugins/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } } - /* ===== */ - - if (defined('SED_ADMIN')) - { - $t -> parse("MAIN"); - $adminmain = $t -> text("MAIN"); - } - else - { - $t->parse("MAIN"); - $t->out("MAIN"); - require(SED_ROOT . "/system/footer.php"); - } + require(SED_ROOT . "/system/footer.php"); } -?> \ No newline at end of file + +?> diff --git a/system/lang/en/main.lang.php b/system/lang/en/main.lang.php index 448c289..e5252e1 100644 --- a/system/lang/en/main.lang.php +++ b/system/lang/en/main.lang.php @@ -605,6 +605,8 @@ $L['pfs_filesinthisfolder'] = "File(s) in this folder"; $L['pfs_newfile'] = "Upload a file :"; $L['pfs_newfolder'] = "Create a new folder :"; +$L['pfs_editfolder'] = "Editing a folder"; +$L['pfs_editfile'] = "Editing a file"; $L['pfs_extallowed'] = "Extensions allowed"; $L['pfs_insertasthumbnail'] = "Insert as thumbnail"; // New in v175 diff --git a/system/lang/ru/main.lang.php b/system/lang/ru/main.lang.php index f1ecd14..3633595 100644 --- a/system/lang/ru/main.lang.php +++ b/system/lang/ru/main.lang.php @@ -602,8 +602,10 @@ $L['pfs_maxsize'] = "Максимальный размер файла"; $L['pfs_filesintheroot'] = "Файл(ов) в корневом каталоге"; $L['pfs_filesinthisfolder'] = "Файл(ов) в этой папке"; -$L['pfs_newfile'] = "Загрузить файл:"; -$L['pfs_newfolder'] = "Создать новую папку:"; +$L['pfs_newfile'] = "Загрузить файл"; +$L['pfs_newfolder'] = "Создать новую папку"; +$L['pfs_editfolder'] = "Редактирование папки"; +$L['pfs_editfile'] = "Редактирование файла"; $L['pfs_ispublic'] = "Публичная?"; $L['pfs_isgallery'] = "Галерея?"; $L['pfs_extallowed'] = "Допустимые расширения"; @@ -613,7 +615,7 @@ $L['pfs_insertaslink'] = "Вставить ссылку на файл"; // New in v175 $L['pfs_multiuploading'] = "Мультизагрузка файлов"; // New in v175 -$L['pfs_setassample'] = "Установить как образец"; // New in v150 +$L['pfs_setassample'] = "Образец"; // New in v150 $L['pfs_addlogo'] = "Добавить лого"; // New in v150 $L['pfs_resize'] = "Изменить размер, если больше чем %1\$s пикселей"; // New in v150