Esempio n. 1
0
function help_and_nag()
{
    global $config;
    global $user;
    echo '<div id="helpbutton">';
    echo '<a href="wiki">Help</a>';
    if ($config[motd]) {
        echo "<br>" . $config[motd];
    }
    if ($user->info[total_size] > $config[good_share]) {
        null;
    } else {
        if ($user->info[total_size] <= $config[cut_off]) {
            if ($user->info[hit_count] != -1) {
                if ($user->info[hit_count] >= $config[max_hit] / 2 and $config[encourage] == true) {
                    if ($user->info[hit_count] < $config[max_hit]) {
                        echo '<br>' . ($config[max_hit] - $user->info[hit_count]) . ' searches before you must <a href="wiki/index.php?title=Sharing">share</a> to search';
                    } else {
                        echo '<br><a href="wiki/index.php?title=Sharing">Share</a> your files to use the search';
                    }
                }
                if ($config[encourage] == true) {
                    echo '<br><a href="search.php?show_hosts=true">Share size = ' . readable_size($user->info[total_size]) . '</a>';
                    if ($user->info[total_size] > 0) {
                        echo '. You need to share more';
                    }
                    echo '<br>Please share as much as you can';
                    if (time() - $user->info[last_seen] > 3 * 24 * 60 * 60) {
                        echo '<br><a href="wiki/index.php?title=Firewall">Your firewall is blocking your share</a>';
                    } else {
                        echo '<br>Firewall trouble? no';
                    }
                    echo '';
                }
                if ($config[encourage] == false) {
                    echo '<br>You are not <a href="wiki/index.php?title=Sharing">sharing</a>';
                }
            } else {
                echo '<br>Your share is low';
            }
        } else {
            echo '<br>Can you <a href="wiki/index.php?title=Sharing">share</a> more?';
        }
    }
    if ($user->info[total_size] > $config[cut_off] and $user->info[hit_count] > round($config[max_hit] / 2, 0)) {
        echo '<br>Thank you for sharing';
    }
    echo '</div>';
}
function fetch_event_resources_text($event_id = 0)
{
    global $db;
    $output = array();
    if ($event_id = (int) $event_id) {
        $query = "SELECT * FROM `event_files` WHERE `event_id` = " . $db->qstr($event_id);
        $results = $db->GetAll($query);
        if ($results) {
            $output["html"] = "";
            $output["text"] = "";
            $output["html"] .= "<table style=\"margin-top: 20px; width: 100%\" cellspacing=\"0\" cellpadding=\"3\" border=\"0\">\n";
            $output["html"] .= "<thead>\n";
            $output["html"] .= "\t<tr>\n";
            $output["html"] .= "\t\t<td style=\"background-color: #EEEEEE; border: 1px #666666 solid; font-weight: bold\">File Title</td>\n";
            $output["html"] .= "\t\t<td style=\"background-color: #EEEEEE; border: 1px #666666 solid; border-left: none; font-weight: bold\">Last Updated</td>\n";
            $output["html"] .= "\t</tr>\n";
            $output["html"] .= "</thead>\n";
            $output["html"] .= "<tbody>\n";
            foreach ($results as $result) {
                $output["html"] .= "<tr>\n";
                $output["html"] .= "\t<td>\n";
                $output["html"] .= "\t\t<a href=\"" . ENTRADA_URL . "/admin/events?section=content&id=" . $event_id . "\" title=\"Click to update " . html_encode($result["file_title"]) . "\" style=\"font-weight: bold\">" . html_encode($result["file_title"]) . "</a>";
                $output["html"] .= "\t\t<span class=\"content-small\">(" . readable_size($result["file_size"]) . ")</span>";
                $output["html"] .= "\t</td>\n";
                $output["html"] .= "\t<td>" . ((int) $result["updated_date"] ? date(DEFAULT_DATE_FORMAT, $result["updated_date"]) : "Over two years ago") . "</td>\n";
                $output["html"] .= "</tr>\n";
            }
            $output["html"] .= "</tbody>\n";
            $output["html"] .= "</table>\n";
            foreach ($results as $key => $result) {
                $output["text"] .= "   - " . $result["file_title"] . " (" . readable_size($result["file_size"]) . ")\n";
                $output["text"] .= "     Last Updated: " . ((int) $result["updated_date"] ? date(DEFAULT_DATE_FORMAT, $result["updated_date"]) : "Over two years ago") . "\n\n";
            }
        } else {
            $output["html"] .= "<div class=\"display-red\">\n";
            $output["html"] .= "<strong>There are no resources available for download.</strong>\n";
            $output["html"] .= "<br /><br />\n";
            $output["html"] .= "Please take a moment to upload any relevant documents by <a href=\"" . ENTRADA_URL . "/admin/events?section=content&id=" . $event_id . "\" style=\"font-weight: bold\">clicking here</a>.\n";
            $output["html"] .= "</div>\n";
            $output["text"] .= "   *There are no resources available for download.*\n\n";
            $output["text"] .= "   Please take a moment to upload any relevant documents at the following URL:\n";
            $output["text"] .= "   " . ENTRADA_URL . "/admin/events?section=content&id=" . $event_id . "\n\n";
        }
    }
    return $output;
}
 } else {
     $scmess4 = "<center><font color=DeepSkyBlue  >File";
 }
 print "<tr><td style=\"border:1px solid black\">";
 if (is_dir($nfiles)) {
     print "<font face= tahoma size=2 color=DeepSkyBlue  >[ {$nfiles}    ]<br>";
 } else {
     print "<font face= tahoma size=2 color=#dadada>{$nfiles} <br>";
 }
 print "</td>";
 print "<td style=\"border:1px solid black\">";
 print "<center><font face= tahoma size=2 color=#dadada>";
 if (is_dir("{$nscdir}/{$nfiles}")) {
     print "<b>K</b>Dir";
 } elseif (is_file("{$nscdir}/{$nfiles}")) {
     readable_size($scmess1);
 } else {
     print "---";
 }
 print "</td>";
 print "<td style=\"border:1px solid black\">";
 print "<center><font face= tahoma size=2 >{$scmess2}";
 print "</td>";
 print "<td style=\"border:1px solid black\">";
 print "<center><font face= tahoma size=2 >{$scmess3}";
 print "</td>";
 print "<td style=\"border:1px solid black\">";
 print "<center><font face= tahoma size=2 >{$scmess4}";
 print "</td>";
 print "<td style=\"border:1px solid black\">";
 if (is_file("{$nscdir}/{$nfiles}")) {
                                <h3 class="border-below">Podcast Upload Wizard</h3>
								<div id="body">
									<h2 id="step-title">Adding new podcast file</h2>
									<div id="step1">
										<div id="q1" class="wizard-question<?php 
                        echo in_array("q1", $ERRORSTR) ? " display-error" : "";
                        ?>
">
											<div style="font-size: 13px">Please select the podcast file to upload from your computer:</div>
											<div style="padding-left: 65px; padding-right: 10px; padding-top: 10px">
												<input type="file" id="filename" name="filename" value="" size="25" onchange="grabFilename()" /><br /><br />
												<?php 
                        if (isset($PROCESSED["file_name"]) && !in_array("q5", $ERRORSTR)) {
                            echo "<div class=\"display-notice\" style=\"margin-bottom: 0px\">Since there was an error in your previous request, you will need to re-select the local file from your computer in order to upload it. We apologize for the inconvenience; however, this is a security precaution.</div>";
                        } else {
                            echo "<span class=\"content-small\"><strong>Note:</strong> The maximum allowable filesize of a podcast is " . readable_size(MAX_UPLOAD_FILESIZE) . ".</span>";
                        }
                        ?>
											</div>
										</div>
										
										<div id="q2" class="wizard-question<?php 
                        echo in_array("q2", $ERRORSTR) ? " display-error" : "";
                        ?>
">
											<div style="font-size: 13px">You can <span style="font-style: oblique">optionally</span> provide a different title for this podcast.</div>
											<div style="padding-left: 65px; padding-right: 10px; padding-top: 10px">
												<label for="file_title" class="form-nrequired">File Title:</label> <span class="content-small"><strong>Example:</strong> Podcast Of Event 1</span><br />
												<input type="text" id="file_title" name="file_title" value="<?php 
                        echo isset($PROCESSED["file_title"]) ? html_encode($PROCESSED["file_title"]) : "";
                        ?>
Esempio n. 5
0
 #if Kleeja integtared we dont want make alot of queries
 $ids_and_names = array();
 while ($row = $SQL->fetch($result)) {
     //thumb ?
     $is_there_thumb = file_exists(PATH . $row['folder'] . '/thumbs/' . $row['name']) ? true : false;
     #for username in integrated user system
     if ($row['user'] != '-1' and (int) $config['user_system'] != 1) {
         if (!in_array($row['user'], $ids_and_names)) {
             $row['username'] = $usrcp->usernamebyid($row['user']);
             $ids_and_names[$row['user']] = $row['username'];
         } else {
             $row['username'] = $ids_and_names[$row['user']];
         }
     }
     #make a list of the images
     $images_list[$row['id']] = array('id' => $row['id'], 'tdnum' => $tdnum == 0 ? true : false, 'tdnum2' => $tdnum == 4 ? true : false, 'name' => $row['real_filename'] == '' ? strlen($row['name']) > 25 ? substr($row['name'], 0, 20) . '...' : $row['name'] : (strlen($row['real_filename']) > 20 ? str_replace('\'', "\\'", substr($row['real_filename'], 0, 20)) . '...' : str_replace('\'', "\\'", $row['real_filename'])), 'ip' => htmlspecialchars($row['user_ip']), 'href' => PATH . $row['folder'] . '/' . $row['name'], 'size' => readable_size($row['size']), 'ups' => $row['uploads'], 'time' => date('d-m-Y h:i a', $row['time']), 'user' => (int) $row['user'] == -1 ? $lang['GUST'] : $row['username'], 'is_user' => (int) $row['user'] == -1 ? 0 : 1, 'is_thumb' => $is_there_thumb, 'thumb_link' => $is_there_thumb ? PATH . $row['folder'] . '/thumbs/' . $row['name'] : PATH . $row['folder'] . '/' . $row['name']);
     //fix ...
     $tdnum = $tdnum == 4 ? 0 : $tdnum + 1;
     $del[$row['id']] = isset($_POST['del_' . $row['id']]) ? $_POST['del_' . $row['id']] : '';
     /*
     		//when submit !!
     		if (isset($_POST['submit']))
     		{
     			if ($del[$row['id']])
     			{
     				//delete from folder ..
     				@kleeja_unlink (PATH . $row['folder'] . '/' . $row['name']);
     				//delete thumb
     				if (file_exists(PATH . $row['folder'] . '/thumbs/' . $row['name'] ))
     				{
     					@kleeja_unlink (PATH . $row['folder'] . '/thumbs/' . $row['name'] );
Esempio n. 6
0
					<th><?php 
    echo $lang['SIZE'];
    ?>
</th>
				</tr>
				</thead>
				<!-- group list files -->
				<?php 
    foreach ($group_data['exts'] as $ext => $size) {
        ?>
					<tr>
						<td class="guide_ext_cell"><?php 
        echo $ext;
        ?>
</td>
						<td class="guide_size_cell"><?php 
        echo readable_size($size);
        ?>
</td>
					</tr>
				<?php 
    }
    ?>
				</table>
  </div>
</div>
<?php 
}
?>

					<tbody>
						<tr>
							<td colspan="3">
								<div id="file_list">
									<div id="file_1" class="file-upload">
										<table>
											<tr>
												<td colspan="3"><h2>File Details</h2></td>
											</tr>
											<tr>
												<td colspan="2" style="vertical-align: top"><label for="uploaded_file" class="form-required">Select Local File</label></td>
												<td style="vertical-align: top">
													<input type="file" id="uploaded_file_1" name="uploaded_file" onchange="fetchFilename(1)" />
													<div class="content-small" style="margin-top: 5px">
														<strong>Notice:</strong> You may upload files under <?php 
                    echo readable_size(MAX_UPLOAD_FILESIZE);
                    ?>
.
													</div>
												</td>
											</tr>
											<tr>
												<td colspan="3">&nbsp;</td>
											</tr>
											<tr>
												<td colspan="2"><label for="file_title" class="form-required">File Title</label></td>
												<td><input type="text" id="file_1_title" name="file_title" value="<?php 
                    echo isset($PROCESSED["file_title"]) ? html_encode($PROCESSED["file_title"]) : "";
                    ?>
" maxlength="64" style="width: 95%" /></td>
											</tr>
" />
								</td>
							</tr>
							<tr>
								<td colspan="3">&nbsp;</td>
							</tr>
							<tr>
								<td colspan="3"><h2>Photo Details</h2></td>
							</tr>
							<tr>
								<td colspan="2" style="vertical-align: top"><label for="photo_file" class="form-nrequired">Replacement Photo</label></td>
								<td style="vertical-align: top">
									<input type="file" id="photo_file" name="photo_file" onchange="fetchPhotoFilename()" />
									<div class="content-small" style="margin-top: 5px">
									<strong>Notice:</strong> You may upload JPEG, GIF or PNG images under <?php 
                        echo readable_size($VALID_MAX_FILESIZE);
                        ?>
 only and any image larger than <?php 
                        echo $VALID_MAX_DIMENSIONS["photo"];
                        ?>
px (width or height) will be automatically resized.
									</div>
								</td>
							</tr>
							<tr>
								<td colspan="3">&nbsp;</td>
							</tr>
							<tr>
								<td colspan="2"><label for="photo_title" class="form-required">Photo Title</label></td>
								<td><input type="text" id="photo_title" name="photo_title" value="<?php 
                        echo isset($PROCESSED["photo_title"]) ? html_encode($PROCESSED["photo_title"]) : "";
Esempio n. 9
0
File: go.php Progetto: omtim/kleeja
     }
     #stats of most online users
     if (empty($config['most_user_online_ever']) || trim($config['most_user_online_ever']) == '') {
         $most_online = 1;
         # 1 == you
         $on_muoe = time();
     } else {
         list($most_online, $on_muoe) = @explode(':', $config['most_user_online_ever']);
     }
     #page info
     $current_title = $lang['STATS'];
     $current_template = 'stats.php';
     $files_st = $stat_files;
     $imgs_st = $stat_imgs;
     $users_st = $stat_users;
     $sizes_st = readable_size($stat_sizes);
     $lst_reg = empty($stat_last_user) ? $lang['UNKNOWN'] : $stat_last_user;
     $on_muoe = kleeja_date($on_muoe);
     ($hook = kleeja_run_hook('stats_go_page')) ? eval($hook) : null;
     //run hook
     break;
     # Depreacted from 1rc6+, see do.php
 # Depreacted from 1rc6+, see do.php
 case 'down':
     #go.php?go=down&n=$1&f=$2&i=$3
     if (ig('n')) {
         $url_file = $config['mod_writer'] == 1 ? $config['siteurl'] . 'download' . g('i', 'int') . '.html' : $config['siteurl'] . 'do.php?id=' . g('n', 'int');
     } else {
         $url_file = $config['siteurl'];
     }
     $SQL->close();
Esempio n. 10
0
 echo "\t\t\t\t</div>\n";
 echo "\t\t\t</div>\n";
 echo "\t\t</td>\n";
 echo "\t</tr>\n";
 if ($total_releases > 1) {
     echo "<tr>\n";
     echo "\t<td>&nbsp;</td>\n";
     echo "\t<td style=\"padding-top: 15px\">\n";
     echo "\t\t<h2>Older Versions</h2>\n";
     echo "\t\t<div id=\"file-download-releases\">\n";
     echo "\t\t\t<ul>\n";
     foreach ($results as $progress => $result) {
         if ((int) $progress > 0) {
             // Because I don't want to display the first file again.
             echo "\t\t<li>\n";
             echo "\t\t\t<a href=\"" . COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-file&amp;id=" . $RECORD_ID . "&amp;download=" . $result["file_version"] . "\" style=\"vertical-align: middle\"" . ((int) $file_record["access_method"] ? " target=\"_blank\"" : "") . "><span id=\"file-version-" . $result["csfversion_id"] . "-title\">" . html_encode($result["file_filename"]) . " (v" . $result["file_version"] . ")</span></a> <span class=\"content-small\" style=\"vertical-align: middle\">" . readable_size($result["file_filesize"]) . "</span>\n";
             echo shares_file_version_module_access($result["csfversion_id"], "delete-revision") ? " (<a class=\"action\" href=\"javascript:revisionDelete('" . $result["csfversion_id"] . "')\">delete</a>)" : "";
             echo "\t\t\t<div class=\"content-small\">\n";
             echo "\t\t\tUploaded " . date(DEFAULT_DATE_FORMAT, $result["updated_date"]) . " by <a href=\"" . ENTRADA_URL . "/people?profile=" . html_encode($result["uploader_username"]) . "\" style=\"font-size: 10px; font-weight: normal\">" . html_encode($result["uploader"]) . "</a>.\n";
             echo "\t\t\t</div>\n";
             echo "\t\t</li>";
         }
     }
     echo "\t\t\t</ul>\n";
     echo "\t\t</div>\n";
     echo "\t</td>\n";
     echo "</tr>\n";
 }
 echo "</tbody>\n";
 echo "</table>\n";
 echo "<br /><br />";
Esempio n. 11
0
}
#set form ket
$GET_FORM_KEY = kleeja_add_form_key_get('REPAIR_FORM_KEY');
//check _GET Csrf token
if ($case && in_array($case, array('clearc', 'sync_files', 'sync_images', 'sync_users', 'tables', 'sync_sizes', 'status_file'))) {
    if (!kleeja_check_form_key_get('REPAIR_FORM_KEY')) {
        kleeja_admin_err($lang['INVALID_GET_KEY'], true, $lang['ERROR'], true, ADMIN_PATH, 2);
    }
}
switch ($case) {
    default:
        # Get real number from database right now
        $all_files = get_actual_stats('files');
        $all_images = get_actual_stats('imgs');
        $all_users = get_actual_stats('users');
        $all_sizes = readable_size(get_actual_stats('sizes'));
        #links
        $del_cache_link = ADMIN_PATH . '?cp=maintenance&amp;case=clearc&amp;' . $GET_FORM_KEY;
        $resync_files_link = $config['siteurl'] . 'go.php?go=resync&amp;case=sync_files';
        $resync_images_link = $config['siteurl'] . 'go.php?go=resync&amp;case=sync_images';
        $resync_users_link = ADMIN_PATH . '?cp=maintenance&amp;case=sync_users&amp;' . $GET_FORM_KEY;
        $resync_sizes_link = ADMIN_PATH . '?cp=maintenance&amp;case=sync_sizes&amp;' . $GET_FORM_KEY;
        $repair_tables_link = ADMIN_PATH . '?cp=maintenance&amp;case=tables&amp;' . $GET_FORM_KEY;
        $status_file_link = ADMIN_PATH . '?cp=maintenance&amp;case=status_file&amp;' . $GET_FORM_KEY;
        $current_template = "maintenance.php";
        break;
        // We, I mean developrts and support team anywhere, need sometime
        // some inforamtion about the status of Kleeja .. this will give
        // a zip file contain those data ..
    // We, I mean developrts and support team anywhere, need sometime
    // some inforamtion about the status of Kleeja .. this will give
Esempio n. 12
0
<section class="profile">
	<h5><?php 
echo __('global.profile');
?>
</h5>

	<?php 
foreach ($profile as $row) {
    ?>
	<p><code><?php 
    echo $row['sql'];
    ?>
</code></p>
	<?php 
}
?>

	<p><?php 
echo __('global.profile_memory_usage');
?>
	<?php 
echo readable_size(memory_get_peak_usage(true));
?>
</p>
</section>
Esempio n. 13
0
 if ($event_files) {
     foreach ($event_files as $result) {
         $filename = $result["file_name"];
         $parts = pathinfo($filename);
         $ext = $parts["extension"];
         echo "\t<tr id=\"file-" . $result["efile_id"] . "\">\n";
         echo "\t\t<td class=\"modified\" style=\"vertical-align: top\">" . ((int) $result["last_visited"] ? (int) $result["last_visited"] >= (int) $result["updated_date"] ? "<img src=\"" . ENTRADA_RELATIVE . "/images/accept.png\" width=\"16\" height=\"16\" alt=\"You have already downloaded the latest version.\" title=\"You have already downloaded the latest version.\" />" : "<img src=\"" . ENTRADA_RELATIVE . "/images/exclamation.png\" width=\"16\" height=\"16\" alt=\"This file has been updated since you have last downloaded it.\" title=\"This file has been updated since you have last downloaded it.\" />" : "") . "</td>\n";
         echo "\t\t<td class=\"file-category\" style=\"vertical-align: top\">" . (isset($RESOURCE_CATEGORIES["event"][$result["file_category"]]) ? html_encode($RESOURCE_CATEGORIES["event"][$result["file_category"]]) : "Unknown Category") . "</td>\n";
         echo "\t\t<td class=\"title\" style=\"vertical-align: top; white-space: normal; overflow: visible\">\n";
         echo "\t\t\t<img src=\"" . ENTRADA_RELATIVE . "/serve-icon.php?ext=" . $ext . "\" width=\"16\" height=\"16\" alt=\"" . strtoupper($ext) . " Document\" title=\"" . strtoupper($ext) . " Document\" style=\"vertical-align: middle\" />\n";
         if ((!(int) $result["release_date"] || $result["release_date"] <= time()) && (!(int) $result["release_until"] || $result["release_until"] >= time())) {
             echo "\t\t<a href=\"" . ENTRADA_RELATIVE . "/file-event.php?id=" . $result["efile_id"] . "\" title=\"Click to download " . html_encode($result["file_title"]) . "\" style=\"font-weight: bold\"" . ((int) $result["access_method"] ? " target=\"_blank\"" : "") . ">" . html_encode($result["file_title"]) . "</a>";
         } else {
             echo "\t\t<span style=\"color: #666666; font-weight: bold\">" . html_encode($result["file_title"]) . "</span>";
         }
         echo "\t\t\t<span class=\"content-small\">(" . readable_size($result["file_size"]) . ")</span>";
         echo "\t\t\t<div class=\"content-small\" style=\"margin-top: 3px; margin-bottom: 5px\">\n";
         if ((int) $result["release_date"] && $result["release_date"] > time()) {
             echo "\t\tThis file will be available for downloading <strong>" . date(DEFAULT_DATE_FORMAT, $result["release_date"]) . "</strong>.<br /><br />";
         } elseif ((int) $result["release_until"] && $result["release_until"] < time()) {
             echo "\t\tThis file was only available for download until <strong>" . date(DEFAULT_DATE_FORMAT, $result["release_until"]) . "</strong>. Please contact the primary teacher for assistance if required.<br /><br />";
         }
         if (clean_input($result["file_notes"], array("notags", "nows")) != "") {
             echo "\t\t" . trim(strip_selected_tags($result["file_notes"], array("font"))) . "\n";
         }
         echo "\t\t\t</div>\n";
         echo "\t\t</td>\n";
         echo "\t\t<td class=\"date\" style=\"vertical-align: top\">" . ((int) $result["updated_date"] ? date(DEFAULT_DATE_FORMAT, $result["updated_date"]) : "Unknown") . "</td>\n";
         echo "\t</tr>\n";
     }
 } else {
Esempio n. 14
0
            ?>
</a>

								<div class="fileinfo">
								<span><?php 
            echo $lang['FILEUPS'];
            ?>
: <?php 
            echo $file['uploads'];
            ?>
</span>
								<span><?php 
            echo $lang['FILESIZE'];
            ?>
: <?php 
            echo readable_size($file['size']);
            ?>
</span>
								<span><?php 
            echo $lang['FILEDATE'];
            ?>
: <?php 
            echo kleeja_date($file['time']);
            ?>
</span>
								</div>
							</div>
						</div>
					<?php 
        }
        ?>
Esempio n. 15
0
                            <li>Original size: <?php 
    echo readable_size(strlen($process_data['source']));
    ?>
 (<?php 
    echo strlen(gzencode($process_data['source'], 9));
    ?>
 bytes gzipped)</li>
                            <li>Final size: <?php 
    echo readable_size(strlen($process_data['css']));
    ?>
 (<?php 
    echo strlen(gzencode($process_data['css'], 9));
    ?>
 bytes gzipped)</li>
                            <li>Difference: <strong><?php 
    printf('%s (%+g%%)', readable_size(strlen($process_data['css']) - strlen($process_data['source']), true), round(strlen($process_data['css']) / strlen($process_data['source']) * 100, 2));
    ?>
</strong></li>
                        </ul>
                        <ul>
                            <li>Duration: <?php 
    echo readable_time($process_data['execution_time']);
    ?>
</li>
                        </ul>
                    </div>     
                <?php 
}
?>
            </div>
            <div id="submit">
Esempio n. 16
0
"></div>
													<script type="text/javascript">
														new Control.ProgressBar('community-usage').setProgress('<?php 
                            echo $percent > 100 ? 100 : $percent;
                            ?>
');
													</script>
												</td>
											</tr>
											<tr>
												<td colspan="2">&nbsp;</td>
												<td><span class="content-small"><strong>Usage:</strong> <?php 
                            echo $percent;
                            ?>
% or <?php 
                            echo readable_size($community_details["storage_usage"]) . " of " . readable_size($community_details["storage_max"]);
                            ?>
</span></td>
											</tr>
											<tr>
												<td colspan="3">&nbsp;</td>
											</tr>
											<?php 
                        }
                        ?>
										<tr>
											<td><?php 
                        echo help_create_button("Community Administrators", "community-community_admistrators");
                        ?>
</td>
											<td><span class="form-nrequired">Community Administrators</span></td>
Esempio n. 17
0
print "<td width=5% style=\"border:1px solid black\">";print "<center><b>Type";print "</td>"; 
print "<td width=5% style=\"border:1px solid black\">";print "<center><b>Edit";print "</td>";
print "<td width=5% style=\"border:1px solid black\">";print "<center><b>Rename";print "</td>";
print "<td width=6% style=\"border:1px solid black\">";print "<center><b>Download";print "</td>";if(strstr(PHP_OS,"Linux")){
print "<td width=8% style=\"border:1px solid black\">";print "<center><b>Owner";print "</td>";}
print "<td width=8% style=\"border:1px solid black\">";print "<center><b>Permission";print "</td></tr>"; foreach ($files as $nfiles){ 
if (is_file("$nscdir/$nfiles")){ $scmess1=filesize("$nscdir/$nfiles");}
if (is_writable("$nscdir/$nfiles")){ 
$scmess2= "<center><font color=DeepSkyBlue  >yes";}else {$scmess2="<center><font color=red>Hayir";}if (is_readable("$nscdir/$nfiles")){ 
$scmess3= "<center><font color=DeepSkyBlue  >yes";}else {$scmess3= "<center><font color=red>Hayir";}if (is_dir("$nscdir/$nfiles")){$scmess4= "<font color=red><center>Dir";}else{$scmess4= "<center><font color=DeepSkyBlue  >File";} 
print"<tr><td style=\"border:1px solid black\">"; 
if (is_dir($nfiles)){print "<font face= tahoma size=2 color=DeepSkyBlue  >[ $nfiles    ]<br>";}else {print "<font face= tahoma size=2 color=#dadada>$nfiles <br>";}
print"</td>"; print "<td style=\"border:1px solid black\">"; 
print "<center><font face= tahoma size=2 color=#dadada>";
if (is_dir("$nscdir/$nfiles")){print "<b>K</b>Dir";}
elseif(is_file("$nscdir/$nfiles")){readable_size($scmess1);}else {print "---";}
print "</td>"; print "<td style=\"border:1px solid black\">"; 
print "<center><font face= tahoma size=2 >$scmess2"; print "</td>"; 
print"<td style=\"border:1px solid black\">"; 
print "<center><font face= tahoma size=2 >$scmess3"; print "</td>"; 
print "<td style=\"border:1px solid black\">"; 
print "<center><font face= tahoma size=2 >$scmess4"; print"</td>";
print "<td style=\"border:1px solid black\">";if(is_file("$nscdir/$nfiles")){
print " <center><a href=".inclink('dlink', 'edit')."&edit=$nfiles&scdir=$nscdir>Edit</a>";}else {print "<center><font face=tahoma size=2 color=gray>Düzenle</center>";}print"</td>";  print "<td style=\"border:1px solid black\">";print " <center><a href=".inclink('dlink', 'ren')."&ren=$nfiles&scdir=$nscdir>Rename</a>";print"</td>";print "<td style=\"border:1px solid black\">";
if(is_file("$nscdir/$nfiles")){
print " <center><a href=".inclink('dlink', 'dwld')."&dwld=$nfiles&scdir=$nscdir>Download</a>";}else {print "<center><font face=tahoma size=2 color=gray>indir</center>";}print"</td>"; if(strstr(PHP_OS,"Linux")){
print "<td style=\"border:1px solid black\">";
print "<center><font face=tahoma size=2 color=#dadada>";owgr($nfiles);
print "</center>";print"</td>";} 
print "<td style=\"border:1px solid DeepSkyBlue  \">";print "<center><div>";
permcol("$nscdir/$nfiles");print "</div>";print"</td>"; print "</tr>"; 
Esempio n. 18
0
     $num = 0;
     #if Kleeja is integtared with other user system,  we dont want make alot of queries
     $ids_and_names = $files_list = array();
     while ($row = $SQL->fetch($result)) {
         $userfile = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $row['user'] . '.html' : 'ucp.php?go=fileuser&amp;id=' . $row['user']);
         #for username from integrated user system
         if ($row['user'] != '-1' and (int) $config['user_system'] != 1) {
             if (!in_array($row['user'], $ids_and_names)) {
                 $row['username'] = $usrcp->usernamebyid($row['user']);
                 $ids_and_names[$row['user']] = $row['username'];
             } else {
                 $row['username'] = $ids_and_names[$row['user']];
             }
         }
         #files array
         $files_list[$row['id']] = array('id' => $row['id'], 'name' => "<a title=\" " . ($row['real_filename'] == '' ? $row['name'] : $row['real_filename']) . "\" href=\"./" . PATH . $row['folder'] . "/" . $row['name'] . "\" target=\"blank\">" . ($row['real_filename'] == '' ? strlen($row['name']) > 20 ? substr($row['name'], 0, 20) . '...' : $row['name'] : (strlen($row['real_filename']) > 20 ? substr($row['real_filename'], 0, 20) . '...' : $row['real_filename'])) . "</a>", 'size' => readable_size($row['size']), 'ups' => $row['uploads'], 'direct' => $row['id_form'] == 'direct' ? true : false, 'time_human' => kleeja_date($row['time']), 'time' => kleeja_date($row['time'], false), 'type' => $row['type'], 'typeicon' => file_exists(PATH . "images/filetypes/" . $row['type'] . ".png") ? PATH . "images/filetypes/" . $row['type'] . ".png" : PATH . 'images/filetypes/file.png', 'folder' => $row['folder'], 'report' => $row['report'] > 4 ? "<span style=\"color:red;font-weight:bold\">" . $row['report'] . "</span>" : $row['report'], 'user' => $row['user'] == '-1' ? $lang['GUST'] : '<a href="' . $userfile . '" target="_blank">' . $row['username'] . '</a>', 'ip' => '<a href="http://www.ripe.net/whois?form_type=simple&amp;full_query_string=&amp;searchtext=' . $row['user_ip'] . '&amp;do_search=Search" target="_new">' . $row['user_ip'] . '</a>', 'showfilesbyip' => ADMIN_PATH . '?cp=h_search&amp;s_input=1&amp;s_value=' . $row['user_ip']);
         $del[$row['id']] = isset($_POST['del_' . $row['id']]) ? $_POST['del_' . $row['id']] : '';
     }
     $SQL->free($result);
 } else {
     //no result ..
     $no_results = true;
 }
 #update f_lastvisit
 if (!$is_search) {
     if (filter_exists('f_lastvisit', 'filter_uid')) {
         update_filter('f_lastvisit', time());
     } else {
         insert_filter('lastvisit', time(), false, false, '', 'f_lastvisit');
     }
 }
Esempio n. 19
0
 /** @test */
 function it_registers_readable_size_helper()
 {
     $this->assertEquals('1 kB', readable_size(1024));
 }
Esempio n. 20
0
 /**
  * Processing current upload, aka 'after user click upload button to upload his files'
  *
  * @param bool $just_check If enabled, no uploading will occur, just checking process 
  */
 public function process($just_check = false)
 {
     global $SQL, $dbprefix, $config, $lang;
     ($hook = kleeja_run_hook('process_func_uploading_cls')) ? eval($hook) : null;
     //run hook
     #To prevent flooding, user must wait, waiting-time is grapped from Kleeja settings, admin is exceptional
     if (!user_can('enter_acp') && user_is_flooding()) {
         return $this->errors[] = sprintf($lang['YOU_HAVE_TO_WAIT'], $config['usersectoupload']);
     }
     #if captcha enabled
     if ($config['safe_code']) {
         #captcha is wrong
         if (!kleeja_check_captcha()) {
             return $this->errors[] = $lang['WRONG_VERTY_CODE'];
         }
     }
     #files uploading
     $files = rearrange_files_input($_FILES['file']);
     if (empty($files)) {
         $this->errors[] = $lang['CHOSE_F'];
     }
     foreach ($files as $file) {
         #if total uploaded files reached the limit
         if ($this->total >= $config['filesnum']) {
             break;
         }
         #no file content
         if (empty($file['tmp_name'])) {
             continue;
         }
         #filename without extension?
         if (strpos($file['name'], '.') === false) {
             #TODO: try to figure out the extension for popular files
             $this->errors[] = sprintf($lang['WRONG_F_NAME'], htmlspecialchars($file['name']));
             continue;
         }
         #clean filename, what about other language?
         $filename = strtr($file['name'], 'ŠŽšžŸÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ', 'SZszYAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy');
         $filename = preg_replace(array('/\\s/', '/\\.[\\.]+/', '/[^\\w_\\.\\-]/'), array('_', '.', ''), strtolower($filename));
         #get the extension and the right filename
         $file_extension = strtolower(substr($filename, strrpos($filename, '.') + 1));
         $filename = str_replace('.', '_', substr($filename, 0, strrpos($filename, '.')));
         #if file extension is not allowed?
         if (!in_array($file_extension, array_keys($this->allowed_extensions))) {
             $this->errors[] = sprintf($lang['FORBID_EXT'], $file_extension);
             continue;
         }
         #file check for first 265 content
         if (check_file_content($file['tmp_name']) == false && !$just_check) {
             $this->errors[] = sprintf($lang['NOT_SAFE_FILE'], $filename);
             continue;
         }
         #file size exceed allowed one
         if ($this->allowed_extensions[$file_extension] > 0 && $file['size'] >= $this->allowed_extensions[$file_extension]) {
             $this->errors[] = sprintf($lang['SIZE_F_BIG'], htmlspecialchars($file_extension['name']), readable_size($this->allowed_extensions[$file_extension]));
             continue;
         }
         #modify filename to apply Admin changes
         $filename = change_filename($file['name'], $file_extension);
         ($hook = kleeja_run_hook('uploading_process_func_loop_files')) ? eval($hook) : null;
         //run hook
         #if this is listed as live-ext from Kleeja settings
         $live_exts = array_map('trim', explode(',', $config['imagefolderexts']));
         $folder_to_upload = $this->uploading_folder;
         if (in_array($file_extension, $live_exts)) {
             # live-exts folder, if empty use default folder
             $folder_to_upload = trim($config['imagefolder']) == '' ? trim($config['foldername']) : $this->uploading_folder;
         }
         #is this file an image?
         $is_img = in_array($file_extension, array('png', 'gif', 'jpg', 'jpeg')) ? true : false;
         #now upload
         $upload_result = move_uploaded_file($file['tmp_name'], $folder_to_upload . '/' . $filename);
         #if uploading went ok
         if ($upload_result && !$just_check) {
             #sometime can nott see the file after uploading without this fix
             @chmod($folder . '/' . $filename, 0644);
             #generate delete code
             $delete_code = md5($filename . uniqid());
             #insert to the DB
             $insert_id = $this->add_to_database($filename, $folder_to_upload, $file['size'], $file_extension, $file['name'], $delete_code);
             #if insertion goes bad, rollback, delete the file and show error
             if (!$insert_id) {
                 @unlink($folder . '/' . $filname);
                 $this->errors[] = sprintf($lang['CANT_UPLAOD'], $filename);
                 continue;
             }
             # inforamation of file, used for generating a url boxes
             $file_info = array('::ID::' => $insert_id, '::NAME::' => $filename, '::DIR::' => $folder_to_upload, '::FNAME::' => $file['name'], '::EXT::' => $file_extension, '::CODE::' => $delete_code);
             #if image
             if ($is_img) {
                 # generate thumb always
                 create_thumb($folder_to_upload . '/' . $filename, $file_extension, $folder_to_upload . '/thumbs/' . $filename, $this->thumb_dimensions['width'], $this->thumb_dimensions['height']);
                 #show thumb if enabled
                 if ($config['thumbs_imgs']) {
                     $this->results[$insert_id]['thumb'] = kleeja_get_link('thumb', $file_info);
                 }
                 #if watermark enabled
                 if ($config['write_imgs']) {
                     create_watermark($folder_to_upload . '/' . $filename, $file_extension);
                 }
                 $this->results[$insert_id]['image'] = kleeja_get_link('image', $file_info);
             } else {
                 $this->results[$insert_id]['file'] = kleeja_get_link('file', $file_info);
             }
             #if delete code is enabled to be displayed
             if ($config['del_url_file']) {
                 $this->results[$insert_id]['delete_code'] = kleeja_get_link('del', $file_info);
             }
             #uploaded files increment++
             $this->total++;
         } else {
             $this->errors[] = sprintf($lang['CANT_UPLAOD'], $filename);
         }
     }
     #end-foreach
     #total files equal zero, then show a message to tell user to select files
     if ($this->total == 0 && !sizeof($this->errors)) {
         $this->errors[] = $lang['CHOSE_F'];
     }
 }
Esempio n. 21
0
</strong>
									</a>
							<?php 
                        } else {
                            ?>
									<span class="content-small">
										<strong><?php 
                            echo html_encode($result["file_title"]);
                            ?>
</strong>
									</span>
							<?php 
                        }
                        ?>
									<span class="content-small">(<?php 
                        echo readable_size($result["file_size"]);
                        ?>
)</span>
										<div class="content-small space-above">
							<?php 
                        if ((int) $result["valid_from"] && $result["valid_from"] > time()) {
                            ?>
											This file will be available for downloading <strong><?php 
                            echo date(DEFAULT_DATE_FORMAT, $result["valid_from"]);
                            ?>
</strong>.
							<?php 
                        } elseif ((int) $result["valid_until"] && $result["valid_until"] < time()) {
                            ?>
											This file was only available for download until <strong><?php 
                            echo date(DEFAULT_DATE_FORMAT, $result["valid_until"]);
												</div>
											</div>
	
											<div id="step3" style="display: none">
												<div id="q5" class="wizard-question<?php 
                                echo in_array("q5", $ERRORSTR) ? " display-error" : "";
                                ?>
">
													<div style="font-size: 14px">Please select the file to upload from your computer:</div>
													<div style="padding-left: 65px; padding-right: 10px; padding-top: 10px">
														<input type="file" id="filename" name="filename" value="" size="25" onchange="grabFilename()" /><br /><br />
														<?php 
                                if (isset($PROCESSED["file_name"]) && !in_array("q5", $ERRORSTR)) {
                                    echo "<div class=\"display-notice\" style=\"margin-bottom: 0px\">Since there was an error in your previous request, you will need to re-select the local file from your computer in order to upload it. We apologize for the inconvenience; however, this is a security precaution.</div>";
                                } else {
                                    echo "<span class=\"content-small\"><strong>Notice:</strong> The maximum filesize of this file must be less than " . readable_size(MAX_UPLOAD_FILESIZE) . ". If this file is larger than " . readable_size(MAX_UPLOAD_FILESIZE) . ", you will need to either compress it or split the file up into smaller files, otherwise the upload will fail.</span>";
                                }
                                ?>
													</div>
												</div>
												<div id="q6" class="wizard-question<?php 
                                echo in_array("q6", $ERRORSTR) ? " display-error" : "";
                                ?>
">
													<div style="font-size: 14px">You can <span style="font-style: oblique">optionally</span> provide a different title for this file.</div>
													<div style="padding-left: 65px; padding-right: 10px; padding-top: 10px">
														<label for="file_title" class="form-required">File Title:</label> <span class="content-small"><strong>Example:</strong> Video Of Procedure 1</span><br />
														<input type="text" id="file_title" name="file_title" value="<?php 
                                echo isset($PROCESSED["file_title"]) ? html_encode($PROCESSED["file_title"]) : "";
                                ?>
" maxlength="128" style="width: 350px;" />
Esempio n. 23
0
    exit;
}
#hook to use it for start page, also there is a hook at admin/index.php that you
#can use it with all includes/adm files, just hook your codes and go...
($hook = $plugin->run_hook('default_admin_page')) ? eval($hook) : null;
//run hook
#page info
$current_template = 'start.php';
$h_lst_files = ADMIN_PATH . '?cp=files&amp;last_visit=';
$h_lst_imgs = ADMIN_PATH . '?cp=images&amp;last_visit=';
$current_smt = isset($_GET['smt']) ? preg_match('![a-z0-9_]!i', trim($_GET['smt'])) ? trim($_GET['smt']) : 'general' : 'general';
$GET_FORM_KEY = kleeja_add_form_key_get('adm_start_actions');
# current kleeja data
$lst_reg = empty($stat_last_user) ? $lang['UNKNOWN'] : $stat_last_user;
$files_number = $stat_files + $stat_imgs;
$files_sizes = readable_size($stat_sizes);
$users_number = $stat_users;
# other info about php, mysql, php.ini
$php_version = isset($NO_PHPINFO) || !function_exists('phpinfo') ? phpversion() : 'php ' . phpversion();
$mysql_version = 'MYSQL ' . $SQL->version();
$file_uploads_ini = function_exists('ini_get') ? @ini_get('file_uploads') : @get_cfg_var('file_uploads');
$max_file_uploads_ini = function_exists('ini_get') ? @ini_get('max_file_uploads') : @get_cfg_var('max_file_uploads');
$upload_max_filesize = function_exists('ini_get') ? @ini_get('upload_max_filesize') : @get_cfg_var('upload_max_filesize');
$post_max_size = function_exists('ini_get') ? @ini_get('post_max_size') : @get_cfg_var('post_max_size');
$max_execution_time = function_exists('ini_get') ? @ini_get('max_execution_time') : @get_cfg_var('max_execution_time');
$memory_limit = function_exists('ini_get') ? @ini_get('memory_limit') : @get_cfg_var('memory_limit');
$s_last_google = $stat_last_google == 0 ? '[ ? ]' : kleeja_date($stat_last_google);
$s_google_num = $stat_google_num;
$s_last_bing = $stat_last_bing == 0 ? '[ ? ]' : kleeja_date($stat_last_bing);
$s_bing_num = $stat_bing_num;
$usernamelang = sprintf($lang['KLEEJA_CP_W'], $user->data['name']);
Esempio n. 24
0
 echo "\t\t\t\t</div>\n";
 echo "\t\t\t</div>\n";
 echo "\t\t</td>\n";
 echo "\t</tr>\n";
 if ($total_releases > 1) {
     echo "<tr>\n";
     echo "\t<td>&nbsp;</td>\n";
     echo "\t<td style=\"padding-top: 15px\">\n";
     echo "\t\t<h2>Older Versions</h2>\n";
     echo "\t\t<div id=\"file-download-releases\">\n";
     echo "\t\t\t<ul>\n";
     foreach ($results as $progress => $result) {
         if ((int) $progress > 0) {
             // Because I don't want to display the first file again.
             echo "\t\t<li>\n";
             echo "\t\t\t<a href=\"" . ENTRADA_URL . "/profile/gradebook/assignments?section=view&amp;file_id=" . $TEACHER_FILE_RECORD . "&amp;assignment_id=" . $RECORD_ID . "&amp;" . (isset($iscontact) && $iscontact ? "pid=" . $USER_ID . "&amp;" : "") . "download=" . $result["file_version"] . "\" style=\"vertical-align: middle\" target=\"_blank\"><span id=\"file-version-" . $result["afversion_id"] . "-title\">" . html_encode($result["file_filename"]) . " (v" . $result["file_version"] . ")</span></a> <span class=\"content-small\" style=\"vertical-align: middle\">" . readable_size($result["file_filesize"]) . "</span>\n";
             if ($result["proxy_id"] == $ENTRADA_USER->getID()) {
                 echo "\t\t\t(<a class=\"action delete-version\" id=\"delete_" . $result["afversion_id"] . "\" href=\"javascript:void(0)\">delete</a>)";
             }
             echo "\t\t\t<div class=\"content-small\">\n";
             echo "\t\t\tUploaded " . date(DEFAULT_DATE_FORMAT, $result["updated_date"]) . " by <a href=\"" . ENTRADA_URL . "/people?profile=" . html_encode($result["uploader_username"]) . "\" style=\"font-size: 10px; font-weight: normal\">" . html_encode($result["uploader"]) . "</a>.\n";
             echo "\t\t\t</div>\n";
             echo "\t\t</li>";
         }
     }
     echo "\t\t\t</ul>\n";
     echo "\t\t</div>\n";
     echo "\t</td>\n";
     echo "</tr>\n";
 }
 echo "</tbody>\n";