use an array for warnings in admin panel

This commit is contained in:
Tobias Diekershoff 2016-11-20 16:14:09 +01:00
parent 59c12db020
commit b03009d962
2 changed files with 5 additions and 3 deletions

View file

@ -431,10 +431,10 @@ function admin_page_summary(&$a) {
// are there MyISAM tables in the DB? If so, trigger a warning message // are there MyISAM tables in the DB? If so, trigger a warning message
$r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine`='myisam' LIMIT 1"); $r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine`='myisam' LIMIT 1");
$showwarning = false; $showwarning = false;
$warningtext = ""; $warningtext = array();
if (dbm::is_result($r)) { if (dbm::is_result($r)) {
$showwarning = true; $showwarning = true;
$warningtext = sprintf(t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the <tt>convert_innodb.sql</tt> in the <tt>/util</tt> directory of your Friendica installation.<br />'), 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html'); $warningtext[] = sprintf(t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the <tt>convert_innodb.sql</tt> in the <tt>/util</tt> directory of your Friendica installation.<br />'), 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
} }
$r = q("SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` GROUP BY `page-flags`"); $r = q("SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` GROUP BY `page-flags`");
$accounts = array( $accounts = array(

View file

@ -3,7 +3,9 @@
<h1>{{$title}} - {{$page}}</h1> <h1>{{$title}} - {{$page}}</h1>
{{if $showwarning}} {{if $showwarning}}
<div id="admin-warning-message-wrapper"> <div id="admin-warning-message-wrapper">
<p id="admin-warning-message" class="warning-message">{{$warningtext}}</p> {{foreach $warningtext as $wt}}
<p class="warning-message">{{$wt}}</p>
{{/foreach}}
</div> </div>
{{/if}} {{/if}}