Page 1 of 1

systeminfo and statsonindex hide info

Posted: Sun Oct 07, 2018 9:19 pm
by Sniper_E
I added a function to hide the info in these two extensions. Then added code to the html templates.

statsonindex/styles/prosilver/template/event/overall_footer_after.html

Code: Select all

<!-- IF not S_IS_BOT and S_USER_LOGGED_IN -->
	<script>function toggle_stat_display() { var x = document.getElementById('stat-display'); if (x.style.display === 'none') { x.style.display = 'block';document.getElementById('stat-display-toggle').title = '{L_COLLAPSE_VIEW}'; } else { x.style.display = 'none';document.getElementById('stat-display-toggle').title = '{L_EXPAND_VIEW}'; } }</script>
<!-- ENDIF -->
statsonindex/styles/prosilver/template/event/index_body_stat_blocks_after.html

Code: Select all

<!-- IF not S_IS_BOT and S_USER_LOGGED_IN and NEWEST_USER -->
<div class="stat-block statisticsonindex">
	<h3><a id="stat-display-toggle" onclick="toggle_stat_display();" style="cursor: pointer" title="{L_EXPAND_VIEW}"><i class="icon fa-bar-chart fa-fw" aria-hidden="true"></i>{L_STATISTICS}</a></h3>
	<p id="stat-display" style="display: none">
	<!-- EVENT index_body_block_stats_prepend -->
	{TOTAL_POSTS} &bull; {POSTS_PER_YEAR} &bull; {POSTS_PER_DAY} &bull; {POSTS_PER_TOPIC} &bull; {POSTS_PER_USER}<br />
	{TOTAL_TOPICS} &bull; {TOPICS_PER_YEAR} &bull; {TOPICS_PER_DAY} &bull; {TOPICS_PER_USER}<br />
	{TOTAL_FILES} &bull; {FILES_PER_YEAR} &bull; {FILES_PER_DAY} &bull; {FILES_PER_USER}<br />
	{TOTAL_USERS} &bull; {USERS_PER_YEAR} &bull; {USERS_PER_DAY} &bull; {NEWEST_USER}<br />
	{L_START_DATE}	<strong>{START_DATE}</strong>
	<!-- EVENT index_body_block_stats_append -->
	</p>
</div>
<!-- ENDIF -->
systeminfo/styles/prosilver/template/event/overall_footer_after.html

Code: Select all

<!-- IF not S_IS_BOT and S_USER_LOGGED_IN -->
	<script>function toggle_system_display() { var x = document.getElementById('system-display'); if (x.style.display === 'none') { x.style.display = 'block';document.getElementById('system-display-toggle').title = '{L_COLLAPSE_VIEW}'; } else { x.style.display = 'none';document.getElementById('system-display-toggle').title = '{L_EXPAND_VIEW}'; } }</script>
<!-- ENDIF -->
systeminfo/styles/prosilver/template/event/index_body_stat_blocks_after.html

Code: Select all

<!-- IF not S_IS_BOT and S_USER_LOGGED_IN -->
<div id="system-info" class="stat-block">
	<h3><a id="system-display-toggle" onclick="toggle_system_display();" style="cursor: pointer" title="{L_EXPAND_VIEW}"><i class="icon fa-info-circle fa-fw" aria-hidden="true"></i>{L_SYSTEM_INFO}</a></h3>
	<p id="system-display" style="display: none">
		{L_SYSTEM_NAME}{L_COLON} <strong>{PHP_OS}-Debian 9-streatch</strong><br />{L_PHP_VERSION}: <strong>7.2.9</strong> &bull; {L_SYSTEM_SQL}{L_COLON} <strong>10.1.26</strong> &bull; {L_BOARD_VERSION}{L_COLON} <strong>phpBB {BOARD_VERSION}</strong><br />
		{L_SYSTEM_UPTIME}{L_COLON} <strong>{UPTIME_DAYS}</strong> {L_SYSTEM_DAYS} <strong>{UPTIME_HOURS}</strong> {L_SYSTEM_HOURS} <strong>{UPTIME_MINS}</strong> {L_SYSTEM_MIN} <strong>{UPTIME_SECS}</strong> {L_SYSTEM_SECS} &bull; {L_SYSTEM_LOAD} <strong>{AVG_LOAD0}</strong> ~ <strong>{AVG_LOAD1}</strong> ~ <strong>{AVG_LOAD2}</strong>
	</p>
</div>
<!-- ENDIF -->
Check it out on the index page... :cool: