PHPIndex

This page lists files in the current directory. You can view content, get download/execute commands for Wget, Curl, or PowerShell, or filter the list using wildcards (e.g., `*.sh`).

idle.phtml
wget 'https://lists2.roe3.org/FreshRSS/app/views/stats/idle.phtml'
View Content
<?php
	declare(strict_types=1);
	/** @var FreshRSS_ViewStats $this */
	$this->partial('aside_subscription');
?>
<main class="post">
	<div class="link-back-wrapper">
		<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
	</div>

	<h1><?= _t('admin.stats.idle') ?></h1>

	<?php
		$current_url = Minz_Url::display(
			array('c' => 'stats', 'a' => 'idle'),
			'php', true
		);
		$nothing = true;
		foreach ($this->idleFeeds as $period => $feedsInPeriod) {
			if (!empty($feedsInPeriod)) {
				$nothing = false;
	?>
	<div class="box">
		<div class="box-title"><h2><?= _t('gen.date.' . $period) ?></h2></div>
			<ul class="box-content scrollbar-thin">
				<?php
					foreach ($feedsInPeriod as $feedInPeriod) {
						$feed = $this->feeds[$feedInPeriod['id']] ?? null;

						$error_class = '';
						$error_title = '';
						if ($feed === null || $feed->inError()) {
							$error_class = ' error';
							$error_title = _t('sub.feed.error');
						}

						$empty_class = '';
						$empty_title = '';
						if ($feed !== null && $feed->nbEntries() == 0) {
							$empty_class = ' empty';
							$empty_title = _t('sub.feed.empty');
						}
						$mute_class = ($feed !== null && $feed->mute()) ? ' mute' : '';
				?>
					<li class="item feed<?= $error_class, $empty_class, $mute_class ?>" title="<?= $error_title, $empty_title ?>">
						<a class="configure open-slider" href="<?= _url('stats', 'feed', 'id', $feedInPeriod['id'], 'sub', 'idle') ?>" title="<?= _t('gen.action.manage') ?>"><?= _i('configure') ?></a>
						<?php if (FreshRSS_Context::userConf()->show_favicons): ?><img class="favicon" src="<?= $feedInPeriod['favicon'] ?>" alt="✇" loading="lazy" /><?php endif; ?>
						<span title="<?= timestamptodate((int)($feedInPeriod['last_date']), false) ?>"><?= $feedInPeriod['name'] ?>
							(<?= _t('admin.stats.number_entries', $feedInPeriod['nb_articles']) ?>)</span>
					</li>
				<?php } ?>
			</ul>
	</div>
	<?php
			}
		}

		if ($nothing) {
	?>
	<p class="alert alert-warn">
		<span class="alert-head"><?= _t('admin.stats.no_idle') ?></span>
	</p>
	<?php } ?>
</main>

<?php $class = isset($this->feed) ? ' active' : ''; ?>
<aside id="slider" class="<?= $class ?>">
	<a class="toggle_aside" href="#close"><img class="icon" src="../themes/icons/close.svg" loading="lazy" alt="❌"></a>
	<div id="slider-content">
		<?php
		if (isset($this->feed)) {
			$this->renderHelper('feed/update');
		}
		?>
	</div>
</aside>
<a href="#" id="close-slider" class="<?= $class ?>">
	<?= _i('close') ?>
</a>
index.phtml
wget 'https://lists2.roe3.org/FreshRSS/app/views/stats/index.phtml'
View Content
<?php
	declare(strict_types=1);
	/** @var FreshRSS_ViewStats $this */
	$this->partial('aside_subscription');
?>
<main class="post">
	<div class="link-back-wrapper">
		<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
	</div>

	<h1><?= _t('admin.stats.main') ?></h1>

	<div class="stat-grid">
		<div class="stat half">
			<h2><?= _t('admin.stats.entry_repartition') ?></h2>
			<div class="table-wrapper scrollbar-thin">
				<table>
					<thead>
						<tr>
							<th> </th>
							<th><?= _t('admin.stats.main_stream') ?></th>
							<th><?= _t('admin.stats.all_feeds') ?></th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<th><?= _t('admin.stats.status_total') ?></th>
							<td class="numeric"><?= format_number($this->repartitions['main_stream']['total'] ?? -1) ?></td>
							<td class="numeric"><?= format_number($this->repartitions['all_feeds']['total'] ?? -1) ?></td>
						</tr>
						<tr>
							<th><?= _t('admin.stats.status_read') ?></th>
							<td class="numeric"><?= format_number($this->repartitions['main_stream']['count_reads'] ?? -1) ?></td>
							<td class="numeric"><?= format_number($this->repartitions['all_feeds']['count_reads'] ?? -1) ?></td>
						</tr>
						<tr>
							<th><?= _t('admin.stats.status_unread') ?></th>
							<td class="numeric"><?= format_number($this->repartitions['main_stream']['count_unreads'] ?? -1) ?></td>
							<td class="numeric"><?= format_number($this->repartitions['all_feeds']['count_unreads'] ?? -1) ?></td>
						</tr>
						<tr>
							<th><?= _t('admin.stats.status_favorites') ?></th>
							<td class="numeric"><?= format_number($this->repartitions['main_stream']['count_favorites'] ?? -1) ?></td>
							<td class="numeric"><?= format_number($this->repartitions['all_feeds']['count_favorites'] ?? -1) ?></td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>

		<div class="stat half">
			<h2><?= _t('admin.stats.top_feed') ?></h2>
			<div class="table-wrapper scrollbar-thin">
				<table>
					<thead>
						<tr>
							<th><?= _t('admin.stats.feed') ?></th>
							<th><?= _t('admin.stats.category') ?></th>
							<th><?= _t('admin.stats.entry_count') ?></th>
							<th><?= _t('admin.stats.percent_of_total') ?></th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($this->topFeed as $feed): ?>
							<tr>
								<td><a href="<?= _url('stats', 'repartition', 'id', $feed['id']) ?>"><?= $feed['name'] ?></a></td>
								<td><?= $feed['category'] ?></td>
								<td class="numeric"><?= format_number($feed['count']) ?></td>
								<td class="numeric"><?php
									if (!empty($this->repartitions['all_feeds']['total'])) {
										echo format_number($feed['count'] / $this->repartitions['all_feeds']['total'] * 100, 1);
									}
								?></td>
							</tr>
						<?php endforeach; ?>
					</tbody>
				</table>
			</div>
		</div>

		<div class="stat">
			<h2><?= _t('admin.stats.entry_per_day') ?></h2>
			<div>
				<canvas id="statsEntriesPerDay"></canvas>
				<script class="jsonData-stats" type="application/json">
				<?= json_encode([
					'canvasID' 		=> 'statsEntriesPerDay',
					'charttype' 	=> 'barWithAverage',
					'labelBarChart' => _t('admin.stats.entry_count'),
					'dataBarChart' 	=> $this->entryCount,
					'labelAverage' 	=> 'Average (' . $this->average . ')',
					'dataAverage' 	=> $this->average,
					'xAxisLabels' 	=> $this->last30DaysLabels,
				], JSON_UNESCAPED_UNICODE)
				?></script>
			</div>
		</div>

		<div class="stat half">
			<h2><?= _t('admin.stats.feed_per_category') ?></h2>
			<div>
				<canvas id="statsFeedsPerCategory"></canvas>
				<script class="jsonData-stats" type="application/json">
				<?php
				echo json_encode(array(
					'canvasID' 		=> 'statsFeedsPerCategory',
					'charttype' 	=> 'doughnut',
					'data' 			=> $this->feedByCategory['data'],
					'labels' 		=> $this->feedByCategory['label'],
				), JSON_UNESCAPED_UNICODE);
				?></script>
			</div>
		</div>

		<div class="stat half">
			<h2><?= _t('admin.stats.entry_per_category') ?></h2>
			<div>
				<canvas id="statsEntriesPerCategory"></canvas>
				<script class="jsonData-stats" type="application/json">
				<?php
				echo json_encode(array(
					'canvasID' 		=> 'statsEntriesPerCategory',
					'charttype' 	=> 'doughnut',
					'data' 			=> $this->entryByCategory['data'],
					'labels' 		=> $this->entryByCategory['label'],
				), JSON_UNESCAPED_UNICODE);
				?></script>
			</div>
		</div>
	</div>
</main>

<script src="../scripts/statsWithChartjs.js?<?= @filemtime(PUBLIC_PATH . '/scripts/statsWithChartjs.js') ?>"></script>
repartition.phtml
wget 'https://lists2.roe3.org/FreshRSS/app/views/stats/repartition.phtml'
View Content
<?php
	declare(strict_types=1);
	/** @var FreshRSS_ViewStats $this */
	$this->partial('aside_subscription');
?>
<main class="post ">
	<div class="link-back-wrapper">
		<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
	</div>

	<h1><?= _t('admin.stats.repartition') ?></h1>

	<select id="feed_select" class="select-change">
		<option data-url="<?= _url('stats', 'repartition') ?>"><?= _t('admin.stats.all_feeds') ?></option>
	<?php foreach ($this->categories as $category) {
		$feeds = $category->feeds();
		if (!empty($feeds)) {
			echo '<optgroup label="', $category->name(), '">';
			foreach ($feeds as $feed) {
				if ($this->feed && $feed->id() == $this->feed->id()) {
					echo '<option value="', $feed->id(), '" selected="selected" data-url="',
						_url('stats', 'repartition', 'id', $feed->id()), '">', $feed->name(), '</option>';
				} else {
					echo '<option value="', $feed->id(), '" data-url="',
						_url('stats', 'repartition', 'id', $feed->id()), '">', $feed->name(), '</option>';
				}
			}
			echo '</optgroup>';
		}
	}?>
	</select>

	<?php if ($this->feed) {?>
		<a class="btn" href="<?= _url('subscription', 'feed', 'id', $this->feed->id()) ?>">
			<?= _i('configure') ?> <?= _t('gen.action.manage') ?>
		</a>
	<?php }?>

	<div class="stat-grid">
		<div class="stat table-wrapper scrollbar-thin">
			<table>
			<tr>
				<th><?= _t('admin.stats.status_total') ?></th>
				<th><?= _t('admin.stats.status_read') ?></th>
				<th><?= _t('admin.stats.status_unread') ?></th>
				<th><?= _t('admin.stats.status_favorites') ?></th>
			</tr>
			<tr>
				<td class="numeric"><?= $this->repartition['total'] ?? -1 ?></td>
				<td class="numeric"><?= $this->repartition['count_reads'] ?? -1 ?></td>
				<td class="numeric"><?= $this->repartition['count_unreads'] ?? -1 ?></td>
				<td class="numeric"><?= $this->repartition['count_favorites'] ?? -1 ?></td>
			</tr>
			</table>
		</div>

		<div class="stat">
			<h2><?= _t('admin.stats.entry_per_hour', $this->averageHour) ?></h2>
			<div>
				<canvas id="statsEntriesPerHour"></canvas>
				<script class="jsonData-stats" type="application/json">
				<?php
				echo json_encode(array(
					'canvasID' 		=> 'statsEntriesPerHour',
					'charttype' 	=> 'bar',
					'data' 			=> $this->repartitionHour,
					'label' 		=> _t('admin.stats.entry_count'),
					'xAxisLabels' 	=> $this->hours24Labels
				), JSON_UNESCAPED_UNICODE);
				?></script>
			</div>
		</div>

		<div class="stat half">
			<h2><?= _t('admin.stats.entry_per_day_of_week', $this->averageDayOfWeek) ?></h2>
			<div>
				<canvas id="statsEntriesPerDayOfWeek"></canvas>
				<script class="jsonData-stats" type="application/json">
				<?php
				echo json_encode(array(
					'canvasID' 		=> 'statsEntriesPerDayOfWeek',
					'charttype' 	=> 'bar',
					'data' 			=> $this->repartitionDayOfWeek,
					'label' 		=> _t('admin.stats.entry_count'),
					'xAxisLabels' 	=> $this->days,
				), JSON_UNESCAPED_UNICODE);
				?></script>
			</div>
		</div>

		<div class="stat half">
			<h2><?= _t('admin.stats.entry_per_month', $this->averageMonth) ?></h2>
			<div>
				<canvas id="statsEntriesPerMonth"></canvas>
				<script class="jsonData-stats" type="application/json">
				<?php
				echo json_encode(array(
					'canvasID' 		=> 'statsEntriesPerMonth',
					'charttype' 	=> 'bar',
					'data' 			=> $this->repartitionMonth,
					'label' 		=> _t('admin.stats.entry_count'),
					'xAxisLabels' 	=> $this->months,
				), JSON_UNESCAPED_UNICODE);
				?></script>
			</div>
		</div>
	</div>
</main>

<script src="../scripts/statsWithChartjs.js?<?= @filemtime(PUBLIC_PATH . '/scripts/statsWithChartjs.js') ?>"></script>