function putFile($File, $Path, $n, $FileTitle, $x)
{
    if ($n == "1") {
        //*****用"move_uploaded_file"方式上傳*****
        //$File上傳檔案存放目錄
        global $FZ, $f_name;
        if (is_uploaded_file($_FILES[$File][tmp_name])) {
            //重新命名
            $sub_name = substr($_FILES[$File][name], -4);
            $f_name = $FileTitle . date("Ymd") . "_" . date("his") . $sub_name;
            //上傳檔案
            move_uploaded_file($_FILES[$File][tmp_name], $Path . $f_name);
            //取得上傳檔案大小
            $f_size = $_FILES[$File][size];
            //$FZ=round($f_size/1000,2)."KB";
            $FZ = getfilesize($f_size);
            return true;
        } else {
            return "無法上傳";
        }
    } elseif ($n == "2") {
        //*****用"copy"方式上傳*****
        //重新命名
        if (is_uploaded_file($_FILES[$File][tmp_name])) {
            $tempfile = $_FILES[$File][tmp_name];
            $realfile = $_FILES[$File][name];
            $revn = substr($realfile, -4);
            //取得上傳檔案大小
            $f_size = $_FILES[$File][size];
            $FZ = round($f_size / 1000, 2) . "KB";
            $f_name = $FileTitle . time() . $revn;
            //上傳檔案
            copy($tempfile, $Path . $f_name);
            return true;
            //建立資料夾
            /*
            mkdir("$Path", 0700);
            $uploadDir = '$Path';
            $uploadFile = $uploadDir . $_FILES['userfile']['name'];
            */
        } else {
            return "無法上傳";
        }
    } else {
        echo "執行函數錯誤";
    }
}
Beispiel #2
0
        $response->header('Content-Type', 'application/json');
        return $response;
    }
});
Route::post('upload/data', 'MediaController@uploadData');
Route::post('upload/file', 'MediaController@uploadFile');
Route::get('premium', function () {
    if (Auth::guest()) {
    } else {
        return View::make('widgets.premium');
    }
});
Route::get('user/settings', function () {
    if (Auth::guest()) {
    } else {
        $data = array('avlbytes' => getfilesize(Auth::user()->avl_bytes), 'usedbytes' => getfilesize(Auth::user()->used_bytes), 'freebytes' => getfilesize(Auth::user()->avl_bytes - Auth::user()->used_bytes), 'perc' => percentage(Auth::user()->used_bytes, Auth::user()->avl_bytes, '1'), 'plan_name' => Auth::user()->category()->name, 'plan_exp' => Auth::user()->prem_valid, 'set_ea' => Auth::user()->ea, 'set_sub_lng' => Auth::user()->default_sub_lng);
        return View::make('widgets.settings', $data);
    }
});
Route::get('user/share/{id}', function ($id) {
    if (Auth::user()->category_id == 1 || Auth::user()->category_id == 27) {
    } else {
        $user_media = UserMedia::where('uni_id', '=', $id)->where('user_id', '=', Auth::user()->id)->first();
        if (isset($user_media->id)) {
            $share_m = ShareMedia::where('user_id', '=', Auth::user()->id)->where('media_id', '=', $user_media->media_id)->first();
            if (isset($share_m->id)) {
                $link = "http://okaydrive.com/share/" . $share_m->uni_id;
            } else {
                $media = Media::where('id', '=', $user_media->media_id)->first();
                if ($media->state == "done") {
                    $new_smedia = new ShareMedia();
Beispiel #3
0
function rl_md5()
{
    global $list, $L, $PHP_SELF;
    $n_md5 = count($_GET["files"]);
    ?>
	<script type="text/javascript">
	var mL = 0, cnt = <?php 
    echo is_numeric($n_md5) ? $n_md5 : 0;
    ?>
;
	var d = document, formMd5, tmrLoop;
	var singlemd5 = true;

	function chAll(){singlemd5 = false; initMD5change(mL);nextFile(mL);loopchk(mL);}

	function loopchk(id){
	  if(id < cnt){ret = d.getElementById('actstat'+id).innerHTML;if(ret.indexOf('_result') != -1){mL++; nextFile(mL);}tmrLoop = setTimeout("loopchk("+mL+")", 50); } else { clearTimeout(tmrLoop); singlemd5=true; mL=0; return;}}

	// send filename to form input hidden
	function nextFile(id){d.getElementById('misionMd5').value = d.getElementById('md5fname'+id).innerHTML; setTimeout("FireUp("+id+")", 200);}

	function FireUp(id){d.getElementById('misionMd5').value += ":" + d.getElementById('impurity').selectedIndex;formMd5.action = 'javascript:get("misionMd5","actstat'+id+'","actstat'+id+'","")';formMd5.submit();}

	function initMD5change(id){var btnAll = d.getElementById('changeall');formMd5 = d.getElementById('frmMD5');if(btnAll.style.display!='none'){ setTimeout("d.getElementById('changeall').style.display='none'", 420);}if(singlemd5){ nextFile(id); }else { for(var i=0; i<cnt; i++){d.getElementById('actstat'+i).innerHTML = 'wait..';  }}}
	 function ntfy(){
	  var msg = "How this MD5 Changer is working?\n\n"; msg += "It is modifying your file by adding single or more char to the end of file.\n"; msg += "It's not guaranted it works properly for every file,\nsomeside effect like corrupted files may occurs.\n"; msg += "Select Impurity Char to pick char(s) that may suitable to your file instead using the default char: 0 (zero)\n\n"; msg += "T_T''"; alert(msg);}
	</script>
	<form name="frmMD5" id="frmMD5" action="<?php 
    echo $PHP_SELF;
    ?>
">
	   <input type="hidden" id="misionMd5" name="misionMd5" value="">
	</form>
	<?php 
    echo $L->say['you_selected'];
    ?>
&nbsp;<b class="g"><?php 
    echo $n_md5;
    ?>
</b>&nbsp;files.<div id="changeall"><?php 
    echo $L->say['you_sure_ch_md5'];
    ?>
<br />
	<input type="button" name="md5ch" onclick="chAll();" value="<?php 
    echo $L->say['_yes'];
    ?>
"></div><div style="padding-top:8px;"></div>
	<table align="center" border=0 cellspacing="1" cellpadding="3">
		<tr class="rowtitleChangemd5">
		 <td align="center">File</td><td align="center">Size</td><td align="center"><?php 
    echo $L->say['cur_md5'];
    ?>
</td>
		 <td valign="middle" width="200">
		  <select id="impurity" name="impurity" title="Impurity Char" style="float:right;" width=60>
			<option selected='selected'>Impurity Char</option>
			<option value="char0">0 (Default)</option>
			<option value="char1">" "</option>
			<option value="char2">//</option>
			<option value="char3">/**/</option>
			<option value="char4">#</option>
		  </select><?php 
    echo $L->say['new_md5'];
    ?>
&nbsp;&nbsp;<a href="javascript:;" onclick="ntfy();" title="RTFM"><b style="color:red"><blink>?</blink></b></a>
		 </td></tr>
	<?php 
    for ($i = 0; $i < $n_md5; $i++) {
        $file = $list[$_GET["files"][$i]];
        if (file_exists($file["name"])) {
            ?>
		<tr class="rowChangemd5">
		<td nowrap>&nbsp;<b id="md5fname<?php 
            echo $i;
            ?>
"><?php 
            echo basename($file["name"]);
            ?>
</b></td>
		<td align="center" class="txtmd5">&nbsp;<span title="<?php 
            echo $file["size"];
            ?>
" style="color:#FFA300; cursor:pointer;">
		 <?php 
            $max2gb = 2147483647;
            //$mdfsize = filesize($file["name"]);
            $mdfsize = getfilesize($file["name"]);
            $mdfsize = $mdfsize > $max2gb || $mdfsize < 0 ? -1 : $mdfsize . " B";
            echo $mdfsize;
            ?>
</span>&nbsp;</td>
		<td nowrap class="txtmd5">&nbsp;<span id="md5hash<?php 
            print $i;
            ?>
" style="color:#FFA300"><?php 
            echo $mdfsize >= 0 ? md5_file($file["name"]) : "File to big";
            ?>
</span>&nbsp;</td>
		<td align="center">
		<?php 
            if ($mdfsize >= 0) {
                ?>
		 <div id="actstat<?php 
                print $i;
                ?>
">
		 <a href="javascript:;" onclick="initMD5change('<?php 
                print $i;
                ?>
')" class="y"><?php 
                echo $L->say['change_md5'];
                ?>
</a></div>
		<?php 
            }
            ?>
		</td>
		</tr>
	<?php 
        }
    }
    ?>
	</table><br />
	<script type="text/javascript">
	 var mproces = d.getElementById('md5_process');
	 mproces.style.display = 'none';
	</script>
<?php 
}
			<input type=file name=upload[] size=25 class=input style=width:33%>
			<input type=file name=upload[] size=25 class=input style=width:33%>
			<input type=file name=upload[] size=25 class=input style=width:33%><br>
			<input type=file name=upload[] size=25 class=input style=width:33%>
			<input type=file name=upload[] size=25 class=input style=width:33%>
			<input type=file name=upload[] size=25 class=input style=width:33%><br>
			<input type=submit value="업로드" class=submit style= width=100%;height:18px><br>
			<img src=images/t.gif border=0 height=3><br>
			(<b><?php 
echo getfilesize($maxDirSize);
?>
</b> 사용가능, <b><?php 
echo getfilesize($dirSize);
?>
</b> 사용중, <b><?php 
echo getfilesize($maxDirSize - $dirSize);
?>
</b> 업로드 가능)</td>
	</tr>
	<tr>
		<td align=center height=40>
			<a href=<?php 
echo $PHP_SELF;
?>
?id=<?php 
echo $id;
?>
&image_page=1>[First]</a><?php 
$startPageNum = $image_page - 5;
if ($startPageNum < 0) {
    $startPageNum = 1;
Beispiel #5
0
    $ada = false;
    $fn = explode(":", $_POST['md5fn']);
    $idx = $fn[1];
    if (is_readable(DOWNLOAD_DIR . $fn[0])) {
        if (!in_array(strtolower(strrchr($fn[0], ".")), $options['forbidden_filetypes'])) {
            $ada = true;
        }
    }
    if (!$ada) {
        exit('<b class="r" title="Error or File Not Found!">&lt;!&gt;</b>');
    }
    // File not exist
    $arrPengotor = array("0", "0", " ", "//", "/**/", "#");
    if ($idx < 0 || $idx > count($arrPengotor)) {
        $idx = 0;
    }
    //do change here
    $nfs = DOWNLOAD_DIR . $fn[0];
    $hdch = @chmod($nfs, 0666);
    $handle = @fopen($nfs, 'a+');
    if ($handle && $hdch) {
        fwrite($handle, $arrPengotor[$idx]);
        fclose($handle);
        exit('<b class="y" id="_result" title="New FileSize: ' . getfilesize($nfs) . ' B" class="txtmd5">' . md5_file($nfs) . '</b>');
    } else {
        echo '<b class="r" title="Error!">&lt;T_T&gt;</b>';
    }
    @fclose($handle);
    @chmod($nfs, 0644);
    exit;
}
Beispiel #6
0
$directory = dir($path);
$i = 0;
$totalsize = 0;
while ($entry = $directory->read()) {
    if ($entry != "." && $entry != "..") {
        $list[] = $entry;
        $i++;
        $totalsize += filesize($path . "/" . $entry);
        if ($i % 100 == 0) {
            print "document.sdc.num.value='" . $i . " numbers';\n";
            print "document.sdc.size.value='" . getfilesize($totalsize) . "';\n";
        }
        flush();
    }
}
$directory->close();
print "document.sdc.num.value='" . number_format($i) . " numbers';\n";
print "document.sdc.size.value='" . getfilesize($totalsize) . "';\n";
$totallist = count($list);
?>
	</script>
	</div>
<?php 
mysql_close($connect);
$connect = "";
?>

<br><Br><Br>

<?php 
foot();
Beispiel #7
0
<h5><a href="popup.php?name=download&file=rate&id=<?php 
        echo $arr['download']['id'];
        ?>
" onclick="return hs.htmlExpand(this, { contentId: 'highslide-html', objectType: 'iframe', objectWidth: 500, objectHeight: 300} )" class="highslide"><img src="images/header.gif"><br><?php 
        echo _DOWNLOAD_MOD_RATE_ATT;
        ?>
</a><br>
<?php 
    }
    ?>
<font color="#FF0066"><?php 
    echo _DOWNLOAD_MOD_READ_SIZE;
    ?>
 <?php 
    $bytes = $arr['download']['size'];
    echo getfilesize($bytes);
    ?>
</h5>

</TD>

<TD width="80%" valign="top">
<BR><font size=3><b><?php 
    echo _DOWNLOAD_MOD_READ_DETAIL;
    ?>
 : <br></font></b>
<?php 
    echo $Detail;
    ?>

<BR><BR>
Beispiel #8
0
function newuser()
{
    global $sqlpref, $extraheaders;
    $extraheaders = "<script language=\"javascript\">\n" . "function checkall() {\n" . "  document.user_edit.config_permbrowse.checked = true;\n" . "  document.user_edit.config_permupload.checked = true;\n" . "  document.user_edit.config_permcreate.checked = true;\n" . "  document.user_edit.config_permuser.checked = true;\n" . "  document.user_edit.config_permpass.checked = true;\n" . "  document.user_edit.config_permdelete.checked = true;\n" . "  document.user_edit.config_permmove.checked = true;\n" . "  document.user_edit.config_permchmod.checked = true;\n" . "  document.user_edit.config_permget.checked = true;\n" . "  document.user_edit.config_permadmin.checked = true;\n" . "  document.user_edit.config_permdeleteuser.checked = true;\n" . "  document.user_edit.config_permedituser.checked = true;\n" . "  document.user_edit.config_permmakeuser.checked = true;\n" . "  document.user_edit.config_permedit.checked = true;\n" . "  document.user_edit.config_permrename.checked = true;\n" . "  document.user_edit.config_permsub.checked = true;\n" . "  document.user_edit.config_permprefs.checked = true;\n" . "  try {document.user_edit.config_permrecycle.checked = true;} catch (e) { }\n" . "}\n" . "function uncheckall() {\n" . "  document.user_edit.config_permbrowse.checked = false;\n" . "  document.user_edit.config_permupload.checked = false;\n" . "  document.user_edit.config_permcreate.checked = false;\n" . "  document.user_edit.config_permuser.checked = false;\n" . "  document.user_edit.config_permpass.checked = false;\n" . "  document.user_edit.config_permdelete.checked = false;\n" . "  document.user_edit.config_permmove.checked = false;\n" . "  document.user_edit.config_permchmod.checked = false;\n" . "  document.user_edit.config_permget.checked = false;\n" . "  document.user_edit.config_permadmin.checked = false;\n" . "  document.user_edit.config_permdeleteuser.checked = false;\n" . "  document.user_edit.config_permedituser.checked = false;\n" . "  document.user_edit.config_permmakeuser.checked = false;\n" . "  document.user_edit.config_permedit.checked = false;\n" . "  document.user_edit.config_permrename.checked = false;\n" . "  document.user_edit.config_permsub.checked = false;\n" . "  document.user_edit.config_permprefs.checked = false;\n" . "  try {document.user_edit.config_permrecycle.checked = false;} catch (e) { }\n" . "}\n" . "</script>\n";
    page_header("Create a new user");
    opentitle("Create a new user");
    opentable("100%");
    echo "<table>\n" . "<form name=\"user_edit\" action=\"" . $adminfile . "?p=saveuser\" method=\"post\">\n";
    echo "<tr><td>Username: <td><input type=\"text\" name=\"config_user\" size=\"40\" border=\"0\" class=\"txtinput\" value=\"{$uname}\">\n" . "<tr><td>Name: <td><input type=\"text\" name=\"config_name\" size=\"40\" border=\"0\" class=\"txtinput\" value=\"{$name}\">\n" . "<tr><td>Password: <td><input type=\"password\" name=\"config_pass\" size=\"40\" border=\"0\" class=\"txtinput\" value=\"\">\n" . "<tr><td>Email: <td><input type=\"text\" name=\"config_email\" size=\"40\" border=\"0\" class=\"txtinput\" value=\"{$email}\">\n" . "<tr><td>Server Directory: <td><input type=\"text\" name=\"config_folder\" size=\"40\" border=\"0\" class=\"txtinput\" value=\"{$folder}\">\n" . "<tr><td>Http Directory: <td><input type=\"text\" name=\"config_http\" size=\"40\" border=\"0\" class=\"txtinput\" value=\"{$http}\"> (*)\n" . "<tr><td>Space Limit: <td><table cellpadding=0 cellspacing=0><td nowrap>" . getspaceusage($uid) . " (" . getfilesize(getspaceusage($uid)) . ") / <td><input type=\"text\" name=\"config_limit\" size=\"15\" width=\"15\" border=\"0\" class=\"txtinput\" value=\"{$limit}\"> bytes</table>\n" . "<tr><td>Language: <td><select name=\"config_language\">\n";
    $handle = opendir("./language");
    while ($file = readdir($handle)) {
        $filelist[] = $file;
    }
    natcasesort($filelist);
    foreach ($filelist as $file) {
        if ($file != "." && $file != ".." && is_dir("./language/" . $file)) {
            @(include "./language/" . $file . "/lng.def.php");
            if ($language == $file) {
                $isel = " selected";
            } else {
                $isel = "";
            }
            echo "<option value=\"{$file}\"{$isel}>{$LNG_NAME}</option>\n";
        }
    }
    closedir("./language");
    echo "</select><tr><td>Theme: <td><select name=\"config_theme\">\n";
    $handle = opendir("./themes");
    while ($file = readdir($handle)) {
        $filelist[] = $file;
    }
    natcasesort($filelist);
    foreach ($filelist as $file) {
        if ($file != "." && $file != ".." && is_dir("./themes/" . $file)) {
            @(include "./themes/" . $file . "/theme.def.php");
            if ($theme == $file) {
                $isel = " selected";
            } else {
                $isel = "";
            }
            echo "<option value=\"{$file}\"{$isel}>{$THEME_NAME}</option>\n";
        }
    }
    closedir("./themes");
    echo "</select>\n" . "<tr><td>Account Status: <td>\n" . "<input type=radio name=\"config_status\" value=\"1\" id=\"stat1\"{$stat2}><label for=\"stat1\"> Active</label>&nbsp;&nbsp;&nbsp;\n" . "<input type=radio name=\"config_status\" value=\"0\" id=\"stat2\"{$stat1}><label for=\"stat2\"> Suspend</label>\n";
    if ($GLOBALS['config']['enable_trash']) {
        echo "<tr><td>Trash Bin: <td>\n" . "<input type=radio name=\"config_recycle\" id=\"rec1\"{$rec2}><label for=\"rec1\"> On</label>&nbsp;&nbsp;&nbsp;\n" . "<input type=radio name=\"config_recycle\" id=\"rec2\"{$rec1}><label for=\"rec2\"> Off</label>\n";
    }
    echo "<tr><td>Permission View: <td>\n" . "<input type=radio name=\"config_formatperms\" value=\"0\" id=\"perm1\"{$perm1}><label for=\"perm1\"> UNIX (0644)</label>&nbsp;&nbsp;&nbsp;\n" . "<input type=radio name=\"config_formatperms\" value=\"1\" id=\"perm2\"{$perm2}><label for=\"perm2\"> Symbolic (-rw-r--r--)</label>\n" . "<tr><td valign=top>Privileges: <td><table cellpadding=1 cellspacing=1>\n" . "<td valign=top nowrap><input type=\"checkbox\" name=\"config_permbrowse\" id=\"config_permbrowse\" size=\"40\" border=\"0\" class=\"text\"{$sel1}><label for=\"config_permbrowse\"> Browse</label>\n" . "<br><input type=\"checkbox\" name=\"config_permupload\" id=\"config_permupload\" size=\"40\" border=\"0\" class=\"text\"{$sel2}><label for=\"config_permupload\"> Upload</label>\n" . "<br><input type=\"checkbox\" name=\"config_permcreate\" id=\"config_permcreate\" size=\"40\" border=\"0\" class=\"text\"{$sel3}><label for=\"config_permcreate\"> Create</label>\n" . "<br><input type=\"checkbox\" name=\"config_permpass\" id=\"config_permpass\" size=\"40\" border=\"0\" class=\"text\"{$sel5}><label for=\"config_permpass\"> Change Password</label>\n" . "<br><input type=\"checkbox\" name=\"config_permdelete\" id=\"config_permdelete\" size=\"40\" border=\"0\" class=\"text\"{$sel6}><label for=\"config_permdelete\"> Delete</label>\n" . "<br><input type=\"checkbox\" name=\"config_permmove\" id=\"config_permmove\" size=\"40\" border=\"0\" class=\"text\"{$sel7}><label for=\"config_permmove\"> Move</label>\n" . "<br><input type=\"checkbox\" name=\"config_permedit\" id=\"config_permedit\" size=\"40\" border=\"0\" class=\"text\"{$sel14}><label for=\"config_permedit\"> Edit</label>\n" . "<br><input type=\"checkbox\" name=\"config_permrename\" id=\"config_permrename\" size=\"40\" border=\"0\" class=\"text\"{$sel15}><label for=\"config_permrename\"> Rename</label>\n" . "<br><input type=\"checkbox\" name=\"config_permget\" id=\"config_permget\" size=\"40\" border=\"0\" class=\"text\"{$sel9}><label for=\"config_permget\"> Get</label>\n" . "<td valign=top nowrap><input type=\"checkbox\" name=\"config_permchmod\" id=\"config_permchmod\" size=\"40\" border=\"0\" class=\"text\"{$sel8}><label for=\"config_permchmod\"> Chmod</label>\n" . "<br><input type=\"checkbox\" name=\"config_permsub\" id=\"config_permsub\" size=\"40\" border=\"0\" class=\"text\"{$sel16}><label for=\"config_persub\"> Access Subdirectories</label>\n" . "<br><input type=\"checkbox\" name=\"config_permuser\" id=\"config_permuser\" size=\"40\" border=\"0\" class=\"text\"{$sel4}><label for=\"config_permuser\"> User CP</label>\n" . "<br><input type=\"checkbox\" name=\"config_permadmin\" id=\"config_permadmin\" size=\"40\" border=\"0\" class=\"text\"{$sel10}><label for=\"config_permadmin\"> Admin CP</label>\n" . "<br><input type=\"checkbox\" name=\"config_permdeleteuser\" id=\"config_permdeleteuser\" size=\"40\" border=\"0\" class=\"text\"{$sel11}><label for=\"config_permdeleteuser\"> Delete Users</label>\n" . "<br><input type=\"checkbox\" name=\"config_permedituser\" id=\"config_permedituser\" size=\"40\" border=\"0\" class=\"text\"{$sel12}><label for=\"config_permedituser\"> Edit Users</label>\n" . "<br><input type=\"checkbox\" name=\"config_permmakeuser\" id=\"config_permmakeuser\" size=\"40\" border=\"0\" class=\"text\"{$sel13}><label for=\"config_permmakeuser\"> Make Users</label>\n" . "<br><input type=\"checkbox\" name=\"config_permprefs\" id=\"config_permprefs\" size=\"40\" border=\"0\" class=\"text\"{$sel18}><label for=\"config_permprefs\"> Edit Prefs</label>\n";
    if ($GLOBALS['config']['enable_trash']) {
        echo "<br><input type=\"checkbox\" name=\"config_permrecycle\" id=\"config_permrecycle\" size=\"40\" border=\"0\" class=\"text\"{$sel17}><label for=\"config_permrecycle\"> Trash Bin</label>\n";
    }
    echo "</table>\n" . "<br><a href=\"javascript:checkall();\">Check All</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:uncheckall();\">Uncheck All</a>\n" . "<input type=hidden name=muid value=\"{$muid}\">\n" . "<tr><td colspan=\"2\"><br><input type=\"submit\" name=\"submitButtonName\" value=\"Save\" border=\"0\" class=\"button\">\n" . "</td></tr></form></table>\n";
    closetable();
    page_footer();
}
Beispiel #9
0
             $title = "";
             if ($zeile['owner'] == NULL || $zeile['owner'] == 0 || $zeile['owner'] == "") {
                 $title = $zeile['dateform'];
             } else {
                 $title = $CLASS['knowledgeroot']->getOwner($zeile['owner']) . " - " . $zeile['dateform'];
             }
             // check for static file download
             if (isset($CLASS['config']->misc->download->static) && $CLASS['config']->misc->download->static == 1) {
                 $downloadlink = "download/" . $zeile['id'] . "/" . $zeile['filename'];
             } else {
                 $downloadlink = "index.php?download=" . $zeile['id'];
             }
             if ($mycontentrights == 2) {
                 echo "<a href=\"index.php?delfile=" . $zeile['id'] . "\" onclick=\"return confirm('" . $CLASS['translate']->_('Do you really want to delete?') . "');\"><img src=\"images/delete.gif\" title=\"" . $CLASS['translate']->_('delete') . "\" class=\"upload\" /></a>&nbsp;<a href=\"" . $downloadlink . "\" title=\"" . $title . "\"><img src=\"images/file.gif\" class=\"upload\" /> " . $zeile['filename'] . "</a>&nbsp;<font class=\"text\">[" . getfilesize($zeile['filesize']) . "]&nbsp;[" . $title . "]</font><br />\n";
             } else {
                 echo "<a href=\"" . $downloadlink . "\" title=\"" . $title . "\"><img src=\"images/file.gif\" class=\"upload\" /> " . $zeile['filename'] . "</a>&nbsp;<font class=\"text\">[" . getfilesize($zeile['filesize']) . "]&nbsp;[" . $title . "]</font><br />\n";
             }
         }
     }
     echo '</div>';
     $CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_content_files_end");
 }
 $includeFileLink = false;
 if ($show_files == 1) {
     // show form for adding new files
     if ($mycontentrights == 2) {
         $includeFileLink = true;
         echo "<div id=\"fileform_" . $row['id'] . "\" style=\"display:none\">\n\t\t\t\t\t\t\t\t<form class=\"AddFileForm\" action=\"index.php\" method=\"post\" enctype=\"multipart/form-data\">\n\n\t\t\t\t\t\t\t\t\t<b>" . $CLASS['translate']->_('add file') . "</b>\n\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"upload\" value=\"yes\" />\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"contentid\" value=\"" . $row['id'] . "\" />\n\t\t\t\t\t\t\t\t\t<input type=\"file\" name=\"datei\" />&nbsp;\n\n\t\t\t\t\t\t\t\t\t<input class=\"button\" type=\"submit\" name=\"submit\" value=\"" . $CLASS['translate']->_('add') . "\" />\n\t\t\t\t\t\t\t\t</form></div>";
     }
 }
 // show content status bar
Beispiel #10
0
 x <?php 
                    echo _IVIDEOT_H;
                    ?>
 px]</font>
</td>
</tr>
<tr><td align="right" width="100"  valign="top"><?php 
                    echo _ADMIN_VIDEO_FORM_VIDEO;
                    ?>
</td><td>
    	<input id="file_upload" name="file_upload" type="file" />
		<a href="javascript:$('#file_upload').uploadifyUpload();">Upload Files</a> | <a href="javascript:$('#file_upload').uploadifyClearQueue();">Clear Queue</a><br><font color="#990000">[ <?php 
                    echo _ADMIN_VIDEO_FORM_VIDEO_COM;
                    ?>
 <?php 
                    echo getfilesize(_VIDEO_LIMIT_UPLOAD);
                    ?>
 <?php 
                    echo _ADMIN_VIDEO_FORM_VIDEO_COM1;
                    ?>
]</font>
</td>
</tr>
</table>
<input type='hidden' name='id' id='id' value="<?php 
                    echo $_GET['id'];
                    ?>
" />
<INPUT id="admin" TYPE="hidden" NAME="admin" size="40" value="<?php 
                    echo $_SESSION['admin_user'];
                    ?>
Beispiel #11
0
    //$morethanone = (count($list)>1);
    if ($options["show_all"] === true) {
        unset($Path);
    }
    ?>

<script type="text/javascript">
/* <![CDATA[ */
var dFile = new Object(); var text = "", thead, tfoot;
<?php 
    echo "var _dlpath = '" . ($options["download_dir"] != "" ? "{$options["download_dir"]}" : "/") . "';{$nn}{$nn}";
    foreach ($list as $key => $file) {
        if (isset($file["name"]) && @file_exists($file["name"])) {
            $c++;
            if ($kumulatifsz) {
                $total_size += getfilesize($file["name"]);
            }
            echo 'dFile["' . $file["date"] . '"] = new Object();' . $nn;
            echo 'dFile["' . $file["date"] . '"]["name"] = "' . xmlentities(basename($file["name"]), false) . '"' . $nn;
            echo 'dFile["' . $file["date"] . '"]["size"] = "' . $file["size"] . '"' . $nn;
            echo 'dFile["' . $file["date"] . '"]["age"] = "' . $file["age"] . '"' . $nn;
            $rnd = rand(11, 99);
            echo 'dFile["' . $file["date"] . '"]["delkey"] = "' . str_replace("=", "", rotN(base64_encode($file["date"] . ':' . '4puZ'), $rnd)) . "-" . $rnd . '"' . $nn;
        }
    }
    // end loop all files
    echo 'total_size = "' . $total_size . '";' . "{$nn}";
    echo 'c = "' . $c . '";' . "{$nn}";
    $lynx_del = $options["deletelink_in_lynx"] && !$options["disable_to"]["act_delete"];
    $morethanone = $c > 1;
    ?>
Beispiel #12
0
                    }
                } else {
                    //copy($_FILES['Filedata']['tmp_name'], "video/thumbs/".TIMESTAMP."_".$_FILES['Filedata']['name'].""))
                    move_uploaded_file($tempFile, $targetFile);
                    echo str_replace($_SERVER['DOCUMENT_ROOT'], '', $targetFile);
                    $db->add_db(TB_VIDEO, array("category" => "" . $_POST['cat'] . "", "topic" => "" . $topic . "", "detail" => "" . $detail . "", "posted" => "" . $_POST['admin'] . "", "post_date" => "" . TIMESTAMP . "", "pic" => "" . TIMESTAMP . "_" . $_FILES['Filedata']['name'] . "", "enable_comment" => "1", "youtube" => "0"));
                }
            }
        } else {
            $tempFile = $_FILES['Filedata']['tmp_name'];
            if (strchr($_FILES['Filedata']['name'], ".") == ".mpg" || strchr($_FILES['Filedata']['name'], ".") == ".mov" || strchr($_FILES['Filedata']['name'], ".") == ".avi" || strchr($_FILES['Filedata']['name'], ".") == ".wmv" || strchr($_FILES['Filedata']['name'], ".") == ".MP4" || strchr($_FILES['Filedata']['name'], ".") == ".flv") {
                $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
                $targetFile = str_replace('//', '/', $targetPath) . TIMESTAMP . "_" . $_FILES['Filedata']['name'];
                $fileTypes = str_replace('*.', '', $_REQUEST['fileext']);
                $fileTypes = str_replace(';', '|', $fileTypes);
                $typesArray = split('\\|', $fileTypes);
                $fileParts = pathinfo($_FILES['Filedata']['name']);
                if (in_array($fileParts['extension'], $typesArray)) {
                    // Uncomment the following line if you want to make the directory if it doesn't exist
                    // mkdir(str_replace('//','/',$targetPath), 0755, true);
                    move_uploaded_file($tempFile, $targetFile);
                    echo str_replace($_SERVER['DOCUMENT_ROOT'], '', $targetFile);
                    $sizes = getfilesize($_FILES['Filedata']['size']);
                    $getID3 = new getID3();
                    $fileInfo = $getID3->analyze($targetFile);
                    $db->add_db(TB_VIDEO, array("category" => "" . $_POST['cat'] . "", "topic" => "" . $topic . "", "detail" => "" . $detail . "", "posted" => "" . $_POST['admin'] . "", "post_date" => "" . TIMESTAMP . "", "video" => "" . TIMESTAMP . "_" . $_FILES['Filedata']['name'] . "", "enable_comment" => "1", "youtube" => "0", "size" => "" . $sizes . "", "times" => "" . $fileInfo['playtime_string'] . ""));
                }
            }
        }
    }
}
Beispiel #13
0
<?php

require_once 'sendsms.php';
require_once 'sendmail.php';
require_once 'captcha.php';
require_once '../../lib.php';
require_once '../../bbs/lib/mainfunc.php';
$ask = @$_POST['ask'];
date_default_timezone_set("Asia/Shanghai");
if ($ask == "getfilesize") {
    getfilesize();
}
if ($ask == "loadcalendar") {
    loadcalendar();
}
if ($ask == "savecalendar") {
    savecalendar();
}
if ($ask == "addinform") {
    addinform();
}
if ($ask == "delinform") {
    delinform();
}
if ($ask == "saveimg") {
    saveimg();
}
if ($ask == "join") {
    memjoin();
}
if ($ask == "login") {
 /**
  * show tree content
  */
 function show_tree_content($count = 0)
 {
     // check if page is a symlink
     /* is not a usable feature at the moment so its disabled
     		$res = $this->CLASS['db']->query(sprintf("SELECT symlink FROM tree WHERE id=%d",$_SESSION['cid']));
     		$anz = $this->CLASS['db']->num_rows($res);
     
     		if($anz == 1) {
     			$row = $this->CLASS['db']->fetch_assoc($res);
     
     			if($row['symlink'] != "" && $row['symlink'] != 0) {
     				$_SESSION['orginial_cid'] = $_SESSION['cid'];
     				$_SESSION['cid'] = $row['symlink'];
     			}
     		}
     		*/
     // isTree removed for symlink
     //if($_SESSION['cid'] != "" && $this->CLASS['path']->isTree($_SESSION['cid']) && $this->CLASS['knowledgeroot']->checkRecursivPerm($_SESSION['cid'], $_SESSION['userid']) != 0) {
     if ($_SESSION['cid'] != "" && $this->CLASS['knowledgeroot']->checkRecursivPerm($_SESSION['cid'], $_SESSION['userid']) != 0) {
         $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "start");
         // get my rights - possible is 0,1,2
         $mypagerights = $this->CLASS['knowledgeroot']->getPageRights($_SESSION['cid'], $_SESSION['userid']);
         $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_page_menu_start");
         // show page menu
         echo $this->CLASS['kr_extension']->show_menu("page", $_SESSION['cid'], $mypagerights);
         $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_page_menu_end");
         //check if userid and groupid is set, if not set to 0
         if ($_SESSION['userid'] == "" || $_SESSION['groupid'] == "") {
             $_SESSION['userid'] = 0;
             $_SESSION['groupid'] = 0;
         }
         // get page content collapse info
         $hashkey = md5('contentcollapsed_' . $_SESSION['cid']);
         if (!($treedata = $this->CLASS['cache']->load($hashkey))) {
             $res = $this->CLASS['db']->query(sprintf("SELECT contentcollapsed FROM tree WHERE id=%d", $_SESSION['cid']));
             $anz = $this->CLASS['db']->num_rows($res);
             if ($anz == 1) {
                 $treedata = $this->CLASS['db']->fetch_assoc($res);
                 $this->CLASS['cache']->save($treedata, $hashkey, array('system', 'contentcollapsed'));
             }
         }
         if ($this->CLASS['db']->dbtype == "pgsql") {
             $query = sprintf("SELECT ct.id as id, ct.content as content, ct.title as title, ct.type as type, u.name as lastupdatedby, to_char(ct.lastupdated,'DD.MM.YYYY HH24:MI:SS') as lastupdated, to_char(ct.createdate,'DD.MM.YYYY HH24:MI:SS') as createdate FROM content ct left outer join users u ON ct.lastupdatedby = u.id WHERE belongs_to=%d AND ct.deleted=0 ORDER BY ct.sorting ASC", $_SESSION['cid']);
         } elseif ($this->CLASS['db']->dbtype == "sqlite" || $this->CLASS['db']->dbtype == "sqlite3") {
             $query = sprintf("SELECT ct.id as id, ct.content as content, ct.title as title, ct.type as type, u.name as lastupdatedby, strftime('%%d.%%m.%%Y %%H:%%M:%%S',ct.lastupdated) as lastupdated, strftime('%%d.%%m.%%Y %%H:%%M:%%S',createdate) as createdate FROM content ct left outer join users u ON ct.lastupdatedby = u.id WHERE belongs_to=%d AND ct.deleted=0 ORDER BY ct.sorting ASC", $_SESSION['cid']);
         } else {
             $query = "SELECT ct.id AS id, ct.content AS content, ct.title AS title, ct.type AS type,\n\t\t\t\t\tu.name AS lastupdatedby, DATE_FORMAT(ct.lastupdated,'%d.%m.%Y %H:%i:%s') as lastupdated,\n\t\t\t\t\tDATE_FORMAT(ct.createdate,'%d.%m.%Y %H:%i:%s') as createdate\n\t\t\t\t\tFROM content ct";
             $query .= sprintf(" LEFT OUTER JOIN users u ON ct.lastupdatedby = u.id\n\t\t\t\t\tWHERE belongs_to=%d AND ct.deleted=0\n\t\t\t\t\tORDER BY ct.sorting ASC", $_SESSION['cid']);
         }
         $hashkey = md5('content_' . $query);
         if (!$this->CLASS['cache']->test($hashkey)) {
             $res = $this->CLASS['db']->query($query);
             $data = null;
             while ($row = $this->CLASS['db']->fetch_assoc($res)) {
                 $data[] = $row;
             }
             $this->CLASS['cache']->save($data, $hashkey, array('system', 'content'));
         } else {
             $data = $this->CLASS['cache']->load($hashkey);
         }
         $anz = count($data);
         // needed for up and down arrows
         $firstcontent = 1;
         $maxcontent = $anz;
         $contentcounter = 0;
         // check if some table is on the page
         if ($anz != 0) {
             foreach ($data as $row) {
                 // get content rights
                 $mycontentrights = $this->CLASS['knowledgeroot']->getContentRights($row['id'], $_SESSION['userid']);
                 // check if it is an extension and if it is enabled
                 if ($mycontentrights == 0 || $row['type'] != "" && $row['type'] != "text" && (!isset($this->CLASS['extension'][$row['type']]) || isset($this->CLASS['extension'][$row['type']]) && $this->CLASS['extension'][$row['type']]['init'] == FALSE)) {
                     $maxcontent--;
                     continue;
                 }
                 $contentcounter++;
                 if ($row['title'] == null || $row['title'] == "") {
                     if ($row['type'] == "" || $row['type'] == "text") {
                         //$contentType = "HTML/text";
                         $contentType = '';
                     } else {
                         $contentType = $row['type'] . " " . "content";
                     }
                     $titleText = $contentType;
                 } else {
                     $titleText = $row['title'];
                 }
                 // init booleans
                 $show_files = 1;
                 $showtitle = $this->CLASS['config']->content->showtitle;
                 if ($this->CLASS['config']->content->collapsecontent) {
                     $collapse = $treedata['contentcollapsed'];
                 } else {
                     $collapse = false;
                 }
                 // check if content should be opened
                 if (isset($_GET['oc']) && $_GET['oc'] == $row['id']) {
                     $collapse = false;
                 }
                 $mousecontext = "";
                 // check if contextmenu are enabled
                 if ($this->CLASS['config']->menu->context == 1) {
                     // set mousecontext for rightclick menu
                     $mousecontext = " oncontextmenu=\"KnowledgerootMenu.show('mousemenu','contentcontext', " . $_SESSION['cid'] . ", " . $row['id'] . "); return false;\"";
                 }
                 $lastUpdated = $this->CLASS['translate']->_('Last modified by') . " " . ($row['lastupdatedby'] != null ? $row['lastupdatedby'] : $this->CLASS['translate']->_('guest')) . " " . $this->CLASS['translate']->_('on') . " " . $row['lastupdated'];
                 $created = $this->CLASS['translate']->_('created') . ": " . $row['createdate'];
                 echo "<div class=\"ContentItem\" id=\"contentid_" . $row['id'] . "\"" . $mousecontext . ">\n\n\t\t\t\t\t<!-- anchor --><a name=\"" . $row['id'] . "\"></a>\n\t\t\t\t\t<div class=\"showMe\" style=\"display:none;\" dojoType=\"dijit.TitlePane\" title=\"<b>" . $titleText . "</b>" . ($this->CLASS['config']->content->showtitledetails ? "&nbsp;({$lastUpdated}&nbsp;|&nbsp;{$created})" : "") . "\" open=\"" . (!$collapse ? "true" : "false") . "\"" . ($collapse ? " href=\"content.php?contentid=" . $row['id'] . "\"" : "") . ">\n";
                 if (!$collapse) {
                     // add up and down arrows
                     if ($mycontentrights == 2 && $mypagerights == 2) {
                         if ($maxcontent != $contentcounter) {
                             $this->CLASS['kr_extension']->menu['content']['movedown']['name'] = 'movedown';
                             $this->CLASS['kr_extension']->menu['content']['movedown']['nolink'] = '1';
                             $this->CLASS['kr_extension']->menu['content']['movedown']['priority'] = '60';
                             $this->CLASS['kr_extension']->menu['content']['movedown']['wrap'] = "<div style=\"height: 13px; float: right;\" dojoType=\"dijit.MenuBarItem\" onclick=\"location.href='index.php?movedown=" . $row['id'] . "';\"><img src=\"images/down_arrow.gif\" /></div>";
                         } else {
                             unset($this->CLASS['kr_extension']->menu['content']['movedown']);
                         }
                         if ($firstcontent != 1) {
                             $this->CLASS['kr_extension']->menu['content']['moveup']['name'] = 'moveup';
                             $this->CLASS['kr_extension']->menu['content']['moveup']['nolink'] = '1';
                             $this->CLASS['kr_extension']->menu['content']['moveup']['priority'] = '70';
                             $this->CLASS['kr_extension']->menu['content']['moveup']['wrap'] = "<div style=\"height: 13px; float: right;\" dojoType=\"dijit.MenuBarItem\" onclick=\"location.href='index.php?moveup=" . $row['id'] . "';\"><img src=\"images/up_arrow.gif\" /></div>";
                         } else {
                             unset($this->CLASS['kr_extension']->menu['content']['moveup']);
                         }
                     }
                     $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_content_menu_start");
                     // show content menu
                     echo $this->CLASS['kr_extension']->show_menu("content", $row['id'], $mypagerights, $mycontentrights, $row['type']);
                     $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_content_menu_end");
                     echo "\n\t\t\t\t\t\t<div class=\"ContentBodyWrapper\" id=\"ContentCollapseWrapper" . $row['id'] . "\">\n\t\t\t\t\t\t<span class=\"ContentBody\">\n";
                     // check if content is an extension
                     if ($row['type'] == "" || $row['type'] == "text") {
                         // show content
                         $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_content_start");
                         // adding colored highlighting
                         if (isset($_GET['highlight']) && $_GET['highlight'] != "") {
                             $highlight = str_replace('&quot;', '\\"', $_GET['highlight']);
                             $highlight = explode(",", $highlight);
                             foreach ($highlight as $hkey => $hvalue) {
                                 $hvalue = mb_ereg_replace('/[^a-zA-Z0-9 \\-_]/mu', '', $hvalue);
                                 $row['content'] = $this->CLASS['highlight']->str_highlight($row['content'], $hvalue, $this->CLASS['highlight']->STR_HIGHLIGHT_STRIPLINKS, '<span class="highlightword">\\1</span>');
                             }
                         }
                         echo $row['content'];
                         $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_content_end");
                     } else {
                         // check if extension is loaded
                         if (isset($this->CLASS['extension'][$row['type']]) and $this->CLASS['extension'][$row['type']]['init'] == TRUE) {
                             $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_extension_start");
                             // run extension
                             echo $this->CLASS['extension'][$row['type']]['class']->show_content($row['id']);
                             $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_extension_end");
                             // check if added files should be shown
                             if ($this->CLASS['extension'][$row['type']]['class']->show_addedfiles != 1) {
                                 $show_files = 0;
                             }
                         } else {
                             $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_extension_not_loaded");
                             continue;
                         }
                     }
                     echo "</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n";
                     if ($show_files == 1) {
                         $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_content_files_start");
                         // select added files
                         $hashkey = md5('files' . $row['id']);
                         if (!$this->CLASS['cache']->test($hashkey)) {
                             if ($this->CLASS['db']->dbtype == "pgsql") {
                                 $result = $this->CLASS['db']->query(sprintf("SELECT id,filename,filesize,owner, to_char(date,'DD. Mon YYYY HH24:MI:SS') AS dateform FROM files WHERE belongs_to=%d AND deleted=0 ORDER BY id ASC", $row['id']));
                             } elseif ($this->CLASS['db']->dbtype == "sqlite" || $this->CLASS['db']->dbtype == "sqlite3") {
                                 $result = $this->CLASS['db']->query(sprintf("SELECT id,filename,filesize,owner, strftime('%%d.%%m.%%Y %%H:%%M:%%S',date) AS dateform FROM files WHERE belongs_to=%d AND deleted=0 ORDER BY id ASC", $row['id']));
                             } else {
                                 $query = "SELECT id,filename,filesize,owner, DATE_FORMAT(date,'%d. %M %Y %H:%i:%s') AS dateform\n\t\t\t\t\t\t\t\t\t\tFROM files";
                                 $query .= sprintf(" WHERE belongs_to=%d AND deleted=0\n\t\t\t\t\t\t\t\t\t\tORDER BY id ASC", $row['id']);
                                 $result = $this->CLASS['db']->query($query);
                             }
                             $rows = null;
                             while ($zeile = $this->CLASS['db']->fetch_assoc($result)) {
                                 $rows[] = $zeile;
                             }
                             $this->CLASS['cache']->save($rows, $hashkey, array('system', 'files'));
                         } else {
                             $rows = $this->CLASS['cache']->load($hashkey);
                         }
                         echo '<div dojoType="dijit.layout.ContentPane">';
                         // read all select files
                         if (is_array($rows)) {
                             foreach ($rows as $zeile) {
                                 $title = "";
                                 if ($zeile['owner'] == NULL || $zeile['owner'] == 0 || $zeile['owner'] == "") {
                                     $title = $zeile['dateform'];
                                 } else {
                                     $title = $this->CLASS['knowledgeroot']->getOwner($zeile['owner']) . " - " . $zeile['dateform'];
                                 }
                                 // check for static file download
                                 if (isset($this->CLASS['config']->misc->download->static) && $this->CLASS['config']->misc->download->static == 1) {
                                     $downloadlink = "download/" . $zeile['id'] . "/" . $zeile['filename'];
                                 } else {
                                     $downloadlink = "index.php?download=" . $zeile['id'];
                                 }
                                 if ($mycontentrights == 2) {
                                     echo "<a href=\"javascript:;\" onclick=\"if(confirm('" . $this->CLASS['translate']->_('Do you really want to delete?') . "')) { location.href='index.php?delfile=" . $zeile['id'] . "'; } \"><img src=\"images/delete.gif\" title=\"" . $this->CLASS['translate']->_('delete') . "\" class=\"upload\" /></a>&nbsp;<a href=\"" . $downloadlink . "\" title=\"" . $title . "\"><img src=\"images/file.gif\" class=\"upload\" /> " . $zeile['filename'] . "</a>&nbsp;<font class=\"text\">[" . getfilesize($zeile['filesize']) . "]&nbsp;[" . $title . "]</font><br />\n";
                                 } else {
                                     echo "<a href=\"" . $downloadlink . "\" title=\"" . $title . "\"><img src=\"images/file.gif\" class=\"upload\" /> " . $zeile['filename'] . "</a>&nbsp;<font class=\"text\">[" . getfilesize($zeile['filesize']) . "]&nbsp;[" . $title . "]</font><br />\n";
                                 }
                             }
                         }
                         echo '</div>';
                         $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_content_files_end");
                     }
                     $includeFileLink = false;
                     if ($show_files == 1) {
                         // show form for adding new files
                         if ($mycontentrights == 2) {
                             $includeFileLink = true;
                             echo "<div id=\"fileform_" . $row['id'] . "\" style=\"display:none\">\n\t\t\t\t\t\t\t\t<form class=\"AddFileForm\" action=\"index.php\" method=\"post\" enctype=\"multipart/form-data\">\n\n\t\t\t\t\t\t\t\t\t<b>" . $this->CLASS['translate']->_('add file') . "</b>\n\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"upload\" value=\"yes\" />\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"contentid\" value=\"" . $row['id'] . "\" />\n\t\t\t\t\t\t\t\t\t<input type=\"file\" name=\"datei\" />&nbsp;\n\n\t\t\t\t\t\t\t\t\t<input class=\"button\" type=\"submit\" name=\"submit\" value=\"" . $this->CLASS['translate']->_('add') . "\" />\n\t\t\t\t\t\t\t\t</form></div>";
                         }
                     }
                     // show content status bar
                     if ($this->CLASS['config']->content->statusbar) {
                         echo "<div class=\"content_statusbar\">" . $lastUpdated . "&nbsp;|&nbsp;" . $created . "</div>\n";
                     }
                 }
                 echo "</div>";
                 //content title pante end
                 $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_contentline_menu_start");
                 // show contentline menu
                 echo $this->CLASS['kr_extension']->show_menu("contentline", $row['id'], $mypagerights, $mycontentrights, $row['type']);
                 $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_contentline_menu_end");
                 // set firstcontent
                 if ($mycontentrights == 2 && $mypagerights == 2) {
                     $firstcontent = 0;
                 }
                 echo "\n\t\t\t\t\t</div>\n";
             }
             // end of while
             $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_page_menu_start");
             // show page menu
             if ($this->CLASS['config']->misc->showpagebottomnavi && $contentcounter != 0) {
                 echo "<div style=\"margin-top: 5px;\" />";
                 echo $this->CLASS['kr_extension']->show_menu("page", $_SESSION['cid'], $mypagerights);
             }
             $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "show_page_menu_end");
             echo "</div><br /><br />";
         } else {
             $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "no_content_start");
             // show notification if no content is present
             echo "<h3>" . $this->CLASS['translate']->_('No content here.') . "</h3>\n";
             $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "no_content_end");
         }
         echo "\n<script>\ndojo.addOnLoad(function(){\n  dojo.query(\".showMe\").forEach(function(node, index, arr){\n\tnode.style.display = 'block';\n  });\n});\n</script>\n\t\t\t";
         // form for move page
         echo "<form name=\"move\" action=\"index.php\" method=\"post\">\n";
         echo "<input type=\"hidden\" name=\"move\" value=\"move\" />\n";
         echo "<input type=\"hidden\" name=\"to\" value=\"" . $_SESSION['cid'] . "\" />\n";
         echo "<input type=\"hidden\" name=\"contentid\" value=\"\" />\n";
         // use for move pagecontent
         echo "</form>\n";
         // form for move content on page
         echo "<form name=\"movecontent\" action=\"index.php\" method=\"post\">\n";
         echo "<input type=\"hidden\" name=\"movecontent\" value=\"movecontent\" />\n";
         echo "<input type=\"hidden\" name=\"page\" value=\"" . $_SESSION['cid'] . "\" />\n";
         // id of page
         echo "<input type=\"hidden\" name=\"contentid\" value=\"\" />\n";
         // id of source content
         echo "<input type=\"hidden\" name=\"targetcontentid\" value=\"\" />\n";
         // id of target content
         echo "<input type=\"hidden\" name=\"position\" value=\"\" />\n";
         // use before or after
         echo "</form>\n";
     } else {
         $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "welcome_msg_start");
         // show welcome message
         echo "<div class=\"welcome\">" . $this->CLASS['translate']->_('Welcome to Knowledgeroot') . "</div>\n";
         $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "welcome_msg_end");
     }
     // check if symlink was set
     if (isset($_SESSION['original_cid']) && $_SESSION['original_cid'] != "") {
         $_SESSION['cid'] = $_SESSION['original_cid'];
         $_SESSION['original_cid'] = "";
     }
     $this->CLASS['hooks']->setHook("kr_content", "show_tree_content", "end");
 }
 $file_copyright = $files->getValue("copyright");
 $file_type = $files->getValue("filetype");
 $file_size = $files->getValue("filesize");
 $file_stamp = date("d-M-Y | H:i", $files->getValue("stamp")) . "h";
 $file_type_ii = in_array($file_type, $imagetype);
 // check if file exists
 // was passiert wenn nicht da ?
 // if(!file_exists($REX[MEDIAFOLDER]."/".$file_name)) continue;
 // get file icon
 $icon_src = "pics/pool_file_icons/file.gif";
 $file_ext = substr(strrchr($file_name, "."), 1);
 if (in_array($file_ext, $file_icons)) {
     $icon_src = "pics/pool_file_icons/{$file_ext}.gif";
 }
 // get file size
 $file_size = getfilesize($file_size);
 if ($file_type_ii) {
     $thumbnail = "<img src=../files/{$file_name} width=80 border=0>";
 } else {
     $thumbnail = "<img src={$icon_src} width=80 height=80 align=left border=0><!-- " . $I18N->msg('pool_file_noshow') . "-->";
 }
 if ($file_title == "") {
     $file_title = "[" . $I18N->msg('pool_file_notitle') . "]";
 }
 if ($file_description == "") {
     $file_description = "[" . $I18N->msg('pool_file_nodescription') . "]";
 }
 // HTMLAREA / INPUT FIELD CHECK / link setzen zum übernehmen
 if ($_SESSION[myarea] == '') {
     $opener_link = "<a href=javascript:void(0) onClick=selectMedia('" . $file_name . "');>" . $I18N->msg('pool_file_get') . "</a>";
 } else {
Beispiel #16
0
$post["hosting_4"] = "1";
//Depositfiles.com	300 Mb
//			$post["hosting_5"]="1";	//Easy-share.com	100 Mb
//			$post["hosting_9"]="1";	//FileFactory.com	300 Mb
//			$post["hosting_8"]="1";	//Megaupload.com	100 Mb
$post["hosting_2"] = "1";
//Rapidshare.com	100 Mb
$post["hosting_3"] = "1";
//Sharedzilla.com	1 Gb
$post["hosting_10"] = "1";
//Uploaded.to		250 Mb
//			$post["hosting_7"]="1";	//Zshare.net		100 Mb
if (count($post) > 6) {
    html_error('You may check out a maximum of 4 file hostins.');
}
$fsize = getfilesize($lfile);
if (($post["hosting_5"] || $post["hosting_8"] || $post["hosting_2"] || $post["hosting_7"]) && $fsize > 104857600) {
    html_error('Max file size 100 Mb');
}
if ($post["hosting_10"] && $fsize > 262144000) {
    html_error('Max file size 250 Mb');
}
if (($post["hosting_4"] || $post["hosting_9"]) && $fsize > 314572800) {
    html_error('Max file size 300 Mb');
}
if (($post["hosting_6"] || $post["hosting_3"]) && $fsize > 1073741824) {
    html_error('Max file size 1 Gb');
}
$uid = mt_rand(1000000, 9999999);
$uid .= $uid >> 1;
$act_url = $ref . 'en/file/uploaddo?load-' . $uid;
 public function appendObj($token, $bucket_name, $object_name, $upload_id, $next_marker, $data)
 {
     $Connection = isset($this->ceph_conn) ? $this->ceph_conn : $this->connectionCeph();
     $part_file_path = session('user_upload_path') . DIRECTORY_SEPARATOR . $object_name . '~' . DIRECTORY_SEPARATOR . '' . $next_marker;
     appendToFile($part_file_path, $data);
     if (getfilesize($part_file_path) > 5 * 1024 * 1024) {
         $opt['fileUpload'] = $part_file_path;
         $opt['partNumber'] = $next_marker;
         $opt['md5'] = md5_file($part_file_path);
         $res = $Connection->upload_part($bucket_name, $object_name . '~', $upload_id, $opt);
         if ($res->isOK()) {
             removeFile($part_file_path);
             $user = new UserService();
             $user->updateUserUploadMarker($token, $object_name, $next_marker + 1);
         } else {
             return false;
         }
     }
     return true;
 }