public function debugHelper() { echo "<pre>"; echo "<b>Kajona V4 Debug Subsystem</b>\n\n"; if (getGet("debugfile") != "") { echo "Loading path for " . getGet("debugfile") . "\n"; $strPath = array_search(getGet("debugfile"), class_resourceloader::getInstance()->getFolderContent("/debug", array(".php"))); if ($strPath !== false) { echo "Passing request to " . $strPath . "\n\n"; include _realpath_ . $strPath; } } else { echo "Searching for debug-scripts available...\n"; $arrFiles = class_resourceloader::getInstance()->getFolderContent("/debug", array(".php")); echo "<ul>"; foreach ($arrFiles as $strPath => $strOneFile) { echo "<li><a href='?debugfile=" . $strOneFile . "' >" . $strOneFile . "</a> <br />" . $strPath . "</li>"; } echo "</ul>"; } $arrTimestampEnde = gettimeofday(); $intTimeUsed = ($arrTimestampEnde['sec'] * 1000000 + $arrTimestampEnde['usec'] - ($this->arrTimestampStart['sec'] * 1000000 + $this->arrTimestampStart['usec'])) / 1000000; echo "\n\n<b>PHP-Time:</b> " . number_format($intTimeUsed, 6) . " sec \n"; echo "<b>Queries db/cachesize/cached/fired:</b> " . class_carrier::getInstance()->getObjDB()->getNumber() . "/" . class_carrier::getInstance()->getObjDB()->getCacheSize() . "/" . class_carrier::getInstance()->getObjDB()->getNumberCache() . "/" . (class_carrier::getInstance()->getObjDB()->getNumber() - class_carrier::getInstance()->getObjDB()->getNumberCache()) . "\n"; echo "<b>Templates cached:</b> " . class_carrier::getInstance()->getObjTemplate()->getNumberCacheSize() . " \n"; echo "<b>Memory/Max Memory:</b> " . bytesToString(memory_get_usage()) . "/" . bytesToString(memory_get_peak_usage()) . " \n"; echo "<b>Classes Loaded:</b> " . class_classloader::getInstance()->getIntNumberOfClassesLoaded() . " \n"; echo "<b>Cache requests/hits/saves/cachesize:</b> " . class_cache::getIntRequests() . "/" . class_cache::getIntHits() . "/" . class_cache::getIntSaves() . "/" . class_cache::getIntCachesize() . " \n"; echo "</pre>"; }
/** * Returns the contents of the info-block * * @return mixed */ public function getArrContent() { $objLang = class_carrier::getInstance()->getObjLang(); $arrReturn = array(); $arrReturn[] = array($objLang->getLang("operatingsystem", "system"), php_uname()); $arrReturn[] = array($objLang->getLang("systeminfo_webserver_version", "system"), $_SERVER["SERVER_SOFTWARE"]); if (function_exists("apache_get_modules")) { $arrReturn[] = array($objLang->getLang("systeminfo_webserver_modules", "system"), implode(", ", @apache_get_modules())); } if (@disk_total_space(_realpath_)) { $arrReturn[] = array($objLang->getLang("speicherplatz", "system"), bytesToString(@disk_free_space(_realpath_)) . "/" . bytesToString(@disk_total_space(_realpath_)) . $objLang->getLang("diskspace_free", "system")); } $arrReturn[] = array($objLang->getLang("system_realpath", "system"), _realpath_); $arrReturn[] = array($objLang->getLang("system_webpath", "system"), _webpath_); return $arrReturn; }
/** * Returns the contents of the info-block * * @return mixed */ public function getArrContent() { $objLang = class_carrier::getInstance()->getObjLang(); $arrReturn = array(); $arrTables = class_carrier::getInstance()->getObjDB()->getTables(true); $intSizeData = 0; $intSizeIndex = 0; switch (class_config::getInstance()->getConfig("dbdriver")) { case "mysqli": case "mysql": foreach ($arrTables as $arrTable) { if (isset($arrTable["Data_length"])) { $intSizeData += $arrTable["Data_length"]; } if (isset($arrTable["Index_length"])) { $intSizeIndex += $arrTable["Index_length"]; } } $arrInfo = class_carrier::getInstance()->getObjDB()->getDbInfo(); $arrReturn[] = array($objLang->getLang("datenbanktreiber", "system"), $arrInfo["dbdriver"]); $arrReturn[] = array($objLang->getLang("datenbankserver", "system"), $arrInfo["dbserver"]); $arrReturn[] = array($objLang->getLang("datenbankclient", "system"), $arrInfo["dbclient"]); $arrReturn[] = array($objLang->getLang("datenbankverbindung", "system"), $arrInfo["dbconnection"]); $arrReturn[] = array($objLang->getLang("anzahltabellen", "system"), count($arrTables)); $arrReturn[] = array($objLang->getLang("groessegesamt", "system"), bytesToString($intSizeData + $intSizeIndex)); $arrReturn[] = array($objLang->getLang("groessedaten", "system"), bytesToString($intSizeData)); break; case "postgres": $arrInfo = class_carrier::getInstance()->getObjDB()->getDbInfo(); $arrReturn[] = array($objLang->getLang("datenbanktreiber", "system"), $arrInfo["dbdriver"]); $arrReturn[] = array($objLang->getLang("datenbankserver", "system"), $arrInfo["dbserver"]); $arrReturn[] = array($objLang->getLang("datenbankclient", "system"), $arrInfo["dbclient"]); $arrReturn[] = array($objLang->getLang("datenbankverbindung", "system"), $arrInfo["dbconnection"]); $arrReturn[] = array($objLang->getLang("anzahltabellen", "system"), count($arrTables)); $arrReturn[] = array($objLang->getLang("groessegesamt", "system"), bytesToString($intSizeData + $intSizeIndex)); $arrReturn[] = array($objLang->getLang("groessedaten", "system"), bytesToString($intSizeData)); break; default: $arrInfo = class_carrier::getInstance()->getObjDB()->getDbInfo(); $arrReturn[] = array($objLang->getLang("datenbanktreiber", "system"), $arrInfo["dbdriver"]); $arrReturn[] = array($objLang->getLang("datenbankserver", "system"), $arrInfo["dbserver"]); $arrReturn[] = array($objLang->getLang("anzahltabellen", "system"), count($arrTables)); break; } return $arrReturn; }
protected function printDebugValues() { $strDebug = ""; $arrTimestampEnde = gettimeofday(); $intTimeUsed = ($arrTimestampEnde['sec'] * 1000000 + $arrTimestampEnde['usec'] - ($this->arrTestStartDate['sec'] * 1000000 + $this->arrTestStartDate['usec'])) / 1000000; $strDebug .= "PHP-Time: " . number_format($intTimeUsed, 6) . " sec \n"; //Hows about the queries? $strDebug .= "Queries db/cachesize/cached/fired: " . class_carrier::getInstance()->getObjDB()->getNumber() . "/" . class_carrier::getInstance()->getObjDB()->getCacheSize() . "/" . class_carrier::getInstance()->getObjDB()->getNumberCache() . "/" . (class_carrier::getInstance()->getObjDB()->getNumber() - class_carrier::getInstance()->getObjDB()->getNumberCache()) . " \n"; //anything to say about the templates? $strDebug .= "Templates cached: " . class_carrier::getInstance()->getObjTemplate()->getNumberCacheSize() . " \n"; //memory $strDebug .= "Memory/Max Memory: " . bytesToString(memory_get_usage()) . "/" . bytesToString(memory_get_peak_usage()) . " \n"; $strDebug .= "Classes Loaded: " . class_classloader::getInstance()->getIntNumberOfClassesLoaded() . " \n"; //and check the cache-stats $strDebug .= "Cache requests/hits/saves/cachesize: " . class_cache::getIntRequests() . "/" . class_cache::getIntHits() . "/" . class_cache::getIntSaves() . "/" . class_cache::getIntCachesize() . " \n"; //echo get_called_class()."\n".$strDebug."\n"; }
/** * Returns the contents of the info-block * * @return mixed */ public function getArrContent() { $objLang = class_carrier::getInstance()->getObjLang(); $arrReturn = array(); $arrReturn[] = array($objLang->getLang("version", "system"), phpversion()); $arrReturn[] = array($objLang->getLang("geladeneerweiterungen", "system"), implode(", ", get_loaded_extensions())); $arrReturn[] = array($objLang->getLang("executiontimeout", "system"), class_carrier::getInstance()->getObjConfig()->getPhpIni("max_execution_time") . "s"); $arrReturn[] = array($objLang->getLang("inputtimeout", "system"), class_carrier::getInstance()->getObjConfig()->getPhpIni("max_input_time") . "s"); $arrReturn[] = array($objLang->getLang("memorylimit", "system"), bytesToString(ini_get("memory_limit"), true)); $arrReturn[] = array($objLang->getLang("errorlevel", "system"), class_carrier::getInstance()->getObjConfig()->getPhpIni("error_reporting")); $arrReturn[] = array($objLang->getLang("systeminfo_php_safemode", "system"), ini_get("safe_mode") ? $objLang->getLang("commons_yes", "system") : $objLang->getLang("commons_no", "system")); $arrReturn[] = array($objLang->getLang("systeminfo_php_urlfopen", "system"), ini_get("allow_url_fopen") ? $objLang->getLang("commons_yes", "system") : $objLang->getLang("commons_no", "system")); $arrReturn[] = array($objLang->getLang("systeminfo_php_regglobal", "system"), ini_get("register_globals") ? $objLang->getLang("commons_yes", "system") : $objLang->getLang("commons_no", "system")); $arrReturn[] = array($objLang->getLang("postmaxsize", "system"), bytesToString(ini_get("post_max_size"), true)); $arrReturn[] = array($objLang->getLang("uploadmaxsize", "system"), bytesToString(ini_get("upload_max_filesize"), true)); $arrReturn[] = array($objLang->getLang("uploads", "system"), class_carrier::getInstance()->getObjConfig()->getPhpIni("file_uploads") == 1 ? $objLang->getLang("commons_yes", "system") : $objLang->getLang("commons_no", "system")); $arrReturn[] = array($objLang->getLang("timezone", "system"), date_default_timezone_get()); $arrReturn[] = array($objLang->getLang("datekajona", "system"), dateToString(new class_date())); return $arrReturn; }
/** * Loads the feed and displays it * * @return string the prepared html-output */ public function loadData() { $strReturn = ""; //Load all files in the folder $objFilesystem = new class_filesystem(); $arrFiles = $objFilesystem->getFilelist($this->arrElementData["char2"]); $strWrapperTemplateID = $this->objTemplate->readTemplate("/element_directorybrowser/" . $this->arrElementData["char1"], "directorybrowser_wrapper"); $strEntryTemplateID = $this->objTemplate->readTemplate("/element_directorybrowser/" . $this->arrElementData["char1"], "directorybrowser_entry"); $strContent = ""; foreach ($arrFiles as $strOneFile) { $arrDetails = $objFilesystem->getFileDetails($this->arrElementData["char2"] . "/" . $strOneFile); $arrTemplate = array(); $arrTemplate["file_name"] = $arrDetails["filename"]; $arrTemplate["file_href"] = _webpath_ . $this->arrElementData["char2"] . "/" . $strOneFile; $arrTemplate["file_date"] = timeToString($arrDetails["filechange"]); $arrTemplate["file_size"] = bytesToString($arrDetails["filesize"]); $strContent .= $this->fillTemplate($arrTemplate, $strEntryTemplateID); } $strReturn .= $this->fillTemplate(array("files" => $strContent), $strWrapperTemplateID); return $strReturn; }
/** * @see interface_admin_systemtask::getAdminForm() * @return string */ public function getAdminForm() { $strReturn = ""; //show dropdown to select db-dump $objFilesystem = new class_filesystem(); $arrFiles = $objFilesystem->getFilelist(_projectpath_ . "/dbdumps/", array(".sql", ".gz")); $arrOptions = array(); foreach ($arrFiles as $strOneFile) { $arrDetails = $objFilesystem->getFileDetails(_projectpath_ . "/dbdumps/" . $strOneFile); $strTimestamp = ""; if (uniStrpos($strOneFile, "_") !== false) { $strTimestamp = uniSubstr($strOneFile, uniStrrpos($strOneFile, "_") + 1, uniStrpos($strOneFile, ".") - uniStrrpos($strOneFile, "_")); } if (uniStrlen($strTimestamp) > 9 && is_numeric($strTimestamp)) { $arrOptions[$strOneFile] = $strOneFile . " (" . bytesToString($arrDetails["filesize"]) . ")" . "<br />" . $this->getLang("systemtask_dbimport_datefilename") . " " . timeToString($strTimestamp) . "<br />" . $this->getLang("systemtask_dbimport_datefileinfo") . " " . timeToString($arrDetails['filechange']); } else { $arrOptions[$strOneFile] = $strOneFile . " (" . bytesToString($arrDetails["filesize"]) . ")" . "<br />" . $this->getLang("systemtask_dbimport_datefileinfo") . " " . timeToString($arrDetails['filechange']); } } $strReturn .= $this->objToolkit->formInputRadiogroup("dbImportFile", $arrOptions, $this->getLang("systemtask_dbimport_file")); return $strReturn; }
//connect to database $db = mysql_connect($dbhost, $dbuser, $dbpass) or die(errorMessage() . "Cannot connect to database. Check your username and password in the config file.</p>"); mysql_select_db($database) or die(errorMessage() . "Error selecting database.</p>"); $query = "SELECT filename,url,size,pubDate FROM " . $prefix . "namemap"; $results = mysql_query($query) or die(errorMessage() . "Can't do SQL query - " . mysql_error() . "</p>"); //if there are no entries in database or RSS feed is disabled in config.php file, delete rss.xml file if (mysql_num_rows($results) == 0 || $enablerss == false) { if (file_exists("rss/rss.xml")) { //make sure file exists before trying to delete unlink("rss/rss.xml") or die("Can't delete rss.xml file using unlink(). Are you running the server under Windows?"); } } else { $fd = fopen("rss/rss.xml", "w") or die(errorMessage() . "Error: Unable to write to rss.xml file!</p>"); $start_text = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" . "<rss version=\"2.0\">\n" . "<channel>\n" . "<title>" . clean($rss_title) . "</title>\n" . "<link>" . $rss_link . "</link>\n" . "<description>" . clean($rss_description) . "</description>\n" . "<lastBuildDate>" . date('D, j M Y h:i:s') . " " . $timezone . "</lastBuildDate>\n"; while ($row = mysql_fetch_row($results)) { //figure out full torrent URL $url = $website_url . $_SERVER['REQUEST_URI']; $url = str_replace("newtorrents.php", "", $url); $url = str_replace("editconfig.php", "", $url); $url = str_replace("deleter.php", "", $url); $url = $url . "torrents/" . $row[0] . ".torrent"; $url = str_replace(" ", "%20", $url); //figure out file(s) size $file_size = bytesToString($row[2]); //go through each entry in database $middle_text = $middle_text . "<item>\n" . "<title>" . $row[0] . " (" . $file_size . ")</title>\n" . "<description>" . $row[0] . " (" . $file_size . ") " . $row[1] . "</description>\n" . "<pubDate>" . $row[3] . " " . $timezone . "</pubDate>\n" . "<guid>" . $url . "</guid>\n" . "<link>" . $url . "</link>\n" . "<enclosure url=\"" . $url . "\" length=\"" . filesize("torrents/" . $row[0] . ".torrent") . "\" type=\"application/x-bittorrent\" />\n" . "</item>\n"; } $end_text = "</channel>\n</rss>"; fwrite($fd, $start_text . $middle_text . $end_text); fclose($fd); }
/** * Prints a file as a detailed-view * and generates forward / backward links + a strip of prev / next files * * @param bool $bitRegisterAdditionalTitle * @return string */ protected function actionFileDetails($bitRegisterAdditionalTitle = true) { if (!$this->checkIfRequestedIdIsInElementsTree()) { return $this->actionList(); } $bitIsImage = false; //Load record $objFile = new class_module_mediamanager_file($this->getSystemid()); //common fields $arrDetailsTemplate = array(); $arrDetailsTemplate["file_name"] = $objFile->getStrName(); $arrDetailsTemplate["file_description"] = $objFile->getStrDescription(); $arrDetailsTemplate["file_subtitle"] = $objFile->getStrSubtitle(); $arrDetailsTemplate["file_filename"] = $objFile->getStrFilename(); $arrDetailsTemplate["file_size"] = bytesToString($objFile->getIntFileSize()); $arrDetailsTemplate["file_hits"] = $objFile->getIntHits(); $arrDetailsTemplate["file_systemid"] = $objFile->getSystemid(); $arrDetailsTemplate["file_elementid"] = $this->arrElementData["content_id"]; $arrDetailsTemplate["file_lmtime"] = timeToString(filemtime(_realpath_ . $objFile->getStrFilename())); if (validateSystemid($objFile->getOwnerId())) { $objUser = new class_module_user_user($objFile->getOwnerId()); $arrDetailsTemplate["file_owner"] = $objUser->getStrUsername(); } if ($objFile->rightRight2()) { $arrDetailsTemplate["file_link_href"] = _webpath_ . "/download.php?systemid=" . $objFile->getSystemid(); $arrDetailsTemplate["file_link"] = "<a href=\"" . _webpath_ . "/download.php?systemid=" . $objFile->getSystemid() . "\">" . $this->getLang("download_link") . "</a>"; } //if its an image, provide additional information $strSuffix = uniStrtolower(uniSubstr($objFile->getStrFilename(), uniStrrpos($objFile->getStrFilename(), "."))); if (in_array($strSuffix, $this->arrImageTypes) && isset($this->arrElementData["gallery_maxh_d"]) && isset($this->arrElementData["gallery_maxw_d"])) { $bitIsImage = true; $arrDetailsTemplate["image_src"] = $this->getImageUrl($objFile->getStrFilename(), $this->arrElementData["gallery_maxh_d"], $this->arrElementData["gallery_maxw_d"], $this->arrElementData["gallery_text"], $this->arrElementData["gallery_overlay"], $objFile->getSystemid(), $this->arrElementData["content_id"]); } $arrStripIds = $this->getNextPrevIds(); $arrDetailsTemplate["backlink"] = $arrStripIds["backward_1"] != "" ? class_link::getLinkPortal($this->getPagename(), "", "", $this->getLang("commons_back"), "fileDetails", "", $arrStripIds["backward_1"]) : ""; $arrDetailsTemplate["forwardlink"] = $arrStripIds["forward_1"] != "" ? class_link::getLinkPortal($this->getPagename(), "", "", $this->getLang("commons_next"), "fileDetails", "", $arrStripIds["forward_1"]) : ""; //next /prev 3 files for ($intI = 1; $intI <= 3; $intI++) { if ($arrStripIds["forward_" . $intI] != "") { $objCurFile = new class_module_mediamanager_file($arrStripIds["forward_" . $intI]); $arrDetailsTemplate["forwardlink_" . $intI] = $this->renderFileStripEntry($objCurFile); } if ($arrStripIds["backward_" . $intI] != "") { $objCurFile = new class_module_mediamanager_file($arrStripIds["backward_" . $intI]); $arrDetailsTemplate["backlink_" . $intI] = $this->renderFileStripEntry($objCurFile); } } //current file $arrDetailsTemplate["filestrip_current"] = $this->renderFileStripEntry($objFile); $arrDetailsTemplate["overview"] = getLinkPortal($this->getPagename(), "", "", $this->getLang("overview"), "mediaFolder", "", $objFile->getPrevId()); $arrDetailsTemplate["pathnavigation"] = $this->generatePathnavi(true); //ratings available? if ($objFile->getFloatRating() !== null) { /** @var $objRating class_module_rating_portal */ $objRating = class_module_system_module::getModuleByName("rating")->getPortalInstanceOfConcreteModule(); $arrDetailsTemplate["file_rating"] = $objRating->buildRatingBar($objFile->getFloatRating(), $objFile->getIntRatingHits(), $objFile->getSystemid(), $objFile->isRateableByUser(), $objFile->rightRight3()); } $strTemplateID = $this->objTemplate->readTemplate("/module_mediamanager/" . $this->arrElementData["repo_template"], "filedetail"); $strReturn = $this->fillTemplate($arrDetailsTemplate, $strTemplateID); //Add pe code $arrPeConfig = array("pe_module" => "mediamanager", "pe_action_edit" => "editFile", "pe_action_edit_params" => "&systemid=" . $objFile->getSystemid()); $strReturn = class_element_portal::addPortalEditorCode($strReturn, $objFile->getSystemid(), $arrPeConfig); //set the name of the current image to the page title via class_pages if ($bitRegisterAdditionalTitle) { class_module_pages_portal::registerAdditionalTitle($objFile->getStrName()); } //Update view counter if ($bitIsImage) { $objFile->increaseHits(); } return $this->addPortaleditorCode($strReturn); }
echo "<tr><td>" . $data[0] . "</td><td>" . $data[11] . "</td><td>\n"; if (Substr($data[12], 0, 7) == "http://") { echo "<a href=\"" . $data[12] . "\">" . $data[12] . "</a>\n"; } else { echo $data[12]; } echo "</td><td>" . bytesToString($data[13]) . "</td>\n"; echo "<td>" . $data[14] . "</td></tr>\n"; echo "</table>\n"; } echo "<table>\n"; echo "<tr><th class=\"subheader\">IP Address</th><th class=\"subheader\">Data Left to Download</th><th class=\"subheader\" width=200>Percent Finished</th><th class=\"subheader\">Port</th><th class=\"subheader\">Last Update</th><th class=\"subheader\">NAT User</th></tr>\n"; while ($data2 = mysql_fetch_row($results2)) { //grab information on each user echo "<tr><td>" . $data2[2] . "</td>\n"; echo "<td>" . bytesToString($data2[1]) . "</td>\n"; //calculate percent done for user $percent_done = 1.0; if ($data2[1] != 0) { $size_in_bytes = $data[13]; if ($size_in_bytes == 0) { //thou shalt not divide by zero $percent_done = 0; } else { $percent_done = round(($size_in_bytes - $data2[1]) / $size_in_bytes, 3); } } ?> <td> <table class="percentages" cellspacing="0"> <tr>
</tr> <?php $results = mysql_query("SELECT " . $prefix . "summary.info_hash, " . $prefix . "namemap.size, " . $prefix . "summary.seeds, " . $prefix . "summary.leechers, format(" . $prefix . "summary.finished,0), format(" . $prefix . "summary.dlbytes/1073741824,3), " . $prefix . "namemap.filename FROM " . $prefix . "summary LEFT JOIN " . $prefix . "namemap ON " . $prefix . "summary.info_hash = " . $prefix . "namemap.info_hash ORDER BY " . $prefix . "namemap.filename") or die(errorMessage() . "" . mysql_error() . "</p>"); $i = 0; while ($data = mysql_fetch_row($results)) { $writeout = "row" . $i % 2; $hash = $data[0]; if (is_null($data[6])) { $data[6] = $data[0]; } if (strlen($data[6]) == 0) { $data[6] = $data[0]; } echo "<tr class=\"{$writeout}\">\n"; echo "\t<td>" . $data[6] . "</td>\n"; echo "\t<td>" . bytesToString($data[1]) . "</td>\n"; for ($j = 2; $j < 5; $j++) { echo "\t<td class=\"center\">{$data[$j]}</td>\n"; } echo "\t<td class=\"center\">{$data['5']} GB</td>\n"; echo "\t<td class=\"center\"><input type=\"checkbox\" name=\"x{$hash}\" value=\"{$i}\" onclick=\"selectRow(this);\"/></td>\n"; echo "</tr>\n"; $i++; } ?> </table> <p class="error">Warning: there is no confirmation for deleting files. Clicking this button is final.</p> <p class="center"><input type="submit" value="Delete" /></p> </form> <a href="index.php"><img src="images/stats.png" border="0" class="icon" alt="Tracker Statistics" title="Tracker Statistics" /></a><a href="index.php">Return to Statistics Page</a><br> <a href="admin.php"><img src="images/admin.png" border="0" class="icon" alt="Admin Page" title="Admin Page" /></a><a href="admin.php">Return to Admin Page</a>
<?php if ($httpuploaded + $btuploaded != 0) { echo round($httpuploaded / ($httpuploaded + $btuploaded) * 100, 2) . "%"; } else { echo "0%"; } ?> </td> <td align="center"> <?php if ($httpuploaded + $btuploaded != 0) { echo round($btuploaded / ($httpuploaded + $btuploaded) * 100, 2) . "%"; } else { echo "0%"; } ?> </td> </tr> </table> </center> <p align="center"> <?php echo "Total Uploaded: " . bytesToString($httpuploaded + $btuploaded); ?> </p> <br> <span class="notice">* - This does not include the GetRight HTTP seeding format which links directly to files.</span> <br><br> <a href="admin.php"><img src="images/admin.png" border="0" class="icon" alt="Admin Page" title="Admin Page" /></a><a href="admin.php">Return to Admin Page</a> </body> </html>
/** * Generates debugging-infos, but only in non-xml mode * * @param string $strReturn * * @return string */ private function getDebugInfo($strReturn) { $strDebug = ""; if (_timedebug_ || _dbnumber_ || _templatenr_ || _memory_) { //Maybe we need the time used to generate this page if (_timedebug_ === true) { $arrTimestampEnde = gettimeofday(); $intTimeUsed = ($arrTimestampEnde['sec'] * 1000000 + $arrTimestampEnde['usec'] - ($this->arrTimestampStart['sec'] * 1000000 + $this->arrTimestampStart['usec'])) / 1000000; $strDebug .= "<b>PHP-Time:</b> " . number_format($intTimeUsed, 6) . " sec "; } //Hows about the queries? if (_dbnumber_ === true) { $strDebug .= "<b>Queries db/cachesize/cached/fired:</b> " . class_carrier::getInstance()->getObjDB()->getNumber() . "/" . class_carrier::getInstance()->getObjDB()->getCacheSize() . "/" . class_carrier::getInstance()->getObjDB()->getNumberCache() . "/" . (class_carrier::getInstance()->getObjDB()->getNumber() - class_carrier::getInstance()->getObjDB()->getNumberCache()) . " "; } //anything to say about the templates? if (_templatenr_ === true) { $strDebug .= "<b>Templates cached:</b> " . class_carrier::getInstance()->getObjTemplate()->getNumberCacheSize() . " "; } //memory if (_memory_ === true) { $strDebug .= "<b>Memory/Max Memory:</b> " . bytesToString(memory_get_usage()) . "/" . bytesToString(memory_get_peak_usage()) . " "; $strDebug .= "<b>Classes Loaded:</b> " . class_classloader::getInstance()->getIntNumberOfClassesLoaded() . " "; } //and check the cache-stats if (_cache_ === true) { $strDebug .= "<b>Cache requests/hits/saves/cachesize:</b> " . class_cache::getIntRequests() . "/" . class_cache::getIntHits() . "/" . class_cache::getIntSaves() . "/" . class_cache::getIntCachesize() . " "; } if (_xmlLoader_ === true) { class_response_object::getInstance()->addHeader("Kajona Debug: " . $strDebug); } else { $strDebug = "<pre style='z-index: 2000000; position: fixed; background-color: white; width: 100%; top: 0px; font-size: 10px; padding: 0; margin: 0;'>Kajona Debug: " . $strDebug . "</pre>"; $intBodyPos = uniStrpos($strReturn, "</body>"); if ($intBodyPos !== false) { $strReturn = uniSubstr($strReturn, 0, $intBodyPos) . $strDebug . uniSubstr($strReturn, $intBodyPos); } else { $strReturn = $strDebug . $strReturn; } } } return $strReturn; }
</td> </tr> <tr> <th><a title="Click Header to Sort">Nombre</a></th> <th><a title="Click Header to Sort">Total de espacio</a></th> <th><a title="Click Header to Sort">Costo aprox<br> en dólares</a></th> <th><a title="Click Header to Sort">Fecha de modificación</a></th> <th><a title="Click Header to Sort">Tipo de contenido</a></th> </tr> </thead> <tbody> <?php foreach ($objects as $object) { echo '<tr>'; echo '<td><a href="' . $object->public_uri() . '" >' . $object->name . '</a></td>'; echo '<td>' . bytesToString($object->content_length) . '</td>'; echo '<td>$' . bytesToDollars($object->content_length) . '</td>'; echo '<td>' . date('Y-m-d H:i', strtotime($object->last_modified)) . '</td>'; echo '<td>' . $object->content_type . '</td>'; echo '</tr>'; } ?> </tbody> <tfoot> <tr id="pagerOne"> <td colspan="6"> <img src="/lib/js/jqueryTableSorter/img/first.png" class="first"/> <img src="/lib/js/jqueryTableSorter/img/prev.png" class="prev"/> <input type="text" class="pagedisplay"/> <img src="/lib/js/jqueryTableSorter/img/next.png" class="next"/>
/** * Returns details and additional functions handling the current image. * * @return string */ protected function actionImageDetails() { $strReturn = ""; //overlay-mode $this->setArrModuleEntry("template", "/folderview.tpl"); $strFile = $this->getParam("file"); $strFile = uniStrReplace(_webpath_, "", $strFile); if (is_file(_realpath_ . $strFile)) { $objFilesystem = new class_filesystem(); $arrDetails = $objFilesystem->getFileDetails($strFile); $arrSize = getimagesize(_realpath_ . $strFile); //Generate Dimensions $intHeight = $arrSize[1]; $intWidth = $arrSize[0]; while ($intWidth > 500 || $intHeight > 400) { $intWidth *= 0.8; $intHeight *= 0.8; } //Round $intWidth = number_format($intWidth, 0); $intHeight = number_format($intHeight, 0); $strImage = "<img src=\"" . _webpath_ . "/image.php?image=" . urlencode($strFile) . "&maxWidth=" . $intWidth . "&maxHeight=" . $intHeight . "\" id=\"fm_mediamanagerPic\" style=\"max-width: none;\" />"; $arrActions = array(); $arrActions[] = $this->objToolkit->listButton(class_link::getLinkAdminManual("href=\"#\" onclick=\"KAJONA.admin.mediamanager.imageEditor.showRealSize(); return false;\"", "", $this->getLang("showRealsize"), "icon_zoom_in")); $arrActions[] = $this->objToolkit->listButton(class_link::getLinkAdminManual("href=\"#\" onclick=\"KAJONA.admin.mediamanager.imageEditor.showPreview(); return false;\"", "", $this->getLang("showPreview"), "icon_zoom_out")) . " "; $arrActions[] = $this->objToolkit->listButton(class_link::getLinkAdminManual("href=\"#\" onclick=\"KAJONA.admin.mediamanager.imageEditor.rotate(90); return false;\"", "", $this->getLang("rotateImageLeft"), "icon_rotate_left")); $arrActions[] = $this->objToolkit->listButton(class_link::getLinkAdminManual("href=\"#\" onclick=\"KAJONA.admin.mediamanager.imageEditor.rotate(270); return false;\"", "", $this->getLang("rotateImageRight"), "icon_rotate_right")) . " "; $arrActions[] = $this->objToolkit->listButton(class_link::getLinkAdminManual("href=\"#\" onclick=\"KAJONA.admin.mediamanager.imageEditor.showCropping(); return false;\"", "", $this->getLang("cropImage"), "icon_crop")); $arrActions[] = $this->objToolkit->listButton(class_link::getLinkAdminManual("href=\"#\" id=\"accept_icon\" onclick=\"KAJONA.admin.mediamanager.imageEditor.saveCropping(); return false;\"", "", $this->getLang("cropImageAccept"), "icon_crop_acceptDisabled")) . " "; $strReturn .= $this->objToolkit->getContentToolbar($arrActions); $strReturn .= "<div class=\"imageContainer\"><div class=\"image\">" . $strImage . "</div></div>"; $strJs = "<script type=\"text/javascript\">\n KAJONA.admin.loader.loadFile([\n '" . class_resourceloader::getInstance()->getCorePathForModule("module_mediamanager") . "/module_mediamanager/admin/scripts/mediamanager.js',\n '" . class_resourceloader::getInstance()->getCorePathForModule("module_mediamanager") . "/module_mediamanager/admin/scripts/jcrop/jquery.Jcrop.js',\n '" . class_resourceloader::getInstance()->getCorePathForModule("module_mediamanager") . "/module_mediamanager/admin/scripts/jcrop/css/jquery.Jcrop.min.css'\n ]);\n\n var fm_image_rawurl = '" . _webpath_ . "/image.php?image=" . urlencode($strFile) . "&quality=80';\n var fm_image_scaledurl = '" . _webpath_ . "/image.php?image=" . urlencode($strFile) . "&maxWidth=__width__&maxHeight=__height__';\n var fm_image_scaledMaxWidth = {$intWidth};\n var fm_image_scaledMaxHeight = {$intHeight};\n var fm_image_isScaled = true;\n var fm_file = '" . $strFile . "' ;\n\n function init_fm_crop_save_warning_dialog() { jsDialog_1.setTitle('" . $this->getLang("cropWarningDialogHeader") . "'); jsDialog_1.setContent('" . $this->getLang("cropWarningSaving") . "', '" . $this->getLang("cropWarningCrop") . "', 'javascript:KAJONA.admin.mediamanager.imageEditor.saveCroppingToBackend()'); jsDialog_1.init(); }\n function init_fm_screenlock_dialog() { jsDialog_3.init(); }\n function hide_fm_screenlock_dialog() { jsDialog_3.hide(); }\n\n\n KAJONA.admin.strCropEnabled= '" . addslashes(class_adminskin_helper::getAdminImage("icon_crop_accept", $this->getLang("cropImageAccept"))) . "';\n KAJONA.admin.strCropDisabled = '" . addslashes(class_adminskin_helper::getAdminImage("icon_crop_acceptDisabled", $this->getLang("cropImageAccept"))) . "';\n\n </script>"; $strJs .= "<input type=\"hidden\" name=\"fm_int_realwidth\" id=\"fm_int_realwidth\" value=\"" . $arrSize[0] . "\" />"; $strJs .= "<input type=\"hidden\" name=\"fm_int_realheight\" id=\"fm_int_realheight\" value=\"" . $arrSize[1] . "\" />"; $strReturn .= $strJs; $arrTable = array(); $arrTable[] = array($this->getLang("commons_path"), $strFile); $arrTable[] = array($this->getLang("image_dimensions"), $arrSize[0] . " x " . $arrSize[1]); $arrTable[] = array($this->getLang("file_size"), bytesToString($arrDetails["filesize"])); $arrTable[] = array($this->getLang("file_editdate"), timeToString($arrDetails["filechange"])); $strReturn .= $this->objToolkit->divider() . $this->objToolkit->dataTable(null, $arrTable); } return $strReturn; }
$speed = round($data[8] / 1024, 2) . " KB/sec"; } } echo "\t<td class=\"center\">{$speed}</td>\n"; $total_speed = $total_speed + $data[8]; //add to total speed, in bytes } echo "</tr>\n"; $i++; } if ($i == 0) { echo "<tr class=\"row0\"><td style=\"text-align: center;\" colspan=\"6\">No torrents</td></tr>"; } //show totals in last row echo "<tr>"; echo "<th>Space Used: " . bytesToString($total_disk_usage) . "</th>"; echo "<th>" . $total_seeders . "</th>"; echo "<th>" . $total_leechers . "</th>"; echo "<th>" . $total_downloads . "</th>"; if ($GLOBALS["countbytes"]) { echo "<th>" . bytestoString($total_bytes_transferred) . "</th>"; if ($total_speed > 2097152) { echo "<th>" . round($total_speed / 1048576, 2) . " MB/sec</th>"; } else { echo "<th>" . round($total_speed / 1024, 2) . " KB/sec</th>"; } } ?> </tr></table></td></tr> <tr class="details"> <td align="left"><a href="http://www.rivetcode.com">RivetTracker</a> Version: 1.02</td>
</td> </tr> <tr> <th><a title="Click Header to Sort">Nombre</a></th> <th><a title="Click Header to Sort">Número de archivos</a></th> <th><a title="Click Header to Sort">Total de espacio</a></th> <th><a title="Click Header to Sort">Costo aproximado en dólares</a></th> </tr> </thead> <tbody> <?php foreach ($containers as $container) { echo '<tr>'; echo '<td><a href="/administracion/archivos/detallesContenedor/' . $container['name'] . '" >' . $container['name'] . '</a></td>'; echo '<td>' . $container["count"] . '</td>'; echo '<td>' . bytesToString($container["bytes"]) . '</td>'; echo '<td>$' . bytesToDollars($container["bytes"]) . '</td>'; echo '</tr>'; } ?> </tbody> <tfoot> <tr id="pagerOne"> <td colspan="6"> <img src="/lib/js/jqueryTableSorter/img/first.png" class="first"/> <img src="/lib/js/jqueryTableSorter/img/prev.png" class="prev"/> <input type="text" class="pagedisplay"/> <img src="/lib/js/jqueryTableSorter/img/next.png" class="next"/> <img src="/lib/js/jqueryTableSorter/img/last.png" class="last"/> <select class="pagesize">
echo "Found " . count($arrFiles) . " dump(s)\n\n"; echo "<form method='post'>"; echo "Dump to import:\n"; $arrImportfileData = array(); foreach ($arrFiles as $strOneFile) { $strFileInfo = ""; $arrDetails = $objFilesystem->getFileDetails(_projectpath_ . "/dbdumps/" . $strOneFile); $strTimestamp = ""; if (uniStrpos($strOneFile, "_") !== false) { $strTimestamp = uniSubstr($strOneFile, uniStrrpos($strOneFile, "_") + 1, uniStrpos($strOneFile, ".") - uniStrrpos($strOneFile, "_")); } if (uniStrlen($strTimestamp) > 9 && is_numeric($strTimestamp)) { //if the timestamp is the last part of the filename, we can use $strTimestamp $strFileInfo = $strOneFile . " (" . bytesToString($arrDetails['filesize']) . ")" . "\n Timestamp according to file name: " . timeToString($strTimestamp) . "\n Timestamp according to file info: " . timeToString($arrDetails['filechange']); } else { $strFileInfo = $strOneFile . " (" . bytesToString($arrDetails['filesize']) . ")" . "\n Timestamp according to file info: " . timeToString($arrDetails['filechange']); } $arrImportfileData[$strOneFile] = $strFileInfo; } $bitShowButton = false; foreach ($arrImportfileData as $strFilename => $strFileInfo) { echo "\n<input type='radio' name='dumpname' id='dumpname_" . $strFilename . "' value='{$strFilename}' /><label for='dumpname_" . $strFilename . "'>" . $strFileInfo . "</label>"; $bitShowButton = true; } if ($bitShowButton) { echo "\n\n<input type='hidden' name='doimport' value='1' />"; echo "<input type='submit' value='Import dump' />"; } else { echo "\nNo dump found."; } echo "</form>";
/** * In nearly all cases, the additional info is rendered left to the action-icons. * * @return string */ public function getStrAdditionalInfo() { $strReturn = basename($this->getStrFilename()); if ($this->getIntType() == self::$INT_TYPE_FILE) { $strReturn .= ", " . bytesToString(@filesize(_realpath_ . $this->getStrFilename())); $strReturn .= ", " . $this->getIntHits() . " " . $this->getLang("file_hits", "mediamanager"); } return $strReturn; }
echo '<div class="bar" style="width:' . $discoPorcentaje . '%;"></div>'; echo '</div>'; ?> </div> </div> </div> </div> <div class="row-fluid"> <div class="span10 offset1"> <div class="row-fluid"> <div class="span4"> <h4 class="black">Ancho de banda utilizado</h4> </div> <div class="span8"> <h4 class="black" style="margin-top:10px;"><?php echo bytesToString($anchoUsadoEnBytes, 1) . " / " . $maxAncho; ?> GB</h4> </div> </div> <div class="row-fluid"> <div class="span12"> <?php if ($anchoPorcentaje < 50) { echo '<span class="badge badge-success" style="padding: 3px; float: left; width: 25px; text-align: center;"> ' . $anchoPorcentaje . '%</span>'; echo '<div class="progress progress-striped progress-success" style="margin-left:38px;border: 1px solid #e3e3e3;">'; } else { if ($anchoPorcentaje < 75) { echo '<span class="badge badge-warning" style="padding: 3px; float: left; width: 25px; text-align: center;"> ' . $anchoPorcentaje . '%</span>';
/** * Returns a input-file element for uploading multiple files with progress bar. Only functionable in combination with * the mediamanager module * * @param string $strName * @param string $strAllowedFileTypes * @param string $strMediamangerRepoSystemId * * @return string */ public function formInputUploadMultiple($strName, $strAllowedFileTypes, $strMediamangerRepoSystemId) { if (class_module_system_module::getModuleByName("mediamanager") === null) { return $this->warningBox("Module mediamanger is required for this multiple uploads"); } $objConfig = class_carrier::getInstance()->getObjConfig(); $objText = class_carrier::getInstance()->getObjLang(); $strTemplateID = $this->objTemplate->readTemplate("/elements.tpl", "input_upload_multiple"); $arrTemplate = array(); $arrTemplate["name"] = $strName; $arrTemplate["mediamanagerRepoId"] = $strMediamangerRepoSystemId; $strAllowedFileRegex = uniStrReplace(array(".", ","), array("", "|"), $strAllowedFileTypes); $strAllowedFileTypes = uniStrReplace(array(".", ","), array("", "', '"), $strAllowedFileTypes); $arrTemplate["allowedExtensions"] = $strAllowedFileTypes != "" ? $objText->getLang("upload_allowed_extensions", "mediamanager") . ": '" . $strAllowedFileTypes . "'" : $strAllowedFileTypes; $arrTemplate["maxFileSize"] = $objConfig->getPhpMaxUploadSize(); $arrTemplate["acceptFileTypes"] = $strAllowedFileRegex != "" ? "/(\\.|\\/)(" . $strAllowedFileRegex . ")\$/i" : "''"; $arrTemplate["upload_multiple_errorFilesize"] = $objText->getLang("upload_multiple_errorFilesize", "mediamanager") . " " . bytesToString($objConfig->getPhpMaxUploadSize()); return $this->objTemplate->fillTemplate($arrTemplate, $strTemplateID); }