Example #1
0
             foreach ($filetypes as $add) {
                 $return_types .= empty($return_types) ? $add : ', ' . $add;
             }
             $matches[2] = $cs_lang['max_size'] . cs_filesize($max_size) . cs_html_br(1);
             $matches[2] .= $cs_lang['filetypes'] . ': ' . $return_types;
             $data['files'][$run]['clip'] = cs_abcode_clip($matches);
         } else {
             $data['files'][$run]['if']['file_exists'] = TRUE;
             $data['files'][$run]['name'] = $file_name[$num];
             $data['files'][$run]['up_name'] = $file_upload_name[$num];
             $file = $file_name[$num];
             $extension = strlen(strrchr($file, "."));
             $name = strlen($file);
             $ext = substr($file, $name - $extension + 1, $name);
             $ext_lower = strtolower($ext);
             $data['files'][$run]['ext'] = cs_filetype($ext_lower);
             $data['files'][$run]['if']['file_is_picture'] = FALSE;
             $data['files'][$run]['if']['file_is_other'] = FALSE;
             #check if file is picture
             if (strcasecmp($ext, 'jpg') == '0' or strcasecmp($ext, 'jpeg') == '0' or strcasecmp($ext, 'gif') == '0' or strcasecmp($ext, 'png') == '0') {
                 $data['files'][$run]['if']['file_is_picture'] = TRUE;
             } else {
                 $data['files'][$run]['if']['file_is_other'] = TRUE;
             }
         }
     }
 }
 $data['if']['new_votes'] = FALSE;
 $data['if']['add_answer'] = FALSE;
 $data['if']['add_file'] = FALSE;
 $data['if']['new_file'] = FALSE;
Example #2
0
$order = 'bdf.boardfiles_id DESC';
$cs_att = cs_sql_select(__FILE__, $from, $select, 0, $order, 0, 0);
$count_att = count($cs_att);
$board_count = cs_sql_count(__FILE__, 'board');
$data['count']['all'] = $count_att;
if (empty($count_att)) {
    $data['attachments'] = '';
}
require_once 'mods/clansphere/filetype.php';
for ($run = 0; $run < $count_att; $run++) {
    $file = $cs_att[$run]['boardfiles_name'];
    $extension = strlen(strrchr($file, "."));
    $name = strlen($file);
    $ext = substr($file, $name - $extension + 1, $name);
    $ext_lower = strtolower($ext);
    $data['attachments'][$run]['icon'] = cs_filetype($ext_lower);
    if (file_exists('uploads/board/files/' . $cs_att[$run]['boardfiles_id'] . '.' . $ext)) {
        $file_file = filesize('uploads/board/files/' . $cs_att[$run]['boardfiles_id'] . '.' . $ext);
        $data['attachments'][$run]['filename'] = cs_html_link($cs_main['php_self']['dirname'] . 'mods/board/attachment.php?id=' . $cs_att[$run]['boardfiles_id'], $file, 1);
        $data['attachments'][$run]['size'] = cs_filesize($file_file);
    } elseif (file_exists('uploads/board/files/' . $file)) {
        $file_file = filesize('uploads/board/files/' . $file);
        $data['attachments'][$run]['filename'] = cs_html_link($cs_main['php_self']['dirname'] . 'mods/board/attachment.php?name=' . $file, $file, 1);
        $data['attachments'][$run]['size'] = cs_filesize($file_file);
    } else {
        $data['attachments'][$run]['filename'] = $cs_lang['no_att_exist'];
        $data['attachments'][$run]['size'] = cs_filesize(0);
    }
    $threads_headline = $cs_att[$run]['threads_headline'];
    $data['attachments'][$run]['topics'] = strlen($threads_headline) <= 15 ? $threads_headline : cs_substr($threads_headline, 0, 15) . '...';
    $data['attachments'][$run]['threads_headline'] = $threads_headline;
Example #3
0
             $file = $cs_thread_files[$run]['boardfiles_name'];
             $extension = strlen(strrchr($file, "."));
             $name = strlen($file);
             $ext = substr($file, $name - $extension + 1, $name);
             $cs_thread_files[$run]['boardfiles_typ'] = $ext;
         }
         require_once 'mods/clansphere/filetype.php';
         for ($run = 0; $run < $loop_files; $run++) {
             $ext = $cs_thread_files[$run]['boardfiles_typ'];
             $file = $cs_thread_files[$run]['boardfiles_name'];
             if (file_exists('uploads/board/files/' . $cs_thread_files[$run]['boardfiles_id'] . '.' . $ext)) {
                 $file_file = filesize('uploads/board/files/' . $cs_thread_files[$run]['boardfiles_id'] . '.' . $ext);
                 $data['files'][$run]['file'] = cs_filetype($ext) . ' ' . cs_html_link($cs_main['php_self']['dirname'] . 'mods/board/attachment.php?id=' . $cs_thread_files[$run]['boardfiles_id'], $file, 1) . ' (' . cs_filesize($file_file) . ' - ' . $cs_thread_files[$run]['boardfiles_downloaded'] . ' ' . $cs_lang['times'] . ' )';
             } elseif (file_exists('uploads/board/files/' . $file)) {
                 $file_file = filesize('uploads/board/files/' . $file);
                 $data['files'][$run]['file'] = cs_filetype($ext) . ' ' . cs_html_link($cs_main['php_self']['dirname'] . 'mods/board/attachment.php?id=' . $file, $file, 1) . ' (' . cs_filesize($file_file) . ' - ' . $cs_thread_files[$run]['boardfiles_downloaded'] . ' ' . $cs_lang['times'] . ' )';
             } else {
                 $data['files'][$run]['file'] = $cs_lang['no_att_file'];
             }
         }
     }
 }
 //Files Ende
 $data['thread_desc']['signature'] = getUserSignature($data['thread']['users_signature']);
 if (!empty($data['thread']['threads_edit'])) {
     $data['thread_desc']['checkedit'] = checkLastEdit($data['thread']['threads_edit'], $cs_lang);
 }
 //board_safemode($data['thread']['users_nick'], $data['thread']['threads_time'], $options);
 $data['thread_desc']['laston'] = cs_userstatus($data['thread']['users_laston'], $data['thread']['users_invisible'], 1);
 //echo cs_html_hr('100%');
 $data['thread_desc']['users_icons'] = getUserIcons($cs_lang, $data['thread']['users_id'], $data['thread']['users_nick'], $data['thread']['users_hidden'], $data['thread']['users_email'], $data['thread']['users_icq'], $data['thread']['users_jabber'], $data['thread']['users_url'], $data['thread']['users_skype']);
Example #4
0
$cs_files = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']);
$files_loop = count($cs_files);
$data['sort']['headline'] = cs_sort('files', 'manage', $start, $categories_id, 1, $sort);
$data['sort']['date'] = cs_sort('files', 'manage', $start, $categories_id, 3, $sort);
$data['files'] = array();
for ($run = 0; $run < $files_loop; $run++) {
    $files_mirror = $cs_files[$run]['files_mirror'];
    $temp = explode("-----", $files_mirror);
    $temp_loop = count($temp);
    $file_typ_array = array();
    $run_3 = '0';
    for ($run_2 = 1; $run_2 < $temp_loop; $run_2++) {
        $temp_a = explode("\n", $temp[$run_2]);
        if (!in_array($temp_a['3'], $file_typ_array, TRUE)) {
            $file_typ_array[$run_3] = $temp_a['3'];
            $run_3++;
        }
    }
    $loop_file_typ_array = count($file_typ_array);
    $data['files'][$run]['filetypes'] = array();
    for ($run_2 = 0; $run_2 < $loop_file_typ_array; $run_2++) {
        $ext = $file_typ_array[$run_2];
        require_once 'mods/clansphere/filetype.php';
        $data['files'][$run]['filetypes'][$run_2]['icon'] = cs_filetype($ext);
    }
    $data['files'][$run]['id'] = $cs_files[$run]['files_id'];
    $data['files'][$run]['name'] = $cs_files[$run]['files_name'];
    $data['files'][$run]['user'] = cs_user($cs_files[$run]['users_id'], $cs_files[$run]['users_nick'], $cs_files[$run]['users_active']);
    $data['files'][$run]['date'] = cs_date('unix', $cs_files[$run]['files_time'], 1);
}
echo cs_subtemplate(__FILE__, $data, 'files', 'manage');
Example #5
0
    $img_info = cs_icon('documentinfo');
    $y = -1;
    require_once 'mods/clansphere/filetype.php';
    for ($x = $start; $x < $count && $y < $max_data; $x++) {
        $y++;
        $file_raw = $dir == '.' ? $datas[$x] : $dir . '/' . $datas[$x];
        $file = cs_explorer_path($file_raw, 'escape');
        chdir($target);
        $type = is_dir($datas[$x]) ? 'dir' : strtolower(substr(strrchr($datas[$x], '.'), 1));
        chdir($cs_main['def_path']);
        $save[$y]['name'] = $datas[$x];
        $save[$y]['chmod'] = substr(sprintf('%o', fileperms($file_raw)), -4);
        $save[$y]['access'] = cs_link($img_access, 'explorer', 'chmod', 'file=' . $file);
        $save[$y]['remove'] = cs_link($img_del, 'explorer', 'remove', 'file=' . $file, 0, $cs_lang['remove']);
        $save[$y]['info'] = cs_link($img_info, 'explorer', 'information', 'file=' . $file);
        $save[$y]['edit'] = $type != 'dir' ? cs_link($img_edit, 'explorer', 'edit', 'file=' . $file) : '';
        $view = cs_link($datas[$x], 'explorer', 'view', 'file=' . $file);
        $save[$y]['symbol'] = cs_filetype($type);
        if ($type == 'jpg' || $type == 'jpeg' || $type == 'png' || $type == 'gif' || $type == 'bmp') {
            $save[$y]['name'] = cs_link($datas[$x], 'explorer', 'view', 'file=' . $file);
        } elseif ($type == 'dir') {
            $save[$y]['name'] = cs_link($datas[$x], 'explorer', 'roots', 'dir=' . $file);
        } elseif ($type == 'html' || $type == 'htm' || ($type = 'php' || $type == 'txt' || $type == 'sql')) {
            $save[$y]['name'] = cs_link($datas[$x], 'explorer', 'view', 'file=' . $file);
        }
    }
    $data['files'] = !empty($save) ? $save : array();
} else {
    $data['files'] = '';
}
echo cs_subtemplate(__FILE__, $data, 'explorer', 'roots');
Example #6
0
$temp_loop = count($temp);
if (isset($_REQUEST['target']) and is_array($cs_file)) {
    $files_cells = array('files_count');
    $files_save = array(++$cs_file['files_count']);
    cs_sql_update(__FILE__, 'files', $files_cells, $files_save, $file_id, 0, 0);
    $temp_a = explode("\n", $temp[$_REQUEST['target']]);
    $select_mirrow = $temp_a['1'];
    header("Location: " . $select_mirrow . "");
}
require_once 'mods/clansphere/filetype.php';
for ($run = 1; $run < $temp_loop; $run++) {
    $temp_a = explode("\n", $temp[$run]);
    if ($account['access_files'] >= $temp_a['4']) {
        $data['mirrors'][$run - 1]['name'] = empty($temp_a['2']) ? $temp_a['1'] : $temp_a['2'];
        $data['mirrors'][$run - 1]['id'] = $run;
        $data['mirrors'][$run - 1]['filetype_image'] = cs_filetype($temp_a['3']);
        $data['mirrors'][$run - 1]['filetype_name'] = $temp_a['3'];
    }
}
include_once 'mods/comments/functions.php';
$where_com = 'comments_mod = \'files\' AND comments_fid = ' . $file_id;
$count_com = cs_sql_count(__FILE__, 'comments', $where_com);
if (empty($cs_file)) {
    require 'mods/errors/404.php';
} else {
    echo cs_subtemplate(__FILE__, $data, 'files', 'view');
    if (!empty($count_com)) {
        echo cs_comments_view($file_id, 'files', 'view', $count_com);
    }
    echo cs_comments_add($file_id, 'files', $cs_file['files_close']);
}