Anyway to alert Admins in the front pages that there are things requiring attention in AdminCP?

ShikiSuen

Well-known member
I tried this one but it doesn't work:
XML:
<xf:if is="$xf.visitor.hasAdminPermission('viewLogs') && $serverErrorLogs">
    <div>ALERT!!!</div>
</xf:if>

Also I tried this one into the condition, but it fails the template mod submission:

XML:
<xf:if is="$upgradeCheck OR $showUnicodeWarning OR {$xf.visitor.hasAdminPermission('style') && $outdatedTemplates} OR {$xf.visitor.hasAdminPermission('viewLogs') && $serverErrorLogs} OR {$xf.visitor.hasAdminPermission('addOn') && $hasProcessingAddOn} OR $legacyConfig OR $hasStoppedManualJobs OR $requirementErrors">
    <div>ALERT!!!</div>
</xf:if>
 
I like this idea, their should be some sort of counting alert which indicate any pending matter in ACP, so we may log in to ACP earlier then usual.
 
ShikiSuen said:
Unfortunately, it appeared to be that some variables like $serverErrorLogs may be available to AdminCP templates only.

Their may be some sort of bridge will do the work?
 
Thanks to the moderator for helping me move the thread to the dev forum.
Now it is possible to receive more professional responds.
 
That's not information that is exposed to templates by default and would require a templater/controller extension, ideally with a caching mechanism of some form, so it doesn't trigger one (or potentially more) database queries on every page load.
 
That's not information that is exposed to templates by default and would require a templater/controller extension, ideally with a caching mechanism of some form, so it doesn't trigger one (or potentially more) database queries on every page load.
Thanks. Apparently it is out of my ability scope now.
I was meant to use this to make the front AdminCP entry icon badged with server error report counts.
截圖 2020-05-23 02.29.08.webp

Now I have no choice but leaving this chance to others, or waiting for possible XF official adaptation (if they have interests).
 
I tried this one but it doesn't work:
XML:
<xf:if is="$xf.visitor.hasAdminPermission('viewLogs') && $serverErrorLogs">
    <div>ALERT!!!</div>
</xf:if>

Also I tried this one into the condition, but it fails the template mod submission:

XML:
<xf:if is="$upgradeCheck OR $showUnicodeWarning OR {$xf.visitor.hasAdminPermission('style') && $outdatedTemplates} OR {$xf.visitor.hasAdminPermission('viewLogs') && $serverErrorLogs} OR {$xf.visitor.hasAdminPermission('addOn') && $hasProcessingAddOn} OR $legacyConfig OR $hasStoppedManualJobs OR $requirementErrors">
    <div>ALERT!!!</div>
</xf:if>

I admire your perseverance
 
Top Bottom