Esempio n. 1
0
 public function player($atts)
 {
     extract(shortcode_atts(array('fileurl' => 'No file found.', 'volume' => '100', 'class' => 'ssfa-player', 'loops' => 'false'), $atts));
     $ids = uniqid();
     $player_cont = '<div style="position:relative; display:inline-block"><div class="' . $class . '">';
     $player_cont .= '<span id="fileaplay_' . $ids . '" class="ssfa-fileaplay-play4 ssfaButton_play" ' . 'onClick="fileaplay(\'play\',\'' . $ids . '\',\'' . fileaway_utility::urlesc($fileurl) . '\',\'' . $volume . '\',\'' . $loops . '\');show_hide(\'play\',\'' . $ids . '\');"></span>';
     $player_cont .= '<span id="fileapause_' . $ids . '" class="ssfa-fileaplay-pause4 ssfaButton_stop" ' . 'onClick="fileaplay(\'stop\',\'' . $ids . '\',\'\',\'' . $volume . '\',\'' . $loops . '\');show_hide(\'stop\',\'' . $ids . '\');"></span>';
     $player_cont .= '</div></div>';
     return $player_cont;
 }
Esempio n. 2
0
 private function paths()
 {
     $home = fileaway_utility::replacefirst(get_option('home'), 'https:', 'http:');
     $wpurl = fileaway_utility::replacefirst(get_bloginfo('wpurl'), 'https:', 'http:');
     $install = trim($home, '/') === trim($wpurl, '/') ? false : str_replace('//', '/', ltrim(str_replace(rtrim($home, '/'), '', rtrim($wpurl, '/')), '/') . '/');
     $install = $install === '/' ? false : $install;
     $installpath = ABSPATH;
     $rootpath = $install ? substr_replace(ABSPATH, '', strrpos(ABSPATH, $install), strlen($install)) : ABSPATH;
     $chosenpath = $this->options['rootdirectory'] === 'siteurl' ? $rootpath : ABSPATH;
     $problemchild = $install && $this->options['rootdirectory'] !== 'siteurl' ? true : false;
     $playback_url = $this->options['rootdirectory'] === 'siteurl' ? rtrim(get_option('home'), '/') . '/' : rtrim(get_bloginfo('wpurl'), '/') . '/';
     $this->pathoptions = array('install' => $install, 'installpath' => $installpath, 'rootpath' => $rootpath, 'chosenpath' => $chosenpath, 'problemchild' => $problemchild, 'playback_url' => $playback_url);
 }
 private function decrypt($file)
 {
     $op = get_option('fileaway_options');
     $key = $op['encryption_key'];
     if (function_exists('mcrypt_encrypt')) {
         return urldecode(trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode(trim($file)), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
     } else {
         $decrypted = '';
         $keys = array_values(array_unique(str_split($key)));
         $keyr = array_reverse($keys);
         foreach (str_split(urldecode($file)) as $s) {
             $decrypted .= in_array($s, $keyr) ? $keys[array_search($s, $keyr)] : $s;
         }
         return fileaway_utility::urlesc(base64_decode(strrev($decrypted)), true);
     }
 }
 public function encrypt($file)
 {
     $op = get_option('fileaway_options');
     if (!isset($op['encryption_key']) || strlen($op['encryption_key']) < 16) {
         $key = $this->key($op);
     } else {
         $key = $op['encryption_key'];
     }
     if (function_exists('mcrypt_encrypt')) {
         return urlencode(trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $file, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)))));
     } else {
         $encrypted = '';
         $keys = array_values(array_unique(str_split($key)));
         $keyr = array_reverse($keys);
         foreach (str_split(strrev(base64_encode(fileaway_utility::urlesc($file)))) as $s) {
             $encrypted .= in_array($s, $keys) ? $keyr[array_search($s, $keys)] : $s;
         }
         return urlencode($encrypted);
     }
 }
Esempio n. 5
0
 public function sc($atts)
 {
     extract($this->correct(wp_parse_args($atts, $this->fileaframe), $this->shortcodes['fileaframe']));
     if ($devices) {
         $get = new fileaway_definitions();
         if ($devices == 'mobile' && !$get->is_mobile) {
             return;
         } elseif ($devices == 'desktop' && $get->is_mobile) {
             return;
         }
     }
     if (!fileaway_utility::visibility($hidefrom, $showto)) {
         return;
     }
     if (!$name) {
         return sprintf(__('Please assign your fileaframe shortcode a unique name, using %s, and assign the same name to its corresponding %s shortcode, using %s', 'file-away'), '[fileaframe name="myuniquename"]', '[fileaway]', '[fileaway name="myuniquename"]');
     } elseif (!$source) {
         return _x('Please specify a source page.', 'File-a-Frame No Source Error Message', 'file-away');
     } else {
         return "<div id='{$name}' class='ssfa-meta-container' style='width:100%; height:100%;'>" . "<iframe name='{$name}' id='{$name}' src='{$source}' width={$width} height={$height} " . "scrolling={$scroll} frameborder='0' marginwidth={$mwidth} marginheight={$mheight} seamless>" . "</iframe>" . "</div>";
     }
 }
 public function get_settings()
 {
     /* Basic Configuration */
     $this->settings['rootdirectory'] = array('title' => 'Set Root Directory', 'type' => 'select', 'choices' => array('install' => 'WP Install Directory', 'siteurl' => 'Site Root Directory'), 'dflt' => 'install');
     $this->settings['strictlogin'] = array('title' => 'Dynamic Usernames', 'type' => 'select', 'choices' => array('false' => 'Force Lowercase', 'true' => 'Strict Matching'), 'dflt' => 'false');
     $this->settings['base1'] = array('title' => 'Base Directory 1', 'type' => 'basedir', 'class' => 'fileaway-basedir fileaway-inline', 'helplink' => false);
     $this->settings['bs1name'] = array('holder' => 'Display Name', 'class' => 'fileaway-basename fileaway-inline', 'helplink' => false);
     $this->settings['base2'] = array('title' => 'Base Directory 2', 'type' => 'basedir', 'class' => 'fileaway-basedir fileaway-inline', 'helplink' => false);
     $this->settings['bs2name'] = array('holder' => 'Display Name', 'class' => 'fileaway-basename fileaway-inline', 'helplink' => false);
     $this->settings['base3'] = array('title' => 'Base Directory 3', 'type' => 'basedir', 'class' => 'fileaway-basedir fileaway-inline', 'helplink' => false);
     $this->settings['bs3name'] = array('holder' => 'Display Name', 'class' => 'fileaway-basename fileaway-inline', 'helplink' => false);
     $this->settings['base4'] = array('title' => 'Base Directory 4', 'type' => 'basedir', 'class' => 'fileaway-basedir fileaway-inline', 'helplink' => false);
     $this->settings['bs4name'] = array('holder' => 'Display Name', 'class' => 'fileaway-basename fileaway-inline', 'helplink' => false);
     $this->settings['base5'] = array('title' => 'Base Directory 5', 'type' => 'basedir', 'class' => 'fileaway-basedir fileaway-inline', 'helplink' => false);
     $this->settings['bs5name'] = array('holder' => 'Display Name', 'class' => 'fileaway-basename fileaway-inline', 'helplink' => false);
     $this->settings['baseurl'] = array('title' => 'Base URL', 'type' => 'select', 'choices' => fileaway_utility::urls(), 'dflt' => rtrim(get_home_url(1), '/'));
     $this->settings['redirect'] = array('title' => 'Guest Redirect URL', 'holder' => 'http://yourdomain.com/registration-page/', 'class' => 'fileaway-permexclusions fileaway-inline');
     $this->settings['exclusions'] = array('title' => 'Permanent Exclusions', 'holder' => '.avi, My Embarrasing Photograph, .tif, My Rough Draft Essay', 'class' => 'fileaway-permexclusions fileaway-inline');
     $this->settings['direxclusions'] = array('title' => 'Exclude Directories', 'holder' => 'My Private Files, Weird_Server_Directory_Name, etc.', 'class' => 'fileaway-permexclusions fileaway-inline');
     $this->settings['newwindow'] = array('title' => 'New Window', 'holder' => 'Example: .pdf, .jpg, .png, .gif, .mp3, .mp4', 'class' => 'fileaway-newwindow fileaway-inline');
     $this->settings['encryption_key'] = array('title' => 'Encryption Key', 'class' => 'fileaway-encryptionkey fileaway-inline', 'submit' => true);
     $this->settings['banner_directory'] = array('title' => 'Banner Directory', 'type' => 'rootpath', 'class' => 'fileaway-basedir fileaway-inline');
     $this->settings['download_prefix'] = array('title' => 'Bulk Download File Prefix', 'class' => 'fileaway-download-prefix fileaway-inline', 'dflt' => '');
     /* Feature Options */
     $this->settings['modalaccess'] = array('section' => 'options', 'title' => 'Modal Access', 'type' => 'select', 'dflt' => 'edit_posts', 'choices' => fileaway_utility::caps());
     $this->settings['tmcerows'] = array('section' => 'options', 'title' => 'Button Position', 'type' => 'select', 'choices' => array('' => 'First Row', '_2' => 'Second Row', '_3' => 'Third Row', '_4' => 'Fourth Row'), 'dflt' => '_2');
     $this->settings['stylesheet'] = array('section' => 'options', 'title' => 'Stylesheet Placement', 'type' => 'select', 'choices' => array('footer' => 'Footer when necessary', 'header' => 'Header all the time'), 'dflt' => 'footer');
     $this->settings['javascript'] = array('section' => 'options', 'title' => 'Javascript Placement', 'type' => 'select', 'choices' => array('footer' => 'Footer when necessary', 'header' => 'Header all the time'), 'dflt' => 'header');
     $this->settings['pathinfo'] = array('section' => 'options', 'title' => 'Alternative Pathinfo', 'type' => 'select', 'choices' => array('disabled' => 'Disabled', 'enabled' => 'Enabled'), 'dflt' => 'disabled');
     $this->settings['daymonth'] = array('section' => 'options', 'title' => 'Date Display Format', 'type' => 'select', 'choices' => array('md' => 'MM/DD/YYYY', 'dm' => 'DD/MM/YYYY'), 'dflt' => 'md');
     $this->settings['postidcolumn'] = array('section' => 'options', 'title' => 'Post ID Column', 'type' => 'select', 'choices' => array('enabled' => 'Enabled', 'disabled' => 'Disabled'), 'dflt' => 'enabled');
     $this->settings['loadusers'] = array('section' => 'options', 'title' => 'Load Users', 'type' => 'select', 'choices' => array('false' => 'False', 'true' => 'True'), 'dflt' => 'false');
     $this->settings['adminstyle'] = array('section' => 'options', 'title' => 'Admin Style', 'type' => 'select', 'choices' => array('classic' => 'Classic', 'minimal' => 'Minimal'), 'dflt' => 'classic', 'submit' => true);
     /* Custom Styles */
     $this->settings['custom_list_classes'] = array('section' => 'customcss', 'title' => 'Custom List Classes', 'holder' => 'classname1|Display Name 1, classname2|Display Name 2', 'class' => 'fileaway-custom fileaway-inline');
     $this->settings['custom_table_classes'] = array('section' => 'customcss', 'title' => 'Custom Table Classes', 'holder' => 'classname1|Display Name 1, classname2|Display Name 2', 'class' => 'fileaway-custom fileaway-inline');
     $this->settings['custom_flightbox_classes'] = array('section' => 'customcss', 'title' => 'Custom Flightbox Classes', 'holder' => 'classname1|Display Name 1, classname2|Display Name 2', 'class' => 'fileaway-custom fileaway-inline');
     $this->settings['custom_color_classes'] = array('section' => 'customcss', 'title' => 'Custom Color Classes', 'holder' => 'classname1|Display Name 1, classname2|Display Name 2', 'class' => 'fileaway-custom fileaway-inline');
     $this->settings['custom_accent_classes'] = array('section' => 'customcss', 'title' => 'Custom Accent Classes', 'holder' => 'classname1|Display Name 1, classname2|Display Name 2', 'class' => 'fileaway-custom fileaway-inline');
     $this->settings['custom_stylesheet'] = array('section' => 'customcss', 'title' => 'Custom Stylesheet', 'holder' => 'my-custom-stylesheet.css', 'class' => 'fileaway-custom-stylesheet fileaway-inline');
     $this->settings['customcss'] = array('section' => 'customcss', 'title' => 'Custom Styles', 'type' => 'customcss', 'class' => 'code fileaway-customcss', 'helplink' => false);
     $this->settings['css_editor'] = array('section' => 'customcss', 'title' => 'Switch Editors', 'type' => 'select', 'choices' => array('syntax' => 'Syntax Highlighted', 'plain' => 'Resizable (Plain Text)'), 'dflt' => 'syntax', 'class' => 'fileaway-custom fileaway-inline', 'helplink' => false, 'submit' => true);
     /*Manager Mode */
     $this->settings['manager_role_access'] = array('section' => 'manager', 'title' => 'Access by Role/Capability', 'type' => 'rolescaps', 'input' => 'hidden');
     $this->settings['manager_user_access'] = array('section' => 'manager', 'title' => 'Access by User', 'type' => 'users', 'input' => 'hidden');
     $this->settings['managerpassword'] = array('section' => 'manager', 'title' => 'Override Password', 'class' => 'fileaway-overridepassword fileaway-inline', 'input' => 'password', 'submit' => true);
     /* Statistics */
     $this->settings['stats'] = array('section' => 'stats', 'title' => 'Download Statistics', 'type' => 'select', 'choices' => array('false' => 'Disabled', 'true' => 'Enabled'), 'dflt' => 'false');
     $this->settings['ignore_roles'] = array('section' => 'stats', 'title' => 'Ignore Roles/Caps', 'type' => 'rolescaps', 'input' => 'hidden');
     $this->settings['ignore_users'] = array('section' => 'stats', 'title' => 'Ignore Users', 'type' => 'users', 'input' => 'hidden');
     $this->settings['recordlimit'] = array('section' => 'stats', 'title' => 'Record Limit', 'holder' => 'e.g., 1000', 'class' => 'fileaway-inline fileaway-integer');
     $this->settings['recordlifespan'] = array('section' => 'stats', 'title' => 'Record Lifespan', 'type' => 'select', 'choices' => array('1 week' => 'One Week', '2 weeks' => 'Two Weeks', '1 month' => 'One Month', '3 months' => 'Three Months', '6 months' => 'Six Months', '1 year' => 'One Year', '2 years' => 'Two Years', 'forever' => 'Eternal Life'), 'dflt' => '3months');
     $this->settings['instant_stats'] = array('section' => 'stats', 'title' => 'Instant Notifications', 'type' => 'select', 'choices' => array('false' => 'Disabled', 'true' => 'Enabled'), 'dflt' => 'false');
     $this->settings['instant_sender_name'] = array('section' => 'stats', 'title' => 'Sender Name', 'dflt' => get_bloginfo('site_name'), 'holder' => 'Your Name');
     $this->settings['instant_sender'] = array('section' => 'stats', 'title' => 'Sender Email', 'dflt' => get_option('admin_email'), 'holder' => '*****@*****.**');
     $this->settings['instant_recipients'] = array('section' => 'stats', 'title' => 'Recipient Emails', 'holder' => 'one@email.com, two@email.com, etc.', 'submit' => true);
     $this->settings['instant_subject'] = array('section' => 'stats', 'title' => 'Email Subject', 'holder' => '%blog% %file% %datetime%', 'dflt' => '%blog% - %file% downloaded at %datetime%', 'submit' => true);
     $this->settings['compiled_stats'] = array('section' => 'stats', 'title' => 'Compiled Notifications', 'type' => 'select', 'choices' => array('false' => 'Disabled', 'daily' => 'Daily', 'weekly' => 'Weekly', 'fortnightly' => 'Fortnightly'), 'dflt' => 'false');
     $this->settings['compiled_sender_name'] = array('section' => 'stats', 'title' => 'Sender Name', 'dflt' => get_bloginfo('site_name'), 'holder' => 'Your Name');
     $this->settings['compiled_sender'] = array('section' => 'stats', 'title' => 'Sender Email', 'holder' => '*****@*****.**', 'dflt' => get_option('admin_email'));
     $this->settings['compiled_recipients'] = array('section' => 'stats', 'title' => 'Recipient Emails', 'holder' => 'one@email.com, two@email.com, etc.', 'submit' => true);
     $this->settings['compiled_subject'] = array('section' => 'stats', 'title' => 'Email Subject', 'holder' => '%blog% %dates%', 'dflt' => '%blog% - Download Stats for %dates%', 'submit' => true);
     /* RSS Feeds */
     $this->settings['feeds'] = array('section' => 'feeds', 'title' => 'Feed Storage Directory', 'class' => 'fileaway-basedir fileaway-feeds fileaway-inline', 'type' => 'rootpath');
     $this->settings['basefeeds'] = array('section' => 'feeds', 'title' => 'Monitored Directories', 'class' => 'fileaway-basedir fileaway-feeds fileaway-inline', 'type' => 'basefeed');
     $this->settings['excluded_feeds'] = array('section' => 'feeds', 'title' => 'Excluded Sub-Directories', 'class' => 'fileaway-basedir fileaway-feeds fileaway-inline', 'type' => 'basefeed');
     $this->settings['feed_excluded_exts'] = array('section' => 'feeds', 'title' => 'Excluded File Extensions', 'class' => 'fileaway-inline', 'type' => 'text', 'holder' => 'ini, html, etc.');
     $this->settings['feed_excluded_files'] = array('section' => 'feeds', 'title' => 'Excluded Strings', 'class' => 'fileaway-inline', 'type' => 'text', 'holder' => 'example, test, draft');
     $this->settings['feedlimit'] = array('section' => 'feeds', 'title' => 'Feed Limit', 'class' => 'fileaway-inline fileaway-integer', 'type' => 'text', 'holder' => 'e.g., 50');
     $this->settings['feeddates'] = array('section' => 'feeds', 'title' => 'Show Dates Modified', 'class' => 'fileaway-inline', 'type' => 'select', 'choices' => array('true' => 'Enabled', 'false' => 'Disabled'), 'dflt' => 'true');
     $this->settings['feedsize'] = array('section' => 'feeds', 'title' => 'Show File Size', 'class' => 'fileaway-inline', 'type' => 'select', 'choices' => array('true' => 'Enabled', 'false' => 'Disabled'), 'dflt' => 'true');
     $this->settings['feedlinks'] = array('section' => 'feeds', 'title' => 'Direct File Links', 'class' => 'fileaway-inline', 'type' => 'select', 'choices' => array('true' => 'Enabled', 'false' => 'Disabled'), 'dflt' => 'true');
     $this->settings['recursivefeeds'] = array('section' => 'feeds', 'title' => 'Feeds within Feeds', 'class' => 'fileaway-inline', 'type' => 'select', 'choices' => array('true' => 'Enabled', 'false' => 'Disabled'), 'dflt' => 'true');
     $this->settings['feedinterval'] = array('section' => 'feeds', 'title' => 'Auto Feed Updates', 'class' => 'fileaway-inline', 'type' => 'select', 'choices' => array('fifteenminutes' => 'Every 15 Minutes', 'thirtyminutes' => 'Every 30 Minutes', 'fortyfiveminutes' => 'Every 45 Minutes', 'hourly' => 'Every Hour', 'sixhours' => 'Every 6 Hours', 'twicedaily' => 'Every 12 Hours', 'daily' => 'Once a Day', 'weekly' => 'Once a Week'), 'dflt' => 'hourly', 'submit' => true);
     $this->settings['updatefeeds'] = array('section' => 'feeds', 'title' => 'Manual Feed Updates', 'class' => 'fileaway-inline', 'type' => 'select', 'choices' => array('true' => 'Update Feeds on Save', 'false' => 'Disable Manual Updates'), 'dflt' => 'true', 'submit' => true);
     /* Database Options */
     $this->settings['reset_options'] = array('section' => 'database', 'title' => 'Reset to Defaults', 'type' => 'select', 'choices' => array('' => '', 'reset' => 'Reset on Save'), 'dflt' => '');
     $this->settings['preserve_options'] = array('section' => 'database', 'title' => 'On Uninstall', 'type' => 'select', 'choices' => array('preserve' => 'Preserve Settings', 'delete' => 'Delete Settings'), 'dflt' => 'preserve', 'submit' => true);
 }
Esempio n. 7
0
    $file_plus_custom = $rawname;
    list($salvaged_filename, $customvalue) = preg_split("/[\\[\\]]/", $file_plus_custom);
    if ($customvalue != '' && !$prettify) {
        $customvalue = str_replace(array('~', '--', '_', '.', '*'), ' ', $customvalue);
        $customvalue = preg_replace('/(?<=\\D)-(?=\\D)/', ' ', "{$customvalue}");
        $customvalue = preg_replace('/(?<=\\d)-(?=\\D)/', ' ', "{$customvalue}");
        $customvalue = preg_replace('/(?<=\\D)-(?=\\d)/', ' ', "{$customvalue}");
    }
    $thename = $prettify ? $salvaged_filename : str_replace(array('~', '--', '_', '.', '*'), ' ', $salvaged_filename);
} else {
    $file_plus_custom = null;
    $customvalue = null;
    $thename = $prettify ? $rawname : str_replace(array('~', '--', '_', '.', '*'), ' ', $rawname);
    $salvaged_filename = $rawname;
}
if (!$prettify) {
    $thename = preg_replace('/(?<=\\D)-(?=\\D)/', ' ', "{$thename}");
    $thename = preg_replace('/(?<=\\d)-(?=\\D)/', ' ', "{$thename}");
    $thename = preg_replace('/(?<=\\D)-(?=\\d)/', ' ', "{$thename}");
}
$ext = !$ext ? '?' : $ext;
$ext = substr($ext, 0, 4);
$bytes = $dynamiclink || $size == 'no' ? 1 : filesize($dir . '/' . $file);
if ($size != 'no') {
    $fsize = fileaway_utility::formatBytes($bytes, 1);
    $fsize = !preg_match('/[a-z]/i', $fsize) ? '1k' : ($fsize === 'NAN' ? '0' : $fsize);
}
$sortdatekey = date("YmdHis", $thetime);
$sortdate = $this->op['daymonth'] === 'dm' ? date("d/m/Y " . $time_format, $thetime) : date($time_format . " m/d/Y", $thetime);
$date = date($date_format, $thetime);
$time = date($time_format, $thetime);
Esempio n. 8
0
<?php

defined('fileaway') or die('Water, water everywhere, but not a drop to drink.');
if (is_array($files)) {
    $now = time();
    foreach ($files as $file) {
        $link = $recursive ? "{$url}/{$file}" : "{$url}/{$dir}/{$file}";
        $slices = fileaway_utility::pathinfo($link);
        $extension = isset($slices['extension']) ? $slices['extension'] : false;
        include fileaway_dir . '/lib/inc/inc.filters.php';
        $dir = $recursive ? str_replace($slices['basename'], '', $file) : $dir;
        $dir = rtrim($dir, '/');
        if (!$excluded && is_readable($dir . '/' . $slices['basename'])) {
            $exts[] = $extension;
            $locs[] = $slices['dirname'];
            $fulls[] = $slices['basename'];
            $rawnames[] = $slices['filename'];
            $links[] = fileaway_utility::urlesc($link);
            $dirs[] = $dir;
            $times[] = $mod != 'no' ? filemtime($dir . '/' . $slices['basename']) : $now;
            $dynamics[] = false;
            $bannerads[] = false;
        }
    }
}
Esempio n. 9
0
$thefiles .= "</tr></thead><tfoot><tr><td colspan='100'>{$pagearea}</td></tr></tfoot><tbody>";
$records = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . fileaway_stats::$db . " WHERE timestamp >= %s AND timestamp <= %s ORDER BY timestamp DESC", $begin, $end), ARRAY_A);
if ($records && count($records)) {
    $rows = array();
    $download = $is_IE || $is_safari ? 'target="_blank"' : 'download';
    $datastat = $stats == 'true' ? 'data-stat="true"' : 'data-stat="false"';
    foreach ($records as $record) {
        $datatime = strtotime($record['timestamp']);
        $prettytime = date($datestring . ' ' . $time_format, strtotime($record['timestamp']));
        $user = $record['uid'] == 0 ? __('Guest', 'file-away') : new WP_User($record['uid']);
        if ($record['uid'] != 0) {
            $user = $user->user_login;
        }
        $count++;
        $filecol = $filecolumn == 'file' ? fileaway_utility::basename($record['file']) : str_replace('/', ' > ', $record['file']);
        $thefiles .= "<tr id='ssfa-file-{$uid}-{$count}'>" . "<td id='timestamp-ssfa-file-{$uid}-{$count}' class='ssfa-sorttimestamp {$theme}-first-column' data-value=\"{$datatime}\" style='min-width:120px;'>" . $prettytime . "</td>" . "<td id='file-ssfa-file-{$uid}-{$count}' class='ssfa-sortfile'>" . "<a href=\"" . fileaway_utility::urlesc($url . "/" . $record['file']) . "\" {$download} {$datastat}>" . $filecol . "</a>" . "</td>" . "<td id='uid-ssfa-file-{$uid}-{$count}' class='ssfa-sortuid'>" . $record['uid'] . "</td>";
        if ($username != 'no') {
            $thefiles .= "<td id='username-ssfa-file-{$uid}-{$count}' class='ssfa-sortusername' style='min-width:120px;'>" . $user . "</td>";
        }
        if ($email != 'no') {
            $thefiles .= "<td id='email-ssfa-file-{$uid}-{$count}' class='ssfa-sortemail'><a href=\"mailto:" . $record['email'] . "\" target='_blank'>" . $record['email'] . "</a></td>";
        }
        if ($ip != 'no') {
            $thefiles .= "<td id='ip-ssfa-file-{$uid}-{$count}' class='ssfa-sortip'>" . $record['ip'] . "</td>";
        }
        if ($agent == 'yes') {
            $thefiles .= "<td id='agent-ssfa-file-{$uid}-{$count}' class='ssfa-sortagent'>" . $record['agent'] . "</td>";
        }
        $thefiles .= '</tr>';
        $rows[] = array('TIMESTAMP' => $record['timestamp'], 'FILE' => $record['file'], 'UID' => $record['uid'], 'USERNAME' => $user, 'EMAIL' => $record['email'], 'IP' => $record['ip'], 'AGENT' => $record['agent']);
    }
Esempio n. 10
0
 public function sc($atts)
 {
     $uid = rand(0, 9999);
     $get = new fileaway_definitions();
     if (isset($atts['style'])) {
         $atts['theme'] = $atts['style'];
     }
     // legacy
     if (isset($atts['uploader']) && $atts['uploader'] === 'true') {
         $atts['uploader'] = 'name';
     }
     // legacy
     extract($get->pathoptions);
     extract($this->correct(wp_parse_args($atts, $this->fileup), $this->shortcodes['fileup']));
     if ($devices == 'mobile' && !$get->is_mobile) {
         return;
     } elseif ($devices == 'desktop' && $get->is_mobile) {
         return;
     }
     if (!fileaway_utility::visibility($hidefrom, $showto)) {
         return;
     }
     if ($this->op['javascript'] == 'footer') {
         $GLOBALS['fileaway_add_scripts'] = true;
     }
     if ($this->op['stylesheet'] == 'footer') {
         $GLOBALS['fileaway_add_styles'] = true;
     }
     // Build Initial Directory
     $base = $base == 's2member-files' ? fileaway_utility::replacefirst(WP_PLUGIN_DIR . '/s2member-files', $chosenpath, '') : $this->op['base' . $base];
     $base = trim($base, '/');
     $base = trim($base, '/');
     $sub = $sub ? trim($sub, '/') : false;
     $dir = $sub ? $base . '/' . $sub : $base;
     extract(fileaway_utility::dynamicpaths($dir));
     $dir = str_replace('//', '/', "{$dir}");
     $debugpath = $chosenpath . $dir;
     $dir = $problemchild ? $install . $dir : $dir;
     if (!is_dir("{$dir}") && $makedir && (!$private_content || $private_content && $logged_in && stripos($dir, 'fa-nullmeta') === false)) {
         if (mkdir($rootpath . $dir, 0775, true)) {
             fileaway_utility::indexmulti($rootpath . $dir, $chosenpath);
         }
     }
     if ($private_content && !is_dir("{$dir}")) {
         return;
     }
     $start = "{$dir}";
     if ($matchdrawer) {
         $fixedlocation = true;
         $drawerid = $matchdrawer && $matchdrawer !== 'true' ? $matchdrawer : null;
         include fileaway_dir . '/lib/inc/inc.open-drawer.php';
         $start = "{$dir}";
     }
     $pathparts = explode('/', $start);
     $basename = end($pathparts);
     $fixed = $start;
     $fixed = $fixedlocation ? $problemchild ? fileaway_utility::replacefirst($fixed, $install, '') : $fixed : null;
     $path = '<input type="hidden" id="ssfa-upload-actionpath-' . $uid . '" value="' . $fixed . '" data-basename="' . $basename . '" data-start="' . $start . '" />';
     // File Type Permissions
     $types = array();
     if ($filetypes) {
         $filetypes = preg_split('/(, |,)/', $filetypes, -1, PREG_SPLIT_NO_EMPTY);
         if (is_array($filetypes)) {
             foreach ($filetypes as $type) {
                 $types[] = strtolower(str_replace(array('.', ' '), '', $type));
             }
         }
     }
     if ($filegroups) {
         $groups = preg_split('/(, |,)/', strtolower(str_replace(' ', '', $filegroups)), -1, PREG_SPLIT_NO_EMPTY);
         foreach ($get->filegroups as $group => $discard) {
             if (in_array($group, $groups)) {
                 $types = array_merge($types, $get->filegroups[$group][2]);
             }
         }
     }
     if (count($types) > 0) {
         $types = array_unique($types);
         asort($types);
         $filetypes = '["' . implode('", "', $types) . '"]';
     } else {
         $filetypes = false;
     }
     $permitted = ($filetypes || $filegroups) && $action == 'permit' ? $filetypes : 'false';
     $prohibited = ($filetypes || $filegroups) && $action == 'prohibit' ? $filetypes : 'false';
     // Configure Settings
     $name = $name ? $name : "ssfa-meta-container-{$uid}";
     $width = is_numeric(preg_replace('[\\D]', '', $width)) ? preg_replace('[\\D]', '', $width) : '100';
     $width = "width:{$width}{$perpx};";
     if ($width == '100' && $perpx == '%') {
         $align = 'none';
     }
     $clearfix = $align == 'none' ? '<div class="ssfa-clearfix"></div>' : null;
     $float = ' float:' . $align . ';';
     $margin = $width !== 'width:100%;' ? $align === 'right' ? ' margin-left:15px;' : ' margin-right:15px;' : null;
     $inlinestyle = $width . $float . $margin;
     $multiple = $single ? '' : ' multiple=multiple';
     $addfiles = $single ? __('+ Add File', 'file-away') : __('+ Add Files', 'file-away');
     $overwrite = $overwrite == 'true' ? 'true' : 'false';
     $uploadlabel = $uploadlabel ? $uploadlabel : __('File Up &#10138;', 'file-away');
     $pathcheck = $problemchild ? fileaway_utility::replacefirst($start, $install, '') : $start;
     $uploadedby = $uploader ? get_current_user_id() : 0;
     $uploadtype = $uploader ? $uploader : 'false';
     // Configure Max File Size Setting
     $max_file_size = trim(preg_replace('[\\D]', '', $maxsize));
     $max_size_type = trim(strtolower($maxsizetype));
     $max_file_size = is_numeric($max_file_size) ? $max_file_size : 10;
     $max_size_type = in_array($max_size_type, array('k', 'm', 'g')) ? $max_size_type : 'm';
     $ms = $max_file_size . $max_size_type;
     $ms = fileaway_utility::ini(false, true, false, $ms);
     $pms = fileaway_utility::ini('post_max_size');
     $ums = fileaway_utility::ini('upload_max_filesize');
     $maxsize = $pms < $ms ? $pms : $ms;
     $maxsize = $ums < $maxsize ? $ums : $maxsize;
     // Initialize Settings
     $fixedsetting = $fixedlocation ? '"' . $fixed . '"' : 'false';
     $initialize = '<script> ' . 'FileUpConfig[' . $uid . '] = { ' . 'form_id: "ssfa_fileup_form_' . $uid . '", ' . 'uid: ' . $uid . ', ' . 'nonce: "' . wp_create_nonce('fileaway-fileup-nonce') . '", ' . 'container: "' . $name . '", ' . 'table: "' . $theme . '", ' . 'iconcolor: "' . $iconcolor . '", ' . 'maxsize: ' . $maxsize . ', ' . 'permitted: ' . $permitted . ', ' . 'prohibited: ' . $prohibited . ', ' . 'fixed: ' . $fixedsetting . ', ' . 'pathcheck: "' . $pathcheck . '", ' . 'uploader: ' . $uploadedby . ', ' . 'identby: "' . $uploadtype . '", ' . 'overwrite: "' . $overwrite . '", ' . 'loading: "' . fileaway_url . '/lib/img/ajax.gif" ' . '}; ' . '</script>';
     $fadeit = $fadein ? $fadein == 'opacity' ? 'opacity:0;' : 'display:none;' : null;
     if ($fadein) {
         $fadescript = $fadein == 'opacity' ? '.animate({opacity:"1"}, ' . $fadetime . ');' : '.fadeIn(' . $fadetime . ');';
         $initialize .= '<script> jQuery(document).ready(function($){ setTimeout(function(){ $("div#ssfa_fileup_container_' . $uid . '")' . $fadescript . ' }, 1000); }); </script>';
     }
     // Form Output
     if (!is_dir($debugpath)) {
         return current_user_can('administrator') ? __('File Up Admin Notice: The initial directory specified does not exist:', 'file-away') . '<br>' . $debugpath : null;
     }
     $dropdown = $fixedlocation ? null : '<div id="ssfa-fileup-path-container-' . $uid . '" style="display:inline-block; float:left;">' . '<div id="ssfa-fileup-directories-select-container-' . $uid . '">' . '<label for="ssfa-fileup-directories-select-' . $uid . '" ' . 'style="display:block!important; margin-bottom:5px!important; text-align:left;">' . __('Destination Directory', 'file-away') . '</label>' . '<select name="ssfa-fileup-directories-select-' . $uid . '" id="ssfa-fileup-directories-select-' . $uid . '" ' . 'class="chozed-select ssfa-fileup-directories-select" data-placeholder="&nbsp;">' . '<option></option>' . '<option value="' . $start . '">' . $basename . '</option>' . '</select>' . '<br>' . '<div id="ssfa-fileup-action-path-' . $uid . '" style="margin-top:5px; min-height:25px;">' . '<img id="ssfa-fileup-action-ajax-loading-' . $uid . '" src="' . fileaway_url . '/lib/img/ajax.gif" ' . 'style="width:15px; margin:0 0 0 5px!important; box-shadow:none!important; display:none;">' . '</div>' . '</div>' . '</div>';
     $form = $clearfix . '<div id="ssfa_fileup_container_' . $uid . '" class="ssfa_fileup_container ' . $class . '" data-uid="' . $uid . '" data-mn="' . wp_create_nonce('fileaway-manager-nonce') . '" style="' . $inlinestyle . ' ' . $fadeit . '">' . '<form name="ssfa_fileup_form_' . $uid . '" id="ssfa_fileup_form_' . $uid . '" action="javascript:void(0);" enctype="multipart/form-data">' . $path . $dropdown . '<div class="ssfa_fileup_buttons_container" style="text-align:right;">' . '<span class="ssfa_fileup_wrapper" style="text-align:left;">' . '<input type="file" name="ssfa_fileup_files_' . $uid . '[]" id="ssfa_fileup_files_' . $uid . '" ' . 'class="ssfa_hidden_browse"' . $multiple . ' data-uid="' . $uid . '" />' . '<span class="ssfa_add_files">' . $addfiles . '</span>' . '<span id="ssfa_submit_upload_' . $uid . '" data-uid="' . $uid . '">' . $uploadlabel . '</span>' . '</span>' . '</div>' . '</form>' . '<div id="ssfa_fileup_files_container_' . $uid . '" class="ssfa_fileup_files_container"></div>' . '<span id="ssfa_rf_' . $uid . '" style="display:none;"></span>' . '</div>' . $clearfix;
     return $initialize . $form;
 }
Esempio n. 11
0
         $excluded = true;
     }
 }
 if ($excluded) {
     break;
 }
 // DON'T SHOW THUMBNAILS FROM UPLOADED IMAGES
 $excluded = preg_match('/\\d{2,}[Xx]\\d{2,}\\./', $file) ? true : false;
 if ($excluded) {
     break;
 }
 $excluded = !$manager && fileaway_utility::startswith(fileaway_utility::basename($file), '_thumb_') ? true : false;
 if ($excluded) {
     break;
 }
 $excluded = !$manager && fileaway_utility::startswith(fileaway_utility::basename($file), 'fa-feed-logo') ? true : false;
 if ($excluded) {
     break;
 }
 // ONLY INCLUDE THESE
 if ($only) {
     $onlyinclude = 0;
     $onlyincs = preg_split('/(, |,)/', $only, -1, PREG_SPLIT_NO_EMPTY);
     if (is_array($onlyincs)) {
         foreach ($onlyincs as $onlyinc) {
             if (strripos("{$file}", "{$onlyinc}") !== false) {
                 $onlyinclude = 1;
                 break;
             }
         }
     }
 public function sc($atts)
 {
     if (isset($atts['style'])) {
         $atts['theme'] = $atts['style'];
     }
     $get = new fileaway_definitions();
     extract($get->pathoptions);
     extract($this->correct(wp_parse_args($atts, $this->fileaway_values), $this->shortcodes['fileaway_values']));
     if ($devices == 'mobile' && !$get->is_mobile) {
         return;
     } elseif ($devices == 'desktop' && $get->is_mobile) {
         return;
     }
     if (!fileaway_utility::visibility($hidefrom, $showto)) {
         return;
     }
     if ($this->op['javascript'] == 'footer') {
         $GLOBALS['fileaway_add_scripts'] = true;
     }
     if ($this->op['stylesheet'] == 'footer') {
         $GLOBALS['fileaway_add_styles'] = true;
     }
     include fileaway_dir . '/lib/inc/inc.values-declarations.php';
     global $is_IE, $is_safari;
     $uid = rand(0, 9999);
     $name = "ssfa-meta-container-{$uid}";
     $randcolor = array("red", "green", "blue", "brown", "black", "orange", "silver", "purple", "pink");
     $paginated = $paginate ? " data-page-navigation='.ssfa-pagination'" : null;
     $pagearea = $paginate ? "<div class='ssfa-pagination ssfa-pagination-centered hide-if-no-paging'></div>" : null;
     $pagesized = $paginate ? " data-page-size='{$pagesize}'" : null;
     $page = $paginate ? $paginated . $pagesized : "{$paginated} data-page-size='100000'";
     $theme = "ssfa-{$theme}";
     $textalign = $textalign ? ' ssfa-' . $textalign : null;
     $width = preg_replace('[\\D]', '', $width);
     $width = $width ? "width:{$width}{$perpx};" : null;
     $float = " float:{$align};";
     $margin = $width !== 'width:100%;' ? $align === 'right' ? ' margin-left:15px;' : ' margin-right:15px;' : null;
     $howshouldiputit = $width . $float . $margin;
     if ($width == '100' && $perpx == '%') {
         $align = 'none';
     }
     $clearfix = $align == 'none' ? "<div class='ssfa-clearfix'></div>" : null;
     include fileaway_dir . '/lib/inc/inc.base.php';
     extract(fileaway_utility::dynamicpaths($dir, $playbackpath));
     $makedir = $makecsv ? true : $makedir;
     $dir = rtrim($dir, '/');
     if (!is_dir("{$dir}") && $makedir && (!$private_content || $private_content && $logged_in)) {
         if (mkdir($rootpath . $dir, 0775, true)) {
             fileaway_utility::indexmulti($rootpath . $dir, $chosenpath);
         }
     }
     if (!is_dir("{$dir}")) {
         return;
     }
     $nonce = wp_create_nonce('fileaway-values-nonce');
     $start = "{$dir}";
     if ($filename) {
         if (!fileaway_utility::endswith(strtolower($filename), '.csv')) {
             $filename = $filename . '.csv';
         }
         $filename = str_replace('fa-userid', $fa_userid, $filename);
         $filename = str_replace('fa-userrole', $fa_userrole, $filename);
         $filename = str_replace('fa-firstlast', $fa_firstlast, $filename);
         $filename = str_replace('fa-username', $fa_username, $filename);
         if (stripos($filename, 'fa-usermeta(') !== false) {
             $umetas = array();
             $countmetas = preg_match_all('/\\((.*)\\)/U', $filename, $umetas);
             if (is_array($umetas[1])) {
                 foreach ($umetas[1] as $umeta) {
                     $metavalue = get_user_meta($fa_userid, $umeta, true);
                     if (!$metavalue || $metavalue == '') {
                         $makecsv = false;
                     }
                     $filename = str_ireplace('fa-usermeta(' . $umeta . ')', $metavalue, $filename);
                 }
             }
         }
         $showoptions = false;
         if (!is_file($rootpath . $dir . '/' . $filename) && $makecsv) {
             $csv = new fileaway_csv();
             $csv->encoding($read, $write);
             $rows = array();
             $cols = array();
             $csv->titles = preg_split('/(, |,)/', $makecsv, -1, PREG_SPLIT_NO_EMPTY);
             foreach ($csv->titles as $header) {
                 $cols[$header] = '';
             }
             $rows[0] = $cols;
             $csv->data = $rows;
             $csv->save($rootpath . $dir . '/' . $filename);
         }
     } else {
         if ($recursive) {
             $globaldirexes = array();
             $localdirexes = array();
             if ($excludedirs) {
                 $localdirexes = preg_split('/(, |,)/', $excludedirs, -1, PREG_SPLIT_NO_EMPTY);
             }
             if ($this->op['direxclusions']) {
                 $globaldirexes = preg_split('/(, |,)/', $this->op['direxclusions'], -1, PREG_SPLIT_NO_EMPTY);
             }
             if (!is_array($globaldirexes)) {
                 $globaldirexes = array();
             }
             if (!is_array($localdirexes)) {
                 $localdirexes = array();
             }
             $direxes = array_unique(array_merge($localdirexes, $globaldirexes));
             $excludedirs = count($direxes) > 0 ? $direxes : false;
             if ($onlydirs) {
                 $onlydirs = $dir . ',' . rtrim($onlydirs);
             }
             $justthesedirs = $onlydirs ? preg_split('/(, |,)/', $onlydirs, -1, PREG_SPLIT_NO_EMPTY) : 0;
             $onlydirs = is_array($justthesedirs) && count($justthesedirs) > 0 ? $justthesedirs : 0;
         }
         $selected = false;
         $showoptions = false;
         if (isset($_REQUEST['fa_csv']) && isset($_REQUEST['fa_index'])) {
             $selected = $_GET['fa_csv'];
             $filename = base64_decode($selected);
             $file_index = $_GET['fa_index'];
             $selected = fileaway_utility::querystring(get_permalink(), $_SERVER['QUERY_STRING'], array('fa_csv' => $selected, 'fa_index' => $file_index));
         }
         $dir = rtrim($dir, '/');
         $files = $recursive ? fileaway_utility::recursefiles($dir, $onlydirs, $excludedirs, '[cC][sS][vV]') : glob("{$dir}/*.[cC][sS][vV]");
         if (!$editor && !is_array($files)) {
             return;
         }
         $count = count($files);
         if ($count !== 1) {
             $showoptions = true;
         } elseif ($count === 1) {
             $showoptions = false;
             $filename = fileaway_utility::basename($files[0]);
             $file_index = 0;
             $dir = $recursive ? str_replace($filename, '', $files[0]) : $dir;
             $dir = rtrim($dir, '/');
         }
         if ($showoptions) {
             $options = array();
             $original_url = fileaway_utility::querystring(get_permalink(), $_SERVER['QUERY_STRING'], array('fa_csv', 'fa_index'), true);
             if (is_array($files)) {
                 foreach ($files as $key => $file) {
                     if (isset($file_index) && $file_index == $key) {
                         $dir = $recursive ? str_replace(fileaway_utility::basename($file), '', $file) : $dir;
                         $dir = rtrim($dir, '/');
                     }
                     $is_selected = $file === $dir . '/' . $filename ? 'selected' : null;
                     $link = fileaway_utility::querystring(get_permalink(), $_SERVER['QUERY_STRING'], array('fa_csv' => base64_encode(fileaway_utility::basename($file)), 'fa_index' => $key));
                     $option_display = $recursive ? $install ? fileaway_utility::replacefirst($file, $install, '') : $file : preg_replace('/.csv$/i', '', fileaway_utility::basename($file));
                     $option_display = $recursive ? str_replace('/', ' &gt; ', $option_display) : $option_display;
                     $options[] = '<option value="' . $link . '" ' . $is_selected . '>' . trim($option_display, '/') . '</option>';
                 }
             }
             $download_link = $filename && isset($file_index) && array_key_exists($file_index, $files) ? '<a href="' . fileaway_utility::urlesc($url . '/' . $dir . '/' . $filename) . '" ' . 'style="text-decoration:none!important; position:relative; top:4px; left:10px;" ' . 'class="ssfa-csv-download" download="' . $filename . '">' . '<span class="ssfa-icon-arrow-down-2" style="font-size:18px; color: #AAA;"></span>' . '</a>' : null;
             $is_recursive = $recursive ? 'true' : 'false';
             $deletecsv = $editor && isset($file_index) && array_key_exists($file_index, $files) ? '<span id="ssfa-delete-csv-' . $uid . '" style="font-size:18px; position:relative; top:4px; left:20px; color:#AAA; cursor:pointer;" ' . 'class="ssfa-icon-remove" aria-hidden="true" data-uid="' . $uid . '"></span>' : null;
             $newcsvspace = $deletecsv == null ? 10 : 30;
             $newcsv = $editor ? '<span id="ssfa-new-csv-' . $uid . '" style="font-size:18px; position:relative; top:4px; left:' . $newcsvspace . 'px; color:#AAA; cursor:pointer;" ' . 'class="ssfa-icon-file-4" aria-hidden="true" data-uid="' . $uid . '" data-pg="' . $GLOBALS['post']->ID . '" data-path="' . base64_encode($dir) . '" ' . 'data-recurse="' . $is_recursive . '" data-read="' . $read . '" data-write="' . $write . '"></span>' : null;
             $select = "<div class='ssfa-clearfix' style='float:left; margin-bottom:15px;'>" . "<div id='ssfa-fileaway-values-{$uid}' style='text-align:left;'>" . "<div style='text-align:left; margin-top:5px;'>" . "<select class='chozed-select ssfa-fileaway-values-select' id='ssfa-fileaway-values-select-{$uid}' " . "data-placeholder=\"{$placeholder}\">" . "<option></option>" . implode(' ', $options) . "</select>" . $download_link . $deletecsv . $newcsv . "</div>" . "</div>" . "</div>";
             $selectscript = "<script>" . "jQuery(document).ready(function(\$){ " . "var select = \$('select#ssfa-fileaway-values-select-{$uid}'); " . "\$(select).chozed({ " . "allow_single_deselect:true, " . "width: '300px', " . "inherit_select_classes:true, " . "no_results_text: fileaway_mgmt.no_results, " . "search_contains: true " . "}); " . "\$(select).on('change', function(){ " . "var shadow = \$('<div id=\"ssfa-values-shadow\" style=\"display:none;\" />'); " . "\$('body').append(shadow); " . "shadow.fadeIn(1000); " . "\$('body').css('cursor', 'progress'); " . "if(\$(this).val() == '') window.location.href = \"" . $original_url . "\"; " . "else window.location.href = \$(this).val(); " . "}); " . "}); " . "</script>";
         }
     }
     if (!$filename && !$showoptions) {
         return 'No file found.';
     }
     $edit = $editor ? 'true' : 'false';
     $mobileclass = $get->is_mobile ? 'ssfa-mobile' : null;
     $thefiles .= $clearfix . "<div id='{$name}' class='ssfa-meta-container ssfa-fileaway-values {$mobileclass}' data-editor='{$edit}' data-uid='{$uid}' data-fvn=\"" . $nonce . "\" style='opacity:0; margin: 10px 0 20px; {$howshouldiputit}'>";
     if ($filename && is_file($rootpath . $dir . '/' . $filename)) {
         $disablesort = $sorting ? false : "data-sort='false'";
         $heading = $showoptions ? $select : '<a href="' . fileaway_utility::urlesc($url . '/' . $dir . '/' . $filename) . '" download="' . $filename . '" ' . 'style="text-decoration:none; color:inherit!important;">' . $filename . '</a>';
         include fileaway_dir . '/lib/inc/inc.precontent.php';
         $thefiles .= "<script type='text/javascript'>jQuery(function(){ jQuery('.footable').footable();});</script>" . "<table id='ssfa-table-{$uid}' class='ssfa-values-table footable ssfa-sortable {$theme} {$textalign}' data-filter='#filter-{$uid}' data-uid='{$uid}' " . "data-theme=\"{$theme}\" data-src=\"" . base64_encode($dir . '/' . $filename) . "\" data-filename=\"" . fileaway_utility::basename($filename) . "\" " . "data-read=\"{$read}\" data-write=\"{$write}\" {$disablesort} {$page}>" . "<thead><tr>";
         ini_set('auto_detect_line_endings', TRUE);
         $filename = $rootpath . $dir . '/' . $filename;
         if (file_exists($filename) && is_readable($filename)) {
             $csv = new fileaway_csv();
             $csv->encoding($read, $write);
             $csv->auto($filename);
             $rows = $csv->data;
             $headers = $csv->titles;
             $editorcursor = $editor ? 'style="cursor:cell"' : null;
             $editorcontext = $editor ? 'class="ssfa-values-context"' : null;
             foreach ($headers as $key => $header) {
                 $sortinitial = $key < 1 ? " data-sort-initial='true'" : null;
                 $initialclass = $key < 1 ? 'class="' . $theme . '-first-column"' : null;
                 $thefiles .= "<th id='ssfa-values-header-{$uid}-{$key}' {$initialclass} data-colnum=\"{$key}\" data-col=\"{$header}\" {$sortinitial}>" . $header . "</th>";
             }
             $thefiles .= "</tr></thead><tfoot><tr><td colspan='100'>{$pagearea}</td></tr></tfoot><tbody>";
             foreach ($rows as $k => $row) {
                 $thefiles .= "<tr id='ssfa-values-{$uid}-{$k}' {$editorcontext}  data-row='{$k}'>";
                 foreach ($headers as $key => $header) {
                     $col1class = $key < 1 ? "class='{$theme}-first-column'" : null;
                     $input = $editor ? '<input type="text" id="input-ssfa-values-' . $uid . '-' . $k . '-' . $key . '" data-row="' . $k . '" data-col="' . $header . '" data-colnum="' . $key . '" ' . 'value="' . $row[$header] . '" style="display:none; width:90%">' : null;
                     $thefiles .= '<td id="cell-ssfa-values-' . $uid . '-' . $k . '-' . $key . '" ' . $col1class . ' ' . $editorcursor . '>' . '<span id="value-ssfa-values-' . $uid . '-' . $k . '-' . $key . '" data-row="' . $k . '" data-col="' . $header . '" data-colnum="' . $key . '">' . $row[$header] . '</span>&nbsp;' . $input . '</td>';
                 }
                 $thefiles .= "</tr>";
             }
             $thefiles .= "</tbody></table></div>";
         }
     } elseif ($showoptions) {
         $thefiles .= $select;
     }
     $thefiles .= $showoptions ? $selectscript : null;
     $thefiles .= "<script> jQuery(document).ready(function(\$){ setTimeout(function(){ \$('div#" . $name . "').animate({opacity:'1'},1000); }, 1000 ); }); </script>";
     $thefiles .= "</div>{$clearfix}";
     return $thefiles;
 }
Esempio n. 13
0
    $thetime = $times[$k];
    $file = $full;
    $total = $totals[$k];
    $iss2 = false;
    include fileaway_dir . '/lib/inc/inc.prettify.php';
    if ($thename == '') {
        continue;
    }
    include fileaway_dir . '/lib/inc/inc.colors.php';
    $datemodified = $mod == 'yes' ? "<div class='ssfa-datemodified'>" . sprintf(_x('Last modified %s at %s', 'For List Types: *Date* at *Time*', 'file-away'), $date, $time) . "</div>" : null;
    $listfilesize = $size != 'no' ? $theme == 'ssfa-minimal-list' ? "<span class='ssfa-listfilesize'>({$fsize})</span>" : "<span class='ssfa-listfilesize'>{$fsize}</span>" : null;
    if ($s2mem && strpos($dir, 's2member-files') !== false) {
        $iss2 = true;
        $s2skip = $s2skipconfirm ? '&s2member_skip_confirmation' : '';
        $sub = fileaway_utility::replacefirst($rootpath . $dir, WP_PLUGIN_DIR . '/s2member-files/', '');
        $link = $s2mem && strpos($dir, 's2member-files') !== false ? $url . '/?s2member_file_download=' . $sub . $file . $s2skip : $link;
    }
    $link = $encryption && !$iss2 ? $encrypt->url($rootpath . $dir . '/' . $file) : $link;
    $fulllink = 'href="' . $link . '"';
    $statstatus = $stats ? 'true' : 'false';
    $fulllink = $redirect ? 'href="' . $this->op['redirect'] . '"' : $fulllink;
    include fileaway_dir . '/lib/inc/inc.icons.php';
    $linktype = $iss2 || $encryption ? '' : $linktype;
    $linktype = $redirect ? 'target="_blank"' : $linktype;
    if ($flightbox && !fileaway_utility::startswith($file, '_thumb_')) {
        include fileaway_dir . '/lib/inc/inc.flightbox.php';
    }
    $thename = "<span class='ssfa-filename'>" . fileaway_utility::strtotitle($thename) . "</span>";
    $count++;
    $thefiles .= "<a id='ssfa-{$uid}-{$count}' class='{$display}{$noicons}{$colors}' {$fulllink} {$linktype} data-stat='{$statstatus}'>" . "<div class='ssfa-listitem {$ellipsis}'>" . "<span class='ssfa-topline'>{$icon} {$thename} {$listfilesize}</span> " . "{$total}" . "{$datemodified}" . "</div>" . "</a>";
}
Esempio n. 14
0
                        $subini = parse_ini_file($inilocation);
                        $subfeedid = $subini['id'];
                        $subfeedfile = $rootpath . trim($this->op['feeds'], '/') . '/_feed_' . $subfeedid . '.xml';
                        if (is_file($subfeedfile)) {
                            $subfeedurl = fileaway_utility::replacefirst($subfeedfile, $rootpath, rtrim($this->op['baseurl'], '/') . '/');
                            $subrsslink = '<span class="ssfa-rssmini ' . $dir_colors . '" data-href="' . $subfeedurl . '">rss</span>';
                        }
                    }
                }
                $dirtext = $subrsslink ? null : _x('dir', 'abbrv. of *directory*', 'file-away');
                $folder = str_replace("{$dir}" . '/', '', "{$folder}");
                $prettyfolder = str_replace(array('~', '--', '_', '.', '*'), ' ', "{$folder}");
                $prettyfolder = preg_replace('/(?<=\\D)-(?=\\D)/', ' ', "{$prettyfolder}");
                $prettyfolder = preg_replace('/(?<=\\D)-(?=\\d)/', ' ', "{$prettyfolder}");
                $prettyfolder = preg_replace('/(?<=\\d)-(?=\\D)/', ' ', "{$prettyfolder}");
                $prettyfolder = fileaway_utility::strtotitle($prettyfolder);
                $dpath = ltrim("{$dlink}", '/');
                $dlink = str_replace('/', '*', "{$dpath}");
                $managedir = $manager && $dirman ? "<a href='' id='rename-ssfa-dir-{$uid}-{$f}'>" . __('Rename', 'file-away') . "</a><br>" . "<a href='' id='delete-ssfa-dir-{$uid}-{$f}'>" . __('Delete', 'file-away') . "</a></td>" : ' &nbsp; ';
                $renamedir = $manager && $dirman ? '<input id="rename-ssfa-dir-' . $uid . '-' . $f . '" type="text" value="' . $folder . '" ' . 'style="width:90%; text-align:center; display:none">' : null;
                $thefiles .= "<tr id='ssfa-dir-{$uid}-{$f}' class='ssfa-drawers'>" . "<td id='folder-ssfa-dir-{$uid}-{$f}' data-value=\"# # # # # {$folder}\" class='ssfa-sorttype {$theme}-first-column'>" . "<a href=\"" . fileaway_utility::querystring(get_permalink(), $_SERVER["QUERY_STRING"], array("drawer" . $drawerid => $dlink)) . "\" data-name=\"" . $folder . "\" data-path=\"" . $dpath . "\">" . "<span style='font-size:20px; margin-left:3px;' class='ssfa-faminicon ssfa-icon-{$drawericon} {$dir_icocol}' aria-hidden='true'></span>" . "<br>" . $dirtext . "</a>" . $subrsslink . "</td>" . "<td id='name-ssfa-dir-{$uid}-{$f}' data-value=\"# # # # # {$folder}\" class='ssfa-sortname'>" . "<a href=\"" . fileaway_utility::querystring(get_permalink(), $_SERVER["QUERY_STRING"], array("drawer" . $drawerid => $dlink)) . "\" class=\"{$dir_colors}\">" . "<span class='ssfa-filename' style='text-transform:uppercase;'>{$prettyfolder}</span>" . "</a>" . $renamedir . "</td>";
                $icell = 0;
                foreach ($cells as $cell) {
                    $icell++;
                    $thefiles .= $icell < $ccell ? "<td class='{$theme}' data-value=\"# # # #  {$folder}\"> &nbsp; </td>" : "<td id='manager-ssfa-dir-{$uid}-{$f}' class='{$theme}' data-value=\"# # # #  {$folder}\">{$managedir}</td>";
                }
                $thefiles .= "</tr>";
            }
        }
    }
}
Esempio n. 15
0
 public function sc($atts)
 {
     if (isset($atts['style'])) {
         $atts['theme'] = $atts['style'];
     }
     $get = new fileaway_definitions();
     extract($get->pathoptions);
     extract($this->correctatts(wp_parse_args($atts, $this->attachaway), $this->shortcodes['attachaway'], 'attachaway'));
     if ($devices == 'mobile' && !$get->is_mobile) {
         return;
     } elseif ($devices == 'desktop' && $get->is_mobile) {
         return;
     }
     if (!fileaway_utility::visibility($hidefrom, $showto)) {
         return;
     }
     if ($this->op['javascript'] == 'footer') {
         $GLOBALS['fileaway_add_scripts'] = true;
     }
     if ($this->op['stylesheet'] == 'footer') {
         $GLOBALS['fileaway_add_styles'] = true;
     }
     $attachaway = true;
     $statstatus = 'false';
     $iss2 = false;
     $rsslink = null;
     $crumbies = null;
     $clearfix = $align == 'none' ? "<div class='ssfa-clearfix'></div>" : null;
     $boximages = array();
     $flightbox = $get->is_mobile ? false : $flightbox;
     $randcolor = array("red", "green", "blue", "brown", "black", "orange", "silver", "purple", "pink");
     $fb = 0;
     $count = 0;
     $thefiles = '';
     $uid = rand(0, 9999);
     global $post, $is_IE, $is_safari;
     $ascdesc = $desc ? 'DESC' : 'ASC';
     $id = $postid ? $postid : $post->ID;
     $attachments = get_posts(array('orderby' => $orderby, 'order' => $ascdesc, 'post_type' => 'attachment', 'posts_per_page' => -1, 'post_parent' => $id));
     if ($debug === 'on' && is_user_logged_in()) {
         return $this->debug($id, $attachments);
     }
     include fileaway_dir . '/lib/inc/inc.styles.php';
     $fadeit = $fadein ? $fadein == 'opacity' ? 'opacity:0;' : 'display:none;' : null;
     if ($fadein) {
         $fadescript = $fadein == 'opacity' ? '.animate({opacity:"1"}, ' . $fadetime . ');' : '.fadeIn(' . $fadetime . ');';
         $thefiles .= '<script> jQuery(document).ready(function($){ setTimeout(function(){ $("div#ssfa-meta-container-' . $uid . '")' . $fadescript . ' }, 1000); }); </script>';
     }
     $mobileclass = $get->is_mobile ? 'ssfa-mobile' : null;
     $flightbox_nonce = !empty($flightbox) ? 'data-fbn="' . wp_create_nonce('fileaway-flightbox-nonce') . '"' : '';
     $flightbox_class = !empty($flightbox) ? 'flightbox-parent' : '';
     $thefiles .= "{$clearfix}<div id='ssfa-meta-container-{$uid}' data-uid='{$uid}' " . "{$flightbox_nonce} class='ssfa-meta-container {$mobileclass} {$class} {$flightbox_class}' style='margin: 10px 0 20px; {$fadeit} {$howshouldiputit}'>";
     include fileaway_dir . '/lib/inc/inc.precontent.php';
     if ($type === 'table') {
         $typesort = null;
         $filenamesort = null;
         $capsort = null;
         $dessort = null;
         $sizesort = null;
         if ($sortfirst === 'type') {
             $typesort = " data-sort-initial='true'";
         } elseif ($sortfirst === 'type-desc') {
             $typesort = " data-sort-initial='descending'";
         } elseif ($sortfirst === 'filename') {
             $filenamesort = " data-sort-initial='true'";
         } elseif ($sortfirst === 'filename-desc') {
             $filenamesort = " data-sort-initial='descending'";
         } elseif ($sortfirst === 'caption') {
             $capsort = " data-sort-initial='true'";
         } elseif ($sortfirst === 'caption-desc') {
             $capsort = " data-sort-initial='descending'";
         } elseif ($sortfirst === 'description') {
             $dessort = " data-sort-initial='true'";
         } elseif ($sortfirst === 'description-desc') {
             $dessort = " data-sort-initial='descending'";
         } elseif ($sortfirst === 'size') {
             $sizesort = " data-sort-initial='true'";
         } elseif ($sortfirst === 'size-desc') {
             $sizesort = " data-sort-initial='descending'";
         } else {
             $filenamesort = " data-sort-initial='true' ";
         }
         $disablesort = $sortfirst == 'disabled' ? "data-sort='false'" : false;
         $filenamesort = $disablesort ? null : $filenamesort;
         $filenamelabel = $filenamelabel ? $filenamelabel : _x('File&nbsp;Name', 'File Name Column', 'file-away');
         $thefiles .= "<script type='text/javascript'>jQuery(function(){jQuery('.footable').footable();});</script>" . "<table id='ssfa-table' data-filter='#filter-{$uid}' {$disablesort} {$page} class='footable ssfa-sortable {$theme}{$textalign}'><thead><tr>" . "<th class='ssfa-sorttype {$theme}-first-column' title=\"" . _x('Click to Sort', 'Column Sort Message', 'file-away') . "\"" . $typesort . ">" . _x('Type', 'File Type Column', 'file-away') . "</th>" . "<th class='ssfa-sortname' title=\"" . _x('Click to Sort', 'Column Sort Message', 'file-away') . "\"" . $filenamesort . ">" . $filenamelabel . "</th>";
         $thefiles .= $capcolumn ? "<th class='ssfa-sortcapcolumn' title=\"" . _x('Click to Sort', 'Column Sort Message', 'file-away') . "\"" . $capsort . ">" . $capcolumn . "</th>" : null;
         $thefiles .= $descolumn ? "<th class='ssfa-sortdescolumn' title=\"" . _x('Click to Sort', 'Column Sort Message', 'file-away') . "\"" . $dessort . ">" . $descolumn . "</th>" : null;
         $thefiles .= $size !== 'no' ? "<th class='ssfa-sortsize' data-type='numeric' title=\"" . _x('Click to Sort', 'Column Sort Message', 'file-away') . "\"" . $sizesort . ">" . _x('Size', 'File Size Column', 'file-away') . "</th>" : null;
         $thefiles .= "</tr></thead><tfoot><tr><td colspan='100'>{$pagearea}</td></tr></tfoot><tbody>";
     }
     if (is_array($attachments)) {
         foreach ($attachments as $attachment) {
             extract(fileaway_utility::getattachment($attachment->ID));
             $filetype = wp_check_filetype($filelink);
             $ext = $filetype['ext'];
             $extension = $ext;
             $oext = $ext;
             $basename = fileaway_utility::basename($filelink);
             $rawname = str_replace('.' . $ext, '', $basename);
             $filename = str_replace(array('~', '-', '--', '_', '.', '*'), ' ', $rawname);
             $title = $title ? $title : $filename;
             if ($caption === strtoupper($caption) || $caption === strtolower($caption)) {
                 $caption = fileaway_utility::sentencecase($caption);
             }
             if ($description === strtoupper($description) || $description === strtolower($description)) {
                 fileaway_utility::sentencecase($description);
             }
             $title = "<span class='ssfa-filename'>" . fileaway_utility::strtotitle(strtolower($title)) . "</span>";
             $ext = !$ext ? '?' : $ext;
             $ext = strtolower($ext);
             $ext = substr($ext, 0, 4) . '';
             $bytes = filesize(get_attached_file($attachment->ID));
             if ($size !== 'no') {
                 $fsize = fileaway_utility::formatBytes($bytes, 1);
                 $fsize = !preg_match('/[a-z]/i', $fsize) ? '1k' : ($fsize === 'NAN' ? '0' : $fsize);
             }
             include fileaway_dir . '/lib/inc/inc.colors.php';
             $listfilesize = $type !== 'table' && $size !== 'no' ? $theme === "ssfa-minimal-list" ? "<span class='ssfa-listfilesize'> ({$fsize})</span>" : "<span class='ssfa-listfilesize'>{$fsize}</span>" : null;
             $file = $basename;
             $manager = false;
             $onlyaudio = false;
             include fileaway_dir . '/lib/inc/inc.filters.php';
             if ($excluded) {
                 continue;
             }
             $getthumb = false;
             $thumbnails = false;
             include fileaway_dir . '/lib/inc/inc.icons.php';
             $count += 1;
             $link = $filelink;
             $fulllink = 'href="' . $link . '"';
             if ($flightbox) {
                 include fileaway_dir . '/lib/inc/inc.flightbox.php';
             }
             if ($type !== 'table') {
                 $thefiles .= "<a id='ssfa' class='{$display}{$noicons}{$colors}' {$fulllink} {$linktype}>" . "<div class='ssfa-listitem {$ellipsis}'><span class='ssfa-topline'>{$icon} {$title} {$listfilesize}</span></div>" . "</a>";
             } else {
                 $thefiles .= "<tr><td id='filetype-ssfa-file-{$uid}-{$count}' class='ssfa-sorttype {$theme}-first-column'><a {$fulllink} {$linktype}>{$icon} {$ext}</a></td>" . "<td id='filename-ssfa-file-{$uid}-{$count}' class='ssfa-sortname'><a {$fulllink} class='{$colors}' {$linktype}>{$title}</a></td>";
                 $thefiles .= $capcolumn ? "<td class='ssfa-sortcapcolumn'>{$caption}</td>" : null;
                 $thefiles .= $descolumn ? "<td class='ssfa-sortdescolumn'>{$description}</td>" : null;
                 $thefiles .= $size !== 'no' ? "<td class='ssfa-sortsize' data-value='{$bytes}'>{$fsize}</td>" : null;
                 $thefiles .= '</tr>';
             }
         }
         $thefiles .= $type === 'table' ? '</tbody></table></div>' : '</div>';
         $thefiles .= "</div>{$clearfix}";
     }
     if ($flightbox && $fb) {
         $thefiles .= '<script>FlightBoxes[' . $uid . '] = ' . $fb . '; ';
         if (count($boximages) > 0) {
             $thefiles .= implode(' ', $boximages);
         }
         $thefiles .= '</script>';
     }
     return $count > 0 ? $thefiles : null;
 }
Esempio n. 16
0
             $header = $row;
         } else {
             if (count($header) > count($row)) {
                 $difference = count($header) - count($row);
                 for ($i = 1; $i <= $difference; $i++) {
                     $row[count($row) + 1] = ',';
                 }
             }
             $dynamiclinks[] = array_combine($header, $row);
         }
     }
     fclose($handle);
 }
 foreach ($dynamiclinks as $dl) {
     if (isset($dl['URL']) && (preg_match('/[a-z]/i', $dl['URL']) || preg_match('/\\d/', $dl['URL']))) {
         $finalname = isset($dl['FILENAME']) && (preg_match('/[a-z]/i', $dl['FILENAME']) || preg_match('/\\d/', $dl['FILENAME'])) ? $dl['FILENAME'] : str_replace('.', '', fileaway_utility::basename($dl['URL']));
         $youtube = preg_match('#^https?://(?:www\\.)?(?:youtube\\.com/watch|youtu\\.be/)#', $dl['URL']) ? true : false;
         $vimeo = preg_match('#vimeo.com/#', $dl['URL']) ? true : false;
         $ext = $youtube ? 'tube' : ($vimeo ? 'vmeo' : 'link');
         $exts[] = $ext;
         $locs[] = $locs[$parser];
         $fulls[] = $finalname . '.' . $ext;
         $rawnames[] = $finalname;
         $links[] = $dl['URL'];
         $dirs[] = $dirs[$parser];
         $times[] = $times[$parser];
         $bannerads[] = false;
         $dynamics[] = true;
     }
 }
 unset($exts[$parser]);
Esempio n. 17
0
            }
            $banners[] = array_combine($header, $row);
        }
    }
    fclose($handle);
}
foreach ($banners as $banner) {
    if (isset($banner['URL']) && (preg_match('/[a-z]/i', $banner['URL']) || preg_match('/\\d/', $banner['URL'])) && isset($banner['FILENAME']) && is_file($rootpath . $bannerpath . '/' . $banner['FILENAME'])) {
        $image = $url . '/' . $bannerpath . '/' . $banner['FILENAME'];
        $slices = fileaway_utility::pathinfo($image);
        $extension = isset($slices['extension']) ? $slices['extension'] : false;
        $allbanners['exts'][] = $extension;
        $allbanners['locs'][] = $slices['dirname'];
        $allbanners['fulls'][] = $slices['basename'];
        $allbanners['rawnames'][] = $slices['filename'];
        $allbanners['links'][] = fileaway_utility::urlesc($banner['URL']);
        $allbanners['dirs'][] = $bannerpath;
        $allbanners['times'][] = $now;
        $allbanners['dynamics'][] = false;
        $allbanners['bannerads'][] = true;
    }
}
if (isset($allbanners['rawnames']) && count($allbanners['rawnames'] > 0)) {
    $numbanners = $fcount < $bannerize ? 1 : (int) round($fcount / $bannerize, 0);
    if ($numbanners > count($allbanners['rawnames'])) {
        $numbanners = count($allbanners['rawnames']);
    }
    $getbanners = array_rand($allbanners['rawnames'], $numbanners);
    $inc = $bannerize;
    $rement = $inc;
    if (is_array($getbanners)) {
Esempio n. 18
0
    $crumbs = array();
}
$crumblink = array();
$addclass = !$heading ? ' ssfa-crumbs-noheading' : null;
$crumbies = "<div class='ssfa-clearfix ssfa-crumbs{$addclass}'>{$rsslink}";
$rsslink = null;
foreach ($crumbs as $k => $crumb) {
    $crumblink[$k] = '';
    $prettycrumb = str_replace(array('~', '--', '_', '.', '*'), ' ', $crumb);
    $prettycrumb = preg_replace('/(?<=\\D)-(?=\\D)/', ' ', $prettycrumb);
    $prettycrumb = preg_replace('/(?<=\\d)-(?=\\D)/', ' ', $prettycrumb);
    $prettycrumb = preg_replace('/(?<=\\D)-(?=\\d)/', ' ', $prettycrumb);
    $prettycrumb = fileaway_utility::strtotitle($prettycrumb);
    if ($crumb !== '') {
        $i = 0;
        while ($i <= $k) {
            if ($i == 0) {
                $comma = '';
            } else {
                $comma = "*";
            }
            $crumblink[$k] .= $comma . "{$crumbs[$i]}";
            $i++;
        }
        if ($basebase === $basecheck) {
            $crumblink[$k] = ltrim(fileaway_utility::replacefirst("{$crumblink[$k]}", "{$basebase}", ''), '*');
        }
        $crumbies .= '<a href="' . fileaway_utility::querystring(get_permalink(), $_SERVER["QUERY_STRING"], array("drawer" . $drawerid => $crumblink[$k])) . '">' . $prettycrumb . '</a> / ';
    }
}
$crumbies .= "</div>";
Esempio n. 19
0
 public function feeds()
 {
     extract($this->definitions->pathoptions);
     $basedirs = fileaway_utility::feeds();
     $excluded_dirs = fileaway_utility::feeds(true);
     $wp_excludes = array('wp-admin', 'wp-includes', 'wp-content/themes', 'wp-content/upgrade');
     $startswith = array('fa-feed-logo', '_thumb_', 'fileaway-url-parser', 'fileaway-banner-parser', 'index.htm', 'index.php', '.ht');
     $endswith = array('ini', 'php');
     if (isset($this->options['feed_excluded_exts']) && !empty($this->options['feed_excluded_exts'])) {
         $endswith = array_unique(array_merge($endswith, preg_split('/(, |,)/', trim($this->options['feed_excluded_exts']), -1, PREG_SPLIT_NO_EMPTY)));
     }
     $excludestrings = array();
     if (isset($this->options['feed_excluded_files']) && !empty($this->options['feed_excluded_files'])) {
         $excludestrings = preg_split('/(, |,)/', trim($this->options['feed_excluded_files']), -1, PREG_SPLIT_NO_EMPTY);
     }
     if (!isset($this->options['feeds']) || !$this->options['feeds'] || trim($this->options['feeds']) == '' || trim($this->options['feeds']) == '/') {
         return;
     }
     fileaway_utility::timezone();
     $storage = $rootpath . trim(trim($this->options['feeds']), '/');
     if (!is_dir($storage)) {
         if (mkdir($storage, 0775, true)) {
             fileaway_utility::indexmulti($storage, $chosenpath);
         }
     }
     $globallogo = false;
     if (is_file($storage . '/fa-feed-logo.png')) {
         $globallogo = $storage . '/fa-feed-logo.png';
     } elseif (is_file($storage . '/fa-feed-logo.jpg')) {
         $globallogo = $storage . '/fa-feed-logo.jpg';
     } elseif (is_file($storage . '/fa-feed-logo.gif')) {
         $globallogo = $storage . '/fa-feed-logo.gif';
     }
     if ($globallogo) {
         $globallogo = fileaway_utility::urlesc(fileaway_utility::replacefirst($globallogo, rtrim($rootpath, '/'), rtrim($this->options['baseurl'], '/') . '/'));
     }
     $feedlimit = isset($this->options['feedlimit']) && is_numeric($this->options['feedlimit']) ? round($this->options['feedlimit'], 0) : false;
     $hardlinks = array();
     $map = is_file($storage . '/fa-directory-map.csv') ? new fileaway_csv($storage . '/fa-directory-map.csv') : false;
     $now = time();
     foreach ($basedirs as $basedir) {
         $basedir = $rootpath . trim(trim($basedir), '/');
         $dirs = fileaway_utility::recursivedirs($basedir);
         array_unshift($dirs, $basedir);
         $datestring = $this->options['daymonth'] == 'md' ? 'm/d/Y H:i' : 'd/m/Y H:i';
         foreach ($dirs as $k => $dir) {
             foreach ($wp_excludes as $wp) {
                 if (stripos($dir, $wp) !== false) {
                     continue 2;
                 }
             }
             $feedfile = $dir . '/_fa.feed.id.ini';
             if (!is_file($feedfile)) {
                 $feedid = uniqid(true);
                 $feedfile_contents = "; Do not move or delete this file, nor alter its contents \n" . "id = " . $feedid;
                 file_put_contents($feedfile, $feedfile_contents);
             } else {
                 $ini = parse_ini_file($feedfile);
                 $feedid = $ini['id'];
             }
             $feed = $storage . '/_feed_' . $feedid . '.xml';
             if (fileaway_utility::startswith(fileaway_utility::replacefirst($dir, $rootpath, ''), $excluded_dirs)) {
                 if (is_file($feed)) {
                     unlink($feed);
                 }
                 continue;
             }
             $feedlogo = false;
             if (is_file($dir . '/fa-feed-logo.png')) {
                 $feedlogo = $dir . '/fa-feed-logo.png';
             } elseif (is_file($dir . '/fa-feed-logo.jpg')) {
                 $feedlogo = $dir . '/fa-feed-logo.jpg';
             } elseif (is_file($dir . '/fa-feed-logo.gif')) {
                 $feedlogo = $dir . '/fa-feed-logo.gif';
             }
             $feedlogo = $feedlogo ? fileaway_utility::urlesc(fileaway_utility::replacefirst($feedlogo, rtrim($rootpath, '/'), rtrim($this->options['baseurl'], '/') . '/')) : $globallogo;
             $files = array();
             $subxml = array();
             $initfiles = array_filter(glob("{$dir}/*"), 'is_file');
             if ($this->options['recursivefeeds'] == 'true') {
                 $initdirs = glob("{$dir}/*", GLOB_ONLYDIR);
                 if (is_array($initdirs) && count($initdirs) > 0) {
                     foreach ($initdirs as $subdir) {
                         if (in_array(fileaway_utility::replacefirst($subdir, $rootpath, ''), $excluded_dirs)) {
                             continue;
                         }
                         $subfeedfile = $subdir . '/_fa.feed.id.ini';
                         if (!is_file($subfeedfile)) {
                             continue;
                         }
                         $subini = parse_ini_file($subfeedfile);
                         $subfeedid = $subini['id'];
                         $subfeed = $storage . '/_feed_' . $subfeedid . '.xml';
                         if (!is_file($subfeed)) {
                             continue;
                         }
                         $sublink = $map ? $this->csvsearch($map->data, $map->titles, trim(fileaway_utility::replacefirst($subdir, $rootpath, ''), '/')) : false;
                         $sublink = $sublink ? $sublink : fileaway_utility::replacefirst($subfeed, $rootpath, rtrim($this->options['baseurl'], '/') . '/');
                         $subPubDate = $this->options['feeddates'] == 'false' ? null : "<pubDate>" . date($datestring, filemtime($subdir)) . "</pubDate>\n" . ($subxml[] = "<item>\n" . "<title>" . fileaway_utility::basename($subdir) . "</title>\n" . "<link>" . $sublink . "</link>\n" . "<description>RSS Feed</description>\n" . $subPubDate . "</item>\n");
                     }
                 }
             }
             if (is_array($initfiles)) {
                 foreach ($initfiles as $i => $file) {
                     if (fileaway_utility::startswith(fileaway_utility::basename($file), $startswith)) {
                         unset($initfiles[$i]);
                         continue;
                     }
                     if (fileaway_utility::endswith(strtolower(fileaway_utility::basename($file)), $endswith)) {
                         unset($initfiles[$i]);
                         continue;
                     }
                     foreach ($excludestrings as $str) {
                         if (strpos(fileaway_utility::basename($file), $str) !== false) {
                             unset($initfiles[$i]);
                             continue 2;
                         }
                     }
                     $mime = false;
                     $parts = fileaway_utility::pathinfo($file);
                     $ext = strtolower($parts['extension']);
                     if ($this->options['feedlinks'] != 'false') {
                         if (in_array($ext, array('mp3', 'wav', 'ogg'))) {
                             $mime = $ext == 'mp3' ? 'audio/mpeg' : ($ext == 'wav' ? 'audio/vnd.wave' : 'audio/ogg');
                         } elseif (in_array($ext, array('png', 'gif', 'jpg', 'jpeg'))) {
                             $mime = $ext == 'png' ? 'image/png' : ($ext == 'gif' ? 'image/gif' : 'image/jpeg');
                         } elseif (in_array($ext, array('avi', 'mpeg', 'mp4', 'ogv', 'mov', 'webm', 'flv', 'wmv', 'mkv'))) {
                             $mime = $ext == 'avi' ? 'video/avi' : ($ext == 'mp4' ? 'video/mp4' : ($ext == 'flv' ? 'video/x-flv' : ($ext == 'mpeg' ? 'video/mpeg' : ($ext == 'ogv' ? 'video/ogg' : ($ext == 'mov' ? 'video/quicktime' : ($ext == 'webm' ? 'video/webm' : ($ext == 'wmv' ? 'video/x-ms-wmv' : 'video/x-matroska')))))));
                         }
                         if (stripos($file, 's2member-files/')) {
                             $getsub = explode('s2member-files/', fileaway_utility::urlesc($file));
                             $fileurl = rtrim($this->options['baseurl'], '/') . '/?s2member_file_download=' . $getsub[1];
                         } else {
                             $fileurl = fileaway_utility::urlesc(fileaway_utility::replacefirst($file, $rootpath, rtrim($this->options['baseurl'], '/') . '/'));
                         }
                     } else {
                         $fileurl = false;
                     }
                     $files['dirname'][] = $parts['dirname'];
                     $files['basename'][] = $parts['basename'];
                     $files['filename'][] = $parts['filename'];
                     $files['extension'][] = $parts['extension'];
                     $files['mime'][] = $mime;
                     $files['datemodified'][] = $this->options['feeddates'] != 'false' ? filemtime($file) : $now;
                     $files['filesize'][] = $this->options['feedsize'] != 'false' ? filesize($file) : false;
                     $files['url'][] = $fileurl;
                 }
                 if (isset($files['datemodified']) && count($files['datemodified']) > 0) {
                     array_multisort($files['datemodified'], SORT_DESC, SORT_NUMERIC, $files['dirname'], $files['basename'], $files['filename'], $files['extension'], $files['mime'], $files['filesize'], $files['url']);
                 }
                 $directory = explode('/', $dir);
                 $directory = array_pop($directory);
                 $stripped_url = str_ireplace(array('http:', 'https:', 'www.', 'ww2.', '//'), '', rtrim($this->options['baseurl'], '/'));
                 $ttl = $this->options['feedinterval'] == 'fifteenminutes' ? 15 : ($this->options['feedinterval'] == 'thirtyminutes' ? 30 : ($this->options['feedinterval'] == 'fortyfiveminutes' ? 45 : 60));
                 $channellink = $map ? $this->csvsearch($map->data, $map->titles, trim(fileaway_utility::replacefirst($dir, $rootpath, ''), '/')) : $this->options['baseurl'];
                 $description = $channellink ? $channellink : fileaway_utility::replacefirst($dir, $rootpath, rtrim($this->options['baseurl'], '/') . '/');
                 $channellink = $channellink ? $channellink : $this->options['baseurl'];
                 $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" . "<rss version=\"2.0\">\n" . "<channel>\n" . "<title>" . $stripped_url . " > " . $directory . "</title>\n" . "<link>" . $channellink . "</link>\n" . "<description>" . $description . "</description>\n" . "<lastBuildDate>" . date($datestring) . "</lastBuildDate>\n" . "<pubDate>" . date($datestring) . "</pubDate>\n" . "<ttl>" . $ttl . "</ttl>\n" . "<generator>File Away</generator>\n";
                 if ($feedlogo) {
                     $xml .= "<image>\n" . "<url>" . $feedlogo . "</url>\n" . "<title>" . str_replace(array('http://', 'https://', 'www.'), '', $this->options['baseurl']) . " > " . $directory . "</title>\n" . "<link>" . $this->options['baseurl'] . "</link>\n" . "</image>\n";
                 }
                 if (count($subxml > 0)) {
                     $xml .= implode($subxml);
                 }
                 if (isset($files['datemodified']) && count($files['datemodified']) > 0) {
                     foreach ($files['datemodified'] as $k => $file) {
                         if ($feedlimit && $k >= $feedlimit) {
                             break;
                         }
                         $rawname = str_replace('&', 'and', $files['filename'][$k]);
                         if (preg_match('/\\[([^\\]]+)\\]/', $rawname)) {
                             list($thename, $customvalue) = preg_split("/[\\[\\]]/", $rawname);
                             $customvalue = str_replace(array('~', '--', '_', '.', '*'), ' ', $customvalue);
                             $customvalue = preg_replace('/(?<=\\D)-(?=\\D)/', ' ', "{$customvalue}");
                             $customvalue = preg_replace('/(?<=\\d)-(?=\\D)/', ' ', "{$customvalue}");
                             $customvalue = preg_replace('/(?<=\\D)-(?=\\d)/', ' ', "{$customvalue}");
                             $thename = str_replace(array('~', '--', '_', '.', '*'), ' ', $thename);
                         } else {
                             $customvalue = false;
                             $thename = str_replace(array('~', '--', '_', '.', '*'), ' ', $rawname);
                         }
                         $thename = preg_replace('/(?<=\\D)-(?=\\D)/', ' ', "{$thename}");
                         $thename = preg_replace('/(?<=\\d)-(?=\\D)/', ' ', "{$thename}");
                         $thename = preg_replace('/(?<=\\D)-(?=\\d)/', ' ', "{$thename}");
                         $showsize = $this->options['feedsize'] == 'false' ? null : "Size: " . fileaway_utility::formatBytes($files['filesize'][$k]) . ".";
                         $filedescription = $customvalue ? $customvalue . ' (' . $files['extension'][$k] . " file. " . $showsize : $files['extension'][$k] . " file. " . $showsize;
                         $pubDate = $this->options['feeddates'] == 'false' ? null : "<pubDate>" . date($datestring, $file) . "</pubDate>\n";
                         $filelink = $files['url'][$k] ? $files['url'][$k] : $channellink;
                         $xml .= "<item>\n" . "<title>" . $thename . "</title>\n" . "<link>" . $filelink . "</link>\n" . "<description>" . $filedescription . "</description>\n" . $pubDate;
                         if ($files['mime'][$k]) {
                             $xml .= "<enclosure url=\"" . $files['url'][$k] . "\" length=\"" . $files['filesize'][$k] . "\" type=\"" . $files['mime'][$k] . "\" />\n";
                         }
                         $xml .= "</item>\n";
                     }
                 }
                 $xml .= "</channel>\n" . "</rss>";
                 $oldfeed = file_get_contents($feed);
                 if ($xml != $oldfeed) {
                     file_put_contents($feed, $xml);
                 }
             }
         }
     }
     date_default_timezone_set('UTC');
     exit;
 }
Esempio n. 20
0
 public function sc($atts)
 {
     if (isset($atts['style'])) {
         $atts['theme'] = $atts['style'];
     }
     $get = new fileaway_definitions();
     extract($get->pathoptions);
     extract($this->correctatts(wp_parse_args($atts, $this->fileaway), $this->shortcodes['fileaway'], 'fileaway'));
     if ($devices == 'mobile' && !$get->is_mobile) {
         return;
     } elseif ($devices == 'desktop' && $get->is_mobile) {
         return;
     }
     if (!fileaway_utility::visibility($hidefrom, $showto)) {
         return;
     }
     if ($this->op['javascript'] == 'footer') {
         $GLOBALS['fileaway_add_scripts'] = true;
     }
     if ($this->op['stylesheet'] == 'footer') {
         $GLOBALS['fileaway_add_styles'] = true;
     }
     include fileaway_dir . '/lib/inc/inc.declarations.php';
     include fileaway_dir . '/lib/inc/inc.base.php';
     extract(fileaway_utility::dynamicpaths($dir, $playbackpath));
     if ($debug == 'on' && $logged_in) {
         return $this->debug($rootpath . $dir);
     }
     if (isset($atts['tutorials'])) {
         $dir = fileaway_dir . '/lib/tts';
     }
     if (!is_dir("{$dir}") && $makedir && (!$private_content || $private_content && $logged_in && stripos($dir, 'fa-nullmeta') === false)) {
         if (mkdir($rootpath . $dir, 0775, true)) {
             fileaway_utility::indexmulti($rootpath . $dir, $chosenpath);
         }
     }
     if (!is_dir("{$dir}")) {
         return;
     }
     $start = "{$dir}";
     $uid = rand(0, 9999);
     $name = $name ? $name : "ssfa-meta-container-{$uid}";
     $manager = $playback ? false : $manager;
     if ($manager) {
         include fileaway_dir . '/lib/inc/inc.manager-access.php';
     }
     if ($manager) {
         $encryption = false;
     }
     if ($metadata) {
         global $wpdb;
     }
     if ($type != 'table') {
         $bulkdownload = false;
     }
     $limit = $manager ? false : $limit;
     $bulkclass = $bulkdownload ? 'bd-table' : ($manager ? 'mngr-table' : null);
     include fileaway_dir . '/lib/inc/inc.styles.php';
     $fadeit = $fadein ? $fadein == 'opacity' ? 'opacity:0;' : 'display:none;' : null;
     if ($fadein) {
         $fadescript = $fadein == 'opacity' ? '.animate({opacity:"1"}, ' . $fadetime . ');' : '.fadeIn(' . $fadetime . ');';
         $thefiles .= '<script> jQuery(document).ready(function($){ setTimeout(function(){ $("div#' . $name . '")' . $fadescript . ' }, 1000); }); </script>';
     }
     $mobileclass = $get->is_mobile ? 'ssfa-mobile' : null;
     $flightbox_nonce = !empty($flightbox) ? 'data-fbn="' . wp_create_nonce('fileaway-flightbox-nonce') . '"' : '';
     $flightbox_class = !empty($flightbox) ? 'flightbox-parent' : '';
     $thefiles .= "{$clearfix}<div id='{$name}' class='ssfa-meta-container {$flightbox_class} {$mobileclass} {$class}' data-uid='{$uid}' {$flightbox_nonce} style='margin: 10px 0 20px; {$fadeit} {$howshouldiputit}'>";
     if ($directories) {
         $recursive = false;
         include fileaway_dir . '/lib/inc/inc.open-drawer.php';
     }
     if ($showrss) {
         include fileaway_dir . '/lib/inc/inc.rss-link.php';
     }
     if ($directories) {
         include fileaway_dir . '/lib/inc/inc.directories-nav.php';
     }
     include fileaway_dir . '/lib/inc/inc.stats-redirects.php';
     include fileaway_dir . '/lib/inc/inc.precontent.php';
     include fileaway_dir . '/lib/inc/inc.thead.php';
     include fileaway_dir . '/lib/inc/inc.directories.php';
     $files = $recursive ? fileaway_utility::recursefiles($dir, $onlydirs, $excludedirs) : scandir($dir);
     $count = 0;
     fileaway_utility::timezone();
     include fileaway_dir . '/lib/inc/inc.file-array.php';
     include fileaway_dir . '/lib/inc/inc.dynamic-links.php';
     $fcount = count($rawnames);
     if ($fcount < 1 && !$directories) {
         return;
     }
     if ($playback) {
         $GLOBALS['fileaway_playback_script'] = true;
         if ($playback == 'compact') {
             $playaway = new playaway();
         }
         $sources = $get->filegroups['audio'][2];
         $used = array();
     }
     include fileaway_dir . '/lib/inc/inc.thumbnails-setup.php';
     if (is_array($rawnames)) {
         include fileaway_dir . '/lib/inc/inc.sort.php';
         if ($type == 'table' && !$manager && $bannerize) {
             include fileaway_dir . '/lib/inc/inc.bannerize.php';
         }
         foreach ($rawnames as $k => $rawname) {
             if ($playback && in_array($rawname, $used) && in_array($exts[$k], $sources)) {
                 continue;
             }
             $link = $links[$k];
             $loc = $locs[$k];
             $ext = $exts[$k];
             $oext = $ext;
             $extension = strtolower($ext);
             $full = $fulls[$k];
             $dir = $dirs[$k];
             $thetime = $times[$k];
             $file = $full;
             $dynamiclink = $dynamics[$k];
             $bannerad = isset($bannerads[$k]) ? $bannerads[$k] : false;
             if ($s2mem) {
                 list($trash, $s2dir) = explode('s2member-files', $dir);
                 $s2dir = trim($s2dir, '/');
                 $s2dir = $s2dir == '' ? $s2dir : $s2dir . '/';
             }
             if ($onlydirs && is_array($onlydirs)) {
                 foreach ($onlydirs as $only) {
                     $keeper = 0;
                     if (strpos("{$dir}", "{$only}") !== false) {
                         $keeper = 1;
                         break;
                     }
                 }
                 if (!$keeper) {
                     continue;
                 }
             }
             if ($excludedirs && is_array($excludedirs)) {
                 foreach ($excludedirs as $ex) {
                     if (strpos("{$dir}", "{$ex}") !== false) {
                         continue 2;
                     }
                 }
             }
             include fileaway_dir . '/lib/inc/inc.prettify.php';
             if (!$dynamiclink && (is_dir($dir . '/' . $file) || $thename == '')) {
                 continue;
             }
             $link = $encryption && !$dynamiclink && !$bannerad ? $encrypt->url($rootpath . $dir . '/' . $file) : $link;
             include fileaway_dir . '/lib/inc/inc.thumbnails.php';
             include fileaway_dir . '/lib/inc/inc.colors.php';
             $datemodified = $type != 'table' && $mod == 'yes' ? "<div class='ssfa-datemodified'>" . sprintf(_x('Last modified %s at %s', 'For List Types: *Date* at *Time*', 'file-away'), $date, $time) . "</div>" : null;
             $listfilesize = $type != 'table' && $size != 'no' ? $theme == 'ssfa-minimal-list' ? "<span class='ssfa-listfilesize'>({$fsize})</span>" : "<span class='ssfa-listfilesize'>{$fsize}</span>" : null;
             $link = $s2mem && !$manager ? $url . '/?s2member_file_download=' . $s2dir . $file . $s2skip : $link;
             $fulllink = 'href="' . $link . '"';
             $redirect = $dynamiclink || $bannerad ? false : $redirect;
             $statstatus = $stats && !$dynamiclink && !$bannerad ? 'true' : 'false';
             $fulllink = $redirect ? 'href="' . $this->op['redirect'] . '"' : $fulllink;
             include fileaway_dir . '/lib/inc/inc.icons.php';
             $linktype = $s2mem || $encryption ? '' : $linktype;
             $linktype = $dynamiclink || $redirect ? 'target="_blank"' : $linktype;
             if ($flightbox && !$bannerad && !fileaway_utility::startswith($file, '_thumb_')) {
                 include fileaway_dir . '/lib/inc/inc.flightbox.php';
             }
             $audiocorrect = null;
             if ($playback) {
                 include fileaway_dir . '/lib/inc/inc.playback.php';
             } else {
                 $player = null;
                 $players = null;
             }
             $thename = $prettify ? $thename : fileaway_utility::strtotitle($thename);
             $thename = "<span class='ssfa-filename' {$audiocorrect}>" . $thename . "</span>";
             $count += 1;
             if ($nolinks && !$dynamiclink) {
                 $nolinkslist = "<a id='ssfa-{$uid}-{$count}' href='javascript:' class='{$display}{$noicons}{$colors}' style='cursor:default'>";
                 $nolinkstable = "<a id='ssfa-{$uid}-{$count}' href='javascript:' class='{$colors}' style='cursor:default'>";
                 $players = null;
             } else {
                 $nolinkslist = "<a id='ssfa-{$uid}-{$count}' class='{$display}{$noicons}{$colors}' {$fulllink} {$linktype} data-stat='{$statstatus}'>";
                 $nolinkstable = "<a id='ssfa-{$uid}-{$count}' class='{$colors}' {$fulllink} {$linktype} data-stat='{$statstatus}'>";
             }
             if (!$type || $type != 'table') {
                 $thefiles .= "{$nolinkslist}" . "<div class='ssfa-listitem {$ellipsis}'>" . "<span class='ssfa-topline'>{$icon} {$thename} {$listfilesize}</span> " . "{$datemodified}" . "</div>" . "</a>";
             } elseif ($type == 'table' && $bannerad) {
                 $src = str_replace($rootpath . $dir, rtrim($url, '/') . '/' . $dir, $rootpath . $dir . '/' . $file);
                 $thefiles .= "<tr id='ssfa-banner-{$uid}-{$count}' class='fileaway-dynamic fileaway-banner'>" . "<td id='filetype-ssfa-file-{$uid}-{$count}' colspan='100' class='ssfa-banner {$theme}-first-column'>" . "<a href=\"{$link}\" rel='nofollow' target='_blank'><img src=\"{$src}\" style='width:100%; border:0;'></a>" . "</td>" . "</tr>";
             } elseif ($type == 'table') {
                 $oext = $manager || $bulkdownload ? 'data-ext="' . $oext . '"' : null;
                 $filepath = $manager || $bulkdownload ? 'data-path="' . $dir . '"' : null;
                 $oldname = $manager || $bulkdownload ? 'data-name="' . $rawname . '"' : null;
                 $salvaged_filename = $manager ? trim($salvaged_filename) : $salvaged_filename;
                 if ($manager && $customdata) {
                     $fileinput = '<input id="rawname-ssfa-file-' . $uid . '-' . $count . '" type="text" value="' . $salvaged_filename . '" ' . 'style="width:80%; height:26px; font-size:12px; text-align:center; display:none">';
                 } elseif ($manager && !$customdata) {
                     $fileinput = '<input id="rawname-ssfa-file-' . $uid . '-' . $count . '" type="text" value="' . $rawname . '" ' . 'style="width:80%; height:26px; font-size:12px; text-align:center; display:none">';
                 } else {
                     $fileinput = null;
                 }
                 if ($playback && in_array($rawname, $used)) {
                     if ($has_sample && $playback === 'compact') {
                         $iconarea = $player;
                         $thefinalname = $thename;
                     } elseif ($has_sample && $playback === 'extended') {
                         $iconarea = "<br>{$nolinkstable}{$icon}</a>";
                         $thefinalname = $thename . $players . $player;
                         $players = null;
                     } elseif (!$has_sample && $has_multiple) {
                         $thefinalname = $thename;
                         $iconarea = "<br>{$nolinkstable}{$icon}</a>";
                     } elseif (!$has_sample && !$has_multiple) {
                         $iconarea = "{$nolinkstable}{$icon} {$ext}</a>";
                         $thefinalname = "{$nolinkstable}{$thename}</a>";
                         $players = null;
                     }
                 } else {
                     $iconarea = "{$nolinkstable}{$icon} {$ext}</a>";
                     $thefinalname = "{$nolinkstable}{$thename}</a>";
                     $players = null;
                 }
                 if ($getthumb) {
                     $iconarea = "{$nolinkstable}{$icon}</a>";
                 }
                 $dynamicclass = $dynamiclink ? 'fileaway-dynamic' : '';
                 $thefiles .= "<tr id='ssfa-file-{$uid}-{$count}' class='{$dynamicclass}'>" . "<td id='filetype-ssfa-file-{$uid}-{$count}' class='ssfa-sorttype {$theme}-first-column' {$oext}>{$iconarea}</td>" . "<td id='filename-ssfa-file-{$uid}-{$count}' class='ssfa-sortname' {$filepath} {$oldname}>{$thefinalname}{$players} {$fileinput}</td>";
                 if ($customdata && is_array($customarray)) {
                     if ($metadata) {
                         $customdataclassname = 'fileaway-metadata';
                         $mdata_value = $wpdb->get_row($wpdb->prepare("SELECT metadata FROM " . $wpdb->prefix . "fileaway_metadata WHERE file = %s", $dir . '/' . $file));
                         if ($mdata_value) {
                             $customvalues = unserialize($mdata_value->metadata);
                         } else {
                             $customvalues = explode(',', $customvalue);
                         }
                     } else {
                         $customvalues = explode(',', $customvalue);
                         $customdataclassname = 'fileaway-customdata';
                     }
                     foreach ($customarray as $z => $customdatum) {
                         if ($customdatum !== ' ') {
                             $value = !isset($customvalues[$z]) ? '' : ($prettify ? $customvalues[$z] : fileaway_utility::strtotitle(trim($customvalues[$z])));
                             $custominput[$z] = $manager ? '<input class="' . $customdataclassname . '" id="customdata-' . $z . '-ssfa-file-' . $uid . '-' . $count . '" type="text" value="' . $value . '" ' . 'style="width:80%; height:26px; font-size:12px; text-align:center; display:none">' : null;
                             $thefiles .= "<td id='customadata-cell-{$z}-ssfa-file-{$uid}-{$count}' class='ssfa-sortcustomdata'>" . "<span id='customadata-{$z}-ssfa-file-{$uid}-{$count}'>" . "{$value}" . "</span>" . trim($custominput[$z]) . "</td>";
                         }
                     }
                 }
                 $thefiles .= $mod !== 'no' ? "<td id='mod-ssfa-file-{$uid}-{$count}' class='ssfa-sortdate' data-value='{$sortdatekey}'>{$sortdate}</td>" : null;
                 $thefiles .= $size !== 'no' ? "<td id='size-ssfa-file-{$uid}-{$count}' class='ssfa-sortsize' data-value='{$bytes}'>{$fsize}</td>" : null;
                 if ($manager) {
                     $thefiles .= "<td id='manager-ssfa-file-{$uid}-{$count}' class='ssfa-sortmanager'>";
                     if (!$dynamiclink) {
                         $thefiles .= "<a href='' id='rename-ssfa-file-{$uid}-{$count}'>" . __('Rename', 'file-away') . "</a><br>" . "<a href='' id='delete-ssfa-file-{$uid}-{$count}'>" . __('Delete', 'file-away') . "</a>";
                     }
                     $thefiles .= "</td>";
                 }
                 $thefiles .= '</tr>';
             }
         }
     }
     $thefiles .= $type == 'table' ? '</tbody></table>' : null;
     if ($manager) {
         include fileaway_dir . '/lib/inc/inc.bulk-action-content.php';
     } elseif ($bulkdownload) {
         include fileaway_dir . '/lib/inc/inc.bulk-download-content.php';
     }
     $thefiles .= "</div></div>{$clearfix}";
     if ($flightbox && $fb) {
         $thefiles .= '<script>FlightBoxes[' . $uid . '] = ' . $fb . '; ';
         if (count($boximages) > 0) {
             $thefiles .= implode(' ', $boximages);
         }
         $thefiles .= '</script>';
     }
     date_default_timezone_set('UTC');
     if ($private_content && $logged_in && $count > 0) {
         return $thefiles;
     } elseif (!$private_content && $count > 0) {
         return $thefiles;
     } elseif ($directories && (!$private_content || $logged_in && $private_content)) {
         return $thefiles;
     } else {
         return;
     }
 }
 public function optioninfo()
 {
     $get = new fileaway_definitions();
     $optioninfo = array();
     $optioninfo['stats'] = array('heading' => 'Download Statistics', 'info' => "Default: true (if Statistics are enabled in the global settings). To disable on a per-shortcode basis, use <code>stats=\"false\"</code>. If Download Statistics is enabled in the global settings, and not explicitly disabled here, file download statistics will be gathered for each download event, unless the specific user has been excluded from statistics gathering. The user's ID, email address, ip address, and user agent string will be recorded, along with the file downloaded, its location, and the precise time of download. The data will be stored in an SQL table for retrieval at your convenience and display at your discretion.<br><br>Note: in <code>[stataway]</code> statistics tables, this attribute is disabled by default and must be expressly set to true to collect stats from downloads on statistics tables. In <code>[stataway]</code> lists, stats are enabled by default as normal.");
     $optioninfo['password'] = array('heading' => 'Manager Mode: Override Password', 'info' => "Enter the Override Password here, and if it matches the Override Password established in the File Away Options page, then any user IDs or user roles/capabilities specified in the prior fields (in addition to the roles and users set in the permanent settings) will have Manager Mode privileges for this shortcode only.");
     $optioninfo['color'] = array('heading' => 'Link Color', 'info' => "The color of primary links and styles. Default for lists: Random. Default for tables: Classic.");
     $optioninfo['accent'] = array('heading' => 'Accent Color', 'info' => "Defaults to random if left blank.");
     $optioninfo['iconcolor'] = array('heading' => 'Icon Color', 'info' => "Default for lists: Random. Default for tables: Classic.");
     $optioninfo['icons'] = array('heading' => 'Icons', 'info' => "Defaults to File Type icons if left blank.");
     $optioninfo['display'] = array('heading' => 'Display Style', 'info' => "Alphabetical Lists default to vertical layout by default.");
     $optioninfo['prettify'] = array('heading' => 'Prettify Filenames', 'info' => "Default: Enabled. To disable, add <code>prettify=\"off\"</code> to your shortcode. To enable, omit this attribute from your shortcode. Gets rid of various special characters and adds a sentence title to your filename.");
     $optioninfo['debug'] = array('heading' => 'Debug Mode', 'info' => "If nothing is showing up on the page when you insert the shortcode, it's either because there are no files in the directory/attached to the page that you're pointing to, or because you've excluded anything that's in the directory/attached to the page that you're pointing to. Activating the debug feature will display a box in the page content that will tell you the directory or the attachment page to which your shortcode is pointing.");
     $optioninfo['search'] = array('heading' => 'Filtering', 'info' => "By default, a search icon will be placed at the top-right of the table, which allows users to filter out table content to find what they're looking for. You can disable it if desired.");
     $optioninfo['searchlabel'] = array('heading' => 'Search Label', 'info' => "Optional. If omitted, just the search icon will show. If using a label, KEEP IT SHORT. The icon + label have to fit within the width of the hidden input field.");
     $optioninfo['paginate'] = array('heading' => 'Pagination', 'info' => "By default, pagination on tables is disabled. Recommended only for large file directories/csv files.");
     $optioninfo['pagesize'] = array('heading' => 'Number per Page', 'info' => "If pagination is enabled, you can set the number of files to show per page. Default is 15.");
     $optioninfo['textalign'] = array('heading' => 'Text Alignment', 'info' => "For tables. Defaults to Center.");
     $optioninfo['customdata'] = array('heading' => 'Custom Column(s)', 'info' => "You can add multiple custom columns to your table and add custom data to any file you want. Name the columns here, e.g., <code>Artist</code>, then to add data to your files, you have two options: If Metadata Storage is set to 'In Database', just use Manager Mode's 'Rename' function to add the metadata. It will be stored in a custom database table. If Metadata Storage is set to 'In Filename', just put the data in between square brackets [ ] at the *end* of your file name, *before* the extension. If you want to add more than one column, separate the column names here with a comma (e.g., <code>Artist, Album, Label, Year</code>), and separate the corresponding data in the fileneames with a comma. You can do this with Manager Mode's 'Rename' function, and it will format it for you automatically. Example filenames: <br /><br /><code>My Funny Valentine [Chet Baker, My Funny Valentine, Blue Note, 1994].mp3</code><br /><code>So What [Miles Davis, Kind of Blue, Columbia, 1959].mp3</code><br /><code>Birdland [Weather Report, Heavy Weather, Columbia, 1977].mp3</code><br /><br />The data in square brackets will be automatically added to the column(s) that you create here. This feature can be used for any purpose you like.<br /><br />Note that anything in square brackets will only show up in Data Tables, and, in that case, only if you name your custom column(s) here.");
     $optioninfo['metadata'] = array('heading' => 'Metadata Storage', 'info' => "You have two options for storing metadata for your files: 1) In Database, or 2) In Filename. See the info box for Custom Columns Name(s) (i.e., customdata) for more information. To enable Database storage, just add <code>metadata=\"database\"</code> to your File Away table shortcode. For Filename storage, just omit the <code>metadata</code> attribute, as it is the default behavior. Note, the In Filename option, do not use commas ( , ) in your descriptions, as commas are used to separate multiple columns. You may use commas as normal with the In Database option.");
     $optioninfo['postid'] = array('heading' => 'Post / Page ID', 'info' => "If left blank, by default the shortcode will grab the attachments from the page or post where the shortcode is inserted (the current page). Alternatively, you can specify a post/page ID here, and the shortcode will grab the attachments from that one instead. <br /><br />If you don't know the ID, Attach Away has added an 'ID' column to your 'All Pages' and 'All Posts' pages. This column can be enabled or disabled in the File Away settings page.");
     $optioninfo['capcolumn'] = array('heading' => 'Caption Column', 'info' => "You can add a custom column to your table and add custom data to any attachment file you want. For this particular column, the data will be pulled from the attachment's 'Caption' field. Name the column here, anything you want, e.g., <code>Artist</code>. Then just add the specific data to the Caption field for each attachment file. Example:<br /><br /><code>Caption Column Name: Artist</code><br /><code>Attachment 1 Caption: Jon Bon Jovi</code><br /><code>Attachment 2 Caption: Michael J. Iafrate</code><br /><br />For easy management of your attachments without leaving the page editor, File Away recommends the <a href='https://wordpress.org/plugins/wp-better-attachments/' class='inner-link' target='_blank'>WP Better Attachments</a> plugin by Dan Holloran.");
     $optioninfo['descolumn'] = array('heading' => 'Description Column', 'info' => "You can add a second custom column to your table and add custom data to any attachment file you want. For this column, the data will be pulled from the attachment's 'Description' field. Name the column here, anything you want, e.g., <code>Author</code>. Then just add the specific data to the Description field for each attachment file. Example:<br /><br /><code>Description Column Name: Author</code><br /><code>Attachment 1 Description: Vaclav Havel</code><br /><code>Attachment 2 Description: Terry Eagleton</code><br /><br />For easy management of your attachments without leaving the page editor, File Away recommends the <a href='https://wordpress.org/plugins/wp-better-attachments/' class='inner-link' target='_blank'>WP Better Attachments</a> plugin by Dan Holloran.");
     $optioninfo['sortfirst'] = array('heading' => 'Initial Sorting', 'info' => "If you want to disable column sorting altogether, choose 'Disable Sorting' and the files will be output in a natural alphabetical order. Otherwise, choose the column by which to sort your table on initial page load. You can choose to sort in ascending or descending order for each column. Defaults to Filename (Asc) if left blank.<br /><br />Note: If you are using multiple custom columns in a <code>[fileaway]</code> table, and you wish to sort initially by one of those custom columns, set your Initial Sorting to either Custom Column (Asc) or Custom Column (Desc) here, then in the Custom Column Name(s) field (i.e., the <code>customdata</code> attribute), put an asterisk(*) next to the name of the column by which you wish to sort initially. Don't worry. The asterisk will be removed before it gets to the page.");
     $optioninfo['nolinks'] = array('heading' => 'Disable Links', 'info' => "Defaults to false. If Disable Links is set to 'True', the hypertext reference is removed from the &#60;a&#62; tag. This is in case you want, for instance, to display successful uploads without providing links to the files. You'll still want to style your links using the shortcode options, but the link functionality will be removed.");
     $optioninfo['redirect'] = array('heading' => 'Guest Redirect', 'info' => "If you have specified a redirect URl on your File Away settings page, and have enabled redirection here, logged-out users will be redirect to the page you specify when they click on a download link. To disable redirection of logged-out users, simply omit this attribute from the shortcode. It is, thus, disabled by default.");
     $optioninfo['showrss'] = array('heading' => 'Show RSS Links', 'info' => "Defaults to false. If set to true, and your Feed Storage Directory is set, and your table is not in recursive mode, and a feed file exists for the directory, then an RSS link to that directory's feed will be displayed for user subscriptions.");
     $optioninfo['showto'] = array('heading' => 'Show to Roles / Capabilities', 'info' => "Takes a comma-separated list of user roles / capabilities. If used, only those users with one of the user roles or capabilities specified in this field will have access to the file/attachment display or file upload form.");
     $optioninfo['hidefrom'] = array('heading' => 'Hide from Roles / Capabilities', 'info' => "Takes a comma-separated list of user roles / capabilities. If used, those users with one of the user roles or capabilities specified in this field will <em>not</em> have access to the file/attachment display or file upload form. If this attribute is used, logged-out users are also prevented from seeing the file/attachment display or file upload form.");
     $optioninfo['devices'] = array('heading' => 'Device Visibility', 'info' => "If omitted, will default to All Devices. Otherwise, select whether to display the output to desktops/notebooks, or to tablets/mobiles. This will allow you to create separate shortcodes tailored to different sized screens.");
     $optioninfo['maxsize'] = array('heading' => 'Max Size', 'info' => "The maximum allowed file size for each individual uploaded file. Enter an integer (e.g., 20). You will specify MB, KB, or GB under Max Size Type. If left blank, the default will be 10MB. Note that the system will also check the post_max_size and upload_max_filesize settings from your php.ini file, and if either is smaller than the size you specify here, that one will override your specification. Here are your current php.ini settings for your reference:<br /><br />post_max_size: " . fileaway_utility::ini('post_max_size', false, 'Not Set') . "<br />upload_max_filesize: " . fileaway_utility::ini('upload_max_filesize', false, 'Not Set'));
     $optioninfo['maxsizetype'] = array('heading' => 'Max Size Type', 'info' => "Defaults to MB if left blank. Complements your Max Size setting. Note that the system will also check the post_max_size and upload_max_filesize settings from your php.ini file, and if either is smaller than the size you specify here, that one will override your specification. Here are your current php.ini settings for your reference:<br /><br />post_max_size: " . fileaway_utility::ini('post_max_size', false, 'Not Set') . "<br />upload_max_filesize: " . fileaway_utility::ini('upload_max_filesize', false, 'Not Set'));
     $optioninfo['name'] = array('heading' => 'Unique Name', 'info' => "For File Away tables: Required only if in use with a corresponding iframe shortcode, otherwise optional. Assign a unique name. One word, no spaces. You will assign the same unique name to the corresponding File Away iframe shortcode. This will (1) enable the iframe to scroll to the top of the table when a new page is clicked, and (2) allow for easier reference when multiple iframed tables are on the same page. (Note that you can now have multiple Directory Tree/Manager Mode tables on the same page without use of the iframe, using the <code>drawerid</code> attribute.<br><br>For File Away iframes: Required. Assign a unique name. One word, no spaces. You will assign the same unique name to the corresponding File Away shortcode. This will (1) enable the iframe to scroll to the top of the table when a new page is clicked, and (2) allow for easier reference when multiple iframed tables are on the same page. <br><br>For File-Up shortcodes: Completely optional. Assign a unique name. One word, no spaces. If no name is assigned, a random unique name will be generated on each pageload.");
     $optioninfo['source'] = array('heading' => 'Source Slug/URL', 'info' => "Required. Enter the full URL, or just the page slug (like this: <code>/my-page-slug/</code>, of the iframed-templated page where you put your <code>[fileaway]</code> shortcode. To apply the File Away iframe template to that page, select 'File Away iframe' from the Page Template dropdown on the WordPress page editor.");
     $optioninfo['scroll'] = array('heading' => 'Scrolling', 'info' => "Defaults to 'Off' if left blank. You will want to set your height attribute to a sufficient integer, and compensate by activating pagination on your <code>[fileaway]</code> table, and setting the pagination pagesize to a small number such as 10 or 20.");
     $optioninfo['height'] = array('heading' => 'Height', 'info' => "Required. Enter an integer. The height attribute does not permit percentages. It is automatically in pixels so only the number is required. It is recommended to set it to a sufficient height such as 1000. If the height attribute is not set, well, your thing will look funny.");
     $optioninfo['width'] = array('heading' => 'Width', 'info' => "For File Away, Attach Away, and Form Away Open shortcodes: Optional: If left blank, will default to auto-width if the type is set as 'Alphabetical List,' and to 100% if the type is set as 'Sortable Data Table.' If less than 100%, text will wrap around your list or table to the left or right, depending upon your alignment setting.<br><br>For File Away iframe shortcodes: Defaults to 100% if left blank. Otherwise, specify a pixel width by entering only the number desired. E.g., 800.<br><br>For File-Up shortcodes: Optional: If left blank, will default to 100%. If less than 100%, text will wrap around your upload form to the left or right, depending upon your alignment setting.");
     $optioninfo['perpx'] = array('heading' => 'Width Type', 'info' => "Specify whether your width integer should be processed as a percentage or in pixels. Default: %");
     $optioninfo['mheight'] = array('heading' => 'Margin Height', 'info' => "Defaults to 0 if left blank.");
     $optioninfo['mwidth'] = array('heading' => 'Margin Width', 'info' => "Defaults to 0 if left blank.");
     $optioninfo['base'] = array('heading' => 'Base Directory', 'info' => "Begin with one of the base directories you set up in the Configuration page. You can extend this path using the Sub Directory option. Defaults to Base 1 if left blank.<br><br>For File-Up shortcodes: This is the initial folder to which a user may upload files. If uploads are not set to a fixed location, they will be able to upload to any subdirectories, but not to any parent directories of the initial directory specified. You can extend this initial path using the Sub Directory option.");
     $optioninfo['sub'] = array('heading' => 'Sub-Directory', 'info' => "Optional: Define a sub-directory to extend the path of your selected base directory. It can be one or more levels deep. You can leave out leading and trailing slashes. I.e., <code>uploads/2010</code> rather than <code>/uploads/2010/</code><br /><br />You can also use one or more of the five dynamic path codes: <code>fa-firstlast</code> <code>fa-userid</code> <code>fa-username</code> <code>fa-userrole</code> and <code>fa-usermeta(metakey)</code> (replacing \"metakey\" with the user meta key name of your choice). If you've created directories that are named for your users' first and last names (e.g., jackhandy), userid (e.g., 15), username (e.g., admin), user role (e.g., subscriber), or for any user meta value from any user meta key they may have, the codes will dynamically point whoever is logged in to their appropriate folder. <br /><br />For example: <code>uploads/fa-userrole/fa-firstlastfa-userid</code> will point dynamically, depending on who is logged in, to directories like: <code>uploads/editor/jackhandy15</code> or <code>uploads/subscriber/joanjett58</code>.<br><br>The directories you create for your users must be all lowercase with no spaces, with the exception of the <code>fa-username</code> code. On the Basic Configuration tab of the File Away settings page, you may choose whether to render <code>fa-username</code> as forced lowercase or strict case-sensitive. <code>NOTE:</code> Rather than creating the directories manually, you can use the <code>makedir='true'</code> attribute and File Away will create static and dynamic directories for you, recursively, if the directory does not already exist.");
     $optioninfo['makedir'] = array('heading' => 'Make Directories On Page Load', 'info' => "For both <code>[fileaway]</code> and <code>[fileup]</code> shortcodes, you don't have to worry about whether the directory you're pointing to exists. Adding <code>makedir='true'</code> to either shortcode will create the specified directory if it doesn't already exist, and in it, an empty index.php file to prevent direct browser access to the directory. You can do this for both static and dynamic directories. You can do this for just your base directories, or for your base+sub attributes combined. <br><br>Static Example: If Base 1 equals <code>wp-content/uploads</code> and your sub attribute equals <code>files/images/jpegs</code>, then the directory path of <code>wp-content/uploads/files/images/jpegs</code> will be created for you, recursively, if it doesn't already exist.<br><br>Dynamic Example: If Base 1 equals <code>wp-content/uploads/fa-userrole</code> and your sub attribute equals <code>personal/fa-username</code>, then the dynamic directory path for each user will be created the first time they hit the page, something like this: <code>wp-content/uploads/editor/personal/magicjohnson</code>.<br><br>You can do this with File Away and File Up shortcodes together in tandem, so that users can upload files to their own directories. We recommend a basic setup like this (though the path here is just an example): <code>[fileup base=\"1\" sub=\"personal/fa-username\" makedir=\"true\"]&lt;br&gt;&lt;br&gt;[fileaway base=\"1\" sub=\"personal/fa-username\" directories=\"on\"]</code><br><br>You can have <code>makedir=\"true\"</code> in both shortcodes if you want, but you only really need it in the first one that appears on the page. If it's in the second shortcode and not the first, then the first shortcode will return blank because the directory does not yet exist. Adding <code>directories=\"on\"</code> (or <code>manager=\"on\"</code>, your preference) to your File Away shortcode will ensure that the user sees their File Away table even though there are not initially any files in it. If not in Directory Tree or Manager Mode, File Away will return blank if there are no files. <br><br>Penultimately, if Dynamic Path codes are used, a directory will only be created if the user is logged in. Finally, leaving <code>makedir=\"true\"</code> in your shortcode will not slow anything down. File Away and File Up have always checked to make sure the directory exists before proceeding with the rest of their business. Creating a directory takes a split second anyway, but if it already exists, the make-directory command is simply skipped over.");
     $optioninfo['images'] = array('heading' => 'Images', 'info' => "Optional: If left blank, the default behavior is to list image files along with all other files. You can alternatively choose to exclude all image types from your display, or to show only image types in your display. Image types are: " . implode(', ', $get->imagetypes));
     $optioninfo['code'] = array('heading' => 'Code Documents', 'info' => "By default, and for security, web code documents are excluded from file displays. If you have a directory or attachment page with some code docs that you want to include in your display, you can choose to include them along with any/all other file types. Code file types excluded by default are: " . implode(', ', $get->codexts) . ". The one exception is index.htm/l and index.php files, which are always excluded, and will not be included if Code Docs are enabled.");
     $optioninfo['only'] = array('heading' => 'Show Only Specific', 'info' => "If you'd like, you can enter a comma-separated list of filenames and/or file extensions here. Doing this will filter out anything not here entered. Do not use quotation marks. Just separate each item with a comma. <br /><br />Example: <br /><br /><code>My Polished Essay, .mp3, Gertrude Stein Essay, .jpg</code><br /><br />This will tell the shortcode only to ouput files that have the string 'My Polished Essay' or 'Gertrude Stein Essay', and any file with the extension .mp3 or .jpg");
     $optioninfo['exclude'] = array('heading' => 'Exclude Specific', 'info' => "Here you can enter a comma-separated list of filenames or file extensions to exclude from your list. Example: <br /><br /><code>.doc, .ppt, My Unfinished Draft Essay, Embarrassing Photo Name</code> <br /><br />This will exclude all .doc and .ppt files from your list, as well as your ugly first draft and that photo of you after that party.");
     $optioninfo['include'] = array('heading' => 'Include Specific', 'info' => "This option also takes a comma-separated list of files or file extensions, but it is primarily for correcting / fine tuning. For instance, if you excluded '.doc' in the above field, you may want to include '.docx' here, so it isn't filtered out, if that's your fancy.");
     $optioninfo['action'] = array('heading' => 'File Type Action', 'info' => "If you specify any file types or file groups, the action you select here will determine whether the specified file types are prohibited, or the only permitted file types. If left blank, the default option will be permit.");
     $optioninfo['filetypes'] = array('heading' => 'File Types', 'info' => "This option takes a comma-separated list of file extensions (do not precede the extension with a period). These file types will be either permitted or prohibited, depending on the action you select. If you also specify file groups, the file types associated with the selected groups will be added to the list here.");
     $filegroups = '';
     foreach ($get->filegroups as $group => $discard) {
         if ($group == 'unknown') {
             continue;
         }
         $filegroups .= '<span style="color:red;">' . $group . ':</span> [' . implode(', ', $get->filegroups[$group][2]) . ']<br>';
     }
     $optioninfo['filegroups'] = array('heading' => 'File Type Groups', 'info' => "You may select multiple groups from the list of available file groups. All file types associated with the selected file groups will be either permitted or prohibited, depending on the action you select. If you also specify a list of individual file types, they will be added to the list here.<br /><br />{$filegroups}");
     $optioninfo['heading'] = array('heading' => 'Heading', 'info' => "Optional: Give your list or table a nice title.");
     $optioninfo['hcolor'] = array('heading' => 'Heading Color', 'info' => "Defaults to random color if left blank.");
     $optioninfo['single'] = array('heading' => 'Single or Multiple Uploads', 'info' => "Optional: If left blank, will default to multiple. If single is selected, a user may only upload one file at a time.");
     $optioninfo['align'] = array('heading' => 'Alignment', 'info' => "Use in combination with the width setting to float your list, table, or upload form to the left or right of the page, to allow other page content to wrap around it. Choose 'None' to prevent wrapping. For lists and tables, defaults to 'Left.' For File-Up shortcodes, defaults to 'None.'");
     $optioninfo['size'] = array('heading' => 'File Size', 'info' => "Will show the file size by default if left blank. In tables, you'll be able to sort by file size.");
     $optioninfo['corners'] = array('heading' => 'Corners', 'info' => "Defaults to all corners rounded if not used. Does not apply to the minimal-list theme, or to tables.");
     $optioninfo['mod'] = array('heading' => 'Date Modified', 'info' => "If left blank, will show by default in tables, as a sortable column, and will hide by default in lists. (Note: This option is not available for Post / Page Attachments.)");
     $optioninfo['bulkdownload'] = array('heading' => 'Bulk Download', 'info' => "If enabled, users will be able to select specific files, or select all files, in a table, then click on the download button at the bottom of the table in order to download a zip file containing their selections. Note that Bulk Downloads are automatically enabled in Manager Mode, but can be enabled here for any other table type (regular, recursive, directory tree, or audio playback). Default: Disabled.");
     $optioninfo['flightbox'] = array('heading' => 'Flightbox', 'info' => "File Away's answer to the Lightbox, designed from the ground up for use with File Away and Attach Away lists and tables. Choose whether to use the Flightbox for images (jpg, gif, png), video files (flv, mp4, m4v, ogv, webm, YouTube and Vimeo), PDF files, or for all three, choose multi. The size of the Flightbox window is dynamic based on the current size of the broseer window. Every time a new file is called up into the Flightbox, the box resizes to fit the dimensions of your file as well as the screen size.");
     $optioninfo['boxtheme'] = array('heading' => 'Flightbox Theme', 'info' => "Choose from one of four themes, or design your own. The icon colors will be matched according to your Icon Color selection for your list or table.");
     $optioninfo['maximgwidth'] = array('heading' => 'Max Image Width', 'info' => "An integer only. E.g., <code>1000</code>. Optional. If omitted, the box window will never be larger than the user's screen, or than the default max width of 1920 (pixels). The window size will be proportional to images, and images will not be stretched.");
     $optioninfo['maximgheight'] = array('heading' => 'Max Image Height', 'info' => "An integer only. E.g., <code>600</code>. Optional. If omitted, the box window will never be larger than the user's screen, or than the default max height of 1080 (pixels). The window size will be proportional to images, and images will not be stretched.");
     $optioninfo['videowidth'] = array('heading' => 'Video Width', 'info' => "An integer only. E.g., <code>1000</code>. Optional. If omitted, the box window will never be larger than the user's screen, or than the default max video width of 1920 (pixels). The video player will always maintain a 16:9 ratio.");
     $optioninfo['recursive'] = array('heading' => 'Recursive Directory Iteration', 'info' => "If disabled (the default), only the files in the single directory specified will be displayed. If enabled, the files from all subdirectories will be displayed as well. If Directory Tree mode is enabled, Recursive Directory Iteration will be disabled.");
     $optioninfo['directories'] = array('heading' => 'Directory Tree Mode', 'info' => "If disabled (the default), your File Away table will display only the single directory specified in your Base and Sub attributes. If Directory Tree mode is enabled, the directory specified will be the starting-off point, but the user will be able to navigate through any subsequent directories as well. It is recommended that you use this mode in conjunction with the File Away iframe shortcode (see instructions under that shortcode option).");
     $optioninfo['manager'] = array('heading' => 'Manager Mode', 'info' => "If enabled, users with access privileges will be able to manage files from the front-end. Users without access privileges will still see the table, but the management features will not be output to the page. Manager Mode currently includes the ability to rename and delete files individually, and to copy, move, and delete files in bulk.<br /><br />If custom columns are included in the table, the Rename feature will provide additional fields for each visible custom column, and will automatically format the filename for use with File Away custom columns.<br /><br />See the Manager Mode tab on the File Away options page to set access privileges and/or use the Manager Mode options below to fine tune privileges on a per-shortcode basis. If Manager Mode is enabled, Directory Tree Mode will also be enabled automatically. Default: Disabled.");
     $optioninfo['role_override'] = array('heading' => 'Manager Mode: User Role / Capability Access Override', 'info' => "If the Override Password is provided in the password field, and it matches the Override Password established in the File Away Options page, then any user roles or capabilities specified here (in addition to the user roles / capabilities set in the permanent settings) will have Manager Mode privileges for this shortcode only. Enter a comma-separated list of user roles / capabilities, like so: <code>author,subscriber,townidiot,edit_pages</code>.<br /><br />Alternatively, in place of specifying actual roles or caps, you can elect to enter the dynamic code: <code>fa-userrole</code> into the Role Access Override field. Be aware that doing this will effectively grant Manager Mode access to all logged in users. Thus, the dynamic role code should only be used on File Away tables where the directory paths are also dynamic. This will grant users access to rename, copy, move, and delete files within the confines of their of own subdirectories.");
     $optioninfo['dirman_access'] = array('heading' => 'Manager Mode: Directory Management Access', 'info' => "If left blank, all users otherwise able to access manager mode will have the ability to create/delete/rename sub-directories of the established parent directory. If you wish to limit access to sub-directory management, include a comma-separated list of user roles / capabilities here. Only those roles / capabilities listed here will have access to directory management.");
     $optioninfo['user_override'] = array('heading' => 'Manager Mode: User Access Override', 'info' => "If the Override Password is provided in the password field, and it matches the Override Password established in the File Away Options page, then any user IDs specified here (in addition to the users set in the permanent settings) will have Manager Mode privileges, for this shortcode only. Enter a comma-separated list of user IDs, like so: <code>20,217,219</code>.<br /><br />Alternatively, in place of specifying actual user IDs, you can elect to enter the dynamic code: <code>fa-userid</code> into the User Access Override field. Be aware that doing this will effectively grant Manager Mode access to all logged in users. Thus, the dynamic user ID code should only be used on File Away tables where the directory paths are also dynamic. This will grant users access to rename, copy, move, and delete files within the confines of their of own subdirectories.");
     $optioninfo['drawerid'] = array('heading' => 'Drawer ID Number', 'info' => "You can have multiple Directory Tree Nav or Manager Mode tables on the same page, without the use of the iframe, if you assign each table a unique drawer id number. Just assign them a number the order the shortcodes appear in your page editor. <code>drawerid=1</code> for your first shortcode, <code>drawerid=2</code> for your second shortcode, etc. In the url, it will apear like this: <code>?drawer1=</code>");
     $optioninfo['drawericon'] = array('heading' => 'Directory Icon', 'info' => "The icon used for directories in Directory Tree mode. Default: Drawer.");
     $optioninfo['drawerlabel'] = array('heading' => 'Directory Column Label', 'info' => "The column heading for the Directory Names and File Names. Default: Drawer/File.");
     $optioninfo['excludedirs'] = array('heading' => 'Exclude Directories', 'info' => "In addition to any permanent directory exclusions specified on the File Away Options config tab, here you can include a comma-separated list of directory names you wish to exclude from this specific Directory Tree table or Recursive table/list. Do not include the forward slashes ('/'). The names listed here must match your directory names exactly, and are case-sensitive. Example:<br /><br /><code>My Private Files, Weird_Server_Directory_Name, etc.</code>");
     $optioninfo['onlydirs'] = array('heading' => 'Only These Directories', 'info' => "For your Directory Tree tables or Recursive tables/lists, here you can specify a comma-separated list of the only directory names you want to include in this table. All other sibling directories will be excluded. These directories must be found in the parent directory to which your shortcode is pointing (ie, your Base Directory and Sub Directory shortcode settings).<br /><br />Note: If you specify a directory 'My Files,' any subdirectories of 'My Files' will also be included. Example:<br /><br /><code>My Public Files, Public Records, etc.</code>");
     $optioninfo['playback'] = array('heading' => 'Audio Playback', 'info' => "Please read these notes carefully:<br /><br />You have two activation options: compact, and extended. Compact will put a small play/stop button in your filetype column. Extended will put a full-featured audio controller, with play/pause, draggable progress bar, track time, and volume, in your filename column.<br /><br />The audio player is compatible with mp3, ogg, and wav. If any of those file types are found, the player will be added to the column. Note that if you have multiple types with the same filename, then only one will show in the table, and the other file types will be added to the player as fallbacks for greater cross-browser compatibility. For instance: <br /><br />'My Song.mp3', 'My Song.ogg', and 'My Song.wav' will only show once on the table, but each file will be nested in the audio player as fallbacks for each other. If you only have one or two of those types in the directory, then only those found will be added to the player. One is sufficient. <br /><br />Note that any other audio file types that have the same filename will appear as download links under the File Name in the File Name column. (See <a class='inner-link' href='https://wordpress.org/plugins/file-away/screenshots/' target='_blank'>screenshots</a> for clarity.) For instance:<br /><br />If you have 'My Song.mp3', 'My Song.ogg', 'My Song.aiff', 'My Song.rx2' in the directory, then the mp3 and ogg files will be nested in the player, and each of the four matching audio files will be given their own download link in the second column, specifying their file type. The system searches for the following file types with matching file names, and will add them automatically: <code>" . implode(', ', $get->filegroups['audio'][2]) . "</code><br /><br />If no mp3, ogg, or wav file exists for that file name, then the files will appear in the table as any other file type, with no audio player. <br /><br />Note that you can also place your sample/playback files (mp3, ogg, wav) in a separate directory from the downloadable files (any audio file type), and specify the playback file directory using the 'playbackpath' shortcode attribute. See the info link next to 'Playback Path' for more info on that.<br /><br />Finally, note that Audio Playback mode is compatible with regular tables, Directory Tree tables, and Recursive tables, but is not compatible with Manager Mode.");
     $optioninfo['onlyaudio'] = array('heading' => 'Audio Files Only', 'info' => "Activate this option and only audio files will be shown in the table. Disabled, all otherwise-not-excluded files will be shown, but only audio files will get the playback button.");
     $optioninfo['loopaudio'] = array('heading' => 'Loop Audio', 'info' => "Activate this option to play audio files in a continuous loop.");
     $optioninfo['playbackpath'] = array('heading' => 'Playback Path', 'info' => "Optional. By default, the Playback system will search for mp3, ogg, and wav files in the directory specified by your Base Directory and Sub Directory shortcode attributes. If, however, you wish to store your playback files in a separate location from your download files, you can specify that location here. Rules:<br /><br />Do NOT include opening and closing forward slashes. Correct: <code>Files/Audio/Samples</code>. Incorrect: <code>/Files/Audio/Samples/</code><br /><br />Note: You must include the entire path beginning from your WordPress installation directory or site root. The Playback Path is ignorant of your specified base directory. So, let's say Base Directory 1 equals 'Files':<br /><br /><code>[fileaway base=\"1\" sub=\"Audio/Downloads\" playbackpath=\"Files/Audio/Samples\" playback=\"yes\"]</code><br /><br />If you have Directory Tree mode or Recursive mode enabled, you will probably want to be sure that your Playback folder is not a subdirectory of your Downloads folder.<br /><br />Finally, you can only specify one playback path for any given File Away table. It will not recurse into subdirectories looking for playback files.");
     $optioninfo['playbacklabel'] = array('heading' => 'Playback Column Label', 'info' => "When Audio Playback is not enabled, this column heading is fixed to 'Type'. When compact Playback is enabled, you can specify a different column label if desired. E.g., 'Sample'");
     $optioninfo['encryption'] = array('heading' => 'Encrypted Downloads', 'info' => "Disabled by default. If enabled, download links will be encrypted and the file locations will be masked. Not compatible with Manager Mode. Not smart to use with Directory Tree Navigation (since the directories are plain to see anyway), or with Bulk Downloads (the file paths can be found in a data-attribute in the HTML of each table row), but fine with Recursive Mode and with Audio Playback.");
     $optioninfo['orderby'] = array('heading' => 'Order By', 'info' => "Choose whether to order your page attachments by title, menu order, post id, date, date modified, or random.");
     $optioninfo['desc'] = array('heading' => 'Descending', 'info' => "Omit for ascending order; 'Yes' for descending order.");
     $optioninfo['s2skipconfirm'] = array('heading' => 'S2Members Skip Confirmation', 'info' => "Deactivates the javascript confirm dialogue on S2Member download links.");
     $optioninfo['fixedlocation'] = array('heading' => 'Upload Loations Options', 'info' => "If set to fixed, the only upload directory will be the path you specify with the base+sub attributes. By default, a user will be able to select subdirectories of that specified path from a dropdown.");
     $optioninfo['matchdrawer'] = array('heading' => 'Match Upload Directory to Current Directory Tree Drawer', 'info' => "You can lock the uploader path of the File Up form to match the current drawer of a corresponding File Away Directory Tree or Manager Mode table. If <code>matchdrawer</code> is enabled, <code>fixedlocation</code> will also be hardcoded to \"true\". Here's what you need to know:<br><br>1. The <code>base</code> and <code>sub</code> specifications must be the same for the two matching File Away and File Up shortcodes.<br>2. If you have only one File Away Directory Tree/Manager Mode table on the page, and you have not specified a <code>drawerid</code> in your <code>[fileaway]</code> shortcode, then all you have to do is add <code>matchdrawer=\"true\"</code> to your <code>[fileup]</code> shortcode.<br>3. If, however, you have more than one File Away Directory Tree/Manager Mode table on the page, then each of your File Away shortcodes should have a unique <code>drawerid</code> specified. In that case, the <code>matchdrawer</code> specification in our <code>[fileup]</code> shortcode should match the Drawer ID of the specific table to which you wish to lock the upload form. You can have multiple upload forms, each matched to one of multiple tables. It would look like this:<br><br>" . "<code>[fileup base=1 sub=\"files\" matchdrawer=\"true\"]</code> <-- No specific drawer specified, just \"true\"<br>" . "<code>[fileaway base=1 sub=\"files\" manager=\"true\"]</code> <-- no drawerid specified<br><br>" . "<code>[fileup base=2 sub=\"resources\" matchdrawer=\"1\"]</code> <-- matches drawer id 1<br>" . "<code>[fileaway base=2 sub=\"resources\" directories=\"true\" drawerid=\"1\"]</code> <-- drawer id set to 1<br><br>" . "<code>[fileup base=2 sub=\"docs\" matchdrawer=\"2\"]</code> <-- matches drawer id 2<br>" . "<code>[fileaway base=2 sub=\"docs\" manager=\"true\" drawerid=\"2\"]</code> <-- drawer id set to 2");
     $optioninfo['uploader'] = array('heading' => 'Append Uploader Name or User ID to File Name', 'info' => "If enabled and if the user is logged in, the user's display_name or User ID will be appended to the uploaded filename in File Away customdata format. In turn, you can display the uploader information in your File Away table using <code>[fileaway type=\"table\" customdata=\"Uploaded By\"]</code>");
     $optioninfo['uploadlabel'] = array('heading' => 'Upload Label', 'info' => "Change the text on the upload button.");
     $optioninfo['overwrite'] = array('heading' => 'Overwrite Filenames on Upload', 'info' => "By default, if an uploaded file has the same name as an existing file, the uploaded file will be automatically renamed. If overwrite is set to true (<code>overwrite=\"true\"</code>), all files uploaded will overwrite any file with the same filename. This is an either/or setting. Overwriting files should only be enabled in very specific circumstances. Note: overwriting will always be disabled if the user is not logged in.");
     $optioninfo['thumbnails'] = array('heading' => 'Media Thumbnails', 'info' => "You can have thumbnail images for jpg, png, and gif, images, for PDF files, and for any video file type that is playable in the Flightbox, including YouTube and Vimeo videos. Video thumbnails will work in either transient or permanent thumbnails mode. Thumbnails for video files must be supplied by you (with the exception of YouTube and Vimeo thumbs); they must exist in the same directory as the video file, and they must follow this naming format: <br><code>myVideofile.mp4<br>_thumb_vid_myVideofile.jpg</code><br><br>Video thumbnail images can be either <code>jpg</code> or <code>png</code>. The latter will take priority if both image types are found. The thumbnail images for videos should probably be at least 180px wide by 120px in height. Other than that, they can be any size. They will be scaled and cropped purely by CSS3.<br><br>YouTube and Vimeo thumbs will be grabbed from YouTube and Vimeo respectively, but if you want to override the default thumb from their servers, you can add your own thumbnail image to the directory as you would any other video thumbnail.<br><br>For jpg/jpeg, gif, and png thumbnails, you have two options: transient and permanent. Transient requires resources every time the page loads, as it generates a thumbnail for each image, but only temporarily. It does it all over again the next time the page loads. Permanent will create a permanent thumbnail image the first time the page loads. The next time the page loads, if that thumbnail already exists, it doesn't have to create it again. Permanent thumbnails are prefixed by <code>_thumb_wd_</code> or <code>_thumb_sq_</code>, followed by the filename (medium and large thumbs also include med_ or lrg_ in the prefix).<br /><br />Since transient thumbnails require more resources, there are other options to determine how to skip over images that are too large for your server to handle. See the info links for the Max Source Bytes, Max Source Width, and Max Source Height options that will appear below when the Transient option is selected.<br><br>PDF thumbnails will be generated only in permanent mode.");
     $optioninfo['thumbsize'] = array('heading' => 'Thumbnail Size', 'info' => "Default: Small. If omitted, the thumbnail size will be small.<br><br>Small: 60x40 (wide) and 40x40 (sqaure)<br>Medium: 120x80 (wide) and 80x80 (square)<br>Large: 180x120 (wide) and 120x120 (square).");
     $optioninfo['thumbstyle'] = array('heading' => 'Thumbnail Style', 'info' => "The cropped dimensions and aesthetics of your generated thumbnails. The dimensions (wide/oval, square/circle) are fed into the server-side script that generates the thumbnails. The sharp/rounded specification is handled by the CSS on the client-side.");
     $optioninfo['graythumbs'] = array('heading' => 'Thumbnail Grayscale Filter', 'info' => "If set to Grayscale, the css will apply a grayscale filter to your thumbnails for all browsers that can handle it.");
     $optioninfo['maxsrcbytes'] = array('heading' => 'Max Image Source Size in Bytes', 'info' => "This setting applies to 'transient' thumbnails only. Default: <code>1887436.8</code> (i.e., 1.8M)<br /><br />If the pixel dimensions and/or filesize of your image are too large for your server to handle, the script will fail and return a broken image graphic in place of your thumbnail. To prevent this, we set the maximum size in bytes, maximum width in pixels, and maximum height in pixels, of the source image. If the source image is greater than any one of these, the filetype icon will be output instead of attempting to generate a thumbnail.<br /><br />Tweak these three settings to suit your server and find the right balance. Find the lowest threshold for an image where the server can easily handle generating the thumbnail, and set it there. <br /><br />You can also adjust your <code>memory_limit</code> setting in your php.ini file, but be very careful about making this limit too large, which might create other problems for you.");
     $optioninfo['maxsrcwidth'] = array('heading' => 'Max Image Source Width in Pixels', 'info' => "This setting applies to 'transient' thumbnails only. Default: <code>3000</code><br /><br />If the pixel dimensions and/or filesize of your image are too large for your server to handle, the script will fail and return a broken image graphic in place of your thumbnail. To prevent this, we set the maximum size in bytes, maximum width in pixels, and maximum height in pixels, of the source image. If the source image is greater than any one of these, the filetype icon will be output instead of attempting to generate a thumbnail. <br /><br />Tweak these three settings to suit your server and find the right balance. Find the lowest threshold for an image where the server can easily handle generating the thumbnail, and set it there. <br /><br />You can also adjust your <code>memory_limit</code> setting in your php.ini file, but be very careful about making this limit too large, which might create other problems for you.");
     $optioninfo['maxsrcheight'] = array('heading' => 'Max Image Source Height in Pixels', 'info' => "This setting applies to 'transient' thumbnails only. Default: <code>2500</code><br /><br />If the pixel dimensions and/or filesize of your image are too large for your server to handle, the script will fail and return a broken image graphic in place of your thumbnail. To prevent this, we set the maximum size in bytes, maximum width in pixels, and maximum height in pixels, of the source image. If the source image is greater than any one of these, the filetype icon will be output instead of attempting to generate a thumbnail. <br /><br />Tweak these three settings to suit your server and find the right balance. Find the lowest threshold for an image where the server can easily handle generating the thumbnail, and set it there. <br /><br />You can also adjust your <code>memory_limit</code> setting in your php.ini file, but be very careful about making this limit too large, which might create other problems for you.");
     $optioninfo['bannerize'] = array('heading' => 'Banner Interval', 'info' => "To activate banners in your table, just enter the integer here, i.e., the number of files that should be displayed between each instance of a banner. For further instructions on how to Bannerize your File Away table, see the Tutorials tab on the File Away settings page.");
     $optioninfo['fadein'] = array('heading' => 'Fade In', 'info' => "Default: Disabled. Tables or lists with large numbers of files, and especially paginated tables, can sometimes take a second or two to initialize, and the CSS may look funky for a bit while everything is getting situated. To avoid this, you can choose to fade in your list or table after it's done getting ready. If you choose Opacity Fade, the height of the list or table will be preserved while it's not yet visible. If you choose Display Fade, any content below the list or table will be pushed down when it fades in.");
     $optioninfo['fadetime'] = array('heading' => 'Fade In Time', 'info' => "Default: 1000. Choose the amount of time the fade in will take, in milliseconds. E.g., 1500 equals 1.5 seconds. There will be a fixed one second delay upon pageload before the fade in begins.");
     $optioninfo['nolinksbox'] = array('heading' => 'Flightbox Download Links', 'info' => "Default: Enabled. You can disable the Download Arrow on the Flightbox if you so desire. Won't stop clever people from right-clicking and saving images, and there's nothing you can do to stop PDFs from being saved/printed. Nevertheless, the option exists for your discretion.");
     $optioninfo['limit'] = array('heading' => 'Limit Results', 'info' => "Default: No Limit. If you wish to limit the number of files that are output to your list or table from the scan, enter the number of results you'd like here. Integers only, e.g., <code>25</code>");
     $optioninfo['limitby'] = array('heading' => 'Limit Results By Order Type', 'info' => "Default: Random (if limit is set). If you haven't set a limit, this feature will do nothing. Otherwise, choose from the available options. For instance, if you want to get the five most recent files in the directory, enter <code>5</code> for the <code>limit</code> attribute, and <code>mostrecent</code> here.");
     $optioninfo['filenamelabel'] = array('heading' => 'File Name Column Label', 'info' => "Optional. The label for the File Name column. You may wish to give it a different name. E.g., <code>Links</code> or <code>Titles</code>.");
     $optioninfo['datelabel'] = array('heading' => 'Date Modified Column Label', 'info' => "Optional. The label for the Date Modified column. Maybe shorten it to just <code>Updated</code> or something.");
     $optioninfo['placeholder'] = array('heading' => 'CSV Selection Placeholder Text', 'info' => "If you're not pointing to a specific CSV filename, and if there is more than one CSV file in the directory or directories to which you're pointing, a dropdown will appear allowing the user to select the CSV file they wish to load into the table. By default, the placeholder text will read <code>Select CSV</code>. You can change it here if you'd like.");
     $optioninfo['sorting'] = array('heading' => 'Column Sorting', 'info' => "Default if not in Editor Mode: Disabled. You can enable or disable column sorting on your CSV table. If in Editor Mode, sorting will be enabled.");
     $optioninfo['filename'] = array('heading' => 'CSV File Name', 'info' => "If you omit the Filename, the shortcode will scan the directory (or directory and sub-directories if recursive iteration is enabled) for all CSV files, and display them in a dropdown for selection by the user. The selected CSV will then load into a table on the page. If, however, you specify a filename, then only that CSV file will load, and there will be no dropdown selection available to the user.<br><br>Note that for CSV filenames, File Away Dynamic Path Codes can be used. See the tutorial on Dynamic Paths for detailed information, but in brief: <code>fa-username</code>, <code>fa-userrole</code>, <code>fa-userid</code>, <code>fa-firstlast</code>, and <code>fa-usermeta(metakey)</code> (replacing \"metakey\" with the user meta key name of your choice) are the five Dynamic Codes. So if the CSV file is named for the user's username, in directory also named for their username, like this for instance: <code>/files/users/billybob/billybob_datasheet.csv</code>, then your shortcode would look something like this: <code>[fileaway_values base=\"1\" sub=\"files/users/fa-username\" filename=\"fa-username_datasheet.csv\"]</code>");
     $optioninfo['editor'] = array('heading' => 'CSV Editor Mode', 'info' => "Default: Disabled. If enabled, the user will be able to change the values of any cell, add new rows to the spreadsheet, delete existing rows, create new columns, delete existing columns, rename columns, and save timestamped backup files to the server. If Editor Mode is enabled and a specific filename is not specified, the user will also be able to create new CSV files from scratch. To change the value of a cell, double-click on the cell, enter the new value, then click outside the cell. It will save automatically. To add or delete rows, right-mouse click on a row to get the context-menu. To add, delete, or rename columns, right-mouse click on a column heading. When a row is deleted, or a column is modified, the page will automatically refresh in order to update the row and column numbers in the table, to ensure subsequent changes to the document are correct. To see that the changes have been made to your actual CSV file on the server, you can download the CSV at any time (click on the filename header if there is no dropdown, or the Down Arrow icon if there is a dropdown).");
     $optioninfo['makecsv'] = array('heading' => 'Make New CSV', 'info' => "This takes a comma-separated list of Column Headers for a new CSV file which will be created for you on pageload if the file does not already exist in the directory specified. <code>makecsv</code> will be disabled if no filename is specified in the <code>filename</code> attribute. If <code>makecsv</code> is used, <code>makedir</code> will also be activated whether specified or not. Example: <code>Column 1 Header,Column 2 Header,Column 3 Header</code>. It no filename is specified, you will be able to create new CSV documents using the UI on the front-end, with Editor Mode enabled.");
     $optioninfo['read'] = array('heading' => 'Read Encoding', 'info' => "Default if omitted: ISO-8859-1. The character encoding set with which your CSV file will be read.");
     $optioninfo['write'] = array('heading' => 'Write Encoding', 'info' => "Default if omitted: ISO-8859-1. The character encoding set with which your CSV file will be written.");
     $optioninfo['numcols'] = array('heading' => 'Total Number of Columns', 'info' => "Required. Designate the total number of columns for your table.");
     $optioninfo['sort'] = array('heading' => 'Sorting Options', 'info' => "Choose whether the initial sort will be in ascending or descending order, or disable column sorting completely.");
     $optioninfo['initialsort'] = array('heading' => 'Initial Sort', 'info' => "Designate the column by which to sort the table on initial pageload. Identify the column by its number. Default will be 1 if left blank.");
     $optioninfo['col'] = array('heading' => 'Column Heading', 'info' => "Required. The heading for this particular column.");
     $optioninfo['colclass'] = array('heading' => 'Column Class', 'info' => "Apply one or more CSS classes to your column heading cell. Separate multiple classes with a space.");
     $optioninfo['coltype'] = array('heading' => 'Column Sort Type', 'info' => "Choose whether the column should be sorted as Alphabetical or as Numeric. Default: alpha");
     $optioninfo['colsort'] = array('heading' => 'Column Sort Option', 'info' => "Choose whether to enable or disable sorting for this particular column. If sorting is disabled for this column, it will still be sorted according to other columns, but will not be sortable itself. By default, all columns are sortable, if sorting is enabled globally.");
     $optioninfo['classes'] = array('heading' => 'CSS Classes', 'info' => "Optionally apply one or more CSS classes to the outermost containing div of your table. Separate multiple classes with a space.");
     $optioninfo['sortvalue'] = array('heading' => 'Sort Value', 'info' => "A hidden value by which to sort that column, if you do not wish to sort by the visible cell content itself. Useful for dates, or images, or whatever you like. For example, if your date field id is 125, your cell shortcode could look like this:<br><br><code>[formaway_cell classes=\"mydateclass\" sortvalue=\"[125 format=Ymd]\"][125 format='D, F jS, Y'][/fileaway_cell]</code><br><br>This would sort the dates column like this: <code>20141231</code>, so that the dates are sorted in proper chronological order. The sort value should be a relatively short string of text, not an image and not a string that includes HTML tags.");
     $optioninfo['colspan'] = array('heading' => 'Colspan', 'info' => "An integer determining how many columns this cell should cover. If omitted, the default is 1. Note that using the colspan attribute with an integer greater than 1 will effectively destroy the table's ability to sort columns.");
     $optioninfo['clearfix'] = array('heading' => 'Clearfix', 'info' => "Optionally add a clearfix div to the end of your table. Omit this attribute if you do not wish to add a clearfix div.");
     $optioninfo['show'] = array('heading' => 'Show', 'info' => 'Show Top Downloads or Most Recent Downloads. Default if omitted: Top Downloads.');
     $optioninfo['scope'] = array('heading' => 'Scope', 'info' => "The date range within which to draw the data. For <code>[stataway]</code> lists, <code>all</code> is not recommended if your site is high traffic. For <code>[stataway_user]</code> shortcodes, <code>all</code> is fine, since the results are limited to a single user.");
     $optioninfo['number'] = array('heading' => 'Number to Show', 'info' => "If omitted, all results within the scope will be displayed. Otherwise, enter an integer, e.g., <code>10</code> to show the top 10 downloads, or 10 most recent downloads.");
     $optioninfo['class'] = array('heading' => 'CSS Class', 'info' => "Optionally add your own CSS class (or multiple space-separated classes) to the containing element.");
     $optioninfo['username'] = array('heading' => 'Username Column', 'info' => "Whether to show or hide the username column in statistics tables.");
     $optioninfo['email'] = array('heading' => 'User Email Column', 'info' => "Whether to show or hide the user email column in statistics tables.");
     $optioninfo['ip'] = array('heading' => 'IP Address Column', 'info' => "Whether to show or hide the IP address column in statistics tables.");
     $optioninfo['agent'] = array('heading' => 'User Agent Column', 'info' => "Whether to show or hide the user agent column in statistics tables.");
     $optioninfo['output'] = array('heading' => 'Output Type', 'info' => "Choose whether to display the total number of download for the given user as a single integer (wrapped in a span element with the class of your choice), or to display an ordered or unordered list of the given user's file downloads, wrapped in a div with the class of your choice. Default: total");
     $optioninfo['user'] = array('heading' => 'User ID', 'info' => "If left blank, the default will be the current logged in user. Otherwise, you may specify a single user id.");
     $optioninfo['timestamp'] = array('heading' => 'Timestamp', 'info' => "Whether to show or hide the timestamp on ordered/unordered list output. Default: hide.");
     $optioninfo['filecolumn'] = array('heading' => 'File Column', 'info' => "Whether to show the full path to the file plus the file name, or just the file name, in your statistics table's file column. Full path is the default, and is recommended to avoid confusion if more than one file in different directories has the same file name.");
     $this->optioninfo = $optioninfo;
 }
Esempio n. 22
0
                $getthumb = false;
                break;
            }
            break;
        }
    } elseif ($thumbnails == 'permanent') {
        if ($extension == 'pdf' && function_exists('exec')) {
            $thumbpath = $rootpath . $dir . '/_thumb_' . $thumbfix . $rawname . '.jpg';
            $tempfile = fileaway_utility::urlesc($file);
            if (!is_file($thumbpath)) {
                $pdfpath = $rootpath . $dir . '/' . $file;
                //exec("convert \"{$pdfpath}[0]\" -colorspace RGB -geometry 60x40 $thumbpath");
                //exec("convert -define jpeg:size=120x60 \"{$pdfpath}[0]\" -colorspace RGB -geometry 120x60 $thumbpath");
                if ($thumbsize == 'large') {
                    exec("convert -define jpeg:size=180x180 \"{$pdfpath}[0]\" -colorspace RGB -thumbnail 180x180 -gravity center -crop 180x180+0+0 +repage {$thumbpath}");
                } elseif ($thumbsize == 'medium') {
                    exec("convert -define jpeg:size=120x120 \"{$pdfpath}[0]\" -colorspace RGB -thumbnail 120x120 -gravity center -crop 120x120+0+0 +repage {$thumbpath}");
                } else {
                    exec("convert -define jpeg:size=60x60 \"{$pdfpath}[0]\" -colorspace RGB -thumbnail 60x60 -gravity center -crop 60x60+0+0 +repage {$thumbpath}");
                }
            }
            $thumblink = is_file($thumbpath) ? str_replace($tempfile, '_thumb_' . $thumbfix . fileaway_utility::replacelast($tempfile, '.pdf', '.jpg'), $links[$k]) : false;
        } else {
            $tempfile = fileaway_utility::urlesc($file);
            if (!is_file($rootpath . $dir . '/_thumb_' . $thumbfix . $file)) {
                fileaway_utility::createthumb($rootpath . $dir . '/' . $file, $rootpath . $dir . '/_thumb_' . $thumbfix . $file, $extension, $thumbwidth, $thumbheight);
            }
            $thumblink = is_file($rootpath . $dir . '/_thumb_' . $thumbfix . $file) ? str_replace($tempfile, '_thumb_' . $thumbfix . $tempfile, $links[$k]) : false;
        }
    }
}
Esempio n. 23
0
 public function userstats($atts)
 {
     if (!is_user_logged_in()) {
         return;
     }
     extract($this->correct(wp_parse_args($atts, $this->stataway_user), $this->shortcodes['stataway_user']));
     global $wpdb;
     $userid = $user && is_numeric($user) ? $user : get_current_user_id();
     if (!get_userdata($userid)) {
         return false;
     }
     fileaway_utility::timezone();
     $now = date('Y-m-d H:i:s');
     switch ($scope) {
         case '24hrs':
             $begin = date('Y-m-d H:i:s', strtotime($now . ' - 24 hours'));
             break;
         case 'week':
             $begin = date('Y-m-d H:i:s', strtotime($now . ' - 1 week'));
             break;
         case 'twoweeks':
             $begin = date('Y-m-d H:i:s', strtotime($now . ' - 2 weeks'));
             break;
         case 'month':
             $begin = date('Y-m-d H:i:s', strtotime($now . ' - 30 days'));
             break;
         case 'year':
             $begin = date('Y-m-d H:i:s', strtotime($now . ' - 1 year'));
             break;
         case 'all':
             $begin = '1900-01-01 00:00:00';
             break;
         default:
             $begin = date('Y-m-d H:i:s', strtotime($now . ' - 1 week'));
     }
     $end = $now;
     $records = $wpdb->get_results($wpdb->prepare("SELECT file, timestamp FROM " . fileaway_stats::$db . " WHERE uid = %d AND timestamp >= %s AND timestamp <= %s ORDER BY timestamp DESC", $userid, $begin, $end), ARRAY_A);
     if (!$records || count($records) < 1) {
         $count = 0;
     } else {
         $count = count($records);
     }
     date_default_timezone_set('UTC');
     if ($output == 'total') {
         return '<span class="' . $class . '">' . $count . '</span>';
     }
     if ($count < 1) {
         return false;
     }
     $datestring = $this->op['daymonth'] == 'md' ? 'm/d/Y' : 'd/m/Y';
     $items = array();
     foreach ($records as $i => $record) {
         $items[$i] = '<li>' . fileaway_utility::basename($record['file']);
         if ($timestamp == 'yes') {
             $items[$i] .= ' <span style="display:block;" class="' . $class . 'timestamp">' . date($datestring . ' ' . get_option('time_format'), strtotime($record['timestamp'])) . '</span>';
         }
         $items[$i] .= '</li>';
     }
     return '<div class="' . $class . '"><' . $output . '>' . implode($items) . '</' . $output . '></div>';
 }
 public function manager()
 {
     $dm = 'Go directly to jail. Do not pass GO. Do not collect $200 dollars.';
     if (!wp_verify_nonce($_POST['nonce'], 'fileaway-nonce')) {
         die($dm);
     }
     $li = is_user_logged_in();
     extract($this->pathoptions);
     $action = $_POST['act'];
     // Flightbox
     if ($action === 'flightbox') {
         if (!wp_verify_nonce($_POST['flightbox_nonce'], 'fileaway-flightbox-nonce')) {
             die($dm);
         }
         list($url, $query) = explode('?boxtype=', $_POST['url']);
         $src = $url;
         $query = 'boxtype=' . $query;
         parse_str($query);
         if (($s2 == 'true' || $s2 == 'skip') && $g == 'false') {
             $s2skip = $s2 == 'skip' ? '&s2member_skip_confirmation' : '';
             $init = fileaway_utility::replacefirst($url, rtrim($this->settings['baseurl'], '/') . '/', $rootpath);
             $sub = fileaway_utility::replacefirst($init, WP_PLUGIN_DIR . '/s2member-files/', '');
             $url = rtrim($this->settings['baseurl'], '/') . '/?s2member_file_download=' . $sub . $s2skip;
         }
         $url = $g == 'true' ? $this->settings['redirect'] : $url;
         $statstatus = $s == 'true' ? ' data-stat="true"' : ' data-stat="false"';
         $linktype = $g == 'true' || $GLOBALS['is_IE'] || $GLOBALS['is_safari'] ? 'target="_blank"' : 'download';
         $uid = (string) $_POST['uid'];
         $icons = (string) $_POST['icons'];
         $next = stripslashes($_POST['next']);
         $prev = stripslashes($_POST['prev']);
         $current = stripslashes($_POST['current']);
         $nolinks = $_POST['nolinks'] == 'true' ? true : false;
         $wh = $_POST['wh'];
         $ww = $_POST['ww'];
         if ($wh > 1000) {
             $font = 20;
             $bar = 40;
             $mrg = 20;
         } elseif ($wh > 800) {
             $font = 16;
             $bar = 32;
             $mrg = 16;
         } elseif ($wh > 600) {
             $font = 14;
             $bar = 28;
             $mrg = 14;
         } elseif ($wh > 400) {
             $font = 12;
             $bar = 24;
             $mrg = 12;
         } else {
             $font = 8;
             $bar = 20;
             $mrg = 8;
         }
         if ($boxtype == 'image') {
             if ($wh < $mh + 150) {
                 $mh = $wh - 150;
             }
             if ($ww < $mw) {
                 $mw = $ww - 150;
             }
             if ($d == 'width') {
                 $ratio = $w / $h;
                 $width = $w < $mw ? $w : $mw;
                 $height = round($width / $ratio, 0);
                 if ($height > $mh) {
                     $d = 'height';
                 }
             }
             if ($d == 'height') {
                 $ratio = $h / $w;
                 $height = $h < $mh ? $h : $mh;
                 $width = round($height / $ratio, 0);
             }
             if ($width < 200) {
                 $offset = ($ww - 230) / 2;
                 $cwidth = 200 + 30;
                 $cheight = $height + $bar + 30;
             } else {
                 $offset = ($ww - ($width + 30)) / 2;
                 $cwidth = $width + 30;
                 $cheight = $height + $bar + 30;
             }
             $csize = 'width:' . $cwidth . 'px; height:' . $cheight . 'px;';
             $isize = 'width:' . $width . 'px; height:' . $height . 'px;';
             $top = $wh < $height + $bar + 30 ? '0' : ($wh - ($height + $bar + 30)) / 2;
             $download_link = $nolinks ? null : '<a href="' . $url . '" class="ssfa-flightbox-download" ' . $linktype . $statstatus . '>' . '<span class="ssfa-icon-arrow-down-2" style="font-size:' . $font . 'px; margin-right:5px; display:inline-block;"></span>' . '</a>';
             $response = array('html' => '<div id="ssfa-flightbox" class="' . $_POST['theme'] . '" style="display:inline-block; ' . $csize . ' left:' . $offset . 'px; top:' . $top . 'px; padding:0px!important;">' . '<div id="ssfa-flightbox-inner" style="opacity:0; margin: 15px 15px 0!important;">' . '<a href="' . $_POST['nexturl'] . '" onclick="' . $next . '"><img src="' . $src . '" style="' . $isize . '"></a>' . '</div>' . '<div class="ssfa-flightbox-controls ' . $icons . '" style="margin:' . $mrg . 'px 15px!important; display:block; text-align:right;">' . '<a href="' . $_POST['prevurl'] . '" onclick="' . $prev . '">' . '<span class="ssfa-icon-arrow-left-2" style="font-size:' . $font . 'px; margin-right:5px; display:inline-block;"></span>' . '</a>' . '<a href="' . $_POST['nexturl'] . '" onclick="' . $next . '">' . '<span class="ssfa-icon-arrow-right-2" style="font-size:' . $font . 'px; margin-right:5px; display:inline-block;"></span>' . '</a>' . $download_link . '<a href="javascript:" onclick="Xflightbox();">' . '<span class="ssfa-icon-console-2" style="font-size:' . $font . 'px; margin-right:0; display:inline-block;"></span>' . '</a>' . '</div>' . '</div>', 'width' => $cwidth . 'px', 'height' => $cheight . 'px', 'top' => $top . 'px', 'offset' => $offset . 'px', 'iframe' => 'false');
         } elseif ($boxtype == 'video') {
             $is_iframe = 'true';
             $ratio = 1920 / 1080;
             $height = round($w / $ratio, 0);
             if ($wh < $height + 150) {
                 $height = $wh - 150;
                 $w = round($height * $ratio, 0);
             }
             $csize = 'width:' . ($w + 30) . 'px; height:' . ($height + $bar + 30) . 'px;';
             $top = $wh < $height + $bar + 30 ? '0' : ($wh - ($height + $bar + 30)) / 2;
             $offset = ($ww - ($w + 30)) / 2;
             if ($e == 'vmeo') {
                 $download = null;
                 $vimeo = explode('vimeo.com/', $src);
                 $vid_id = $vimeo[1];
                 $video = '<iframe src="//player.vimeo.com/video/' . $vid_id . '?title=0&amp;byline=0&amp;portrait=0&amp;color=ffffff&amp;autoplay=0" ' . 'width="' . $w . '" height="' . $height . '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
             } elseif ($e == 'tube') {
                 $download = null;
                 if (stripos($src, 'youtu.be/') !== false) {
                     $youtube = explode('youtu.be/', $src);
                     $yt = explode('?', $youtube[1]);
                     $vid_id = $yt[0];
                 } else {
                     $youtube = explode('?', $src);
                     parse_str($youtube[1], $yt);
                     $vid_id = $yt['v'];
                 }
                 $video = '<iframe width="' . $w . '" height="' . $height . '" src="//www.youtube.com/embed/' . $vid_id . '?rel=0" frameborder="0" allowfullscreen></iframe>';
             } elseif ($e == 'flv') {
                 $is_iframe = 'false';
                 $download = $nolinks ? null : '<a href="' . $url . '" class="ssfa-flightbox-download" ' . $linktype . $statstatus . '>' . '<span class="ssfa-icon-arrow-down-2" style="font-size:' . $font . 'px; margin-right:5px; display:inline-block;"></span>' . '</a>';
                 $video = '<object type="application/x-shockwave-flash" data="' . fileaway_url . '/lib/swf/player_flv_maxi.swf" width="' . $w . '" height="' . $height . '">' . '<param name="movie" value="' . fileaway_url . '/lib/swf/player_flv_maxi.swf" />' . '<param name="allowFullScreen" value="true" />' . '<param name="FlashVars" ' . 'value="flv=' . $src . '&amp;margin=0' . '&amp;bgcolor=000000&' . 'amp;bgcolor1=000000' . '&amp;bgcolor2=000000' . '&amp;showstop=1' . '&amp;showvolume=1' . '&amp;showtime=1' . '&amp;showfullscreen=1' . '&amp;buttonovercolor=ffffff' . '&amp;sliderovercolor=ffffff' . '&amp;showiconplay=1' . '&amp;showmouse=autohide" ' . '/>' . '</object>';
             } else {
                 $is_iframe = 'false';
                 $download = $nolinks ? null : '<a href="' . $url . '" class="ssfa-flightbox-download" ' . $linktype . $statstatus . '>' . '<span class="ssfa-icon-arrow-down-2" style="font-size:' . $font . 'px; margin-right:5px; display:inline-block;"></span>' . '</a>';
                 $video = fileaway_utility::video(array('src' => $src, 'height' => $height, 'width' => $w, 'class' => 'ssfa-flightbox-video-player', 'preload' => 'none', 'id' => uniqid('flightbox-video-')));
             }
             $response = array('html' => '<div id="ssfa-flightbox" class="' . $_POST['theme'] . '" style="display:inline-block; ' . $csize . ' left:' . $offset . 'px; top:' . $top . 'px; padding:0!important;">' . '<div id="ssfa-flightbox-inner" style="opacity:0; margin: 15px 15px 0!important;">' . $video . '</div>' . '<div class="ssfa-flightbox-controls ' . $icons . '" style="margin:' . $mrg . 'px 15px!important; display:block; text-align:right;">' . '<a href="' . $_POST['prevurl'] . '" onclick="' . $prev . '">' . '<span class="ssfa-icon-arrow-left-2" style="font-size:' . $font . 'px; margin-right:5px; display:inline-block;"></span>' . '</a>' . '<a href="' . $_POST['nexturl'] . '" onclick="' . $next . '">' . '<span class="ssfa-icon-arrow-right-2" style="font-size:' . $font . 'px; margin-right:5px; display:inline-block;"></span>' . '</a>' . $download . '<a href="javascript:" onclick="Xflightbox();">' . '<span class="ssfa-icon-console-2" style="font-size:' . $font . 'px; margin-right:0; display:inline-block;"></span>' . '</a>' . '</div>' . '</div>', 'width' => $w + 30 . 'px', 'height' => $height + $bar + 30 . 'px', 'top' => $top . 'px', 'offset' => $offset . 'px', 'iframe' => $is_iframe, 'iwidth' => $w, 'iheight' => $height);
         } elseif ($boxtype == 'pdf') {
             $of = $wh < 720 ? 100 : ($wh < 400 ? 50 : 200);
             if ($r == 'tall') {
                 $ratio = 22 / 17;
                 $height = $wh - $of;
                 $width = round($height / $ratio, 0);
                 $rotate = 'expand';
                 $current = str_replace('&r=tall', '&r=wide', $current);
                 $currenturl = str_replace('&r=tall', '&r=wide', $_POST['currenturl']);
             } else {
                 $ratio = 22 / (17 / 1.5);
                 $height = $wh - $of;
                 $width = round($height * $ratio, 0);
                 while ($width > $ww - $of) {
                     $width = $width - 10;
                 }
                 $rotate = 'contract';
                 $current = str_replace('&r=wide', '&r=tall', $current);
                 $currenturl = str_replace('&r=wide', '&r=tall', $_POST['currenturl']);
             }
             if ($width < 200) {
                 $width = 200;
             }
             $csize = 'width:' . ($width + 30) . 'px; height:' . ($height + $bar + 30) . 'px;';
             $top = $wh < $height + $bar + 30 ? '0' : ($wh - ($height + $bar + 30)) / 2;
             $offset = ($ww - ($width + 30)) / 2;
             $download_link = $nolinks ? null : '<a href="' . $url . '" class="ssfa-flightbox-download" ' . $linktype . $statstatus . '>' . '<span class="ssfa-icon-arrow-down-2" style="font-size:' . $font . 'px; margin-right:5px; display:inline-block;"></span>' . '</a>';
             $response = array('html' => '<div id="ssfa-flightbox" class="' . $_POST['theme'] . '" style="display:inline-block; ' . $csize . ' left:' . $offset . 'px; top:' . $top . 'px; padding:0!important;">' . '<div id="ssfa-flightbox-inner" style="opacity:0; margin: 15px 15px 0!important;">' . '<iframe src="' . $src . '" frameborder=0 height="' . $height . '" width="' . $width . '" name="' . fileaway_utility::basename($src) . '" scrolling="no" seamless>' . 'Your browser does not support iframes.' . '</iframe>' . '</div>' . '<div class="ssfa-flightbox-controls ' . $icons . '" style="margin:' . $mrg . 'px 15px!important; display:block; text-align:right;">' . '<a href="' . $_POST['prevurl'] . '" onclick="' . $prev . '">' . '<span class="ssfa-icon-arrow-left-2" style="font-size:' . $font . 'px; margin-right:5px; display:inline-block;"></span>' . '</a>' . '<a href="' . $_POST['nexturl'] . '" onclick="' . $next . '">' . '<span class="ssfa-icon-arrow-right-2" style="font-size:' . $font . 'px; margin-right:5px; display:inline-block;"></span>' . '</a>' . '<a href="' . $currenturl . '" onclick="' . $current . '">' . '<span class="ssfa-icon-' . $rotate . '" style="font-size:' . $font . 'px; margin-right:5px; display:inline-block;"></span>' . '</a>' . $download_link . '<a href="javascript:" onclick="Xflightbox();">' . '<span class="ssfa-icon-console-2" style="font-size:' . $font . 'px; margin-right:0; display:inline-block;"></span>' . '</a>' . '</div>' . '</div>', 'width' => $width + 30 . 'px', 'height' => $height + $bar + 30 . 'px', 'top' => $top . 'px', 'offset' => $offset . 'px', 'iframe' => 'true', 'iwidth' => $width, 'iheight' => $height);
         }
     } elseif ($action === 'createdir') {
         if (!$li) {
             die($dm);
         }
         if (!wp_verify_nonce($_POST['manager_nonce'], 'fileaway-manager-nonce')) {
             die($dm);
         }
         $parents = stripslashes(trim(str_replace('..', '', $_POST['parents']), '/'));
         $newsub = stripslashes(trim(str_replace('..', '', $_POST['newsub']), '/'));
         $uid = $_POST['uid'];
         $count = $_POST['count'];
         $page = $_POST['pg'];
         $querystring = ltrim($_POST['querystring'], '?');
         $drawericon = $_POST['drawer'];
         $drawerid = $_POST['drawerid'];
         $cells = $_POST['cells'];
         $class = $_POST['cls'];
         $base = $_POST['base'];
         $subs = explode('/', $newsub);
         $first = $subs[0];
         $last = $subs[count($subs) - 1];
         $start = trim(fileaway_utility::replacefirst($parents, $base, '') . '/' . $first, '/');
         $drawer = str_replace('/', '*', $start);
         $final = $rootpath . $parents . '/' . $newsub;
         $prettyfolder = str_replace(array('~', '--', '_', '.', '*'), ' ', "{$first}");
         $prettyfolder = preg_replace('/(?<=\\D)-(?=\\D)/', ' ', "{$prettyfolder}");
         $prettyfolder = preg_replace('/(?<=\\D)-(?=\\d)/', ' ', "{$prettyfolder}");
         $prettyfolder = preg_replace('/(?<=\\d)-(?=\\D)/', ' ', "{$prettyfolder}");
         $prettyfolder = fileaway_utility::strtotitle($prettyfolder);
         if (is_dir($final)) {
             $response = array('status' => 'error', 'message' => __('That directory name already exists in this location.', 'file-away'));
         } else {
             $first_exists = is_dir($rootpath . $parents . '/' . $first) ? true : false;
             if (mkdir($final, 0755, true)) {
                 fileaway_utility::indexmulti($rootpath . $parents . '/' . $newsub, $rootpath . $parents . '/');
                 if (!$first_exists) {
                     $status = "insert";
                     $message = "<tr id='ssfa-dir-{$uid}-{$count}' class='ssfa-drawers'>" . "<td id='folder-ssfa-dir-{$uid}-{$count}' data-value=\"# # # # # {$first}\" class='ssfa-sorttype {$class}-first-column'>" . "<a href=\"" . fileaway_utility::querystring(get_permalink($page), $querystring, array($drawerid => $drawer)) . "\" data-name=\"" . $first . "\" data-path=\"" . $start . "\">" . "<span style='font-size:20px; margin-left:3px;' class='ssfa-faminicon ssfa-icon-{$drawericon} ssfa-classic' aria-hidden='true'></span>" . "<br>" . _x('dir', 'abbrv. of *directory*', 'file-away') . "</a>" . "</td>" . "<td id='name-ssfa-dir-{$uid}-{$count}' data-value='# # # # # {$first}' class='ssfa-sortname'>" . "<a class='ssfa-classic' href=\"" . fileaway_utility::querystring(get_permalink($page), $querystring, array($drawerid => $drawer)) . "\">" . "<span class='ssfa-filename' style='text-transform:uppercase;'>{$prettyfolder}</span>" . "</a>" . "<input type='text' id='rename-ssfa-dir-{$uid}-{$count}' type='text' value=\"{$first}\" " . "style='width:90%; text-align:center; display:none'>" . "</td>";
                     $icell = 1;
                     while ($icell < $cells) {
                         $message .= "<td class='{$class}' data-value=\"# # # # # {$first}\"> &nbsp; </td>";
                         $icell++;
                     }
                     $message .= "<td id='manager-ssfa-dir-{$uid}-{$count}' class=\"{$class}\" data-value=\"# # # # # {$first}\">" . "<a href='' id='rename-ssfa-dir-{$uid}-{$count}'>" . __('Rename', 'file-away') . "</a><br>" . "<a href='' id='delete-ssfa-dir-{$uid}-{$count}'>" . __('Delete', 'file-away') . "</a>" . "</td>";
                     $message .= "</tr>";
                 } else {
                     $status = "success";
                     $message = __('Your sub-directories have been successfully created.', 'file-away');
                 }
                 $response = array('status' => $status, 'message' => $message, 'uid' => $uid);
             } else {
                 $response = array('status' => 'error', 'message' => __('Sorry, there was a problem creating that directory for you.', 'file-away'));
             }
         }
     } elseif ($action === 'renamedir') {
         global $wpdb;
         if (!$li) {
             die($dm);
         }
         if (!wp_verify_nonce($_POST['manager_nonce'], 'fileaway-manager-nonce')) {
             die($dm);
         }
         $table = fileaway_stats::$db;
         $table_exists = $wpdb->get_var("SHOW TABLES LIKE '{$table}'") != $table ? false : true;
         $meta_table = fileaway_metadata::$db;
         $meta_table_exists = $wpdb->get_var("SHOW TABLES LIKE '{$meta_table}'") != $meta_table ? false : true;
         $metadata = $_POST['metadata'] == 'true' ? true : false;
         $oldpath = stripslashes(trim(str_replace('..', '', $_POST['oldpath']), '/'));
         $newname = stripslashes(str_replace(array('..', '/'), '', $_POST['newname']));
         $pp = explode('/', $oldpath);
         $newpath = fileaway_utility::replacelast($oldpath, end($pp), $newname);
         $olddata = $_POST['datapath'];
         $datapp = explode('/', $olddata);
         $newdata = fileaway_utility::replacelast($olddata, end($datapp), $newname);
         $parents = stripslashes($_POST['parents']);
         $old = $parents . '/' . end($pp);
         $dst = $rootpath . $newpath;
         $src = $rootpath . $old;
         $check_path = trim(str_replace('/', '', $newpath));
         if ($rootpath . $check_path == $rootpath || $rootpath . $check_path == $rootpath . 'wp-content' || strpos($check_path, 'wp-admin') !== false || strpos($check_path, 'wp-includes') !== false) {
             die($dm);
         }
         $page = $_POST['pg'];
         $querystring = ltrim($_POST['querystring'], '?');
         $drawer = str_replace('/', '*', $newdata);
         $drawerid = $_POST['drawerid'];
         $newurl = fileaway_utility::querystring(get_permalink($page), $querystring, array($drawerid => $drawer));
         $response = false;
         if (is_dir($dst)) {
             $response = array('status' => 'error', 'message' => __('That directory already exists.', 'file-away'));
         } elseif (!is_dir($src)) {
             $response = array('status' => 'error', 'message' => __('The directory you\'re trying to rename could not be found.', 'file-away'));
         } else {
             if (!is_dir("{$dst}")) {
                 mkdir("{$dst}", 0755, true);
             }
             $dirs = fileaway_utility::recursivedirs($src);
             if (is_array($dirs)) {
                 $dirs = array_reverse($dirs);
                 $fcount = 0;
                 $fscount = 0;
                 $dcount = 1;
                 $dscount = 0;
                 foreach ($dirs as $dir) {
                     $dcount++;
                     $files = false;
                     $filedest = str_replace("{$src}", "{$dst}", "{$dir}");
                     if (!is_dir($filedest)) {
                         mkdir("{$filedest}", 0755, true);
                     }
                     $files = array_filter(glob("{$dir}" . "/*"), 'is_file');
                     if (is_array($files)) {
                         foreach ($files as $file) {
                             $fcount++;
                             $filename = fileaway_utility::basename($file);
                             if (rename("{$file}", "{$filedest}" . "/" . "{$filename}")) {
                                 $fscount++;
                                 if ($table_exists) {
                                     fileaway_utility::updatestats('file', fileaway_utility::replacefirst($file, $rootpath, ''), fileaway_utility::replacefirst($filedest . '/' . $filename, $rootpath, ''));
                                 }
                                 if ($metadata && $meta_table_exists) {
                                     fileaway_utility::updatemetadata(false, fileaway_utility::replacefirst($file, $rootpath, ''), fileaway_utility::replacefirst($filedest . '/' . $filename, $rootpath, ''));
                                 }
                             }
                         }
                     }
                     if (rmdir($dir)) {
                         $dscount++;
                     }
                 }
             }
             $basefiles = array_filter(glob("{$src}" . "/*"), 'is_file');
             if (is_array($basefiles)) {
                 foreach ($basefiles as $file) {
                     $fcount++;
                     $filename = fileaway_utility::basename($file);
                     if (rename("{$file}", "{$dst}" . "/" . "{$filename}")) {
                         $fscount++;
                         if ($table_exists) {
                             fileaway_utility::updatestats('file', fileaway_utility::replacefirst($file, $rootpath, ''), fileaway_utility::replacefirst($dst . '/' . $filename, $rootpath, ''));
                         }
                         if ($metadata && $meta_table_exists) {
                             fileaway_utility::updatemetadata(false, fileaway_utility::replacefirst($file, $rootpath, ''), fileaway_utility::replacefirst($dst . '/' . $filename, $rootpath, ''));
                         }
                     }
                 }
             }
             if (rmdir($src)) {
                 $dscount++;
             }
             if ($fcount > 0 && !$fscount) {
                 $response = array('status' => 'error', 'message' => __('We tried to move the files into the newly-named directory but none of them would budge.', 'file-away'));
             } elseif ($fcount > 0 && $fcount > $fscount) {
                 $response = array('status' => 'error', 'message' => __('We tried to move the files into the newly-named directory, but there were some stragglers, so we couldn\'t remove the old directory.', 'file-away'));
             } elseif (!is_dir($src)) {
                 $response = array('status' => 'success', 'url' => $newurl, 'newdata' => $newdata, 'newname' => $newname);
             } else {
                 $response = array('status' => 'error', 'message' => __('An unspecified error occurred.', 'file-away'));
             }
         }
     } elseif ($action === 'deletedir') {
         if (!$li) {
             die($dm);
         }
         if (!wp_verify_nonce($_POST['manager_nonce'], 'fileaway-manager-nonce')) {
             die($dm);
         }
         $status = $_POST['status'];
         $path1 = $_POST['path1'];
         $path2 = $_POST['path2'];
         $path = stripslashes($path1 . '/' . $path2);
         $src = $rootpath . $path;
         if ($src == $rootpath || $src == $rootpath . 'wp-content' || strpos($src, 'wp-admin') !== false || strpos($src, 'wp-includes') !== false) {
             die($dm);
         }
         $response = false;
         if (!is_dir("{$src}")) {
             $response = array('status' => 'error', 'message' => __('The directory marked for deletion could not be found.', 'file-away') . ' ' . $path);
         } else {
             $dirs = fileaway_utility::recursivedirs($src);
             $dirs = is_array($dirs) ? array_reverse($dirs) : $dirs;
             if ($status === 'life') {
                 $dcount = 0;
                 $fcount = 0;
                 if (is_array($dirs)) {
                     foreach ($dirs as $dir) {
                         $dcount++;
                         $files = false;
                         $files = array_filter(glob("{$dir}" . "/*"), 'is_file');
                         if (is_array($files)) {
                             foreach ($files as $file) {
                                 $fcount++;
                             }
                         }
                     }
                 }
                 $basefiles = array_filter(glob("{$src}" . "/*"), 'is_file');
                 if (is_array($basefiles)) {
                     foreach ($basefiles as $file) {
                         $fcount++;
                     }
                 }
                 if ($fcount == 0) {
                     $status = 'death';
                 } else {
                     $filemsg = null;
                     if ($fcount >= 1) {
                         $plufiles = $fcount > 1 ? _x('files', 'plural', 'file-away') : _x('file', 'singular', 'file-away');
                         $filemsg = ' ' . __('and', 'file-away') . ' ' . $fcount . ' ' . $plufiles;
                     }
                     $dirmsg = null;
                     if ($dcount >= 1) {
                         $pludirs = $dcount > 1 ? _x('sub-directories', 'plural', 'file-away') : _x('sub-directory', 'singular', 'file-away');
                         $dirmsg = ', ' . $dcount . ' ' . $pludirs;
                     }
                     $message = sprintf(_x('You are about to delete 1 directory%s from the server. ' . 'This action is permanent and cannot be undone. Are you sure you wish to proceed?', 'Do not put a space between *directory* and the %s variable', 'file-away'), $dirmsg . $filemsg);
                     $response = array('status' => 'confirm', 'message' => $message);
                 }
             }
             if ($status === 'death') {
                 $pcount = 1;
                 $pscount = 0;
                 $dcount = 0;
                 $dscount = 0;
                 $fcount = 0;
                 $fscount = 0;
                 if (is_array($dirs)) {
                     foreach ($dirs as $dir) {
                         $dcount++;
                         $files = false;
                         $files = array_filter(glob("{$dir}" . "/*"), 'is_file');
                         if (is_array($files)) {
                             foreach ($files as $file) {
                                 $fcount++;
                                 $file = realpath($file);
                                 if (is_readable($file)) {
                                     if (unlink($file)) {
                                         $fscount++;
                                     }
                                 }
                             }
                         }
                         if (rmdir($dir)) {
                             $dscount++;
                         }
                     }
                 }
                 $basefiles = array_filter(glob("{$src}" . "/*"), 'is_file');
                 if (is_array($basefiles)) {
                     foreach ($basefiles as $file) {
                         $fcount++;
                         $file = realpath($file);
                         if (is_readable($file)) {
                             if (unlink($file)) {
                                 $fscount++;
                             }
                         }
                     }
                 }
                 if (rmdir($src)) {
                     $pscount++;
                 }
                 if ($pscount && $fscount || $pscount && !$fcount) {
                     $success = $pscount == $pcount && $dscount == $dcount && $fscount == $fcount ? 'success' : 'partial';
                     $success = $fscount == $fcount && !$fcount ? 'success-single' : $success;
                     $filemsg = null;
                     if ($fcount >= 1) {
                         $plufiles = $fcount > 1 ? _x('files', 'plural', 'file-away') : _x('file', 'singular', 'file-away');
                         $filemsg = ' ' . __('and', 'file-away') . ' ' . $fscount . ' ' . __('of', 'file-away') . ' ' . $fcount . ' ' . $plufiles;
                     } else {
                         $filemsg = ' ' . sprintf(__('and %d files', 'file-away'), $fcount);
                     }
                     $dirmsg = null;
                     if ($dcount >= 1) {
                         $pludirs = $dcount > 1 ? _x('sub-directories', 'plural', 'file-away') : _x('sub-directory', 'singular', 'file-away');
                         $dirmsg = ', ' . $dscount . ' ' . __('of', 'file-away') . ' ' . $dcount . ' ' . $pludirs;
                     }
                     $message = sprintf(_x('%d of 1 directory%s have been removed from the server.', 'Do not put a space between *directory* and the %s variable', 'file-away'), $pscount, $dirmsg . $filemsg);
                     $response = array('status' => $success, 'message' => $message);
                 } else {
                     $response = array('status' => 'error', 'message' => __('Sorry, but there was an error attempting to remove this directory.', 'file-away'));
                 }
             }
         }
     } elseif ($action === 'rename') {
         if (!$li) {
             die($dm);
         }
         if (!wp_verify_nonce($_POST['manager_nonce'], 'fileaway-manager-nonce')) {
             die($dm);
         }
         global $wpdb;
         $table = fileaway_stats::$db;
         $table_exists = $wpdb->get_var("SHOW TABLES LIKE '{$table}'") != $table ? false : true;
         $meta_table = fileaway_metadata::$db;
         $meta_table_exists = $wpdb->get_var("SHOW TABLES LIKE '{$meta_table}'") != $meta_table ? false : true;
         $metadata = $_POST['metadata'] == 'true' ? true : false;
         $url = stripslashes($_POST['url']);
         $pp = $problemchild ? fileaway_utility::replacefirst(stripslashes($_POST['pp']), $install, '') : stripslashes($_POST['pp']);
         $oldname = stripslashes($_POST['oldname']);
         $rawname = stripslashes($_POST['rawname']);
         $ext = $_POST['ext'];
         if (strpos(strtolower($ext), 'php') !== false) {
             die($dm);
         }
         if (strpos($url, '.' . $ext . '?type=') !== false) {
             list($url, $querystring) = explode('?', $url);
             $querystring = '?' . $querystring;
         } else {
             $querystring = '';
         }
         $oldfile = $chosenpath . "{$pp}/{$oldname}.{$ext}";
         $customdata = isset($_POST['customdata']) ? $_POST['customdata'] : array();
         if (!$metadata) {
             $not_empty = false;
             if (is_array($customdata)) {
                 $customd = array();
                 foreach ($customdata as $datum) {
                     $customd[] = stripslashes($datum);
                     if (stripslashes($datum) != '') {
                         $not_empty = true;
                     }
                 }
             }
             $customd = $not_empty ? stripslashes(implode(',', $customdata)) : '';
             if ($customd !== '') {
                 $customd = " [{$customd}]";
             } else {
                 $customd = '';
             }
             $newfile = $chosenpath . "{$pp}/{$rawname}{$customd}.{$ext}";
             if ($newfile !== $oldfile) {
                 $i = 1;
                 while (is_file($newfile)) {
                     if ($i == 1) {
                         $rawname = "{$rawname}" . " ({$i})";
                     } else {
                         $j = $i - 1;
                         $rawname = rtrim("{$rawname}", " ({$j})");
                         $rawname = "{$rawname}" . " ({$i})";
                     }
                     $i++;
                     $newfile = $chosenpath . "{$pp}/{$rawname}{$customd}.{$ext}";
                 }
             }
             if ($customd !== '') {
                 $customd = " [" . trim(ltrim(rtrim("{$customd}", "]"), " ["), " ") . "]";
             }
             $newfile = $chosenpath . "{$pp}/" . trim("{$rawname}", ' ') . "{$customd}.{$ext}";
             $newurl = str_replace("{$pp}/{$oldname}.{$ext}", "", fileaway_utility::urlesc("{$url}", true));
             $newurl = fileaway_utility::urlesc("{$newurl}{$pp}/" . trim("{$rawname}") . "{$customd}.{$ext}");
             $newoldname = trim("{$rawname}", ' ') . "{$customd}";
             $download = trim("{$rawname}", ' ') . "{$customd}.{$ext}";
             if (is_file("{$oldfile}")) {
                 rename("{$oldfile}", "{$newfile}");
             }
             $errors = is_file("{$newfile}") ? '' : __('The file was not renamed.', 'file-away');
             if (is_file($newfile) && $table_exists) {
                 fileaway_utility::updatestats('file', fileaway_utility::replacefirst($oldfile, $rootpath, ''), fileaway_utility::replacefirst($newfile, $rootpath, ''));
             }
         } else {
             $not_empty = false;
             if (is_array($customdata)) {
                 $customd = array();
                 foreach ($customdata as $datum) {
                     $customd[] = stripslashes($datum);
                     if (stripslashes($datum) != '') {
                         $not_empty = true;
                     }
                 }
             }
             $customdata = $not_empty ? $customd : '';
             $newfile = $chosenpath . "{$pp}/{$rawname}.{$ext}";
             if ($newfile !== $oldfile) {
                 $i = 1;
                 while (is_file($newfile)) {
                     if ($i == 1) {
                         $rawname = "{$rawname}" . " ({$i})";
                     } else {
                         $j = $i - 1;
                         $rawname = rtrim("{$rawname}", " ({$j})");
                         $rawname = "{$rawname}" . " ({$i})";
                     }
                     $i++;
                     $newfile = $chosenpath . "{$pp}/{$rawname}.{$ext}";
                 }
             }
             $newfile = $chosenpath . "{$pp}/" . trim("{$rawname}", ' ') . ".{$ext}";
             $newurl = str_replace("{$pp}/{$oldname}.{$ext}", "", fileaway_utility::urlesc("{$url}", true));
             $newurl = fileaway_utility::urlesc("{$newurl}{$pp}/" . trim("{$rawname}") . ".{$ext}");
             $newoldname = trim("{$rawname}", ' ');
             $download = trim("{$rawname}", ' ') . ".{$ext}";
             if (is_file("{$oldfile}")) {
                 rename("{$oldfile}", "{$newfile}");
             }
             $errors = is_file("{$newfile}") ? '' : __('The file was not renamed.', 'file-away');
             if (is_file($newfile) && $table_exists) {
                 fileaway_utility::updatestats('file', fileaway_utility::replacefirst($oldfile, $rootpath, ''), fileaway_utility::replacefirst($newfile, $rootpath, ''));
             }
             if (is_file($newfile) && $meta_table_exists) {
                 fileaway_utility::updatemetadata($customdata, fileaway_utility::replacefirst($oldfile, $rootpath, ''), fileaway_utility::replacefirst($newfile, $rootpath, ''));
             }
             if ($customdata === '') {
                 $customdata = array();
             }
         }
         $response = array("errors" => $errors, "download" => $download, "pp" => $pp, "newurl" => $newurl . $querystring, "extension" => $ext, "oldfile" => $oldfile, "newfile" => $newfile, "rawname" => $rawname, "customdata" => $customdata, "newoldname" => $newoldname);
     } elseif ($action === 'delete') {
         if (!$li) {
             die($dm);
         }
         if (!wp_verify_nonce($_POST['manager_nonce'], 'fileaway-manager-nonce')) {
             die($dm);
         }
         $pp = $_POST["pp"];
         $oldname = $_POST["oldname"];
         $ext = $_POST["ext"];
         if (!in_array($ext, array('php', 'htaccess', 'htpasswd')) && strpos($oldname, 'wp-admin') === false && strpos($oldname, 'wp-config') === false && strpos($oldname, 'wp-includes') === false) {
             $oldfile = "{$rootpath}{$pp}/{$oldname}.{$ext}";
             if (!is_file("{$oldfile}")) {
                 $oldfile = stripslashes("{$oldfile}");
             }
             if (is_file("{$oldfile}")) {
                 if (unlink("{$oldfile}")) {
                     $response = "success";
                 } else {
                     $response = "error";
                 }
             } else {
                 $response = "error";
             }
         } else {
             $response = 'error';
         }
     } elseif ($action == 'bulkdownload') {
         if (!wp_verify_nonce($_POST['bulkdownload_nonce'], 'fileaway-bulk-download-nonce')) {
             die($dm);
         }
         $files = $_POST["files"];
         $stats = $_POST['stats'];
         $zipfiles = array();
         $values = array();
         if (is_array($files)) {
             foreach ($files as $file) {
                 if (strpos($file, '..') !== false) {
                     continue;
                 }
                 if (strpos($file, '/') === false) {
                     continue;
                 }
                 if (strpos($file, '.php') !== false) {
                     continue;
                 }
                 if (strpos($file, 'wp-config') !== false) {
                     continue;
                 }
                 if (strpos($file, 'wp-admin') !== false) {
                     continue;
                 }
                 if (strpos($file, 'wp-includes') !== false) {
                     continue;
                 }
                 $file = $rootpath . stripslashes($file);
                 if (file_exists($file)) {
                     $zipfiles[] = $file;
                     $values[] = fileaway_utility::basename($file);
                 }
             }
         }
         $numvals = array_count_values($values);
         $prefix = isset($this->settings['download_prefix']) ? $this->settings['download_prefix'] : false;
         $prefix = $prefix && $prefix !== '' ? $prefix : date('Y-m-d', current_time('timestamp'));
         $time = uniqid();
         $destination = fileaway_dir . '/temp';
         if (!is_dir($destination)) {
             mkdir($destination);
         }
         $filename = stripslashes($prefix) . ' ' . $time . '.zip';
         $link = fileaway_url . '/temp/' . $filename;
         $filename = $destination . '/' . $filename;
         if (count($zipfiles)) {
             $zip = new ZipArchive();
             $zip->open($filename, ZipArchive::CREATE);
             foreach ($zipfiles as $k => $zipfile) {
                 $zip->addFile($zipfile, fileaway_utility::basename($zipfile));
                 if ($numvals[fileaway_utility::basename($zipfile)] > 1) {
                     $parts = fileaway_utility::pathinfo($zipfile);
                     $zip->renameName(fileaway_utility::basename($zipfile), $parts['filename'] . '_' . $k . '.' . $parts['extension']);
                 }
             }
             $zip->close();
         }
         if ($stats == 'true' && count($zipfiles) > 0) {
             $stat = new fileaway_stats();
             $ifiles = array();
             foreach ($zipfiles as $zfile) {
                 $zfile = fileaway_utility::replacefirst($zfile, $rootpath, '');
                 $ifiles[] = $zfile;
                 $stat->insert($zfile, false);
             }
             $current = wp_get_current_user();
             if ($this->settings['instant_stats'] == 'true') {
                 $data = array('timestamp' => date('Y-m-d H:i:s', current_time('timestamp')), 'file' => count($ifiles) . ' ' . strtolower(_x('files', 'plural', 'file-away')), 'files' => "\r\n" . implode("\r\n", $ifiles), 'uid' => $current->ID, 'email' => $current->user_email, 'ip' => $_SERVER['REMOTE_ADDR'], 'agent' => $_SERVER['HTTP_USER_AGENT']);
                 $stat->imail($data);
             }
         }
         $response = is_file($filename) ? $link : "Error";
     } elseif ($action == 'bulkcopy') {
         if (!$li) {
             die($dm);
         }
         if (!wp_verify_nonce($_POST['manager_nonce'], 'fileaway-manager-nonce')) {
             die($dm);
         }
         $from = $_POST['from'];
         $to = $_POST['to'];
         $ext = $_POST['exts'];
         $destination = $problemchild ? fileaway_utility::replacefirst(stripslashes($_POST['destination']), $install, '') : stripslashes($_POST['destination']);
         $success = 0;
         $total = 0;
         $renamers = 0;
         foreach ($from as $k => $fro) {
             $fro = stripslashes($fro);
             $to[$k] = stripslashes($to[$k]);
             $fro = $problemchild ? fileaway_utility::replacefirst("{$fro}", $install, '') : "{$fro}";
             $to[$k] = $problemchild ? fileaway_utility::replacefirst("{$to[$k]}", $install, '') : "{$to[$k]}";
             $total++;
             $newfile = $chosenpath . "{$to[$k]}";
             if (is_file($chosenpath . "{$fro}") && is_file("{$newfile}")) {
                 $i = 1;
                 $noext = fileaway_utility::replacelast("{$newfile}", '.' . $ext[$k], '');
                 while (is_file("{$newfile}")) {
                     if ($i == 1) {
                         $noext = "{$noext}" . " ({$i})";
                     } else {
                         $j = $i - 1;
                         $noext = rtrim("{$noext}", " ({$j})");
                         $noext = "{$noext}" . " ({$i})";
                     }
                     $i++;
                     $newfile = "{$noext}" . '.' . $ext[$k];
                 }
                 $renamers++;
             }
             if (is_file($chosenpath . "{$fro}") && !is_file("{$newfile}")) {
                 copy($chosenpath . "{$fro}", "{$newfile}");
             }
             if (is_file("{$newfile}")) {
                 $success++;
             }
         }
         $response = $success == 0 ? __('There was a problem copying the files. Please consult your local pharmacist.', 'file-away') : ($success == 1 ? sprintf(__('One file was copied to %s and it no longer feels special.', 'file-away'), $destination) : ($success > 1 ? sprintf(__('%d of %d files were successfully cloned and delivered in a black caravan to %s.', 'file-away'), $success, $total, $destination) : null));
     } elseif ($action == 'bulkmove') {
         if (!$li) {
             die($dm);
         }
         if (!wp_verify_nonce($_POST['manager_nonce'], 'fileaway-manager-nonce')) {
             die($dm);
         }
         global $wpdb;
         $table = fileaway_stats::$db;
         $table_exists = $wpdb->get_var("SHOW TABLES LIKE '{$table}'") != $table ? false : true;
         $meta_table = fileaway_metadata::$db;
         $meta_table_exists = $wpdb->get_var("SHOW TABLES LIKE '{$meta_table}'") != $meta_table ? false : true;
         $metadata = $_POST['metadata'] == 'true' ? true : false;
         $from = $_POST["from"];
         $to = $_POST["to"];
         $ext = $_POST['exts'];
         $destination = $problemchild ? fileaway_utility::replacefirst(stripslashes($_POST["destination"]), $install, '') : stripslashes($_POST["destination"]);
         $success = 0;
         $total = 0;
         $renamers = 0;
         foreach ($from as $k => $fro) {
             $fro = stripslashes($fro);
             $to[$k] = stripslashes($to[$k]);
             $fro = $problemchild ? fileaway_utility::replacefirst("{$fro}", $install, '') : "{$fro}";
             $to[$k] = $problemchild ? fileaway_utility::replacefirst("{$to[$k]}", $install, '') : "{$to[$k]}";
             $total++;
             $newfile = $chosenpath . "{$to[$k]}";
             if (is_file($chosenpath . "{$fro}") && is_file("{$newfile}")) {
                 $i = 1;
                 $noext = fileaway_utility::replacelast("{$newfile}", '.' . $ext[$k], '');
                 while (is_file("{$newfile}")) {
                     if ($i == 1) {
                         $noext = "{$noext}" . " ({$i})";
                     } else {
                         $j = $i - 1;
                         $noext = rtrim("{$noext}", " ({$j})");
                         $noext = "{$noext}" . " ({$i})";
                     }
                     $i++;
                     $newfile = "{$noext}" . '.' . $ext[$k];
                 }
                 $renamers++;
             }
             if (is_file($chosenpath . "{$fro}") && !is_file("{$newfile}")) {
                 rename($chosenpath . "{$fro}", "{$newfile}");
             }
             if (is_file("{$newfile}")) {
                 $success++;
                 if ($table_exists) {
                     fileaway_utility::updatestats('file', fileaway_utility::replacefirst($chosenpath . $fro, $rootpath, ''), fileaway_utility::replacefirst($newfile, $rootpath, ''));
                 }
                 if ($metadata && $meta_table_exists) {
                     fileaway_utility::updatemetadata(false, fileaway_utility::replacefirst($chosenpath . $fro, $rootpath, ''), fileaway_utility::replacefirst($newfile, $rootpath, ''));
                 }
             }
         }
         $response = $success == 0 ? __('There was a problem moving the files. Please consult your local ouija specialist.', 'file-away') : ($success == 1 ? sprintf(__('One lonesome file was forced to leave all it knew and move to %s.', 'file-away'), $destination) : ($success > 1 ? sprintf(__('%d of %d files were magically transported to %s.', 'file-away'), $success, $total, $destination) : null));
     } elseif ($action == 'bulkdelete') {
         if (!$li) {
             die($dm);
         }
         if (!wp_verify_nonce($_POST['manager_nonce'], 'fileaway-manager-nonce')) {
             die($dm);
         }
         $files = $_POST['files'];
         $success = 0;
         $total = 0;
         foreach ($files as $k => $file) {
             $file = stripslashes($file);
             if (strpos($file, '.php') === false && strpos($file, 'htaccess') === false && strpos($file, 'htpasswd') === false && strpos($file, 'wp-admin') === false && strpos($file, 'wp-config') === false && strpos($file, 'wp-includes') === false) {
                 $total++;
                 if (is_file($rootpath . $file)) {
                     unlink($rootpath . $file);
                 }
                 if (!is_file($rootpath . $file)) {
                     $success++;
                 }
             }
         }
         $response = $success == 0 ? __('There was a problem deleting the files. Please try pressing your delete button emphatically and repeatedly.', 'file-away') : ($success == 1 ? __('A million fewer files in the world is a victory. One less file, a tragedy. Farewell, file. Au revoir. Auf Wiedersehen. Adieu.', 'file-away') : ($success > 1 ? sprintf(__('%d of %d files were sent plummeting to the nether regions of cyberspace.', 'file-away'), $success, $total) : null));
     } elseif ($action == 'upload') {
         if (isset($_POST) && $_SERVER['REQUEST_METHOD'] == "POST") {
             if (!wp_verify_nonce($_POST['upload_nonce'], 'fileaway-fileup-nonce')) {
                 echo 'system_error';
                 exit;
             }
             $file_name = strip_tags(stripslashes($_FILES['upload_file']['name']));
             $new_name = strip_tags(stripslashes($_POST['new_name']));
             $extension = $_POST['extension'];
             $check_ext = str_replace('/', '', $extension);
             $check_name = str_replace('/', '', $new_name);
             if (empty($check_ext) || empty($check_name)) {
                 echo 'system_error';
                 exit;
             }
             $uploader = stripslashes($_POST['uploader']);
             $file_id = strip_tags($_POST['upload_file_id']);
             $file_size = $_FILES['upload_file']['size'];
             $max_file_size = (int) $_POST['max_file_size'];
             $file_path = trim($_POST['upload_path'], '/');
             if ($uploader) {
                 $user = new WP_User($uploader);
                 $uploadedby = $_POST['identby'] == 'id' ? $user->ID : $user->display_name;
                 if (preg_match('/\\[([^\\]]+)\\]/', $new_name)) {
                     $new_name = fileaway_utility::replacelast($new_name, ']', ',' . $uploadedby . ']');
                 } else {
                     $new_name = fileaway_utility::replacelast($new_name, '.' . $extension, ' [' . $uploadedby . '].' . $extension);
                 }
             }
             $location = str_replace('//', '/', $chosenpath . $file_path . '/' . $new_name);
             $location = stripslashes($location);
             $dir = fileaway_utility::dirname($location);
             $_POST['size_check'] = $file_size > $max_file_size ? 'true' : 'false';
             if ($file_size > $max_file_size) {
                 echo 'system_error';
             } elseif (strpos($location, 'wp-admin') !== false) {
                 echo 'system_error';
             } elseif (strpos($location, 'wp-config') !== false) {
                 echo 'system_error';
             } elseif (strpos($location, '.php') !== false) {
                 echo 'system_error';
             } elseif (strpos($extension, 'php') !== false) {
                 echo 'system_error';
             } elseif (strpos($dir, '..') !== false) {
                 echo 'system_error';
             } else {
                 if (!is_dir($dir)) {
                     mkdir($dir, 0755, true);
                 }
                 $p = fileaway_utility::pathinfo($location);
                 $filename = $p['filename'];
                 $i = 1;
                 $overwrite = $li && stripslashes($_POST['overwrite']) == 'true' ? true : false;
                 if (!$overwrite) {
                     while (is_file($location)) {
                         if ($i == 1) {
                             $filename = $filename . " ({$i})";
                         } else {
                             $j = $i - 1;
                             $filename = rtrim($filename, " ({$j})");
                             $filename = $filename . " ({$i})";
                         }
                         $i++;
                         $name = $filename . '.' . $p['extension'];
                         $location = $p['dirname'] . '/' . $name;
                     }
                 }
                 $name = $filename . '.' . $p['extension'];
                 $location = $p['dirname'] . '/' . $name;
                 if (move_uploaded_file(strip_tags($_FILES['upload_file']['tmp_name']), $location)) {
                     echo $file_id;
                 } else {
                     echo 'system_error';
                 }
             }
             exit;
         } else {
             echo 'system_error';
             exit;
         }
     } elseif ($action == 'actionpath') {
         if (!wp_verify_nonce($_POST['manager_nonce'], 'fileaway-manager-nonce')) {
             die($dm);
         }
         $fileup = $_POST['uploadaction'] === 'true' ? 'fileup-' : '';
         $build = null;
         if ($problemchild) {
             $pathparts = fileaway_utility::replacefirst($_POST['pathparts'], $install, '');
             $start = trim(fileaway_utility::replacefirst($_POST['start'], $install, ''), '/');
         } else {
             $pathparts = $_POST['pathparts'];
             $start = trim($_POST['start'], '/');
         }
         if ($pathparts === '/') {
             $pathparts = $start;
         }
         $pathparts = trim($pathparts, '/');
         $basename = trim($_POST['basename'], '/');
         if (!fileaway_utility::startswith($pathparts, $start)) {
             $pathparts = $start;
         }
         $security = $basename === $start ? false : true;
         $nocrumbs = $security ? trim(fileaway_utility::replacelast("{$start}", "{$basename}", ''), '/') : null;
         if (strpos($pathparts, '..') !== false) {
             $pathparts = $start;
         }
         $dir = $chosenpath . $pathparts;
         $build .= "<option></option>";
         $directories = glob($dir . "/*", GLOB_ONLYDIR);
         if ($directories && is_array($directories)) {
             foreach ($directories as $k => $folder) {
                 $direxcluded = 0;
                 if ($this->settings['direxclusions']) {
                     $direxes = preg_split('/(, |,)/', $this->settings['direxclusions'], -1, PREG_SPLIT_NO_EMPTY);
                     if (is_array($direxes)) {
                         foreach ($direxes as $direx) {
                             $check = strripos($folder, $direx);
                             if ($check !== false) {
                                 $direxcluded = 1;
                                 break;
                             }
                         }
                     }
                 }
                 if (!$direxcluded) {
                     $folder = str_replace($chosenpath, '', $folder);
                     $dirname = explode('/', $folder);
                     $dirname = end($dirname);
                     $build .= '<option value="' . $folder . '">' . $dirname . '</option>';
                 }
             }
         } else {
             $build .= '';
         }
         if ($security) {
             $pieces = explode('/', trim(trim(fileaway_utility::replacefirst("{$pathparts}", "{$nocrumbs}", ''), '/'), '/'));
         } else {
             $pieces = explode('/', trim("{$pathparts}", '/'));
         }
         $piecelink = array();
         $breadcrumbs = null;
         foreach ($pieces as $k => $piece) {
             $i = 0;
             $piecelink[$k] = $security ? "{$nocrumbs}/" : null;
             while ($i <= $k) {
                 $piecelink[$k] .= "{$pieces[$i]}/";
                 $i++;
             }
             $breadcrumbs .= '<a href="javascript:" data-target="' . trim($piecelink[$k], '/') . '" id="ssfa-' . $fileup . 'action-pathpart-' . $k . '">' . fileaway_utility::strtotitle($piece) . '</a> / ';
         }
         $breadcrumbs = stripslashes($breadcrumbs);
         $pathparts = stripslashes($pathparts);
         $build = stripslashes($build);
         $response = array("ops" => $build, "crumbs" => $breadcrumbs, "pathparts" => $pathparts);
     } elseif ($action == 'deletecsv') {
         if (!wp_verify_nonce($_POST['values_nonce'], 'fileaway-values-nonce')) {
             die($dm);
         }
         $src = base64_decode($_POST['src']);
         if (is_file($rootpath . $src)) {
             if (unlink($rootpath . $src)) {
                 $response = array('status' => 'success');
             } else {
                 $response = array('status' => 'error', 'message' => __('There was a problem deleting the files. Please try pressing your delete button emphatically and repeatedly.', 'file-away'));
             }
         } else {
             $response = array('status' => 'error', 'message' => __('The file specified does not exist in this location.', 'file-away'));
         }
     } elseif ($action == 'makecsv') {
         if (!wp_verify_nonce($_POST['values_nonce'], 'fileaway-values-nonce')) {
             die($dm);
         }
         $dir = base64_decode($_POST['path']);
         $filename = trim($_POST['name'], '/');
         if (!fileaway_utility::endswith(strtolower($filename), '.csv')) {
             $filename = $filename . '.csv';
         }
         if (is_file($rootpath . $dir . '/' . $filename)) {
             $response = array('status' => 'error', 'message' => __('A file by that name already exists in this directory.', 'file-away'));
         } else {
             if (strpos($filename, '/') !== false && !is_dir($rootpath . $dir . '/' . fileaway_utility::dirname($filename))) {
                 mkdir($rootpath . $dir . '/' . fileaway_utility::dirname($filename), 0775, true);
             }
             $csv = new fileaway_csv();
             $read = $_POST['read'];
             $write = $_POST['writ'];
             $csv->encoding($read, $write);
             $rows = array();
             $cols = array();
             $csv->titles = preg_split('/(, |,)/', $_POST['cols'], -1, PREG_SPLIT_NO_EMPTY);
             foreach ($csv->titles as $header) {
                 $cols[$header] = '';
             }
             $rows[0] = $cols;
             $csv->data = $rows;
             $csv->save($rootpath . $dir . '/' . $filename);
             if (is_file($rootpath . $dir . '/' . $filename)) {
                 $recursive = $_POST['recursive'] == 'true' ? true : false;
                 $fullpath = $rootpath . $dir;
                 $querystring = ltrim($_POST['querystring'], '?');
                 $files = $recursive ? fileaway_utility::recursefiles($fullpath, array(), array(), '[cC][sS][vV]') : glob("{$fullpath}/*.[cC][sS][vV]");
                 $file_index = array_search($rootpath . $dir . '/' . $filename, $files);
                 $link = fileaway_utility::querystring(get_permalink($_POST['pg']), $querystring, array('fa_csv' => base64_encode(fileaway_utility::basename($filename)), 'fa_index' => $file_index));
                 $response = array('status' => 'success', 'redirect' => $link);
             } else {
                 $reponse = array('status' => 'error', 'message' => sprintf(__('Sorry. There was a problem creating %s', 'file-away'), $filename));
             }
         }
     } elseif ($action == 'values') {
         if (!wp_verify_nonce($_POST['values_nonce'], 'fileaway-values-nonce')) {
             die($dm);
         }
         $src = $rootpath . base64_decode($_POST['src']);
         $csv = new fileaway_csv();
         $csv->sort_by = 'id';
         $csv->auto($src);
         $read = $_POST['read'];
         $write = $_POST['writ'];
         $csv->encoding($read, $write);
         $csv->data[$_POST['row']][$_POST['col']] = $_POST['newvalue'];
         if ($csv->save()) {
             $response = array('status' => 'success');
         } else {
             $csv->data[$_POST['row']][$_POST['col']] = $_POST['oldvalue'];
             if ($csv->save()) {
                 $response = array('status' => 'error', 'message' => __('Sorry about that, but your changes could not be saved.', 'file-away'));
             } else {
                 $response = array('status' => 'error', 'message' => __('Sorry about that, but your changes could not be saved.', 'file-away'));
             }
         }
     } elseif ($action == 'newrow') {
         if (!wp_verify_nonce($_POST['values_nonce'], 'fileaway-values-nonce')) {
             die($dm);
         }
         $response = array();
         $src = $rootpath . base64_decode($_POST['src']);
         $data = array('test', 'test');
         $csv = new fileaway_csv();
         $csv->sort_by = 'id';
         $csv->auto($src);
         $read = $_POST['read'];
         $write = $_POST['writ'];
         $csv->encoding($read, $write);
         foreach ($csv->titles as $col) {
             $csv->data[$_POST['numrows']][$col] = '';
         }
         if ($csv->save()) {
             $response['status'] = 'success';
             $k = $_POST['numrows'];
             $uid = $_POST['uid'];
             $theme = $_POST['theme'];
             $headers = $csv->titles;
             $html = "<tr id='ssfa-values-{$uid}-{$k}' class='ssfa-values-context' data-row='{$k}'>";
             foreach ($headers as $key => $header) {
                 $col1class = $key < 1 ? "class='{$theme}-first-column'" : null;
                 $html .= '<td id="cell-ssfa-values-' . $uid . '-' . $k . '-' . $key . '" ' . $col1class . ' style="cursor:cell">' . '<span id="value-ssfa-values-' . $uid . '-' . $k . '-' . $key . '" data-row="' . $k . '" data-col="' . $header . '" data-colnum="' . $key . '"></span>&nbsp;' . '<input type="text" id="input-ssfa-values-' . $uid . '-' . $k . '-' . $key . '" data-row="' . $k . '" data-col="' . $header . '" data-colnum="' . $key . '" ' . 'value="" style="display:none; width:90%">' . '</td>';
             }
             $html .= "</tr>";
             $response['html'] = $html;
         } else {
             $response = array('status' => 'error', 'message' => __('Sorry about that, but your changes could not be saved.', 'file-away'));
         }
     } elseif ($action == 'deleterow') {
         if (!wp_verify_nonce($_POST['values_nonce'], 'fileaway-values-nonce')) {
             die($dm);
         }
         $src = $rootpath . base64_decode($_POST['src']);
         $csv = new fileaway_csv();
         $csv->sort_by = 'id';
         $csv->auto($src);
         $read = $_POST['read'];
         $write = $_POST['writ'];
         $csv->encoding($read, $write);
         unset($csv->data[$_POST['row']]);
         if ($csv->save()) {
             $response = array('status' => 'success');
         } else {
             $response = array('status' => 'error', 'message' => __('Sorry about that, but your changes could not be saved.', 'file-away'));
         }
     } elseif ($action == 'createcol') {
         if (!wp_verify_nonce($_POST['values_nonce'], 'fileaway-values-nonce')) {
             die($dm);
         }
         $src = $rootpath . base64_decode($_POST['src']);
         $csv = new fileaway_csv();
         $csv->sort_by = 'id';
         $csv->auto($src);
         $read = $_POST['read'];
         $write = $_POST['writ'];
         $csv->encoding($read, $write);
         $headers = $csv->titles;
         $rows = $csv->data;
         if (count($headers) < 2) {
             $csv->delimiter = ",";
         }
         foreach ($rows as $k => $v) {
             fileaway_utility::recreatecol($rows[$k], $_POST['colnum'], 0, $_POST['col']);
         }
         array_splice($headers, $_POST['colnum'], 0, $_POST['col']);
         $csv->titles = $headers;
         $csv->data = $rows;
         if ($csv->save()) {
             $response = array('status' => 'success');
         } else {
             $response = array('status' => 'error', 'message' => __('Sorry about that, but your changes could not be saved.', 'file-away'));
         }
     } elseif ($action == 'colrename') {
         if (!wp_verify_nonce($_POST['values_nonce'], 'fileaway-values-nonce')) {
             die($dm);
         }
         $src = $rootpath . base64_decode($_POST['src']);
         $csv = new fileaway_csv();
         $csv->sort_by = 'id';
         $csv->auto($src);
         $read = $_POST['read'];
         $write = $_POST['writ'];
         $csv->encoding($read, $write);
         $headers = $csv->titles;
         $rows = $csv->data;
         foreach ($rows as $k => $v) {
             fileaway_utility::recreatecol($rows[$k], $_POST['colnum'], 0, $_POST['newname'], $rows[$k][$_POST['oldname']]);
             unset($rows[$k][$_POST['oldname']]);
         }
         $headers[$_POST['colnum']] = $_POST['newname'];
         $csv->titles = $headers;
         $csv->data = $rows;
         if ($csv->save()) {
             $response = array('status' => 'success');
         } else {
             $response = array('status' => 'error', 'message' => __('Sorry about that, but your changes could not be saved.', 'file-away'));
         }
     } elseif ($action == 'coldelete') {
         if (!wp_verify_nonce($_POST['values_nonce'], 'fileaway-values-nonce')) {
             die($dm);
         }
         $src = $rootpath . base64_decode($_POST['src']);
         $csv = new fileaway_csv();
         $csv->sort_by = 'id';
         $csv->auto($src);
         $read = $_POST['read'];
         $write = $_POST['writ'];
         $csv->encoding($read, $write);
         $del_val = $_POST['col'];
         $del_key = $_POST['colnum'];
         $headers = $csv->titles;
         $rows = $csv->data;
         unset($headers[$_POST['colnum']]);
         $headers = array_values($headers);
         foreach ($rows as $k => $v) {
             unset($rows[$k][$_POST['col']]);
         }
         $rows = array_values($rows);
         $csv->titles = $headers;
         $csv->data = $rows;
         if ($csv->save()) {
             $response = array('status' => 'success');
         } else {
             $response = array('status' => 'error', 'message' => __('Sorry about that, but your changes could not be saved.', 'file-away'));
         }
     } elseif ($action == 'backupcsv') {
         if (!wp_verify_nonce($_POST['values_nonce'], 'fileaway-values-nonce')) {
             die($dm);
         }
         $src = $rootpath . base64_decode($_POST['src']);
         $csv = new fileaway_csv();
         $csv->auto($src);
         $read = $_POST['read'];
         $write = $_POST['writ'];
         $csv->encoding($read, $write);
         $bits = fileaway_utility::pathinfo($src);
         $newfile = str_replace('.' . $bits['extension'], ' [' . date('Y-m-d H-i-s', current_time('timestamp')) . '].' . $bits['extension'], $src);
         if ($csv->save($newfile)) {
             $response = array('status' => 'success');
         } else {
             $response = array('status' => 'error', 'message' => __('Sorry about that, but a backup could not be successfully saved.', 'file-away'));
         }
     }
     $response = json_encode($response);
     header("Content-Type: application/json");
     echo $response;
     exit;
 }
Esempio n. 25
0
<?php

defined('fileaway') or die('Water, water everywhere, but not a drop to drink.');
if ($type == 'table' && !$recursive && isset($this->op['feeds']) && $this->op['feeds'] && trim($this->op['feeds']) != '') {
    $getrss = true;
    if (is_file($rootpath . $dir . '/_fa.feed.id.ini')) {
        $ini = parse_ini_file($rootpath . $dir . '/_fa.feed.id.ini');
        $feedid = $ini['id'];
        $feedfile = $rootpath . trim($this->op['feeds'], '/') . '/_feed_' . $feedid . '.xml';
        if (is_file($feedfile)) {
            $feedurl = fileaway_utility::replacefirst($feedfile, $rootpath, rtrim($this->op['baseurl'], '/') . '/');
            $rsslink = '<a href="' . $feedurl . '" target="_blank" class="ssfa-rsslink"><span class="ssfa-icon-feed ssfa-rsslink"></span></a>';
        }
    }
}
Esempio n. 26
0
<?php

defined('fileaway') or die('Water, water everywhere, but not a drop to drink.');
if (isset($_GET['fsb']) && isset($_GET['fse'])) {
    $begin = $_GET['fsb'] . ' 00:00:00';
    $end = $_GET['fse'] . ' 23:59:59';
} else {
    $begin = date('Y-m-d H:i:s', strtotime(date('Y-m-d 00:00:00') . ' -1 week'));
    $end = $now;
}
wp_enqueue_script('jquery-ui-datepicker');
$thefiles .= '<link href="' . fileaway_url . '/lib/css/datepicker.css" rel="stylesheet">';
$thefiles .= '<script>jQuery(document).ready(function($){ ' . '$("#stataway-fsb, #stataway-fse")' . '.datepicker({dateFormat:"yy-mm-dd", autoSize:true, maxDate:0}).datepicker("widget").wrap("<div class=\'stataway-datepicker\'/>"); ' . '}); </script>';
$window = fileaway_utility::querystring(get_permalink(), $_SERVER["QUERY_STRING"], array('fsb', 'fse'), true);
$begin_input = '<input type="text" id="stataway-fsb" name="stataway-fsb" class="stataway-datepicker" value="' . date('Y-m-d', strtotime($begin)) . '"/>';
$end_input = '<input type="text" id="stataway-fse" name="stataway-fse" class="stataway-datepicker" value="' . date('Y-m-d', strtotime($end)) . '"/>';
$heading = "<div class='stataway-datepicker-area'>" . $begin_input . " &#8674; " . $end_input . " " . "<span id='stataway-refresh-{$uid}' style='cursor:pointer' data-url=\"" . $window . "\">&#8635;</span>" . "</div>";
Esempio n. 27
0
<?php

defined('fileaway') or die('Water, water everywhere, but not a drop to drink.');
$boxquery = false;
$s2 = $iss2 ? $s2skipconfirm ? 'skip' : 'true' : 'false';
if ($attachaway) {
    $boxlink = $link;
    $boximage = $link;
} else {
    $boxlink = $links[$k];
    $boximage = $links[$k];
}
if (($flightbox == 'multi' || $flightbox == 'images') && in_array(strtolower($extension), array('jpg', 'jpeg', 'png', 'gif'))) {
    $imgsz = $attachaway ? getimagesize(fileaway_utility::urlesc($link)) : getimagesize($rootpath . $dir . '/' . $file);
    $imgwdth = $imgsz[0];
    $imghght = $imgsz[1];
    $dimension = $imgwdth >= $imghght ? 'width' : 'height';
    $boxquery = '?boxtype=image&g=' . $guest . '&s=' . $statstatus . '&s2=' . $s2 . '&d=' . $dimension . '&w=' . $imgwdth . '&h=' . $imghght . '&mw=' . $maximgwidth . '&mh=' . $maximgheight;
    $boximages[] = 'jQuery(\'<img src="' . $boximage . '"/>\'); ';
} elseif (($flightbox == 'multi' || $flightbox == 'videos') && in_array(strtolower($extension), array('flv', 'mp4', 'm4v', 'webm', 'ogv', 'tube', 'vmeo'))) {
    $boxquery = '?boxtype=video&g=' . $guest . '&s=' . $statstatus . '&s2=' . $s2 . '&e=' . $extension . '&w=' . $videowidth;
} elseif (($flightbox == 'multi' || $flightbox == 'pdfs') && strtolower($extension) == 'pdf' && !$get->is_opera) {
    $boxquery = '?boxtype=pdf&g=' . $guest . '&s=' . $statstatus . '&s2=' . $s2 . '&r=wide';
}
if ($boxquery) {
    $statstatus = 'false';
    $fulllink = $manager ? 'href="' . $boxlink . $boxquery . '" onclick="return flightbox(this.href, \'' . $uid . '-' . ($fb + 1) . '\', \'ssfa-' . $boxtheme . '\', \'' . $icocol . '\', \'' . $nolinksbox . '\');" ' . 'data-flightbox="' . ($fb + 1) . '"' : 'href="javascript:" onclick="flightbox(\'' . $boxlink . $boxquery . '\', \'' . $uid . '-' . ($fb + 1) . '\', \'ssfa-' . $boxtheme . '\', \'' . $icocol . '\', \'' . $nolinksbox . '\');" ' . 'data-flightbox="' . ($fb + 1) . '"';
    $linktype = '';
    $fb++;
}
Esempio n. 28
0
        {
            spl_autoload_register(array($this, 'load'));
        }
        private function load($class)
        {
            $file = fileaway_dir . '/lib/cls/class.' . $class . '.php';
            if (!file_exists($file)) {
                return false;
            }
            include_once $file;
        }
    }
}
new fileaway_autofiler();
new fileaway_languages();
fileaway_utility::timezone();
if (is_admin()) {
    new fileaway_admin();
    new fileaway_notices();
}
new fileaway_attributes();
new fileaway_definitions();
new feedaway();
new fileaway_stats();
new fileaway_metadata();
if (!is_admin()) {
    new fileaway_prints();
    new fileaway();
    new attachaway();
    new fileup();
    new fileaway_values();
Esempio n. 29
0
                $playeratts['loop'] = 'true';
            }
            foreach ($mfiles as $e => $s) {
                $playeratts[$e] = fileaway_utility::urlesc($s);
            }
            $player = '<div class="ssfa-player-extended">' . wp_audio_shortcode($playeratts) . '</div>';
        }
    }
    $sourcefilepath = $chosenpath . $pbdir . $rawname;
    $sourcefileurl = $playback_url . $pbdir . $rawname;
    $players = null;
    $sourcecount = 1;
    foreach ($sources as $audioext) {
        if (is_file($sourcefilepath . '.' . $audioext)) {
            $dlcolor = !$color ? " ssfa-" . $randcolor[array_rand($randcolor)] : " ssfa-{$colors}";
            $players .= $redirect ? '<a class="ssfa-audio-download' . $dlcolor . '" ' . 'href="' . $this->op['redirect'] . '" target="_blank">' : ($encryption ? '<a class="ssfa-audio-download ' . $dlcolor . '" ' . 'href="' . $encrypt->url($sourcefilepath . '.' . $audioext) . '" data-stat="' . $statstatus . '">' : ($s2mem ? '<a class="ssfa-audio-download ' . $dlcolor . '" ' . 'href="' . $url . '/?s2member_file_download=' . $s2dir . fileaway_utility::urlesc($rawname) . '.' . $audioext . $s2skip . '" data-stat="' . $statstatus . '">' : '<a class="ssfa-audio-download ' . $dlcolor . '" ' . 'href="' . fileaway_utility::urlesc($sourcefileurl) . '.' . $audioext . '" download="' . $rawname . '.' . $audioext . '" data-stat="' . $statstatus . '">'));
            $players .= '<div class="ssfa-audio-download" style="margin-bottom:10px;">';
            $players .= '<span class="ssfa-fileaplay-in ssfa-audio-download"></span>';
            $players .= strtoupper($audioext);
            $players .= '</div>';
            $players .= '</a>';
            if ($sourcecount > 1) {
                $has_multiple = 1;
            }
            $sourcecount++;
        }
    }
    $used[] = $rawname;
}
if ($skipthis) {
    continue;
 public function handle($handler = false)
 {
     $base = $this->base();
     $upbase = $this->base();
     $csvbase = $this->base();
     $liststyles = $this->styles('lists');
     $tablestyles = $this->styles('tables');
     $flightboxstyles = $this->styles('flightboxes');
     $random = $this->colors('random');
     $matched = $this->colors('matched');
     $classic = $this->colors('classic');
     $filegroups = $this->filegroups();
     $roles = fileaway_utility::caps();
     $all = $handler && in_array($handler, $this->shortcodes) ? false : true;
     if ($all || $handler == 'fileaway') {
         $this->shortcodes['fileaway'] = array('type' => array('default' => 'list', 'options' => array('' => 'Sorted List', 'table' => 'Sortable Data Table')), 'base' => array('list' => array('default' => '1', 'options' => $base), 'table' => array('default' => '1', 'options' => $base)), 'sub' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'makedir' => array('list' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled')), 'table' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled'))), 'name' => array('table' => array('default' => false, 'options' => false)), 'paginate' => array('table' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled'), 'binary' => 'true')), 'pagesize' => array('table' => array('default' => '15', 'options' => false)), 'search' => array('table' => array('default' => false, 'options' => array('' => 'Enabled', 'no' => 'Disabled'))), 'searchlabel' => array('table' => array('default' => false, 'options' => false)), 'filenamelabel' => array('table' => array('default' => false, 'options' => false)), 'datelabel' => array('table' => array('default' => false, 'options' => false)), 'customdata' => array('table' => array('default' => false, 'options' => false)), 'metadata' => array('table' => array('default' => '', 'options' => array('' => 'In File Name', 'database' => 'In Database'), 'binary' => 'database')), 'sortfirst' => array('table' => array('default' => 'filename', 'options' => array('' => 'Filename ASC', 'filename-desc' => 'Filename DSC', 'type' => 'Filetype ASC', 'type-desc' => 'Filetype DSC', 'custom' => 'Custom Column ASC', 'custom-desc' => 'Custom Column DSC', 'mod' => 'Date Modified ASC', 'mod-desc' => 'Date Modified DSC', 'size' => 'Filesize ASC', 'size-desc' => 'Filesize DSC', 'disabled' => 'Disable Sorting'))), 'mod' => array('list' => array('default' => false, 'options' => array('' => 'Hide', 'yes' => 'Show')), 'table' => array('default' => false, 'options' => array('' => 'Show', 'no' => 'Hide'))), 'size' => array('list' => array('default' => false, 'options' => array('' => 'Show', 'no' => 'Hide')), 'table' => array('default' => false, 'options' => array('' => 'Show', 'no' => 'Hide'))), 'nolinks' => array('list' => array('default' => false, 'options' => array('' => 'False', 'yes' => 'True'), 'binary' => 'yes'), 'table' => array('default' => false, 'options' => array('' => 'False', 'yes' => 'True'), 'binary' => 'yes')), 'redirect' => array('list' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled'), 'binary' => 'true'), 'table' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled'), 'binary' => 'true')), 'showrss' => array('table' => array('default' => false, 'options' => array('' => 'False', 'true' => 'True'), 'binary' => 'true')), 'fadein' => array('list' => array('default' => false, 'options' => array('' => 'Disabled', 'opacity' => 'Opacity Fade', 'display' => 'Display Fade')), 'table' => array('default' => false, 'options' => array('' => 'Disabled', 'opacity' => 'Opacity Fade', 'display' => 'Display Fade'))), 'fadetime' => array('list' => array('default' => '1000', 'options' => array('500' => '500', '' => '1000', '1500' => '1500', '2000' => '2000')), 'table' => array('default' => '1000', 'options' => array('500' => '500', '' => '1000', '1500' => '1500', '2000' => '2000'))), 'class' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'debug' => array('list' => array('default' => false, 'options' => array('' => 'Disabled', 'on' => 'Enabled')), 'table' => array('default' => false, 'options' => array('' => 'Disabled', 'on' => 'Enabled'))), 's2skipconfirm' => array('list' => array('default' => false, 'options' => array('' => 'Confirmations On', 'true' => 'Confirmations Off')), 'table' => array('default' => false, 'options' => array('' => 'Confirmations On', 'true' => 'Confirmations Off'))), 'stats' => array('list' => array('default' => 'true', 'options' => array('' => 'Enabled', 'false' => 'Disabled')), 'table' => array('default' => 'true', 'options' => array('' => 'Enabled', 'false' => 'Disabled'))), 'bulkdownload' => array('table' => array('default' => false, 'options' => array('' => 'Disabled', 'on' => 'Enabled'), 'binary' => 'on')), 'playback' => array('table' => array('default' => false, 'options' => array('' => 'Disabled', 'compact' => 'Compact', 'extended' => 'Extended'), 'binary' => 'compact')), 'playbackpath' => array('table' => array('default' => false, 'options' => false)), 'playbacklabel' => array('table' => array('default' => false, 'options' => false)), 'onlyaudio' => array('table' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled'), 'binary' => 'true')), 'loopaudio' => array('table' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled'), 'binary' => 'true')), 'flightbox' => array('list' => array('default' => false, 'options' => array('' => 'Disabled', 'images' => 'Images', 'videos' => 'Videos', 'pdfs' => 'PDFs', 'multi' => 'Multi-Media')), 'table' => array('default' => false, 'options' => array('' => 'Disabled', 'images' => 'Images', 'videos' => 'Videos', 'pdfs' => 'PDFs', 'multi' => 'Multi-Media'))), 'boxtheme' => array('list' => array('default' => 'minimalist', 'options' => $flightboxstyles), 'table' => array('default' => 'minimalist', 'options' => $flightboxstyles)), 'nolinksbox' => array('list' => array('default' => false, 'options' => array('' => 'Enable Downloads', 'true' => 'Disable Downloads'), 'binary' => 'true'), 'table' => array('default' => false, 'options' => array('' => 'Enable Downloads', 'true' => 'Disable Downloads'), 'binary' => 'true')), 'maximgwidth' => array('list' => array('default' => '1920', 'options' => false), 'table' => array('default' => '1920', 'options' => false)), 'maximgheight' => array('list' => array('default' => '1080', 'options' => false), 'table' => array('default' => '1080', 'options' => false)), 'videowidth' => array('list' => array('default' => '1920', 'options' => false), 'table' => array('default' => '1920', 'options' => false)), 'encryption' => array('list' => array('default' => false, 'options' => array('' => 'Disabled', 'on' => 'Enabled'), 'binary' => 'on'), 'table' => array('default' => false, 'options' => array('' => 'Disabled', 'on' => 'Enabled'), 'binary' => 'on')), 'recursive' => array('list' => array('default' => false, 'options' => array('' => 'Disabled', 'on' => 'Enabled'), 'binary' => 'on'), 'table' => array('default' => false, 'options' => array('' => 'Disabled', 'on' => 'Enabled'), 'binary' => 'on')), 'directories' => array('table' => array('default' => false, 'options' => array('' => 'Disabled', 'on' => 'Enabled'), 'binary' => 'on')), 'manager' => array('table' => array('default' => false, 'options' => array('' => 'Disabled', 'on' => 'Enabled'), 'binary' => 'on')), 'drawerid' => array('table' => array('default' => false, 'options' => false)), 'excludedirs' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'onlydirs' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'drawericon' => array('table' => array('default' => 'drawer', 'options' => array('' => 'Drawer', 'drawer-2' => 'Drawer Alt', 'book' => 'Book', 'cabinet' => 'Cabinet', 'console' => 'Console'))), 'drawerlabel' => array('table' => array('default' => false, 'options' => false)), 'password' => array('table' => array('default' => false, 'options' => false)), 'user_override' => array('table' => array('default' => false, 'options' => false)), 'role_override' => array('table' => array('default' => 'skip', 'options' => $roles)), 'dirman_access' => array('table' => array('default' => 'skip', 'options' => $roles)), 'exclude' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'include' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'only' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'images' => array('list' => array('default' => false, 'options' => array('' => 'Include', 'only' => 'Only', 'none' => 'Exclude')), 'table' => array('default' => false, 'options' => array('' => 'Include', 'only' => 'Only', 'none' => 'Exclude'))), 'code' => array('list' => array('default' => false, 'options' => array('' => 'Exclude', 'yes' => 'Include')), 'table' => array('default' => false, 'options' => array('' => 'Exclude', 'yes' => 'Include'))), 'devices' => array('list' => array('default' => false, 'options' => array('' => 'All Devices', 'desktop' => 'Desktops/Notebooks', 'mobile' => 'Mobiles/Tablets')), 'table' => array('options' => array('' => 'All Devices', 'desktop' => 'Desktops/Notebooks', 'mobile' => 'Mobiles/Tablets'))), 'limit' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'limitby' => array('list' => array('default' => 'random', 'options' => array('' => 'Random', 'oldest' => 'Oldest', 'mostrecent' => 'Most Recent', 'alpha' => 'Alpha Asc', 'alpha-desc' => 'Alpha Desc')), 'table' => array('default' => 'random', 'options' => array('' => 'Random', 'mostrecent' => 'Most Recent', 'oldest' => 'Oldest', 'alpha' => 'Alpha Asc', 'alpha-desc' => 'Alpha Desc'))), 'showto' => array('list' => array('default' => 'skip', 'options' => $roles), 'table' => array('default' => 'skip', 'options' => $roles)), 'hidefrom' => array('list' => array('default' => 'skip', 'options' => $roles), 'table' => array('default' => 'skip', 'options' => $roles)), 'theme' => array('list' => array('default' => 'minimal-list', 'options' => $liststyles), 'table' => array('default' => 'minimalist', 'options' => $tablestyles)), 'heading' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'width' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => '100', 'options' => false)), 'perpx' => array('list' => array('default' => '%', 'options' => array('' => 'Percent', 'px' => 'Pixels')), 'table' => array('default' => '%', 'options' => array('' => 'Percent', 'px' => 'Pixels'))), 'align' => array('list' => array('default' => 'left', 'options' => array('' => 'Left', 'right' => 'Right', 'none' => 'None')), 'table' => array('default' => 'left', 'options' => array('' => 'Left', 'right' => 'Right', 'none' => 'None'))), 'textalign' => array('table' => array('default' => 'center', 'options' => array('' => 'Center', 'left' => 'Left', 'right' => 'Right'))), 'hcolor' => array('list' => array('default' => false, 'options' => $random), 'table' => array('default' => false, 'options' => $random)), 'color' => array('list' => array('default' => false, 'options' => $random), 'table' => array('default' => false, 'options' => $classic)), 'accent' => array('list' => array('default' => false, 'options' => $matched)), 'iconcolor' => array('list' => array('default' => false, 'options' => $random), 'table' => array('default' => false, 'options' => $classic)), 'icons' => array('list' => array('default' => false, 'options' => array('' => 'Filetype', 'paperclip' => 'Paperclip', 'none' => 'None')), 'table' => array('default' => false, 'options' => array('' => 'Filetype', 'paperclip' => 'Paperclip', 'none' => 'None'))), 'prettify' => array('list' => array('default' => false, 'options' => array('' => 'Enabled', 'off' => 'Disabled'), 'binary' => 'off'), 'table' => array('default' => false, 'options' => array('' => 'Enabled', 'off' => 'Disabled'), 'binary' => 'off')), 'corners' => array('list' => array('default' => false, 'options' => array('' => 'Rounded', 'sharp' => 'Sharp', 'roundtop' => 'Rounded Top', 'roundbottom' => 'Rounded Bottom', 'roundleft' => 'Rounded Left', 'roundright' => 'Rounded Right', 'elliptical' => 'Elliptical'))), 'display' => array('list' => array('default' => false, 'options' => array('' => 'Vertical', 'inline' => 'Side-by-Side', '2col' => 'Two Columns'))), 'thumbnails' => array('table' => array('default' => false, 'options' => array('' => 'Disabled', 'transient' => 'Transient', 'permanent' => 'Permanent'), 'binary' => 'transient')), 'thumbsize' => array('table' => array('default' => 'small', 'options' => array('' => 'Small', 'medium' => 'Medium', 'large' => 'Large'))), 'thumbstyle' => array('table' => array('default' => 'widerounded', 'options' => array('' => 'Wide-Rounded', 'widesharp' => 'Wide-Sharp', 'squarerounded' => 'Square-Rounded', 'squaresharp' => 'Square-Sharp', 'oval' => 'Oval', 'circle' => 'Circle'))), 'graythumbs' => array('table' => array('default' => false, 'options' => array('' => 'None', 'true' => 'Grayscale'))), 'maxsrcbytes' => array('table' => array('default' => '1887436.8', 'options' => false)), 'maxsrcheight' => array('table' => array('default' => 2500, 'options' => false)), 'maxsrcwidth' => array('table' => array('default' => 3000, 'options' => false)), 'bannerize' => array('table' => array('default' => false, 'options' => false)));
     }
     if ($all || $handler == 'attachaway') {
         $this->shortcodes['attachaway'] = array('type' => array('default' => 'list', 'options' => array('' => 'Sorted List', 'table' => 'Sortable Data Table')), 'postid' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'search' => array('table' => array('default' => false, 'options' => array('' => 'Enabled', 'no' => 'Disabled'))), 'searchlabel' => array('table' => array('default' => false, 'options' => false)), 'filenamelabel' => array('table' => array('default' => false, 'options' => false)), 'capcolumn' => array('table' => array('default' => false, 'options' => false)), 'descolumn' => array('table' => array('default' => false, 'options' => false)), 'paginate' => array('table' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled'))), 'pagesize' => array('table' => array('default' => 15, 'options' => false)), 'size' => array('list' => array('default' => false, 'options' => array('' => 'Show', 'no' => 'Hide')), 'table' => array('default' => false, 'options' => array('' => 'Show', 'no' => 'Hide'))), 'sortfirst' => array('table' => array('default' => 'filename', 'options' => array('' => 'Filename ASC', 'filename-desc' => 'Filename DSC', 'type' => 'Filetype ASC', 'type-desc' => 'Filetype DSC', 'caption' => 'Caption Column ASC', 'caption-desc' => 'Caption Column DSC', 'description' => 'Description Column ASC', 'description-desc' => 'Description Column DSC', 'mod' => 'Date Modified ASC', 'mod-desc' => 'Date Modified DSC', 'size' => 'Filesize ASC', 'size-desc' => 'Filesize DSC', 'disabled' => 'Disable Sorting'))), 'orderby' => array('list' => array('default' => 'title', 'options' => array('' => 'Title', 'menu_order' => 'Menu Order', 'ID' => 'ID', 'date' => 'Date', 'modified' => 'Modified', 'rand' => 'Random'))), 'desc' => array('list' => array('default' => 'asc', 'options' => array('' => 'Asc', 'true' => 'Desc'))), 'fadein' => array('list' => array('default' => false, 'options' => array('' => 'Disabled', 'opacity' => 'Opacity Fade', 'display' => 'Display Fade')), 'table' => array('default' => false, 'options' => array('' => 'Disabled', 'opacity' => 'Opacity Fade', 'display' => 'Display Fade'))), 'fadetime' => array('list' => array('default' => '1000', 'options' => array('500' => '500', '' => '1000', '1500' => '1500', '2000' => '2000')), 'table' => array('default' => '1000', 'options' => array('500' => '500', '' => '1000', '1500' => '1500', '2000' => '2000'))), 'class' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'debug' => array('list' => array('default' => false, 'options' => array('' => 'Disabled', 'on' => 'Enabled')), 'table' => array('default' => false, 'options' => array('' => 'Disabled', 'on' => 'Enabled'))), 'flightbox' => array('list' => array('default' => false, 'options' => array('' => 'Disabled', 'images' => 'Images', 'videos' => 'Videos', 'pdfs' => 'PDFs', 'multi' => 'Multi-Media')), 'table' => array('default' => false, 'options' => array('' => 'Disabled', 'images' => 'Images', 'videos' => 'Videos', 'pdfs' => 'PDFs', 'multi' => 'Multi-Media'))), 'boxtheme' => array('list' => array('default' => 'minimalist', 'options' => $flightboxstyles), 'table' => array('default' => 'minimalist', 'options' => $flightboxstyles)), 'nolinksbox' => array('list' => array('default' => false, 'options' => array('' => 'Enable Downloads', 'true' => 'Disable Downloads'), 'binary' => 'true'), 'table' => array('default' => false, 'options' => array('' => 'Enable Downloads', 'true' => 'Disable Downloads'), 'binary' => 'true')), 'maximgwidth' => array('list' => array('default' => '1920', 'options' => false), 'table' => array('default' => '1920', 'options' => false)), 'maximgheight' => array('list' => array('default' => '1080', 'options' => false), 'table' => array('default' => '1080', 'options' => false)), 'videowidth' => array('list' => array('default' => '1920', 'options' => false), 'table' => array('default' => '1920', 'options' => false)), 'exclude' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'include' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'only' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'images' => array('list' => array('default' => false, 'options' => array('' => 'Include', 'only' => 'Only', 'none' => 'Exclude')), 'table' => array('default' => false, 'options' => array('' => 'Include', 'only' => 'Only', 'none' => 'Exclude'))), 'code' => array('list' => array('default' => false, 'options' => array('' => 'Exclude', 'yes' => 'Include')), 'table' => array('default' => false, 'options' => array('' => 'Exclude', 'yes' => 'Include'))), 'devices' => array('list' => array('default' => false, 'options' => array('' => 'All Devices', 'desktop' => 'Desktops/Notebooks', 'mobile' => 'Mobiles/Tablets')), 'table' => array('options' => array('' => 'All Devices', 'desktop' => 'Desktops/Notebooks', 'mobile' => 'Mobiles/Tablets'))), 'showto' => array('list' => array('default' => 'skip', 'options' => $roles), 'table' => array('default' => 'skip', 'options' => $roles)), 'hidefrom' => array('list' => array('default' => 'skip', 'options' => $roles), 'table' => array('default' => 'skip', 'options' => $roles)), 'theme' => array('list' => array('default' => 'minimal-list', 'options' => $liststyles), 'table' => array('default' => 'minimalist', 'options' => $tablestyles)), 'heading' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'width' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => '100', 'options' => false)), 'perpx' => array('list' => array('default' => '%', 'options' => array('' => 'Percent', 'px' => 'Pixels')), 'table' => array('default' => '%', 'options' => array('' => 'Percent', 'px' => 'Pixels'))), 'align' => array('list' => array('default' => 'left', 'options' => array('' => 'Left', 'right' => 'Right', 'none' => 'None')), 'table' => array('default' => 'left', 'options' => array('' => 'Left', 'right' => 'Right', 'none' => 'None'))), 'textalign' => array('table' => array('default' => 'center', 'options' => array('' => 'Center', 'left' => 'Left', 'right' => 'Right'))), 'hcolor' => array('list' => array('default' => false, 'options' => $random), 'table' => array('default' => false, 'options' => $random)), 'color' => array('list' => array('default' => false, 'options' => $random), 'table' => array('default' => false, 'options' => $classic)), 'accent' => array('list' => array('default' => false, 'options' => $matched)), 'iconcolor' => array('list' => array('default' => false, 'options' => $random), 'table' => array('default' => false, 'options' => $classic)), 'icons' => array('list' => array('default' => false, 'options' => array('' => 'Filetype', 'paperclip' => 'Paperclip', 'none' => 'None')), 'table' => array('default' => false, 'options' => array('' => 'Filetype', 'paperclip' => 'Paperclip', 'none' => 'None'))), 'corners' => array('list' => array('default' => false, 'options' => array('' => 'Rounded', 'sharp' => 'Sharp', 'roundtop' => 'Rounded Top', 'roundbottom' => 'Rounded Bottom', 'roundleft' => 'Rounded Left', 'roundright' => 'Rounded Right', 'elliptical' => 'Elliptical'))), 'display' => array('list' => array('default' => false, 'options' => array('' => 'Vertical', 'inline' => 'Side-by-Side', '2col' => 'Two Columns'))));
     }
     if ($all || $handler == 'fileup') {
         $this->shortcodes['fileup'] = array('base' => array('default' => 1, 'options' => $upbase), 'sub' => array('default' => false, 'options' => false), 'makedir' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled')), 'matchdrawer' => array('default' => false, 'options' => false), 'single' => array('default' => false, 'options' => array('' => 'Multiple', 'true' => 'Single')), 'maxsize' => array('default' => '10', 'options' => false), 'maxsizetype' => array('default' => 'm', 'options' => array('' => 'MB', 'k' => 'KB', 'g' => 'GB')), 'uploadlabel' => array('default' => false, 'options' => false), 'fadein' => array('default' => false, 'options' => array('' => 'Disabled', 'opacity' => 'Opacity Fade', 'display' => 'Display Fade')), 'fadetime' => array('default' => '1000', 'options' => array('500' => '500', '' => '1000', '1500' => '1500', '2000' => '2000')), 'fixedlocation' => array('default' => false, 'options' => array('' => 'Allow Sub Selection', 'true' => 'Fixed Location')), 'uploader' => array('default' => false, 'options' => array('' => 'Disabled', 'name' => 'Display Name', 'id' => 'User ID')), 'overwrite' => array('default' => false, 'options' => array('' => 'Never Overwrite', 'true' => 'Always Overwrite')), 'name' => array('default' => false, 'options' => false), 'class' => array('default' => false, 'options' => false), 'devices' => array('default' => false, 'options' => array('' => 'All Devices', 'desktop' => 'Desktops/Notebooks', 'mobile' => 'Mobiles/Tablets')), 'action' => array('default' => 'permit', 'options' => array('' => 'Permit', 'prohibit' => 'Prohibit')), 'filetypes' => array('default' => false, 'options' => false), 'filegroups' => array('default' => 'skip', 'options' => $filegroups), 'showto' => array('default' => 'skip', 'options' => $roles), 'hidefrom' => array('default' => 'skip', 'options' => $roles), 'theme' => array('default' => 'minimalist', 'options' => $tablestyles), 'width' => array('default' => '100', 'options' => false), 'perpx' => array('default' => '%', 'options' => array('' => 'Percent', 'px' => 'Pixels')), 'align' => array('default' => 'none', 'options' => array('' => 'None', 'left' => 'Left', 'right' => 'Right')), 'iconcolor' => array('default' => false, 'options' => $classic));
     }
     if ($all || $handler == 'fileaway_values') {
         $this->shortcodes['fileaway_values'] = array('base' => array('default' => '1', 'options' => $csvbase), 'sub' => array('default' => false, 'options' => false), 'filename' => array('default' => false, 'options' => false), 'makecsv' => array('default' => false, 'options' => false), 'makedir' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled')), 'paginate' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled'), 'binary' => 'true'), 'pagesize' => array('default' => '15', 'options' => false), 'sorting' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled')), 'search' => array('default' => false, 'options' => array('' => 'Enabled', 'no' => 'Disabled')), 'searchlabel' => array('default' => false, 'options' => false), 'placeholder' => array('default' => __('Select CSV', 'file-away'), 'options' => false), 'read' => array('default' => 'ISO-8859-1', 'options' => array('' => 'ISO-8859-1', 'UTF-8' => 'UTF-8', 'UTF-16' => 'UTF-16', 'ISO-8859-2' => 'ISO-8859-2', 'ISO-8859-3' => 'ISO-8859-3', 'ISO-8859-4' => 'ISO-8859-4', 'ISO-8859-5' => 'ISO-8859-5', 'ISO-8859-6' => 'ISO-8859-6', 'ISO-8859-7' => 'ISO-8859-7', 'ISO-8859-8' => 'ISO-8859-8', 'ISO-8859-9' => 'ISO-8859-9', 'ISO-8859-10' => 'ISO-8859-10', 'ISO-8859-11' => 'ISO-8859-11', 'ISO-8859-13' => 'ISO-8859-13', 'ISO-8859-14' => 'ISO-8859-14', 'ISO-8859-15' => 'ISO-8859-15', 'ISO-8859-16' => 'ISO-8859-16')), 'write' => array('default' => 'ISO-8859-1', 'options' => array('' => 'ISO-8859-1', 'UTF-8' => 'UTF-8', 'UTF-16' => 'UTF-16', 'ISO-8859-2' => 'ISO-8859-2', 'ISO-8859-3' => 'ISO-8859-3', 'ISO-8859-4' => 'ISO-8859-4', 'ISO-8859-5' => 'ISO-8859-5', 'ISO-8859-6' => 'ISO-8859-6', 'ISO-8859-7' => 'ISO-8859-7', 'ISO-8859-8' => 'ISO-8859-8', 'ISO-8859-9' => 'ISO-8859-9', 'ISO-8859-10' => 'ISO-8859-10', 'ISO-8859-11' => 'ISO-8859-11', 'ISO-8859-13' => 'ISO-8859-13', 'ISO-8859-14' => 'ISO-8859-14', 'ISO-8859-15' => 'ISO-8859-15', 'ISO-8859-16' => 'ISO-8859-16')), 'recursive' => array('default' => false, 'options' => array('' => 'Disabled', 'on' => 'Enabled'), 'binary' => 'on'), 'editor' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled'), 'binary' => 'true'), 'exclude' => array('default' => false, 'options' => false), 'include' => array('default' => false, 'options' => false), 'only' => array('default' => false, 'options' => false), 'excludedirs' => array('default' => false, 'options' => false), 'onlydirs' => array('default' => false, 'options' => false), 'devices' => array('default' => false, 'options' => array('' => 'All Devices', 'desktop' => 'Desktops/Notebooks', 'mobile' => 'Mobiles/Tablets')), 'showto' => array('default' => 'skip', 'options' => $roles), 'hidefrom' => array('default' => 'skip', 'options' => $roles), 'theme' => array('default' => 'minimalist', 'options' => $tablestyles), 'width' => array('default' => '100', 'options' => false), 'perpx' => array('default' => '%', 'options' => array('' => 'Percent', 'px' => 'Pixels')), 'align' => array('default' => 'none', 'options' => array('' => 'None', 'left' => 'Left', 'right' => 'Right')), 'textalign' => array('default' => 'center', 'options' => array('' => 'Center', 'left' => 'Left', 'right' => 'Right')), 'hcolor' => array('default' => false, 'options' => $random));
     }
     if ($all || $handler == 'formaway_open') {
         $this->shortcodes['formaway_open'] = array('paginate' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled'), 'binary' => 'true'), 'pagesize' => array('default' => '15', 'options' => false), 'search' => array('default' => false, 'options' => array('' => 'Enabled', 'no' => 'Disabled')), 'searchlabel' => array('default' => false, 'options' => false), 'fadein' => array('default' => false, 'options' => array('' => 'Disabled', 'opacity' => 'Opacity Fade', 'display' => 'Display Fade')), 'fadetime' => array('default' => '1000', 'options' => array('500' => '500', '' => '1000', '1500' => '1500', '2000' => '2000')), 'numcols' => array('default' => '1', 'options' => false), 'sort' => array('default' => false, 'options' => array('' => 'Ascending', 'desc' => 'Descending', 'no' => 'Disabled')), 'initialsort' => array('default' => '1', 'options' => array()), 'theme' => array('default' => 'minimalist', 'options' => $tablestyles), 'heading' => array('default' => false, 'options' => false), 'hcolor' => array('default' => false, 'options' => $random), 'classes' => array('default' => false, 'options' => false), 'width' => array('default' => '100', 'options' => false), 'perpx' => array('default' => '%', 'options' => array('' => 'Percent', 'px' => 'Pixels')), 'align' => array('default' => 'none', 'options' => array('' => 'None', 'left' => 'Left', 'right' => 'Right')), 'textalign' => array('default' => 'center', 'options' => array('' => 'Center', 'left' => 'Left', 'right' => 'Right')));
     }
     if ($all || $handler == 'formaway_row') {
         $this->shortcodes['formaway_row'] = array('classes' => array('default' => false, 'options' => false));
     }
     if ($all || $handler == 'formaway_cell') {
         $this->shortcodes['formaway_cell'] = array('sortvalue' => array('default' => false, 'options' => false), 'classes' => array('default' => false, 'options' => false), 'colspan' => array('default' => false, 'options' => false));
     }
     if ($all || $handler == 'formaway_close') {
         $this->shortcodes['formaway_close'] = array('clearfix' => array('default' => false, 'options' => array('' => 'No', 'true' => 'Yes')));
     }
     if ($all || $handler == 'fileaframe') {
         $this->shortcodes['fileaframe'] = array('source' => array('default' => false, 'options' => false), 'name' => array('default' => false, 'options' => false), 'scroll' => array('default' => 'no', 'options' => array('' => 'Off', 'yes' => 'On', 'auto' => 'Auto')), 'width' => array('default' => '100%', 'options' => false), 'height' => array('default' => '1000px', 'options' => false), 'mwidth' => array('default' => '0px', 'options' => false), 'mheight' => array('default' => '0px', 'options' => false), 'showto' => array('default' => 'skip', 'options' => $roles), 'hidefrom' => array('default' => 'skip', 'options' => $roles), 'devices' => array('default' => false, 'options' => array('' => 'All Devices', 'desktop' => 'Desktops/Notebooks', 'mobile' => 'Mobiles/Tablets')));
     }
     if ($all || $handler == 'stataway') {
         $this->shortcodes['stataway'] = array('type' => array('default' => 'table', 'options' => array('' => 'Sorted List', 'table' => 'Sortable Data Table')), 'show' => array('list' => array('default' => 'top', 'options' => array('' => 'Top Downloads', 'recent' => 'Most Recent Downloads'))), 'scope' => array('list' => array('default' => 'week', 'options' => array('24hrs' => 'Past 24 Hours', 'yesterday' => 'Yesterday', '' => 'Past Week', 'twoweeks' => 'Past Two Weeks', 'month' => 'Past Month', 'year' => 'Past Year', 'all' => 'All Time (Not Recommended)'))), 'number' => array('list' => array('default' => false, 'options' => false)), 'class' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => false, 'options' => false)), 'paginate' => array('table' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled'), 'binary' => 'true')), 'pagesize' => array('table' => array('default' => '15', 'options' => false)), 'search' => array('table' => array('default' => false, 'options' => array('' => 'Enabled', 'no' => 'Disabled'))), 'searchlabel' => array('table' => array('default' => false, 'options' => false)), 'mod' => array('list' => array('default' => false, 'options' => array('' => 'Hide', 'yes' => 'Show'))), 'size' => array('list' => array('default' => false, 'options' => array('' => 'Show', 'no' => 'Hide'))), 'filecolumn' => array('table' => array('default' => 'path', 'options' => array('' => 'Full Path to File', 'file' => 'File Name Only'))), 'username' => array('table' => array('default' => false, 'options' => array('' => 'Show', 'no' => 'Hide'))), 'email' => array('table' => array('default' => false, 'options' => array('' => 'Show', 'no' => 'Hide'))), 'ip' => array('table' => array('default' => false, 'options' => array('' => 'Show', 'no' => 'Hide'))), 'agent' => array('table' => array('default' => false, 'options' => array('' => 'Hide', 'yes' => 'Show'))), 'redirect' => array('list' => array('default' => false, 'options' => array('' => 'Disabled', 'true' => 'Enabled'), 'binary' => 'true')), 'fadein' => array('list' => array('default' => false, 'options' => array('' => 'Disabled', 'opacity' => 'Opacity Fade', 'display' => 'Display Fade')), 'table' => array('default' => false, 'options' => array('' => 'Disabled', 'opacity' => 'Opacity Fade', 'display' => 'Display Fade'))), 'fadetime' => array('list' => array('default' => '1000', 'options' => array('500' => '500', '' => '1000', '1500' => '1500', '2000' => '2000')), 'table' => array('default' => '1000', 'options' => array('500' => '500', '' => '1000', '1500' => '1500', '2000' => '2000'))), 's2skipconfirm' => array('list' => array('default' => false, 'options' => array('' => 'Confirmations On', 'true' => 'Confirmations Off'))), 'stats' => array('list' => array('default' => 'true', 'options' => array('' => 'Enabled', 'false' => 'Disabled')), 'table' => array('default' => 'false', 'options' => array('' => 'Disabled', 'true' => 'Enabled'))), 'flightbox' => array('list' => array('default' => false, 'options' => array('' => 'Disabled', 'images' => 'Images', 'videos' => 'Videos', 'pdfs' => 'PDFs', 'multi' => 'Multi-Media'))), 'boxtheme' => array('list' => array('default' => 'minimalist', 'options' => $flightboxstyles)), 'maximgwidth' => array('list' => array('default' => '1920', 'options' => false)), 'maximgheight' => array('list' => array('default' => '1080', 'options' => false)), 'videowidth' => array('list' => array('default' => '1920', 'options' => false)), 'encryption' => array('list' => array('default' => false, 'options' => array('' => 'Disabled', 'on' => 'Enabled'), 'binary' => 'on')), 'devices' => array('list' => array('default' => false, 'options' => array('' => 'All Devices', 'desktop' => 'Desktops/Notebooks', 'mobile' => 'Mobiles/Tablets')), 'table' => array('options' => array('' => 'All Devices', 'desktop' => 'Desktops/Notebooks', 'mobile' => 'Mobiles/Tablets'))), 'showto' => array('list' => array('default' => 'skip', 'options' => $roles), 'table' => array('default' => 'skip', 'options' => $roles)), 'hidefrom' => array('list' => array('default' => 'skip', 'options' => $roles), 'table' => array('default' => 'skip', 'options' => $roles)), 'theme' => array('list' => array('default' => 'minimal-list', 'options' => $liststyles), 'table' => array('default' => 'minimalist', 'options' => $tablestyles)), 'heading' => array('list' => array('default' => false, 'options' => false)), 'width' => array('list' => array('default' => false, 'options' => false), 'table' => array('default' => '100', 'options' => false)), 'perpx' => array('list' => array('default' => '%', 'options' => array('' => 'Percent', 'px' => 'Pixels')), 'table' => array('default' => '%', 'options' => array('' => 'Percent', 'px' => 'Pixels'))), 'align' => array('list' => array('default' => 'left', 'options' => array('' => 'Left', 'right' => 'Right', 'none' => 'None')), 'table' => array('default' => 'left', 'options' => array('' => 'Left', 'right' => 'Right', 'none' => 'None'))), 'textalign' => array('table' => array('default' => 'center', 'options' => array('' => 'Center', 'left' => 'Left', 'right' => 'Right'))), 'hcolor' => array('list' => array('default' => false, 'options' => $random)), 'color' => array('list' => array('default' => false, 'options' => $random)), 'accent' => array('list' => array('default' => false, 'options' => $matched)), 'iconcolor' => array('list' => array('default' => false, 'options' => $random)), 'icons' => array('list' => array('default' => false, 'options' => array('' => 'Filetype', 'paperclip' => 'Paperclip', 'none' => 'None'))), 'corners' => array('list' => array('default' => false, 'options' => array('' => 'Rounded', 'sharp' => 'Sharp', 'roundtop' => 'Rounded Top', 'roundbottom' => 'Rounded Bottom', 'roundleft' => 'Rounded Left', 'roundright' => 'Rounded Right', 'elliptical' => 'Elliptical'))), 'display' => array('list' => array('default' => false, 'options' => array('' => 'Vertical', 'inline' => 'Side-by-Side', '2col' => 'Two Columns'))));
     }
     if ($all || $handler == 'stataway_user') {
         $this->shortcodes['stataway_user'] = array('output' => array('default' => 'total', 'options' => array('' => 'Total Downloads', 'ol' => 'Ordered List', 'ul' => 'Unordered List')), 'scope' => array('default' => 'week', 'options' => array('24hrs' => 'Past 24 Hours', '' => 'Past Week', 'twoweeks' => 'Past Two Weeks', 'month' => 'Past Month', 'year' => 'Past Year', 'all' => 'All Time')), 'user' => array('default' => false, 'options' => false), 'timestamp' => array('default' => false, 'options' => array('' => 'Hide', 'yes' => 'Show')), 'class' => array('default' => false, 'options' => false));
     }
     if ($all || $handler == 'fileaway_tutorials') {
         $this->shortcodes['fileaway_tutorials'] = array('showto' => array('default' => false, 'options' => $roles), 'hidefrom' => array('default' => false, 'options' => $roles));
     }
 }