示例#1
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 lifespanpurge()
 {
     global $wpdb;
     if ($this->ops['recordlifespan'] == 'forever') {
         return;
     }
     fileaway_utility::timezone();
     $cutoff = date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . ' -' . $this->ops['recordlifespan']));
     date_default_timezone_set('UTC');
     $records = $wpdb->get_results($wpdb->prepare("SELECT id FROM " . self::$db . " WHERE timestamp <= %s", $cutoff), ARRAY_N);
     if (!$records) {
         return;
     }
     foreach ($records as $record) {
         $wpdb->delete(self::$db, array('id' => $record[0]));
     }
     exit;
 }
示例#3
0
文件: file-away.php 项目: RA2WP/RA2WP
        {
            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();
示例#4
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;
 }
示例#5
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;
     }
 }